From 06847fe28253603b29539a4d7fcb45a22a9a836c Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 9 Sep 2016 19:13:54 +0000 Subject: [PATCH] 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. --- ipc_sem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.50.1