From a705575cd79a1ecb8298242c126b76925389cec7 Mon Sep 17 00:00:00 2001 From: dwilder Date: Thu, 11 Oct 2007 18:59:25 +0000 Subject: [PATCH] futimes.c : Only test system calls that have numbers assigned in asm/unistd.h --- testsuite/systemtap.syscall/ChangeLog | 5 +++++ testsuite/systemtap.syscall/futimes.c | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/testsuite/systemtap.syscall/ChangeLog b/testsuite/systemtap.syscall/ChangeLog index 61c72bc2c..69d77c85e 100644 --- a/testsuite/systemtap.syscall/ChangeLog +++ b/testsuite/systemtap.syscall/ChangeLog @@ -1,3 +1,8 @@ +2007-10-11 David Wilder + + * futimes.c: Only test system calls that have + numbers assigned in asm/unistd.h. (see PR:4902) + 2007-10-09 Martin Hunt * rt_signal.c: Fix expected results for IA64. diff --git a/testsuite/systemtap.syscall/futimes.c b/testsuite/systemtap.syscall/futimes.c index 4ccb754f7..359afad3b 100644 --- a/testsuite/systemtap.syscall/futimes.c +++ b/testsuite/systemtap.syscall/futimes.c @@ -4,6 +4,7 @@ #include #include #include +#include #ifndef UTIME_NOW #define UTIME_NOW ((1l << 30) - 1l) @@ -15,6 +16,7 @@ int main() int fd; struct timeval tv[2]; struct timespec ts[2]; + struct utimbuf times; fd = creat("foobar", 0666); @@ -23,19 +25,27 @@ int main() tv[0].tv_usec = 1234; tv[1].tv_sec = 2000000000; tv[1].tv_usec = 5678; + + +#ifdef __NR_utime + times.actime = 1000000000; + times.modtime = 2000000000; + syscall(__NR_utime, "foobar", × ); + // utime ("foobar", \[2001/09/09-01:46:40, 2033/05/18-03:33:20\]) +#endif /* __NR_utimes */ - utimes("foobar", tv); +#ifdef __NR_utimes + syscall(__NR_utimes, "foobar", tv); // utimes ("foobar", \[1000000000.001234\]\[2000000000.005678\]) -#ifdef SYS_futimesat - futimes(fd, tv); - // futimesat (AT_FDCWD, "foobar", \[1000000000.001234\]\[2000000000.005678\]) +#endif /* __NR_utimes */ - futimesat(7, "foobar", tv); +#ifdef __NR_futimesat + syscall(__NR_futimesat, 7, "foobar", tv); // futimesat (7, "foobar", \[1000000000.001234\]\[2000000000.005678\]) - futimesat(AT_FDCWD, "foobar", tv); + syscall(__NR_futimesat, AT_FDCWD, "foobar", tv); // futimesat (AT_FDCWD, "foobar", \[1000000000.001234\]\[2000000000.005678\]) -#endif /* SYS_futimesat */ +#endif /* __NR_futimesat */ #ifdef __NR_utimensat ts[0].tv_sec = 1000000000; -- 2.43.5