Fix pipe syscall on ia64

Andreas Schwab schwab at suse.de
Thu Feb 26 08:59:06 UTC 2004


On ia64 the pipe syscall returns two values instead of storing them
through a pointer.

Andreas.

2004-02-26  Andreas Schwab  <schwab at suse.de>

	* defs.h: Declare getrval2 also on IA64.

	* net.c (sys_pipe): For IA64 use the two return values.

	* syscall.c (getrval2): Implement for IA64.

Index: defs.h
===================================================================
RCS file: /cvsroot/strace/strace/defs.h,v
retrieving revision 1.45
diff -u -p -a -r1.45 defs.h
--- defs.h	14 Nov 2003 02:54:03 -0000	1.45
+++ defs.h	26 Feb 2004 16:30:37 -0000
@@ -484,7 +484,7 @@ extern void tv_div P((struct timeval *, 
 #ifdef SUNOS4
 extern int fixvfork P((struct tcb *));
 #endif
-#if !(defined(LINUX) && !defined(SPARC))
+#if !(defined(LINUX) && !defined(SPARC) && !defined(IA64))
 extern long getrval2 P((struct tcb *));
 #endif
 #ifdef USE_PROCFS
Index: net.c
===================================================================
RCS file: /cvsroot/strace/strace/net.c,v
retrieving revision 1.35
diff -u -p -a -r1.35 net.c
--- net.c	6 Nov 2003 23:41:23 -0000	1.35
+++ net.c	26 Feb 2004 16:30:37 -0000
@@ -1166,7 +1166,7 @@ sys_pipe(tcp)
 struct tcb *tcp;
 {
 
-#if defined(LINUX) && !defined(SPARC) && !defined(SH)
+#if defined(LINUX) && !defined(SPARC) && !defined(SH) && !defined(IA64)
 	int fds[2];
 
 	if (exiting(tcp)) {
@@ -1179,7 +1179,7 @@ struct tcb *tcp;
 		else
 			tprintf("[%u, %u]", fds[0], fds[1]);
 	}
-#elif defined(SPARC) || defined(SH) || defined(SVR4) || defined(FREEBSD)
+#elif defined(SPARC) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
 	if (exiting(tcp))
 		tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
 #endif
Index: syscall.c
===================================================================
RCS file: /cvsroot/strace/strace/syscall.c,v
retrieving revision 1.63
diff -u -p -a -r1.63 syscall.c
--- syscall.c	20 Feb 2004 22:56:43 -0000	1.63
+++ syscall.c	26 Feb 2004 16:30:38 -0000
@@ -2432,6 +2432,9 @@ struct tcb *tcp;
 	if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0)
 		return -1;
 #endif /* SPARC */
+#elif defined(IA64)
+	if (upeek(tcp->pid, PT_R9, &val) < 0)
+		return -1;
 #endif /* LINUX */
 
 #ifdef SUNOS4

-- 
Andreas Schwab, SuSE Labs, schwab at suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




More information about the Strace-devel mailing list