From: Mike F. <su...@li...> - 2013-02-08 22:13:53
|
The branch, master, has been updated via 75201f160b9aa49af70d8f46fb1f087e63d603dd (commit) from a60edf1089d273faef33a6a0e099531507007cf7 (commit) - Log ----------------------------------------------------------------- commit 75201f160b9aa49af70d8f46fb1f087e63d603dd Author: Mike Frysinger <va...@ge...> Date: Fri Feb 8 17:12:41 2013 -0500 syscalls/sysctl: check if __NR_sysctl is defined Recent kernel ports have started omitting this old syscall, so if it isn't defined, just display a normal TCONF message. Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/sysctl/sysctl01.c | 15 +++++++++++++++ testcases/kernel/syscalls/sysctl/sysctl03.c | 15 +++++++++++++++ testcases/kernel/syscalls/sysctl/sysctl04.c | 15 +++++++++++++++ testcases/kernel/syscalls/sysctl/sysctl05.c | 15 +++++++++++++++ 4 files changed, 60 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/syscalls/sysctl/sysctl01.c b/testcases/kernel/syscalls/sysctl/sysctl01.c index ed2d067..cc2817e 100644 --- a/testcases/kernel/syscalls/sysctl/sysctl01.c +++ b/testcases/kernel/syscalls/sysctl/sysctl01.c @@ -53,6 +53,10 @@ #include <linux/sysctl.h> char *TCID = "sysctl01"; + +/* This is an older/deprecated syscall that newer arches are omitting */ +#ifdef __NR_sysctl + int TST_TOTAL = 3; static int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, @@ -194,3 +198,14 @@ void cleanup() TEST_CLEANUP; } + +#else +int TST_TOTAL = 0; /* Total number of test cases. */ + +int main() +{ + + tst_resm(TCONF, "This test needs a kernel that has sysctl syscall."); + tst_exit(); +} +#endif diff --git a/testcases/kernel/syscalls/sysctl/sysctl03.c b/testcases/kernel/syscalls/sysctl/sysctl03.c index 09713d7..6caaa72 100644 --- a/testcases/kernel/syscalls/sysctl/sysctl03.c +++ b/testcases/kernel/syscalls/sysctl/sysctl03.c @@ -73,6 +73,10 @@ #include <pwd.h> char *TCID = "sysctl03"; + +/* This is an older/deprecated syscall that newer arches are omitting */ +#ifdef __NR_sysctl + int TST_TOTAL = 2; int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, @@ -213,3 +217,14 @@ void cleanup(void) { TEST_CLEANUP; } + +#else +int TST_TOTAL = 0; /* Total number of test cases. */ + +int main() +{ + + tst_resm(TCONF, "This test needs a kernel that has sysctl syscall."); + tst_exit(); +} +#endif diff --git a/testcases/kernel/syscalls/sysctl/sysctl04.c b/testcases/kernel/syscalls/sysctl/sysctl04.c index 3e41418..bda1020 100644 --- a/testcases/kernel/syscalls/sysctl/sysctl04.c +++ b/testcases/kernel/syscalls/sysctl/sysctl04.c @@ -54,6 +54,10 @@ #include <linux/sysctl.h> char *TCID = "sysctl04"; + +/* This is an older/deprecated syscall that newer arches are omitting */ +#ifdef __NR_sysctl + int TST_TOTAL = 2; int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, @@ -166,3 +170,14 @@ void cleanup() TEST_CLEANUP; } + +#else +int TST_TOTAL = 0; /* Total number of test cases. */ + +int main() +{ + + tst_resm(TCONF, "This test needs a kernel that has sysctl syscall."); + tst_exit(); +} +#endif diff --git a/testcases/kernel/syscalls/sysctl/sysctl05.c b/testcases/kernel/syscalls/sysctl/sysctl05.c index 4ec4e20..e06ad6e 100644 --- a/testcases/kernel/syscalls/sysctl/sysctl05.c +++ b/testcases/kernel/syscalls/sysctl/sysctl05.c @@ -56,6 +56,10 @@ #include <errno.h> char *TCID = "sysctl05"; + +/* This is an older/deprecated syscall that newer arches are omitting */ +#ifdef __NR_sysctl + int TST_TOTAL = 2; int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, @@ -193,3 +197,14 @@ void cleanup() TEST_CLEANUP; } + +#else +int TST_TOTAL = 0; /* Total number of test cases. */ + +int main() +{ + + tst_resm(TCONF, "This test needs a kernel that has sysctl syscall."); + tst_exit(); +} +#endif hooks/post-receive -- ltp |