summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-21 14:50:44 +0000
committerjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-21 14:50:44 +0000
commit3cafeeadbbe1de646342cdca6a488a8a400a4530 (patch)
tree07dd9b072dce3d5da62df41af8b12b1e0629d8f6 /configure.ac
parent488943f455cfb6f103fc2256efa960ea1527ae86 (diff)
downloadATCD-3cafeeadbbe1de646342cdca6a488a8a400a4530.tar.gz
ChangeLogTag: Tue Mar 21 14:29:29 UTC 2006 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 36 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1d82de1e3cf..e2e459446b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4427,6 +4427,41 @@ dnl Check for Unix98 pthreads extensions
ACE_CHECK_HAS_FUNCS(pthread_getaffinity_np pthread_setaffinity_np)
+dnl Linux's sched_{set,get}affinity interface has changed three times:
+dnl
+dnl In glibc 2.3.2, it was:
+dnl
+dnl int sched_setaffinity(pid_t __pid,
+dnl unsigned int __len, unsigned long * __mask);
+dnl
+dnl In glibc 2.3.3, it was changed to:
+dnl
+dnl int sched_setaffinity(pid_t __pid, const cpu_set_t* __mask);
+dnl
+dnl And in glibc ?.?.?, it was changed again to:
+dnl
+dnl int sched_setaffinity(pid_t __pid, size_t __cpusetsize,
+dnl const cpu_set_t* __cpuset);
+dnl
+dnl The following feature tests attempt to determine which (if any)
+dnl version is supported by the system. A further complication is
+dnl that the C library may support one version, the kernel may not,
+dnl and vice versa.
+dnl
+dnl As of this writing, ACE's ACE_OS::sched_setaffinity() wrapper
+dnl facade implementation only supports the latter two varients. So
+dnl if the system doesn't define cpu_set_t, we simply avoid checking
+dnl for sched_setaffinity(). No attempt is made to verify C library /
+dnl kernel consistency.
+dnl
+dnl The "right" thing to do is to implement something similar to the
+dnl PLPA (Portable Linux Processor Affinity) Library, converting the
+dnl arguments and invoking the syscall directly (instead of calling
+dnl the C library wrapper).
+dnl
+
+if test "$ac_cv_type_cpu_set_t" = yes; then
+
ACE_CHECK_HAS_FUNCS(sched_getaffinity)
if test "$ac_cv_func_sched_getaffinity" = yes; then
dnl The sched_getaffinity() function varies between linux versions
@@ -4485,6 +4520,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(
])
fi dnl test "$ac_cv_func_sched_setaffinity" = yes
+fi dnl test "$ac_cv_type_cpu_set_t" = yes
AC_CHECK_FUNC([pthread_rwlock_init],,)
AC_CHECK_FUNC([pthread_rwlock_destroy],,)