From 479307eac1490a09e71973116ec665006d31fba6 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 3 Jul 2007 21:44:27 +0000 Subject: 2007-07-03 Martin Hunt * futimes.c: New test. --- testsuite/systemtap.syscall/futimes.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 testsuite/systemtap.syscall/futimes.c (limited to 'testsuite/systemtap.syscall/futimes.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 +#include +#include + +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; +} -- cgit