[LTP] [PATCH v3] [mm] mbind01: not working on some systems

Caspar Zhang
2011-04-10T13:01:03Z

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

when executing mem/mbind01 testcase under some systems, it returns
ENOSYS error, indicating that mbind syscall is not implemented on this
system. This behavior is allowed and should not return error.

Signed-off-by: Caspar Zhang <czhang@redhat.com>
---
testcases/kernel/syscalls/mbind/mbind02.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-mm-mbind01-not-working-on-some-systems.patch --]
[-- Type: text/x-patch; name="0002-mm-mbind01-not-working-on-some-systems.patch", Size: 905 bytes --]

diff --git a/testcases/kernel/syscalls/mbind/mbind02.c b/testcases/kernel/syscalls/mbind/mbind02.c
index 78d4a11..c829558 100644
--- a/testcases/kernel/syscalls/mbind/mbind02.c
+++ b/testcases/kernel/syscalls/mbind/mbind02.c
@@ -43,6 +43,7 @@ int TST_TOTAL = 1;
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>

static unsigned long pagesize;
static int opt_node;
@@ -90,8 +91,13 @@ int main(int argc, char** argv)
/* first mbind */
err = mbind(addr+pagesize, pagesize, MPOL_BIND, nmask->maskp,
nmask->size, MPOL_MF_MOVE_ALL);
- if (err != 0)
- tst_brkm(TBROK|TERRNO, NULL, "mbind1");
+ if (err != 0) {
+ if (errno != ENOSYS)
+ tst_brkm(TBROK|TERRNO, NULL, "mbind1");
+ else
+ tst_brkm(TCONF, NULL,
+ "mbind syscall not implemented on this system.");
+ }

/* second mbind */
err = mbind(addr, pagesize*3, MPOL_DEFAULT, NULL, 0, 0);

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

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev

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