[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support |
Date: |
Mon, 17 Oct 2016 16:24:22 +0300 |
From: Aleksandar Markovic <address@hidden>
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 <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 3 +++
1 file changed, 3 insertions(+)
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)
--
2.1.4
- [Qemu-devel] [PULL 00/22] linux-user changes, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 02/22] linux-user: Add support for ustat() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 01/22] linux-user: Add support for adjtimex() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 03/22] linux-user: Fix mq_open() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support,
riku . voipio <=
- [Qemu-devel] [PULL 08/22] linux-user: sparc64: Use correct target SHMLBA in shmat(), riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 06/22] linux-user: Fix syslog() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 11/22] linux-user: Don't use alloca() for epoll_wait's epoll event array, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 09/22] linux-user: add kcmp() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 05/22] linux-user: Fix socketcall() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 07/22] linux-user: Remove a duplicate item from strace.list, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 10/22] linux-user: add RTA_PRIORITY in netlink, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 13/22] linux-user: Fix definition of target_sigevent for 32-bit guests, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 14/22] linux-user: Add support for clock_adjtime() syscall, riku . voipio, 2016/10/17