some NUMA related syscalls: mbind, get_mempolicy are not supported on
some arches (e.g. i386), this patch checks the syscalls' availability in
setup() function by using the macro syscall() implemented in
linux_syscall_numbers.h, if the syscall is not implemented on the
system, a TCONF message will be given like this:

get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on 
your arch

Signed-off-by: Caspar Zhang <[email protected]>
---
 .../syscalls/get_mempolicy/get_mempolicy01.c       |    3 +++
 testcases/kernel/syscalls/mbind/mbind01.c          |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index d0e372c..34fc52a 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -339,6 +339,9 @@ static void cleanup(void)
 
 static void setup(void)
 {
+	/* check syscall availability */
+	syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0);
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 2fc6f5a..9e877f1 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -300,6 +300,9 @@ TEST_END:
 
 static void setup(void)
 {
+	/* check syscall availability */
+	syscall(__NR_mbind, NULL, 0, 0, NULL, 0, 0);
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to