]> sourceware.org Git - systemtap.git/commitdiff
Explicitly test first kernel version in utimensat syscall test.
authorMark Wielaard <mjw@redhat.com>
Sat, 20 Mar 2010 19:53:18 +0000 (20:53 +0100)
committerMark Wielaard <mjw@redhat.com>
Sun, 21 Mar 2010 16:34:41 +0000 (17:34 +0100)
* testsuite/systemtap.syscall/futimes.c: utimensat was only available since
  2.6.22, but libc headers might already define __NR_utimensat.

testsuite/systemtap.syscall/futimes.c

index 4b812513249bf4f00dc89f9898645ed7d9310015..08e6871fe11914f46b9c3769c0ba735751b40201 100644 (file)
@@ -5,6 +5,7 @@
 #include <fcntl.h>
 #include <sys/syscall.h>
 #include <linux/utime.h>
+#include <linux/version.h>
 
 #ifndef UTIME_NOW
 #define UTIME_NOW       ((1l << 30) - 1l)
@@ -47,7 +48,7 @@ int main()
   //staptest// futimesat (AT_FDCWD, "foobar", \[1000000000.001234\]\[2000000000.005678\])
 #endif /* __NR_futimesat */
 
-#ifdef __NR_utimensat
+#if defined(__NR_utimensat) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
   ts[0].tv_sec = 1000000000;
   ts[0].tv_nsec = 123456789;
   ts[1].tv_sec = 2000000000;
This page took 0.02789 seconds and 5 git commands to generate.