From fe1f98621fe1cfafdf66c332a004e2a8c8397b2a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 22 Feb 2013 08:50:49 -0500 Subject: [PATCH] Test for CPU_SET Signed-off-by: Mathieu Desnoyers --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 7a315e8..a49b39f 100644 --- a/configure.ac +++ b/configure.ac @@ -231,6 +231,26 @@ AC_CHECK_FUNCS([sched_setaffinity],[ AC_MSG_RESULT([no]) ]) + # Confirm that we have CPU_SET, and it actually works. + AC_MSG_CHECKING([whether CPU_SET works]) + AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #define _GNU_SOURCE + #include + int main() + { + cpu_set_t foo, mask; CPU_SET (0, &foo); + return 0; + } + ]]) + ],[ + # Works! + AC_DEFINE(HAVE_CPU_SET, 1) + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + ]) + # Check how many arguments does sched_setaffinity take. # Should be 3 or 2. AC_MSG_CHECKING([how many arguments sched_setaffinity takes]) -- 2.34.1