2
0

sched_setaffinity.m4 777 B

12345678910111213141516171819
  1. AC_DEFUN([AX_HAVE_CPU_SET], [
  2. #
  3. # Check for the Linux functions for controlling processor affinity.
  4. #
  5. # LINUX: sched_setaffinity
  6. AC_CHECK_FUNCS(sched_setaffinity sched_getaffinity)
  7. if test "$ac_cv_func_sched_setaffinity" = "yes" ; then
  8. AC_CACHE_CHECK([whether the CPU_SET and CPU_ZERO macros are defined],
  9. ac_cv_cpu_set_defined,[
  10. saved_CFLAGS="$CFLAGS"
  11. CFLAGS="$CFLAGS $SWITCH_AM_CFLAGS $SWITCH_ANSI_CFLAGS -D_GNU_SOURCE"
  12. AC_TRY_COMPILE( [#include <sched.h>],[ cpu_set_t t; CPU_ZERO(&t); CPU_SET(1,&t); ],
  13. ac_cv_cpu_set_defined=yes,ac_cv_cpu_set_defined=no)])
  14. if test "$ac_cv_cpu_set_defined" = "yes" ; then
  15. AC_DEFINE(HAVE_CPU_SET_MACROS,1,[Define if CPU_SET and CPU_ZERO defined])
  16. fi
  17. CFLAGS="$saved_CFLAGS"
  18. fi
  19. ])