diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-27 21:08:10 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-27 21:08:10 +0000 |
commit | 106ec87921a41752777781f073092301d4477567 (patch) | |
tree | 54f0f6ee22467959b29b5fa4e76567b4b146b310 /linux-user/syscall.c | |
parent | 951f13516a50383cd462c9150e643cc9f9566267 (diff) |
initial MIPS signal handling (initial patch by Raphael Rigo)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2031 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 229b089355..60ed9a6078 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2246,6 +2246,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, break; case TARGET_NR_sigaction: { + #if !defined(TARGET_MIPS) struct target_old_sigaction *old_act; struct target_sigaction act, oact, *pact; if (arg2) { @@ -2268,6 +2269,33 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, old_act->sa_restorer = oact.sa_restorer; unlock_user_struct(old_act, arg3, 1); } + #else + struct target_sigaction act, oact, *pact, *old_act; + + if (arg2) { + lock_user_struct(old_act, arg2, 1); + act._sa_handler = old_act->_sa_handler; + target_siginitset(&act.sa_mask, old_act->sa_mask.sig[0]); + act.sa_flags = old_act->sa_flags; + unlock_user_struct(old_act, arg2, 0); + pact = &act; + } else { + pact = NULL; + } + + ret = get_errno(do_sigaction(arg1, pact, &oact)); + + if (!is_error(ret) && arg3) { + lock_user_struct(old_act, arg3, 0); + old_act->_sa_handler = oact._sa_handler; + old_act->sa_flags = oact.sa_flags; + old_act->sa_mask.sig[0] = oact.sa_mask.sig[0]; + old_act->sa_mask.sig[1] = 0; + old_act->sa_mask.sig[2] = 0; + old_act->sa_mask.sig[3] = 0; + unlock_user_struct(old_act, arg3, 1); + } + #endif } break; case TARGET_NR_rt_sigaction: |