]> sourceware.org Git - systemtap.git/commitdiff
2007-07-03 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Tue, 3 Jul 2007 21:44:27 +0000 (21:44 +0000)
committerhunt <hunt>
Tue, 3 Jul 2007 21:44:27 +0000 (21:44 +0000)
* futimes.c: New test.

testsuite/systemtap.syscall/ChangeLog
testsuite/systemtap.syscall/futimes.c [new file with mode: 0644]

index c55b7344e2c510d53523fd3d6f43ac85ad041621..99607f25615d87417651c1a477d1d374a28751c6 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-03  Martin Hunt  <hunt@redhat.com>
+
+       * futimes.c: New test.
+
 2007-06-21  Martin Hunt  <hunt@redhat.com>
 
        * chmod.c, dir.c, mmap.c, net1.c, readwrite.c, stat.c,
diff --git a/testsuite/systemtap.syscall/futimes.c b/testsuite/systemtap.syscall/futimes.c
new file mode 100644 (file)
index 0000000..5b5ebac
--- /dev/null
@@ -0,0 +1,33 @@
+/* COVERAGE: utimes futimes futimesat */
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/time.h>
+#include <fcntl.h>
+
+int main()
+{
+  int fd;
+  struct timeval tv[2];
+
+  fd = creat("foobar", 0666);
+
+  /* access time */
+  tv[0].tv_sec = 1000000000;
+  tv[0].tv_usec = 1234;
+  tv[1].tv_sec = 2000000000;
+  tv[1].tv_usec = 5678;
+  
+  utimes("foobar", tv);
+  // utimes ("foobar", \[1000000000.001234\]\[2000000000.005678\])
+
+  futimes(fd, tv);
+  // futimesat (-100, "foobar", \[1000000000.001234\]\[2000000000.005678\])
+
+  futimesat(7, "foobar", tv);
+  // futimesat (7, "foobar", \[1000000000.001234\]\[2000000000.005678\])
+
+  futimesat(AT_FDCWD, "foobar", tv);
+  // futimesat (-100, "foobar", \[1000000000.001234\]\[2000000000.005678\])
+
+  return 0;
+}
This page took 0.028094 seconds and 5 git commands to generate.