diff mbox

[PULL,v2,04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support

Message ID 3d7a16fa0fb5e8640e14bf845195d1df13dc99f7.1476796525.git.riku.voipio@linaro.org
State Accepted
Commit da39db63e4468e39bb56d04d191866c5276aa7fa
Headers show

Commit Message

Riku Voipio Oct. 18, 2016, 1:21 p.m. UTC
From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>


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 <aleksandar.markovic@imgtec.com>

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

---
 linux-user/syscall.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.1.4
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e031ecf..032cb76 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -790,6 +790,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)