[patch] Check for existence of sched_getaffinity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some architectures do no reliably provide sched_getaffinity, so make sure the
define exists before we try using it.

Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
 configure.ac           |   10 ++++++++++
 schedutils/Makefile.am |    9 +++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3692370..00157e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,16 @@ int test = SYS_pivot_root;
 
 
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/syscall.h>
+#include <unistd.h>
+]], [[
+int test = SYS_sched_getaffinity;
+]])],
+[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, true)],
+[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, false)])
+
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <time.h>
 #include <unistd.h>
 ]], [[
diff --git a/schedutils/Makefile.am b/schedutils/Makefile.am
index 03e3080..e93d31b 100644
--- a/schedutils/Makefile.am
+++ b/schedutils/Makefile.am
@@ -2,7 +2,12 @@ include $(top_srcdir)/config/include-Makefile.am
 
 if BUILD_SCHEDUTILS
 
-usrbinexec_PROGRAMS = chrt ionice taskset
-man_MANS = chrt.1 ionice.1 taskset.1
+usrbinexec_PROGRAMS = chrt ionice
+man_MANS = chrt.1 ionice.1
+
+if HAVE_SCHED_GETAFFINITY
+usrbinexec_PROGRAMS += taskset
+man_MANS += taskset.1
+endif
 
 endif
-- 
1.5.3.rc5
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux