From 667409afe4f909d18f6e19e6ca5a65a4848e51d6 Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Sun, 3 Oct 2010 18:04:55 +0200 Subject: Add support for CPU affinity & topology detection on FreeBSD 8 --- erts/configure.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'erts/configure.in') diff --git a/erts/configure.in b/erts/configure.in index 8c6f2ac076..08498dad29 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -1852,6 +1852,27 @@ if test $processor_bind_functionality = yes; then AC_DEFINE(HAVE_PROCESSOR_BIND, 1, [Define if you have processor_bind functionality]) fi +AC_MSG_CHECKING([for cpuset_getaffinity/cpuset_setaffinity]) +AC_TRY_COMPILE([ +#include +#include +], +[ + int res; + cpuset_t cpuset; + CPU_ZERO(&cpuset); + CPU_SET(1, &cpuset); + res = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &cpuset); + res = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &cpuset); + res = CPU_ISSET(1, &cpuset); + CPU_CLR(1, &cpuset); +], + cpuset_xetaffinity=yes, + cpuset_xetaffinity=no) +AC_MSG_RESULT([$cpuset_xetaffinity]) +if test $cpuset_xetaffinity = yes; then + AC_DEFINE(HAVE_CPUSET_xETAFFINITY, 1, [Define if you have cpuset_getaffinity/cpuset_setaffinity]) +fi AC_CACHE_CHECK([for 'end' symbol], erts_cv_have_end_symbol, -- cgit v1.2.3