and [whether nfds_t is defined].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@366
#undef KERNEL_2_2
#undef KERNEL_2_4
+#undef HAVE_SCHED_PRIORITY
+#undef HAVE_NFDS_T
+
#undef GLIBC_2_1
#undef GLIBC_2_2
;;
esac
+# APIs introduced in recent glibc versions
+
+AC_MSG_CHECKING([whether sched_param has a sched_priority member])
+AC_CACHE_VAL(vg_have_sched_priority,
+[
+AC_TRY_COMPILE([#include <pthread.h>],[
+struct sched_param p; p.sched_priority=1;],
+vg_have_sched_priority=yes,
+vg_have_sched_priority=no)
+])
+AC_MSG_RESULT($vg_have_sched_priority)
+if test "$vg_have_sched_priority" = yes; then
+AC_DEFINE(HAVE_SCHED_PRIORITY)
+fi
+
+AC_MSG_CHECKING([whether nfds_t is defined])
+AC_CACHE_VAL(vg_have_nfds_t,
+[
+AC_TRY_COMPILE([#include <sys/poll.h>],[
+nfds_t i=0;],
+vg_have_nfds_t=yes,
+vg_have_nfds_t=no)
+])
+AC_MSG_RESULT($vg_have_nfds_t)
+if test "$vg_have_nfds_t" = yes; then
+AC_DEFINE(HAVE_NFDS_T)
+fi
+
# try to detect the XFree version
AC_PATH_X
static int moans = N_MOANS;
if (moans-- > 0)
kludged("pthread_attr_getschedparam");
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
if (moans-- > 0)
kludged("pthread_getschedparam");
if (policy) *policy = SCHED_OTHER;
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
#include <sys/poll.h>
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
typedef unsigned long int nfds_t;
#endif
static int moans = N_MOANS;
if (moans-- > 0)
kludged("pthread_attr_getschedparam");
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
if (moans-- > 0)
kludged("pthread_getschedparam");
if (policy) *policy = SCHED_OTHER;
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
#include <sys/poll.h>
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
typedef unsigned long int nfds_t;
#endif
static int moans = N_MOANS;
if (moans-- > 0)
kludged("pthread_attr_getschedparam");
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
if (moans-- > 0)
kludged("pthread_getschedparam");
if (policy) *policy = SCHED_OTHER;
-# ifdef GLIBC_2_1
+# ifdef HAVE_SCHED_PRIORITY
if (param) param->sched_priority = 0; /* who knows */
# else
if (param) param->__sched_priority = 0; /* who knows */
#include <sys/poll.h>
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
typedef unsigned long int nfds_t;
#endif