From: Julian Seward Date: Mon, 3 Jun 2002 13:27:15 +0000 (+0000) Subject: Feature tests for [whether sched_param has a sched_priority member] X-Git-Tag: svn/VALGRIND_1_0_3~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d03544310975709536fc39d5672f6f6c23ca658;p=thirdparty%2Fvalgrind.git Feature tests for [whether sched_param has a sched_priority member] and [whether nfds_t is defined]. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@366 --- diff --git a/acconfig.h b/acconfig.h index 78bd7928b6..aa5ffc3d3f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,6 +1,9 @@ #undef KERNEL_2_2 #undef KERNEL_2_4 +#undef HAVE_SCHED_PRIORITY +#undef HAVE_NFDS_T + #undef GLIBC_2_1 #undef GLIBC_2_2 diff --git a/configure.in b/configure.in index b0634a7919..4782b8ca0b 100644 --- a/configure.in +++ b/configure.in @@ -169,6 +169,34 @@ case "${glibc}" in ;; 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 ],[ +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 ],[ +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 diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index f090a86afd..f71eff4185 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -266,7 +266,7 @@ int pthread_attr_getschedparam(const pthread_attr_t *attr, 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 */ @@ -840,7 +840,7 @@ int pthread_getschedparam(pthread_t target_thread, 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 */ @@ -1877,7 +1877,7 @@ int select ( int n, #include -#ifdef GLIBC_2_1 +#ifndef HAVE_NFDS_T typedef unsigned long int nfds_t; #endif diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index f090a86afd..f71eff4185 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -266,7 +266,7 @@ int pthread_attr_getschedparam(const pthread_attr_t *attr, 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 */ @@ -840,7 +840,7 @@ int pthread_getschedparam(pthread_t target_thread, 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 */ @@ -1877,7 +1877,7 @@ int select ( int n, #include -#ifdef GLIBC_2_1 +#ifndef HAVE_NFDS_T typedef unsigned long int nfds_t; #endif diff --git a/vg_libpthread.c b/vg_libpthread.c index f090a86afd..f71eff4185 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -266,7 +266,7 @@ int pthread_attr_getschedparam(const pthread_attr_t *attr, 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 */ @@ -840,7 +840,7 @@ int pthread_getschedparam(pthread_t target_thread, 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 */ @@ -1877,7 +1877,7 @@ int select ( int n, #include -#ifdef GLIBC_2_1 +#ifndef HAVE_NFDS_T typedef unsigned long int nfds_t; #endif