Revision 6049f4f8 linux-user/syscall.c
b/linux-user/syscall.c | ||
---|---|---|
4775 | 4775 |
#ifdef TARGET_NR_sigaction |
4776 | 4776 |
case TARGET_NR_sigaction: |
4777 | 4777 |
{ |
4778 |
#if !defined(TARGET_MIPS) |
|
4778 |
#if defined(TARGET_ALPHA) |
|
4779 |
struct target_sigaction act, oact, *pact = 0; |
|
4779 | 4780 |
struct target_old_sigaction *old_act; |
4780 |
struct target_sigaction act, oact, *pact; |
|
4781 | 4781 |
if (arg2) { |
4782 | 4782 |
if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1)) |
4783 | 4783 |
goto efault; |
4784 | 4784 |
act._sa_handler = old_act->_sa_handler; |
4785 | 4785 |
target_siginitset(&act.sa_mask, old_act->sa_mask); |
4786 | 4786 |
act.sa_flags = old_act->sa_flags; |
4787 |
act.sa_restorer = old_act->sa_restorer;
|
|
4787 |
act.sa_restorer = 0;
|
|
4788 | 4788 |
unlock_user_struct(old_act, arg2, 0); |
4789 | 4789 |
pact = &act; |
4790 |
} else { |
|
4791 |
pact = NULL; |
|
4792 | 4790 |
} |
4793 | 4791 |
ret = get_errno(do_sigaction(arg1, pact, &oact)); |
4794 | 4792 |
if (!is_error(ret) && arg3) { |
... | ... | |
4797 | 4795 |
old_act->_sa_handler = oact._sa_handler; |
4798 | 4796 |
old_act->sa_mask = oact.sa_mask.sig[0]; |
4799 | 4797 |
old_act->sa_flags = oact.sa_flags; |
4800 |
old_act->sa_restorer = oact.sa_restorer; |
|
4801 | 4798 |
unlock_user_struct(old_act, arg3, 1); |
4802 | 4799 |
} |
4803 |
#else
|
|
4800 |
#elif defined(TARGET_MIPS)
|
|
4804 | 4801 |
struct target_sigaction act, oact, *pact, *old_act; |
4805 | 4802 |
|
4806 | 4803 |
if (arg2) { |
... | ... | |
4828 | 4825 |
old_act->sa_mask.sig[3] = 0; |
4829 | 4826 |
unlock_user_struct(old_act, arg3, 1); |
4830 | 4827 |
} |
4828 |
#else |
|
4829 |
struct target_old_sigaction *old_act; |
|
4830 |
struct target_sigaction act, oact, *pact; |
|
4831 |
if (arg2) { |
|
4832 |
if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1)) |
|
4833 |
goto efault; |
|
4834 |
act._sa_handler = old_act->_sa_handler; |
|
4835 |
target_siginitset(&act.sa_mask, old_act->sa_mask); |
|
4836 |
act.sa_flags = old_act->sa_flags; |
|
4837 |
act.sa_restorer = old_act->sa_restorer; |
|
4838 |
unlock_user_struct(old_act, arg2, 0); |
|
4839 |
pact = &act; |
|
4840 |
} else { |
|
4841 |
pact = NULL; |
|
4842 |
} |
|
4843 |
ret = get_errno(do_sigaction(arg1, pact, &oact)); |
|
4844 |
if (!is_error(ret) && arg3) { |
|
4845 |
if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0)) |
|
4846 |
goto efault; |
|
4847 |
old_act->_sa_handler = oact._sa_handler; |
|
4848 |
old_act->sa_mask = oact.sa_mask.sig[0]; |
|
4849 |
old_act->sa_flags = oact.sa_flags; |
|
4850 |
old_act->sa_restorer = oact.sa_restorer; |
|
4851 |
unlock_user_struct(old_act, arg3, 1); |
|
4852 |
} |
|
4831 | 4853 |
#endif |
4832 | 4854 |
} |
4833 | 4855 |
break; |
4834 | 4856 |
#endif |
4835 | 4857 |
case TARGET_NR_rt_sigaction: |
4836 | 4858 |
{ |
4859 |
#if defined(TARGET_ALPHA) |
|
4860 |
struct target_sigaction act, oact, *pact = 0; |
|
4861 |
struct target_rt_sigaction *rt_act; |
|
4862 |
/* ??? arg4 == sizeof(sigset_t). */ |
|
4863 |
if (arg2) { |
|
4864 |
if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1)) |
|
4865 |
goto efault; |
|
4866 |
act._sa_handler = rt_act->_sa_handler; |
|
4867 |
act.sa_mask = rt_act->sa_mask; |
|
4868 |
act.sa_flags = rt_act->sa_flags; |
|
4869 |
act.sa_restorer = arg5; |
|
4870 |
unlock_user_struct(rt_act, arg2, 0); |
|
4871 |
pact = &act; |
|
4872 |
} |
|
4873 |
ret = get_errno(do_sigaction(arg1, pact, &oact)); |
|
4874 |
if (!is_error(ret) && arg3) { |
|
4875 |
if (!lock_user_struct(VERIFY_WRITE, rt_act, arg3, 0)) |
|
4876 |
goto efault; |
|
4877 |
rt_act->_sa_handler = oact._sa_handler; |
|
4878 |
rt_act->sa_mask = oact.sa_mask; |
|
4879 |
rt_act->sa_flags = oact.sa_flags; |
|
4880 |
unlock_user_struct(rt_act, arg3, 1); |
|
4881 |
} |
|
4882 |
#else |
|
4837 | 4883 |
struct target_sigaction *act; |
4838 | 4884 |
struct target_sigaction *oact; |
4839 | 4885 |
|
... | ... | |
4855 | 4901 |
unlock_user_struct(act, arg2, 0); |
4856 | 4902 |
if (oact) |
4857 | 4903 |
unlock_user_struct(oact, arg3, 1); |
4904 |
#endif |
|
4858 | 4905 |
} |
4859 | 4906 |
break; |
4860 | 4907 |
#ifdef TARGET_NR_sgetmask /* not on alpha */ |
Also available in: Unified diff