From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkC2h-00038v-1J for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkC2b-0007zo-L6 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:24:05 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56972 helo=mail.rt-rk.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkC2b-0007zd-Dg for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:24:01 -0400 From: Aleksandar Markovic Date: Wed, 14 Sep 2016 17:22:03 +0200 Message-Id: <20160914152224.122271-6-aleksandar.markovic@rt-rk.com> In-Reply-To: <20160914152224.122271-1-aleksandar.markovic@rt-rk.com> References: <20160914152224.122271-1-aleksandar.markovic@rt-rk.com> Subject: [Qemu-devel] [PATCH v4 05/11] linux-user: Fix msgrcv() and msgsnd() syscalls support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, riku.voipio@iki.fi, peter.maydell@linaro.org, petar.jovanovic@imgtec.com, miodrag.dinic@imgtec.com, aleksandar.rikalo@imgtec.com, aleksandar.markovic@imgtec.com From: Aleksandar Markovic If syscalls msgrcv() and msgsnd() fail, they return E2BIG, EACCES, EAGAIN, EFAULT, EIDRM, EINTR, EINVAL, ENOMEM, or ENOMSG. By examining negative scenarios of these syscalls for Mips, it was established that ENOMSG does not have the same value accross all platforms, but it is nevertheless not included for conversion in the correspondant conversion table defined in linux-user/syscall.c. This is certainly a bug, since it leads to the incorrect emulation of msgrcv() and msgsnd() for scenarios involving ENOMSG. This patch fixes this by extending the conversion table to include ENOMSG. Also, LTP test msgrcv04 will be fixed for some platforms. Signed-off-by: Aleksandar Markovic --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7f8ae41..bdc12ae 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -750,6 +750,9 @@ static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE] = { #ifdef ENOTRECOVERABLE [ENOTRECOVERABLE] = TARGET_ENOTRECOVERABLE, #endif +#ifdef ENOMSG + [ENOMSG] = TARGET_ENOMSG, +#endif }; static inline int host_to_target_errno(int err) -- 2.9.3