]> granicus.if.org Git - strace/commit
sys_semtimedop: fix timeval argument index in wrapped call
authorStanislav Brabec <sbrabec@suse.cz>
Fri, 7 Dec 2012 20:30:51 +0000 (21:30 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 8 Dec 2012 00:17:59 +0000 (00:17 +0000)
commiteff5c0e60c35d852a97a26cd8c6be50fed75a1a0
treec84415e13027979c3807d958527c094f77f95e24
parenteb54c4772581a143e2757a2be9718377058cc703
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