syscalls/sysfs: replace syscall() macro by ltp_syscall()
PATCH v2 1/1 syscalls/sysfs: replace syscall() macro by ltp_syscall()
v1 ---> v2
a. remove the __NR_sysfs macro defined
b. replace syscall() with ltp_syscall()
--- testcases/kernel/syscalls/sysfs/sysfs01.c | 11 +++-------- testcases/kernel/syscalls/sysfs/sysfs02.c | 11 +++-------- testcases/kernel/syscalls/sysfs/sysfs03.c | 11 +++-------- testcases/kernel/syscalls/sysfs/sysfs04.c | 9 ++------- testcases/kernel/syscalls/sysfs/sysfs05.c | 9 ++------- testcases/kernel/syscalls/sysfs/sysfs06.c | 9 ++------- 6 files changed, 15 insertions(+), 45 deletions(-)
testcases/kernel/syscalls/sysfs/sysfs01.c +3 -8
@@ -66,10 +66,11 @@*Kernel should be compiled with proc filesystem support ******************************************************************************/ -#include "test.h" #include <errno.h> #include <unistd.h> #include <syscall.h> +#include "test.h" +#include "linux_syscall_numbers.h" static void setup ();static void cleanup ();
@@ -85,14 +86,12 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) { tst_count =0 ;/* option 1, buf holds fs name */ -TEST (syscall (__NR_sysfs,1 ,"proc" )); +TEST (ltp_syscall (__NR_sysfs,1 ,"proc" ));/* check return code */ if (TEST_RETURN ==-1 ) {
@@ -102,10 +101,6 @@ int main(int ac, char **av)tst_resm (TPASS ,"sysfs(2) Passed for " "option 1" ); } }/*End of TEST_LOOPING */ -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
testcases/kernel/syscalls/sysfs/sysfs02.c +3 -8
@@ -64,10 +64,11 @@*There is no glibc or libc support *****************************************************************************/ -#include "test.h" #include <errno.h> #include <unistd.h> #include <syscall.h> +#include "test.h" +#include "linux_syscall_numbers.h" static void setup ();static void cleanup ();
@@ -84,14 +85,12 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) { tst_count =0 ;/*option 2 buf holds fs name */ -TEST (syscall (__NR_sysfs,2 ,0 , buf)); +TEST (ltp_syscall (__NR_sysfs,2 ,0 , buf));/* check return code */ if (TEST_RETURN ==-1 ) {
@@ -102,10 +101,6 @@ int main(int ac, char **av)tst_resm (TPASS ,"sysfs(2) Passed for option 2" ); } }/*End of TEST_LOOPING */ -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
testcases/kernel/syscalls/sysfs/sysfs03.c +3 -8
@@ -64,10 +64,11 @@*There is no glibc or libc support *****************************************************************************/ -#include "test.h" #include <errno.h> #include <unistd.h> #include <syscall.h> +#include "test.h" +#include "linux_syscall_numbers.h" static void setup ();static void cleanup ();
@@ -83,13 +84,11 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) { tst_count =0 ; -TEST (syscall (__NR_sysfs,3 )); +TEST (ltp_syscall (__NR_sysfs,3 ));/* check return code */ if (TEST_RETURN ==-1 ) {
@@ -100,10 +99,6 @@ int main(int ac, char **av)tst_resm (TPASS ,"sysfs(2) Passed for option 3" ); } }/*End of TEST_LOOPING */ -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
testcases/kernel/syscalls/sysfs/sysfs04.c +2 -7
@@ -71,6 +71,7 @@#include <errno.h> #include <syscall.h> #include "test.h" +#include "linux_syscall_numbers.h" #define INVALID_OPTION 100static void setup ();
@@ -87,12 +88,10 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) { tst_count =0 ; -TEST (syscall (__NR_sysfs,INVALID_OPTION )); +TEST (ltp_syscall (__NR_sysfs,INVALID_OPTION ));/* check return code */ if ((TEST_RETURN ==-1 ) && (TEST_ERRNO ==EINVAL )) {
@@ -104,10 +103,6 @@ int main(int ac, char **av) " : EINVAL and got %d", EINVAL, TEST_ERRNO); } } -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
testcases/kernel/syscalls/sysfs/sysfs05.c +2 -7
@@ -72,6 +72,7 @@#include <errno.h> #include <syscall.h> #include "test.h" +#include "linux_syscall_numbers.h" static void setup ();static void cleanup ();
@@ -101,14 +102,12 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) {for (i =0 ; i <TST_TOTAL ; i++) { tst_count =0 ; -TEST (syscall (__NR_sysfs, option[i], fsname[i])); +TEST (ltp_syscall (__NR_sysfs, option[i], fsname[i]));/* check return code */ if ((TEST_RETURN == -1)
@@ -128,10 +127,6 @@ int main(int ac, char **av) }/*End of TEST LOOPS */ } -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
testcases/kernel/syscalls/sysfs/sysfs06.c +2 -7
@@ -73,6 +73,7 @@#include <syscall.h> #include <sys/mman.h> #include "test.h" +#include "linux_syscall_numbers.h" static void setup ();static void cleanup ();
@@ -104,14 +105,12 @@ int main(int ac, char **av)setup (); -#ifdef __NR_sysfs -for (lc =0 ;TEST_LOOPING (lc); lc++) {for (i =0 ; i <TST_TOTAL ; i++) { tst_count =0 ; -TEST (syscall +TEST (ltp_syscall (__NR_sysfs, option[i], fsindex[i], bad_addr));/* check return code */
@@ -131,10 +130,6 @@ int main(int ac, char **av) } }/*End of TEST LOOPS */ } -#else -tst_resm (TWARN , -"This test can only run on kernels that support the sysfs system call" ); -#endif /*Clean up and exit */ cleanup ();
Signature · 8 lines
1.8.3.1 ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 6 lines
From: "Li Wang" <[email protected]>
To: [email protected]
Cc: "Jan Stancek" <[email protected]>
Sent: Monday, 27 July, 2015 10:53:12 AM
Subject: [Patch v2] syscalls/sysfs: replacesyscall()macro byltp_syscall()
Quoted 6 lines
v1 ---> v2
a. remove the__NR_sysfsmacro defined b. replacesyscall()withltp_syscall()Signed-off-by Li Wang <[email protected]>Signed-off-by Jan Stancek <[email protected]>
Pushed with modified commit message, that reflects final version of patch.
Thanks,
Jan
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list