qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 3/5] linux-user: Map signal numbers in fcntl
Date: Mon,  7 Sep 2020 11:17:46 +0200	[thread overview]
Message-ID: <20200907091748.376101-4-laurent@vivier.eu> (raw)
In-Reply-To: <20200907091748.376101-1-laurent@vivier.eu>

From: Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>

Map signal numbers in fcntl F_SETSIG and F_GETSIG.

Signed-off-by: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <72cc725c-f344-b7f1-d559-401867067d80@members.leeds.ac.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 07220eee40c5..55ac5c320825 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6874,10 +6874,16 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
         break;
 #endif
 
-    case TARGET_F_SETOWN:
-    case TARGET_F_GETOWN:
     case TARGET_F_SETSIG:
+        ret = get_errno(safe_fcntl(fd, host_cmd, target_to_host_signal(arg)));
+        break;
+
     case TARGET_F_GETSIG:
+        ret = host_to_target_signal(get_errno(safe_fcntl(fd, host_cmd, arg)));
+        break;
+
+    case TARGET_F_SETOWN:
+    case TARGET_F_GETOWN:
     case TARGET_F_SETLEASE:
     case TARGET_F_GETLEASE:
     case TARGET_F_SETPIPE_SZ:
-- 
2.26.2



  parent reply	other threads:[~2020-09-07  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  9:17 [PULL 0/5] Linux user for 5.2 patches Laurent Vivier
2020-09-07  9:17 ` [PULL 1/5] linux-user: Add support for ppoll_time64() and pselect6_time64() Laurent Vivier
2020-09-07  9:17 ` [PULL 2/5] linux-user: Correctly start brk after executable Laurent Vivier
2020-09-07  9:17 ` Laurent Vivier [this message]
2020-09-07  9:17 ` [PULL 4/5] linux-user: fix ppc/termbits.h Laurent Vivier
2020-09-07  9:17 ` [PULL 5/5] linux-user: Protect btrfs ioctl target definitions Laurent Vivier
2020-09-07 15:50 ` [PULL 0/5] Linux user for 5.2 patches Peter Maydell

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=20200907091748.376101-4-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=T.E.Baldwin99@members.leeds.ac.uk \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).