#include <string.h>
#include <signal.h>
#include <stdlib.h>
+#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <pwd.h>
while (sdata < sdata_end)
parse_initline();
/* Allocate space for the control arrays */
- initpid = (uint16_t *) idata;
- idata += 2 * initcount;
initptr = (uint8_t **) idata;
idata += sizeof(void *) * initcount;
+ initpid = (uint16_t *) idata;
+ idata += 2 * initcount;
if (brk(idata) == -1)
putstr("unable to return space\n");
memset(initpid, 0, 2 * initcount);
/* Utility for stat and fstat */
int stcpy(inoptr ino, char *buf)
{
- int err = uput((char *) &(ino->c_dev), buf, 12);
- err |= uput((char *) &(ino->c_node.i_addr[0]), buf + 12, 2);
- err |= uput((char *) &(ino->c_node.i_size), buf + 14, 16);
+ int err = uput((char *) &(ino->c_node.i_size), buf + 0, 5*4);
+ err |= uput((char *) &(ino->c_dev), buf + 5*4, 2*2);
+ err |= uput((char *) &(ino->c_node.i_mode), buf + 5*4 + 2*2, 4*2);
+ err |= uput((char *) &(ino->c_node.i_addr[0]), buf + 5*4 + 6*2, 1*2);
return err;
}
struct _uzistat
{
+ /* For alignment reasons, arrange this structure with largest objects
+ * first. */
+ uint32_t st_size;
+ uint32_t st_atime;
+ uint32_t st_mtime;
+ uint32_t st_ctime;
+ uint32_t st_timeh; /* Time high bytes */
int16_t st_dev;
uint16_t st_ino;
uint16_t st_mode;
uint16_t st_uid;
uint16_t st_gid;
uint16_t st_rdev;
- uint32_t st_size;
- uint32_t st_atime;
- uint32_t st_mtime;
- uint32_t st_ctime;
- uint32_t st_timeh; /* Time high bytes */
};
struct _uzisysinfoblk {