From: Dmitry V. Levin Date: Fri, 9 Sep 2016 19:13:54 +0000 (+0000) Subject: ipc: fix printing of nsops argument of semop and semtimedop syscalls X-Git-Tag: v4.14~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06847fe28253603b29539a4d7fcb45a22a9a836c;p=strace ipc: fix printing of nsops argument of semop and semtimedop syscalls According to POSIX, nsops argument of semop syscall has type size_t, but the kernel treats nsops argument of semop and semtimedop syscalls as unsigned int. * ipc_sem.c (tprint_sembuf_array): Change type of "count" argument from unsigned long to unsigned int, print it using %u format. --- diff --git a/ipc_sem.c b/ipc_sem.c index 4725a170..db797469 100644 --- a/ipc_sem.c +++ b/ipc_sem.c @@ -57,7 +57,7 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) #endif static void -tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count) +tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned int count) { #if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H struct sembuf sb; @@ -66,7 +66,7 @@ tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count) #else printaddr(addr); #endif - tprintf(", %lu", count); + tprintf(", %u", count); } SYS_FUNC(semop)