[PATCH] Fix sys_ipc/sys_semtimedop decoding on s390

Heiko Carstens heiko.carstens at de.ibm.com
Wed Nov 30 12:16:29 UTC 2011


The s390 kernel sys_ipc system call only takes five arguments instead of
six arguments which the common code sys_ipc implementation takes.
One of the arguments of the sys_semtimedop subcall is therefore passed in
a different register than in the common code implementation.
This leads to broken decoding of the timespec argument:

semtimedop(0, 0x3ffffb43832, 1, {...})  = -1 EAGAIN

Fixed it looks like this:

semtimedop(0, 0x3ffffc2c842, 1, {0, 10000000}) = -1 EINTR

* linux/ipc.c: Fix sys_semtimedop decoding on s390

Signed-off-by: Heiko Carstens <heiko.carstens at de.ibm.com>
---
 ipc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ipc.c b/ipc.c
index 25539a6..5fb2c67 100644
--- a/ipc.c
+++ b/ipc.c
@@ -346,7 +346,11 @@ int sys_semtimedop(struct tcb *tcp)
 		if (indirect_ipccall(tcp)) {
 			tprint_sembuf(tcp, tcp->u_arg[3], tcp->u_arg[1]);
 			tprints(", ");
+#if defined(S390)
+			printtv(tcp, tcp->u_arg[2]);
+#else
 			printtv(tcp, tcp->u_arg[5]);
+#endif
 		} else {
 			tprint_sembuf(tcp, tcp->u_arg[1], tcp->u_arg[2]);
 			tprints(", ");
-- 
1.7.7.3





More information about the Strace-devel mailing list