From: Mike Frysinger Date: Sun, 26 Aug 2007 11:22:56 +0000 (-0400) Subject: taskset: check for existence of sched_getaffinity X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19a224ad6aaed8b4547b85255d8deae80e8336da;p=util-linux taskset: check for existence of sched_getaffinity Some architectures do no reliably provide sched_getaffinity, so make sure the define exists before we try using it. Signed-off-by: Mike Frysinger --- diff --git a/configure.ac b/configure.ac index 36923703..00157e2d 100644 --- a/configure.ac +++ b/configure.ac @@ -196,6 +196,16 @@ int test = SYS_pivot_root; [AM_CONDITIONAL(HAVE_PIVOT_ROOT, false)]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +]], [[ +int test = SYS_sched_getaffinity; +]])], +[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, true)], +[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, false)]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include diff --git a/schedutils/Makefile.am b/schedutils/Makefile.am index 03e3080b..e93d31b3 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