qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@nowt.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4625] Perform target->host signal mapping for *kill syscalls.
Date: Fri, 30 May 2008 18:05:20 +0000	[thread overview]
Message-ID: <E1K28ye-0001a7-77@cvs.savannah.gnu.org> (raw)

Revision: 4625
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4625
Author:   pbrook
Date:     2008-05-30 18:05:19 +0000 (Fri, 30 May 2008)

Log Message:
-----------
Perform target->host signal mapping for *kill syscalls.

Modified Paths:
--------------
    trunk/linux-user/qemu.h
    trunk/linux-user/signal.c
    trunk/linux-user/syscall.c

Modified: trunk/linux-user/qemu.h
===================================================================
--- trunk/linux-user/qemu.h	2008-05-30 17:54:15 UTC (rev 4624)
+++ trunk/linux-user/qemu.h	2008-05-30 18:05:19 UTC (rev 4625)
@@ -187,6 +187,7 @@
 int queue_signal(int sig, target_siginfo_t *info);
 void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info);
 void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo);
+int target_to_host_signal(int sig);
 long do_sigreturn(CPUState *env);
 long do_rt_sigreturn(CPUState *env);
 abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp);

Modified: trunk/linux-user/signal.c
===================================================================
--- trunk/linux-user/signal.c	2008-05-30 17:54:15 UTC (rev 4624)
+++ trunk/linux-user/signal.c	2008-05-30 18:05:19 UTC (rev 4625)
@@ -113,11 +113,15 @@
 
 static inline int host_to_target_signal(int sig)
 {
+    if (sig > 64)
+        return sig;
     return host_to_target_signal_table[sig];
 }
 
-static inline int target_to_host_signal(int sig)
+int target_to_host_signal(int sig)
 {
+    if (sig > 64)
+        return sig;
     return target_to_host_signal_table[sig];
 }
 

Modified: trunk/linux-user/syscall.c
===================================================================
--- trunk/linux-user/syscall.c	2008-05-30 17:54:15 UTC (rev 4624)
+++ trunk/linux-user/syscall.c	2008-05-30 18:05:19 UTC (rev 4625)
@@ -3488,7 +3488,7 @@
         ret = 0;
         break;
     case TARGET_NR_kill:
-        ret = get_errno(kill(arg1, arg2));
+        ret = get_errno(kill(arg1, target_to_host_signal(arg2)));
         break;
     case TARGET_NR_rename:
         {
@@ -5583,13 +5583,14 @@
 
 #if defined(TARGET_NR_tkill) && defined(__NR_tkill)
     case TARGET_NR_tkill:
-        ret = get_errno(sys_tkill((int)arg1, (int)arg2));
+        ret = get_errno(sys_tkill((int)arg1, target_to_host_signal(arg2)));
         break;
 #endif
 
 #if defined(TARGET_NR_tgkill) && defined(__NR_tgkill)
     case TARGET_NR_tgkill:
-	ret = get_errno(sys_tgkill((int)arg1, (int)arg2, (int)arg3));
+	ret = get_errno(sys_tgkill((int)arg1, (int)arg2,
+                        target_to_host_signal(arg3)));
 	break;
 #endif
 

                 reply	other threads:[~2008-05-30 18:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E1K28ye-0001a7-77@cvs.savannah.gnu.org \
    --to=paul@nowt.org \
    --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).