summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall
diff options
context:
space:
mode:
authorhunt <hunt>2007-07-03 21:44:27 +0000
committerhunt <hunt>2007-07-03 21:44:27 +0000
commit479307eac1490a09e71973116ec665006d31fba6 (patch)
tree34454c72edacc2796e5a8c34e48f3ea30af6f061 /testsuite/systemtap.syscall
parent84cd02024b221fc66501d210a2790040ee4b14ff (diff)
downloadsystemtap-steved-479307eac1490a09e71973116ec665006d31fba6.tar.gz
systemtap-steved-479307eac1490a09e71973116ec665006d31fba6.tar.xz
systemtap-steved-479307eac1490a09e71973116ec665006d31fba6.zip
2007-07-03 Martin Hunt <hunt@redhat.com>
* futimes.c: New test.
Diffstat (limited to 'testsuite/systemtap.syscall')
-rw-r--r--testsuite/systemtap.syscall/ChangeLog4
-rw-r--r--testsuite/systemtap.syscall/futimes.c33
2 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/ChangeLog b/testsuite/systemtap.syscall/ChangeLog
index c55b7344..99607f25 100644
--- a/testsuite/systemtap.syscall/ChangeLog
+++ b/testsuite/systemtap.syscall/ChangeLog
@@ -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
index 00000000..5b5ebac5
--- /dev/null
+++ b/testsuite/systemtap.syscall/futimes.c
@@ -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;
+}