From: Dmitry V. Levin Date: Sat, 4 May 2019 23:15:52 +0000 (+0000) Subject: futex.c: introduce do_futex X-Git-Tag: v5.1~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05d7ac91d211208737928adedbf4156b2a6085ea;p=strace futex.c: introduce do_futex This is going to be used to implement a parser of futex_time64 syscall. * futex.c (do_futex): New function. (SYS_FUNC(futex)): Turn into a thin wrapper around do_futex. --- diff --git a/futex.c b/futex.c index 38acb4e5..41e4857d 100644 --- a/futex.c +++ b/futex.c @@ -26,7 +26,8 @@ #include "xlat/futexwakeops.h" #include "xlat/futexwakecmps.h" -SYS_FUNC(futex) +static int +do_futex(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { const kernel_ulong_t uaddr = tcp->u_arg[0]; const int op = tcp->u_arg[1]; @@ -45,16 +46,16 @@ SYS_FUNC(futex) case FUTEX_WAIT: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); break; case FUTEX_LOCK_PI: tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); break; case FUTEX_WAIT_BITSET: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); tprints(", "); printxval(futexbitset, val3, NULL); break; @@ -98,7 +99,7 @@ SYS_FUNC(futex) case FUTEX_WAIT_REQUEUE_PI: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); tprints(", "); printaddr(uaddr2); break; @@ -121,3 +122,8 @@ SYS_FUNC(futex) return RVAL_DECODED; } + +SYS_FUNC(futex) +{ + return do_futex(tcp, print_timespec); +}