From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199605171544.KAA05491@twiddle.tamu.edu> Date: Fri, 17 May 1996 10:44:24 -0500 (CDT) From: Richard Henderson Subject: a few small strace patches I ran across some 32/64 bit problems. The system call return value needs to be long to handle the vm addresses returned from, e.g. brk and mmap. r~ --- defs.h.orig Fri May 17 00:31:45 1996 +++ defs.h Fri May 17 00:46:32 1996 @@ -105,7 +105,7 @@ int u_nargs; /* System call arguments */ long u_arg[MAX_ARGS]; /* System call arguments */ int u_error; /* Error code */ - int u_rval; /* (first) return value */ + long u_rval; /* (first) return value */ FILE *outf; /* Output file for this process */ char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */ struct timeval stime; /* System time usage as of last process wait */ --- syscall.c.orig Fri May 17 00:47:51 1996 +++ syscall.c Fri May 17 00:48:14 1996 @@ -678,7 +678,7 @@ if (u_error) tprintf("= -1 (errno %d)", u_error); else - tprintf("= %#x", tcp->u_rval); + tprintf("= %#lx", tcp->u_rval); } else if (!(sys_res & RVAL_NONE) && u_error) { #ifdef LINUX @@ -717,16 +717,16 @@ else { switch (sys_res & RVAL_MASK) { case RVAL_HEX: - tprintf("= %#x", tcp->u_rval); + tprintf("= %#lx", tcp->u_rval); break; case RVAL_OCTAL: - tprintf("= %#o", tcp->u_rval); + tprintf("= %#lo", tcp->u_rval); break; case RVAL_UDECIMAL: - tprintf("= %u", tcp->u_rval); + tprintf("= %lu", tcp->u_rval); break; case RVAL_DECIMAL: - tprintf("= %d", tcp->u_rval); + tprintf("= %ld", tcp->u_rval); break; default: fprintf(stderr, --- util.c.orig Fri May 17 00:31:46 1996 +++ util.c Fri May 17 00:40:22 1996 @@ -723,7 +723,7 @@ long off; long *res; { - int val; + long val; #ifdef SUNOS4_KERNEL_ARCH_KLUDGE {