@@ -197,6 +197,7 @@ SYSCALL_DEF(rt_sigaction, ARG_SIGNAL, ARG_PTR, ARG_PTR, ARG_DEC);
SYSCALL_DEF(rt_sigpending, ARG_PTR, ARG_DEC);
SYSCALL_DEF(rt_sigprocmask, ARG_SIGPROCMASKHOW, ARG_PTR, ARG_PTR, ARG_DEC);
SYSCALL_DEF(rt_sigsuspend, ARG_PTR, ARG_DEC);
+SYSCALL_DEF(rt_sigtimedwait, ARG_PTR, ARG_PTR, ARG_PTR, ARG_DEC);
#if !defined(SYSCALL_TABLE) || defined(TARGET_NR_semctl)
SYSCALL_DEF(semctl, ARG_DEC, ARG_DEC, ARG_DEC, ARG_HEX);
#endif
@@ -215,6 +215,43 @@ SYSCALL_IMPL(rt_sigsuspend)
return ret;
}
+SYSCALL_IMPL(rt_sigtimedwait)
+{
+ sigset_t set;
+ struct timespec uts, *puts = NULL;
+ siginfo_t uinfo;
+ abi_long ret;
+ void *p;
+
+ if (arg4 != sizeof(target_sigset_t)) {
+ return -TARGET_EINVAL;
+ }
+ p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1);
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ target_to_host_sigset(&set, p);
+ unlock_user(p, arg1, 0);
+ if (arg3) {
+ puts = &uts;
+ target_to_host_timespec(puts, arg3);
+ }
+
+ ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts, SIGSET_T_SIZE));
+ if (!is_error(ret)) {
+ if (arg2) {
+ p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t), 0);
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ host_to_target_siginfo(p, &uinfo);
+ unlock_user(p, arg2, sizeof(target_siginfo_t));
+ }
+ ret = host_to_target_signal(ret);
+ }
+ return ret;
+}
+
#ifdef TARGET_NR_sigaction
SYSCALL_IMPL(sigaction)
{
@@ -4240,42 +4240,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
- case TARGET_NR_rt_sigtimedwait:
- {
- sigset_t set;
- struct timespec uts, *puts;
- siginfo_t uinfo;
-
- if (arg4 != sizeof(target_sigset_t)) {
- return -TARGET_EINVAL;
- }
-
- if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
- return -TARGET_EFAULT;
- target_to_host_sigset(&set, p);
- unlock_user(p, arg1, 0);
- if (arg3) {
- puts = &uts;
- target_to_host_timespec(puts, arg3);
- } else {
- puts = NULL;
- }
- ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts,
- SIGSET_T_SIZE));
- if (!is_error(ret)) {
- if (arg2) {
- p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t),
- 0);
- if (!p) {
- return -TARGET_EFAULT;
- }
- host_to_target_siginfo(p, &uinfo);
- unlock_user(p, arg2, sizeof(target_siginfo_t));
- }
- ret = host_to_target_signal(ret);
- }
- }
- return ret;
case TARGET_NR_rt_sigqueueinfo:
{
siginfo_t uinfo;
@@ -932,9 +932,6 @@
#ifdef TARGET_NR_rt_sigreturn
{ TARGET_NR_rt_sigreturn, "rt_sigreturn" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_rt_sigtimedwait
-{ TARGET_NR_rt_sigtimedwait, "rt_sigtimedwait" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_rt_tgsigqueueinfo
{ TARGET_NR_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" , NULL, print_rt_tgsigqueueinfo, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 1 + linux-user/syscall-sig.inc.c | 37 ++++++++++++++++++++++++++++++++++++ linux-user/syscall.c | 36 ----------------------------------- linux-user/strace.list | 3 --- 4 files changed, 38 insertions(+), 39 deletions(-) -- 2.17.1