I was confused, and numaif.h is in fact a header under testcases/kernel/syscalls/utils. As such:
1. The autoconf test for the header is removed.
2. An appropriate inclusion is added for numa.h in numaif.h
3. Remove overengineered code in get_mempolicy01.c because linux_syscall_numbers.h handles the unhandled numa syscall numbers.
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
index 9a9947c..375a011 100644
--- a/m4/ltp-numa.m4
+++ b/m4/ltp-numa.m4
@@ -27,9 +27,6 @@
AC_CHECK_HEADERS(numa.h,[
LTP_SYSCALL_NUMA_HEADER=yes
AC_CHECK_FUNCS(numa_alloc_onnode,numa_move_pages)
- AC_CHECK_HEADERS(numaif.h,[LTP_SYSCALL_NUMAIF_HEADER=yes], [], [], [
-#include <numa.h>
-])
]
AC_CHECK_LIB(numa,numa_available,[
NUMA_LIBS="-lnuma"
diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index a0af6af..0e34bc1 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -1,49 +1,49 @@
/******************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007-2008 ,Hitachi, Ltd */
+/* Copyright (c) Crackerjack Project., 2007-2008 ,Hitachi, Ltd */
/* Author(s): Takahiro Yasui <takahiro.yasui.mp@hitachi.com>, */
/* Yumiko Sugita <yumiko.sugita.yf@hitachi.com>, */
/* Satoshi Fujiwara <sa-fuji@sdl.hitachi.co.jp> */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
+/* */
/******************************************************************************/
/******************************************************************************/
-/* */
-/* File: get_mempolicy01.c */
-/* */
-/* Description: This tests the get_mempolicy() syscall */
+/* */
+/* File: get_mempolicy01.c */
+/* */
+/* Description: This tests the get_mempolicy() syscall */
/* */
/* */
/* */
/* */
/* */
-/* */
-/* Usage: <for command-line> */
-/* get_mempolicy01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: get_mempolicy01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/* */
+/* Usage: <for command-line> */
+/* get_mempolicy01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
+/* where, -c n : Run n copies concurrently. */
+/* -e : Turn on errno logging. */
+/* -i n : Execute test n times. */
+/* -I x : Execute test for x seconds. */
+/* -P x : Pause for x seconds between iterations. */
+/* -t : Turn on syscall timing. */
+/* */
+/* Total Tests: 1 */
+/* */
+/* Test Name: get_mempolicy01 */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
#include <sys/syscall.h>
#include <sys/types.h>
@@ -55,14 +55,13 @@
#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
-#include "../utils/numaif.h"
-#include "../utils/include_j_h.h"
-#include "../utils/common_j_h.c"
+#include "numaif.h"
+#include "include_j_h.h"
+#include "common_j_h.c"
/* Harness Specific Include Files. */
#include "test.h"
#include "usctest.h"
-#include "linux_syscall_numbers.h"
/* Extern Global Variables */
extern int Tst_count; /* counter for tst_xxx routines. */
@@ -78,9 +77,6 @@
*/
#define SYSCALL_NAME "get_mempolicy"
-/* s390x doesn't support numa. */
-#if defined(__NR_get_mempolicy) && defined(__NR_mbind) && defined(__NR_set_mempolicy)
-
/* Extern Global Functions */
/******************************************************************************/
/* */
@@ -436,14 +432,3 @@
tst_exit();
}
-
-#else /* Non-existent numa implementation. */
-void cleanup () { };
-
-int
-main(int argc, char **argv) {
- tst_resm(TCONF, "Your system doesn't properly support: %s",
- SYSCALL_NAME);
- tst_exit();
-}
-#endif /* defined(__NR_get_mempolicy) && defined(__NR_mbind) && defined(__NR_set_mempolicy) */
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index cfc3a96..81ce94f 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -59,14 +59,11 @@
#include "include_j_h.h"
#include "config.h"
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
+#include "numaif.h"
/* Harness Specific Include Files. */
#include "test.h"
#include "usctest.h"
-#include "linux_syscall_numbers.h"
/* Extern Global Variables */
extern int Tst_count; /* counter for tst_xxx routines. */
@@ -77,8 +74,6 @@
int testno;
int TST_TOTAL = 2; /* total number of tests in this file. */
-#if defined(HAVE_NUMAIF_H) && defined(__NR_get_mempolicy) && defined(__NR_mbind)
-
/* Extern Global Functions */
/******************************************************************************/
/* */
@@ -411,10 +406,3 @@
cleanup();
tst_exit();
}
-
-#else
-int main (void) {
- tst_resm(TCONF, "NUMA support not provided.");
- tst_exit();
-}
-#endif
diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
index cf87cd4..4b8d7c7 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -20,6 +20,8 @@
include $(top_srcdir)/include/mk/testcases.mk
+CPPFLAGS += -I$(abs_srcdir)/../utils
+
INSTALL_TARGETS := move_pages.sh
MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.c b/testcases/kernel/syscalls/move_pages/move_pages_support.c
index 259049c..3a55e5e 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages_support.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages_support.c
@@ -24,11 +24,6 @@
#if HAVE_NUMA_H
#include <numa.h>
#endif
-/*
- * #if HAVE_NUMAIF_H
- #include <numaif.h>
- #endif
- */
#include <errno.h>
#include <test.h>
@@ -408,25 +403,15 @@
#if HAS_NUMA_H
if (numa_available() < 0) {
tst_resm(TCONF, "NUMA support is not available");
- tst_exit();
- }
-
- if (numa_max_node() < (min_nodes - 1)) {
+ } else if (numa_max_node() < (min_nodes - 1)) {
tst_resm(TCONF, "atleast 2 NUMA nodes are required");
- tst_exit();
- }
-
- if (tst_kvercmp(2, 6, 18) < 0) {
+ } else if (tst_kvercmp(2, 6, 18) < 0) {
tst_resm(TCONF, "2.6.18 or greater kernel required");
- tst_exit();
- }
-
- if (arch_support == 0) {
+ } else if (arch_support == 0) {
tst_resm(TCONF, "this arch does not support move_pages");
- tst_exit();
}
#else
tst_resm(TCONF, "NUMA support not provided");
- tst_exit();
#endif
+ tst_exit();
}
diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.h b/testcases/kernel/syscalls/move_pages/move_pages_support.h
index f760730..3e231de 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages_support.h
+++ b/testcases/kernel/syscalls/move_pages/move_pages_support.h
@@ -19,9 +19,7 @@
#ifndef MOVE_PAGES_SUPPORT_H
#define MOVE_PAGES_SUPPORT_H
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
+#include "numaif.h"
#include <semaphore.h>
long get_page_size();