Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Henderson <richard@twiddle.tamu.edu>
Subject: a few small strace patches
Date: Fri, 17 May 1996 10:44:24 -0500 (CDT)	[thread overview]
Message-ID: <199605171544.KAA05491@twiddle.tamu.edu> (raw)

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
 	{

             reply	other threads:[~1996-05-17 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-17 15:44 Richard Henderson [this message]
1996-05-18 23:08 ` a few small strace patches Thomas Bogendoerfer
  -- strict thread matches above, loose matches on Subject: below --
1996-05-19 10:53 Thomas Bogendoerfer
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox