From 19a224ad6aaed8b4547b85255d8deae80e8336da Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 26 Aug 2007 07:22:56 -0400 Subject: [PATCH] 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 --- configure.ac | 10 ++++++++++ schedutils/Makefile.am | 9 +++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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 -- 2.39.5