2004-08-30 Roland McGrath <roland@redhat.com>
* time.c (clocknames): New variable, symbolic names for clock_t.
(sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep): Use it.
From Ulrich Drepper <drepper@redhat.com>.
Fixes RH#129378.
diff --git a/time.c b/time.c
index eb02f4c..28c05bd 100644
--- a/time.c
+++ b/time.c
@@ -364,12 +364,19 @@
{ 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 @@
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 @@
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]);