From: Roland McGrath Date: Tue, 31 Aug 2004 06:52:45 +0000 (+0000) Subject: 2004-08-30 Roland McGrath X-Git-Tag: v4.5.18~544 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54a4edd69a320542ddd0dffec05dacab7443d453;p=strace 2004-08-30 Roland McGrath * time.c (clocknames): New variable, symbolic names for clock_t. (sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep): Use it. From Ulrich Drepper . Fixes RH#129378. --- diff --git a/time.c b/time.c index eb02f4c6..28c05bd2 100644 --- a/time.c +++ b/time.c @@ -364,12 +364,19 @@ static struct xlat clockflags[] = { { 0, NULL } }; +static struct xlat clocknames[] = { + { CLOCK_REALTIME, "CLOCK_REALTIME" }, + { CLOCK_MONOTONIC, "CLOCK_MONOTONIC" }, + { 0, NULL } +}; + int sys_clock_settime(tcp) struct tcb *tcp; { if (entering(tcp)) { - tprintf("%#lx, ", tcp->u_arg[0]); + printxval(clocknames, tcp->u_arg[0], "CLOCK_???"); + tprintf(", "); printtv(tcp, tcp->u_arg[1]); } return 0; @@ -380,7 +387,8 @@ sys_clock_gettime(tcp) struct tcb *tcp; { if (entering(tcp)) { - tprintf("%#lx, ", tcp->u_arg[0]); + printxval(clocknames, tcp->u_arg[0], "CLOCK_???"); + tprintf(", "); } else { if (syserror(tcp)) tprintf("%#lx", tcp->u_arg[1]); @@ -395,7 +403,8 @@ sys_clock_nanosleep(tcp) struct tcb *tcp; { if (entering(tcp)) { - tprintf("%#lx, ", tcp->u_arg[0]); + printxval(clocknames, tcp->u_arg[0], "CLOCK_???"); + tprintf(", "); printflags(clockflags, tcp->u_arg[1]); tprintf(", "); printtv(tcp, tcp->u_arg[2]);