[LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability

Caspar Zhang
2012-08-09T10:32:24Z

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

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 <caspar@casparzhang.com>
---
.../syscalls/get_mempolicy/get_mempolicy01.c | 3 +++
testcases/kernel/syscalls/mbind/mbind01.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-syscalls-numa-check-syscall-availability.patch --]
[-- Type: text/x-patch; name="0001-syscalls-numa-check-syscall-availability.patch", Size: 892 bytes --]

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();
}

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
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/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]