# define O_LARGEFILE 0100000
# endif
# endif
+# ifdef O_LARGEFILE
{ O_LARGEFILE, "O_LARGEFILE" },
+# endif
#endif
#ifdef O_DIRECTORY
{ O_DIRECTORY, "O_DIRECTORY" },
#ifdef O_NOFOLLOW
{ O_NOFOLLOW, "O_NOFOLLOW" },
#endif
+#ifdef O_NOATIME
+ { O_NOATIME, "O_NOATIME" },
+#endif
#ifdef FNDELAY
{ FNDELAY, "FNDELAY" },
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
/* flags */
- printflags(openmodes, tcp->u_arg[1] + 1);
+ printflags(openmodes, tcp->u_arg[1] + 1, "O_???");
if (tcp->u_arg[1] & O_CREAT) {
/* mode */
tprintf(", %#lo", tcp->u_arg[2]);
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
/* flags */
- printflags(openmodessol, tcp->u_arg[1] + 1);
+ printflags(openmodessol, tcp->u_arg[1] + 1, "O_???");
if (tcp->u_arg[1] & 0x100) {
/* mode */
tprintf(", %#lo", tcp->u_arg[2]);
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
- printflags(access_flags, tcp->u_arg[1]);
+ printflags(access_flags, tcp->u_arg[1], "?_OK");
}
return 0;
}
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
- if (tcp->u_arg[1])
- printflags(fileflags, tcp->u_arg[1]);
- else
- tprintf("0");
+ printflags(fileflags, tcp->u_arg[1], "UF_???");
}
return 0;
}
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
- if (tcp->u_arg[1])
- printflags(fileflags, tcp->u_arg[1]);
- else
- tprintf("0");
+ printflags(fileflags, tcp->u_arg[1], "UF_???");
}
return 0;
}
tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
#if HAVE_STRUCT_STAT_ST_FLAGS
tprintf(", st_flags=");
- if (statbuf->st_flags) {
- printflags(fileflags, statbuf->st_flags);
- } else
- tprintf("0");
+ printflags(fileflags, statbuf->st_flags, "UF_???");
#endif
#if HAVE_STRUCT_STAT_ST_ACLCNT
tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
#if HAVE_STRUCT_STAT_ST_FLAGS
tprintf(", st_flags=");
- if (statbuf.st_flags) {
- printflags(fileflags, statbuf.st_flags);
- } else
- tprintf("0");
+ printflags(fileflags, statbuf.st_flags, "UF_???");
#endif
#if HAVE_STRUCT_STAT_ST_ACLCNT
tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
}
len = tcp->u_rval;
if ((buf = malloc(len)) == NULL) {
- tprintf("out of memory\n");
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
+ fprintf(stderr, "out of memory\n");
return 0;
}
if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
- tprintf("{...}, %lu", tcp->u_arg[2]);
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
free(buf);
return 0;
}
}
len = tcp->u_rval;
if ((buf = malloc(len)) == NULL) {
- tprintf("out of memory\n");
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
+ fprintf(stderr, "out of memory\n");
return 0;
}
if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
- tprintf("{...}, %lu", tcp->u_arg[2]);
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
free(buf);
return 0;
}
}
len = tcp->u_rval;
if ((buf = malloc(len)) == NULL) {
- tprintf("out of memory\n");
+ tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+ fprintf(stderr, "out of memory\n");
return 0;
}
if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
- tprintf("{...}, %lu, %#lx", tcp->u_arg[2], tcp->u_arg[3]);
+ tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
free(buf);
return 0;
}
struct tcb *tcp;
int failed;
unsigned long arg;
-long insize, size;
+unsigned long insize, size;
{
if (!failed) {
- unsigned char *buf = malloc(4 * size + 1);
+ unsigned long capacity = 4 * size + 1;
+ unsigned char *buf = (capacity < size) ? NULL : malloc(capacity);
if (buf == NULL || /* probably a bogus size argument */
- umoven(tcp, arg, size, &buf[3 * size]) < 0) {
+ umoven(tcp, arg, size, (char *) &buf[3 * size]) < 0) {
failed = 1;
}
else {
printstr(tcp, tcp->u_arg[1], -1);
print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
tprintf(", ");
- printflags(xattrflags, tcp->u_arg[4]);
+ printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
}
return 0;
}
printstr(tcp, tcp->u_arg[1], -1);
print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
tprintf(", ");
- printflags(xattrflags, tcp->u_arg[4]);
+ printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
}
return 0;
}