linux-user: translate signal number on return from sigtimedwait
PATCH 1/1 linux-user: translate signal number on return from sigtimedwait
From: Petar Jovanovic <[email protected]>
On success, sigtimedwait() returns a signal number that needs to be translated from a host value to a target value.
This change also fixes issues with sigwait (that is implemented using sigtimedwait()).
Signed-off-by Petar Jovanovic <[email protected]>
--- linux-user/syscall.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
linux-user/syscall.c +11 -5
@@ -6121,11 +6121,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, puts =NULL ; } ret =get_errno (sigtimedwait (&set, &uinfo, puts)); -if (!is_error (ret) && arg2) { -if (!(p =lock_user (VERIFY_WRITE , arg2,sizeof (target_siginfo_t),0 ))) - goto efault; -host_to_target_siginfo (p, &uinfo); -unlock_user (p, arg2,sizeof (target_siginfo_t)); +if (!is_error (ret)) { +if (arg2) { + p =lock_user (VERIFY_WRITE , arg2,sizeof (target_siginfo_t), +0 ); +if (!p) { + goto efault; + } +host_to_target_siginfo (p, &uinfo); +unlock_user (p, arg2,sizeof (target_siginfo_t)); + } + ret =host_to_target_signal (ret); } }break ;
Signature · 1 line
1.7.9.5
Quoted 9 lines · Petar Jovanovic
From: Petar Jovanovic <[email protected]>
On success,
sigtimedwait()returns a signal number that needs to be translated from a host value to a target value.This change also fixes issues with sigwait (that is implemented using
sigtimedwait()).Signed-off-by Petar Jovanovic <[email protected]>
Reviewed-by Peter Maydell <[email protected]>
thanks
-- PMM