summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-12-28 18:58:21 +0000
committerjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-12-28 18:58:21 +0000
commit7d534441576a51c533f3f104b82e7dc7ea4b00fd (patch)
tree10d9e97983febcb83f8cac7328e6170b445e8af0 /configure.ac
parentab61cf1b9becf8b16313a4bd8399b8969a17e920 (diff)
downloadATCD-7d534441576a51c533f3f104b82e7dc7ea4b00fd.tar.gz
ChangeLogTag: Wed Dec 28 10:56:42 2005 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac52
1 files changed, 50 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index db442d7c3d9..10157725c1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1152,7 +1152,7 @@ AC_CHECK_TYPE([cpu_set_t],
[AC_DEFINE([ACE_HAS_CPU_SET_T], 1,
[Define to 1 if the system has the type `cpu_set_t'.])],
[],
- [#include <sys/types.h>])
+ [#include <sched.h>])
AC_CHECK_TYPE([idtype_t],
[AC_DEFINE([ACE_HAS_IDTYPE_T], 1,
@@ -4306,7 +4306,55 @@ dnl Check for Unix98 pthreads extensions
ACE_CHECK_HAS_FUNCS(pthread_attr_setcreatesuspend_np)
ACE_CHECK_HAS_FUNCS(pthread_getaffinity_np pthread_setaffinity_np)
- ACE_CHECK_HAS_FUNCS(sched_getaffinity sched_setaffinity)
+
+ ACE_CHECK_HAS_FUNCS(sched_getaffinity)
+if test "$ac_cv_func_sched_getaffinity" = yes; then
+dnl The sched_getaffinity() function varies between linux versions
+dnl Check which one we have.
+AC_MSG_CHECKING([for 2- or 3-param sched_getaffinity])
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[
+#include <sched.h>
+ ]],
+ [[
+ pid_t pid;
+ cpu_set_t cpuset;
+ sched_getaffinity(pid, sizeof(cpuset), &cpuset);
+ ]])],
+ [
+ AC_MSG_RESULT([3])
+ ],
+ [
+ AC_MSG_RESULT([2])
+ AC_DEFINE([ACE_HAS_2_PARAM_SCHED_GETAFFINITY], 1,
+ [Define to 1 if platform has 2 parameter sched_getaffinity()])
+ ])
+fi dnl test "$ac_cv_func_sched_getaffinity" = yes
+
+ ACE_CHECK_HAS_FUNCS(sched_setaffinity)
+if test "$ac_cv_func_sched_setaffinity" = yes; then
+dnl The sched_setaffinity() function varies between linux versions
+dnl Check which one we have.
+AC_MSG_CHECKING([for 2- or 3-param sched_setaffinity])
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[
+#include <sched.h>
+ ]],
+ [[
+ pid_t pid;
+ cpu_set_t cpuset;
+ sched_setaffinity(pid, sizeof(cpuset), &cpuset);
+ ]])],
+ [
+ AC_MSG_RESULT([3])
+ ],
+ [
+ AC_MSG_RESULT([2])
+ AC_DEFINE([ACE_HAS_2_PARAM_SCHED_SETAFFINITY], 1,
+ [Define to 1 if platform has 2 parameter sched_setaffinity()])
+ ])
+fi dnl test "$ac_cv_func_sched_setaffinity" = yes
+
AC_CHECK_FUNC([pthread_rwlock_init],,)
AC_CHECK_FUNC([pthread_rwlock_destroy],,)