From 7d534441576a51c533f3f104b82e7dc7ea4b00fd Mon Sep 17 00:00:00 2001 From: jtc Date: Wed, 28 Dec 2005 18:58:21 +0000 Subject: ChangeLogTag: Wed Dec 28 10:56:42 2005 J.T. Conklin --- configure.ac | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'configure.ac') 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 ]) + [#include ]) 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 + ]], + [[ + 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 + ]], + [[ + 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],,) -- cgit v1.2.1