From eff5c0e60c35d852a97a26cd8c6be50fed75a1a0 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Fri, 7 Dec 2012 21:30:51 +0100 Subject: sys_semtimedop: fix timeval argument index in wrapped call Looking at the implementation of wrapped semtimedop() call inside glibc and kernel, I started to believe that timeval should be located in tcp->u_arg[4] and not tcp->u_arg[5]. Fortunately, tcp->u_arg[5] now works correctly as well, due to side effects of decode_ipc_subcall(). declaration in header: int semtimedop(semid, *sops, nsops, *timeout); 0 1 2 3 sys_ipc arguments in glibc on all patforms except s390*: semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout 0 1 2 3 4 We have to use indexes: 0 3 1 4 sys_ipc arguments on s390*: semid, (int) nsops, timeout, sops 0 1 2 3 We have to use indexes: 0 3 1 2 * ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in indirect_ipccall case. --- ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc.c b/ipc.c index 0bde1cf..859ee28 100644 --- a/ipc.c +++ b/ipc.c @@ -330,7 +330,7 @@ int sys_semtimedop(struct tcb *tcp) #if defined(S390) printtv(tcp, tcp->u_arg[2]); #else - printtv(tcp, tcp->u_arg[5]); + printtv(tcp, tcp->u_arg[4]); #endif } else { tprint_sembuf(tcp, tcp->u_arg[1], tcp->u_arg[2]); -- cgit v1.2.3