summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 18:05:19 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 18:05:19 +0000
commit3dbf48b96337aa9e27d668636f945be63d19de48 (patch)
tree845e59aad9360c381459d90439ffc57ee3f06b19 /linux-user
parentc0f570c64d956aeeaf1498b60f132b04e7da56e4 (diff)
downloadqemu-3dbf48b96337aa9e27d668636f945be63d19de48.tar.gz
qemu-3dbf48b96337aa9e27d668636f945be63d19de48.tar.bz2
qemu-3dbf48b96337aa9e27d668636f945be63d19de48.zip
Perform target->host signal mapping for *kill syscalls.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4625 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/qemu.h1
-rw-r--r--linux-user/signal.c6
-rw-r--r--linux-user/syscall.c7
3 files changed, 10 insertions, 4 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 5106d4526d..cc44c9a19a 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -187,6 +187,7 @@ void signal_init(void);
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);
diff --git a/linux-user/signal.c b/linux-user/signal.c
index ef9b7356c2..c3b0cde3b9 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -113,11 +113,15 @@ static inline int sas_ss_flags(unsigned long sp)
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];
}
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3c39e9f82c..7548ea7959 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3488,7 +3488,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
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 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#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