]> granicus.if.org Git - strace/commitdiff
2007-02-23 Ulrich Drepper <drepper@redhat.com>
authorRoland McGrath <roland@redhat.com>
Thu, 2 Aug 2007 01:25:34 +0000 (01:25 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 2 Aug 2007 01:25:34 +0000 (01:25 +0000)
* time.c (printitv_bitness): Add missing braces to enclose
conditional code.
(TDF_TIMER_ABSTIME): Define if not already.
(timerfdflags): New variable.
(sys_timerfd): New function.
* linux/syscall.h: Declare sys_timerfd.
* linux/syscallent.h: Add timerfd entry.
* linux/x86_64/syscallent.h: Likewise.

linux/syscall.h
linux/syscallent.h
linux/x86_64/syscallent.h
time.c

index 37a7eec05d28955ec2b16fb7d3307db9f8a32b0b..b87b9db374465ddc1113b7f9dd170b9d93b4a2f1 100644 (file)
@@ -102,7 +102,7 @@ int sys_waitid(), sys_fadvise64(), sys_fadvise64_64();
 int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy(), sys_move_pages();
 int sys_arch_prctl();
 int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
-int sys_utimensat(), sys_epoll_pwait(), sys_signalfd();
+int sys_utimensat(), sys_epoll_pwait(), sys_signalfd(), sys_timerfd();
 
 /* sys_socketcall subcalls */
 
index 8abdbb062ec2ebcf5350cf7ff1e102c8d5ac3546..760819ca350afd2e751ac418b903b209c91e4987 100644 (file)
        { 5,    TD,     sys_epoll_pwait,        "epoll_pwait"   }, /* 319 */
        { 4,    TD|TF,  sys_utimensat,          "utimensat"     }, /* 320 */
        { 3,    TD|TS,  sys_signalfd,           "signalfd"      }, /* 321 */
-       { 5,    0,      printargs,              "SYS_322"       }, /* 322 */
+       { 4,    TD,     sys_timerfd,            "timerfd"       }, /* 322 */
        { 5,    0,      printargs,              "SYS_323"       }, /* 323 */
        { 5,    0,      printargs,              "SYS_324"       }, /* 324 */
        { 5,    0,      printargs,              "SYS_325"       }, /* 325 */
index c561b847f6858671f4a41278fac5b9b8d29aa52a..8605fa9216a2a5f81b50e26f867b634739f17d49 100644 (file)
        { 4,    TD|TF,  sys_utimensat,          "utimensat"     }, /* 280 */
        { 5,    TD,     sys_epoll_pwait,        "epoll_pwait"   }, /* 281 */
        { 3,    TD|TS,  sys_signalfd,           "signalfd"      }, /* 282 */
+       { 4,    TD,     sys_timerfd,            "timerfd"       }, /* 283 */
diff --git a/time.c b/time.c
index b6a2fab9f6c69fa4626c4b7be45c6f00d0d85204..ce309b68c4ef5fd231708ccfd5d167436b4f6e1a 100644 (file)
--- a/time.c
+++ b/time.c
@@ -288,22 +288,24 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
                                struct timeval32 it_interval, it_value;
                        } itv;
 
-                       if ((rc = umove(tcp, addr, &itv)) >= 0)
+                       if ((rc = umove(tcp, addr, &itv)) >= 0) {
                                tprintf("{it_interval=");
                                tprint_timeval32(tcp, &itv.it_interval);
                                tprintf(", it_value=");
                                tprint_timeval32(tcp, &itv.it_value);
                                tprintf("}");
+                       }
                } else
                {
                        struct itimerval itv;
 
-                       if ((rc = umove(tcp, addr, &itv)) >= 0)
+                       if ((rc = umove(tcp, addr, &itv)) >= 0) {
                                tprintf("{it_interval=");
                                tprint_timeval(tcp, &itv.it_interval);
                                tprintf(", it_value=");
                                tprint_timeval(tcp, &itv.it_value);
                                tprintf("}");
+                       }
                }
 
                if (rc < 0)
@@ -892,4 +894,29 @@ long arg;
        }
        return 1;
 }
+
+#ifndef TFD_TIMER_ABSTIME
+#define TFD_TIMER_ABSTIME (1 << 0)
+#endif
+
+static const struct xlat timerfdflags[] = {
+       { TFD_TIMER_ABSTIME,    "TFD_TIMER_ABSTIME"     },
+       { 0,                    NULL                    }
+};
+
+int
+sys_timerfd(tcp)
+struct tcb *tcp;
+{
+       if (entering(tcp)) {
+               /* It does not matter that the kernel uses itimerspec.  */
+               tprintf("%ld, ", tcp->u_arg[0]);
+               printxval(clocknames, tcp->u_arg[1], "CLOCK_???");
+               tprintf(", ");
+               printflags(timerfdflags, tcp->u_arg[2], "TFD_???");
+               tprintf(", ");
+               printitv(tcp, tcp->u_arg[3]);
+       }
+       return 0;
+}
 #endif /* LINUX */