qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4625] Perform target->host signal mapping for *kill syscalls.
@ 2008-05-30 18:05 Paul Brook
  0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2008-05-30 18:05 UTC (permalink / raw)
  To: qemu-devel

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
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-30 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-30 18:05 [Qemu-devel] [4625] Perform target->host signal mapping for *kill syscalls Paul Brook

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