All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
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
Subject: [Qemu-devel] [PATCH v4 05/11] linux-user: Fix msgrcv() and msgsnd() syscalls support
Date: Wed, 14 Sep 2016 17:22:03 +0200	[thread overview]
Message-ID: <20160914152224.122271-6-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <20160914152224.122271-1-aleksandar.markovic@rt-rk.com>

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>
---
 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

  parent reply	other threads:[~2016-09-14 15:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 15:21 [Qemu-devel] [PATCH v4 00/11] linux user: Fix assorted Qemu user mode issues Aleksandar Markovic
2016-09-14 15:21 ` [Qemu-devel] [PATCH v4 01/11] linux-user: Add support for adjtimex() syscall Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 02/11] linux-user: Add support for clock_adjtime() syscall Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 03/11] linux-user: Add support for sysfs() syscall Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 04/11] linux-user: Add support for ustat() syscall Aleksandar Markovic
2016-09-14 15:22 ` Aleksandar Markovic [this message]
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 06/11] linux-user: Fix socketcall() syscall support Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 07/11] linux-user: Fix syslog() " Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 08/11] linux-user: Remove tabs and trailing spaces from linux-user/main.c Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 09/11] linux-user: Improve braces-related formatting in linux-user/main.c Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 10/11] linux-user: Improve usage of spaces " Aleksandar Markovic
2016-09-14 15:22 ` [Qemu-devel] [PATCH v4 11/11] linux-user: Remove a duplicate item from strace.list Aleksandar Markovic
2016-09-14 19:15 ` [Qemu-devel] [PATCH v4 00/11] linux user: Fix assorted Qemu user mode issues Peter Maydell
2016-09-14 20:01   ` Aleksandar Markovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160914152224.122271-6-aleksandar.markovic@rt-rk.com \
    --to=aleksandar.markovic@rt-rk.com \
    --cc=aleksandar.markovic@imgtec.com \
    --cc=aleksandar.rikalo@imgtec.com \
    --cc=miodrag.dinic@imgtec.com \
    --cc=petar.jovanovic@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.