]> err.no Git - util-linux/commitdiff
taskset: check for existence of sched_getaffinity
authorMike Frysinger <vapier@gentoo.org>
Sun, 26 Aug 2007 11:22:56 +0000 (07:22 -0400)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Aug 2007 08:48:29 +0000 (10:48 +0200)
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@gentoo.org>
configure.ac
schedutils/Makefile.am

index 369237031210761235a47a1ca292587f232c7ded..00157e2dbac9cca3b9d62d61fdbf488a09673902 100644 (file)
@@ -196,6 +196,16 @@ int test = SYS_pivot_root;
 [AM_CONDITIONAL(HAVE_PIVOT_ROOT, false)])
 
 
+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>
index 03e3080b5f4847a71a75060b98947a0f35cda407..e93d31b39857dec5bc3c3573f746ec7e765b3f28 100644 (file)
@@ -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