Test for CPU_SET
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 22 Feb 2013 13:50:49 +0000 (08:50 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 22 Feb 2013 16:28:50 +0000 (11:28 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac

index bc8d0584a07ed714e1ccb9edbfeaf1950ac42d47..d1d605bd895b509787b20c6a37d3bde7e6518994 100644 (file)
@@ -215,6 +215,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 <sched.h>
+                               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])
This page took 0.026043 seconds and 4 git commands to generate.