From: Dmitry V. Levin Date: Sat, 4 May 2019 23:15:52 +0000 (+0000) Subject: signal.c: introduce do_rt_sigtimedwait X-Git-Tag: v5.1~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c49452fc643f8bb9732a36e7713fc1bbc2e93979;p=strace signal.c: introduce do_rt_sigtimedwait This is going to be used to implement a parser of rt_sigtimedwait_time64 syscall. * signal.c (do_rt_sigtimedwait): New function. (SYS_FUNC(rt_sigtimedwait)): Turn into a thin wrapper around do_rt_sigtimedwait. --- diff --git a/signal.c b/signal.c index 8d918da2..ce328aa1 100644 --- a/signal.c +++ b/signal.c @@ -648,7 +648,9 @@ SYS_FUNC(rt_tgsigqueueinfo) return RVAL_DECODED; } -SYS_FUNC(rt_sigtimedwait) +static int +do_rt_sigtimedwait(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const sprint_obj_by_addr_fn sprint_ts) { /* NB: kernel requires arg[3] == NSIG_BYTES */ if (entering(tcp)) { @@ -662,10 +664,10 @@ SYS_FUNC(rt_sigtimedwait) */ printaddr(tcp->u_arg[1]); tprints(", "); - print_timespec(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); tprintf(", %" PRI_klu, tcp->u_arg[3]); } else { - char *sts = xstrdup(sprint_timespec(tcp, tcp->u_arg[2])); + char *sts = xstrdup(sprint_ts(tcp, tcp->u_arg[2])); set_tcb_priv_data(tcp, sts, free); } } else { @@ -684,6 +686,11 @@ SYS_FUNC(rt_sigtimedwait) return 0; } +SYS_FUNC(rt_sigtimedwait) +{ + return do_rt_sigtimedwait(tcp, print_timespec, sprint_timespec); +} + SYS_FUNC(restart_syscall) { tprintf("<... resuming interrupted %s ...>",