From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBG3n-00070Y-4F for qemu-devel@nongnu.org; Mon, 01 Jun 2009 18:32:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBG3h-0006zm-MR for qemu-devel@nongnu.org; Mon, 01 Jun 2009 18:32:49 -0400 Received: from [199.232.76.173] (port=47101 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBG3h-0006zj-HA for qemu-devel@nongnu.org; Mon, 01 Jun 2009 18:32:45 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:44287) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBG3g-0005PB-Ou for qemu-devel@nongnu.org; Mon, 01 Jun 2009 18:32:45 -0400 From: Laurent Vivier Date: Tue, 2 Jun 2009 00:32:37 +0200 Message-Id: <1243895557-18462-1-git-send-email-laurent@vivier.eu> Subject: [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier This has been detected trying to use "dbench" with m68k-linux-user/qemu-m68k where "shmctl()" is called with "IPC_RMID | IPC_64". IPC_64 is useless with IPC_RMID, SHM_LOCK, SHM_UNLOCK (as the only parameter is the id without shmid_ds) and already ignored with semctl() and msgctl(). Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b1bba48..c3d1d73 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2539,11 +2539,11 @@ static abi_long do_ipc(unsigned int call, int first, /* IPC_* and SHM_* command values are the same on all linux platforms */ case IPCOP_shmctl: - switch(second) { + switch(second & 0xff) { case IPC_RMID: case SHM_LOCK: case SHM_UNLOCK: - ret = get_errno(shmctl(first, second, NULL)); + ret = get_errno(shmctl(first, second & 0xff, NULL)); break; default: goto unimplemented; -- 1.5.6.5