]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Feature tests for [whether sched_param has a sched_priority member]
authorJulian Seward <jseward@acm.org>
Mon, 3 Jun 2002 13:27:15 +0000 (13:27 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 3 Jun 2002 13:27:15 +0000 (13:27 +0000)
and [whether nfds_t is defined].

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@366

acconfig.h
configure.in
coregrind/arch/x86-linux/vg_libpthread.c
coregrind/vg_libpthread.c
vg_libpthread.c

index 78bd7928b6c3e47df62064eb86e6e85255b33d2b..aa5ffc3d3f56262a59a806cdc52d0ac1796615fd 100644 (file)
@@ -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
 
index b0634a7919459fb6be26b6ca6807051fc7f14ee8..4782b8ca0bc10530cb4e84f579d36cea28a2017c 100644 (file)
@@ -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 <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
index f090a86afdee3614d444fe6891bd904e5a06f44c..f71eff41852d7d0d1740f41be64c1640560bbd3e 100644 (file)
@@ -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 <sys/poll.h>
 
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
 typedef unsigned long int nfds_t;
 #endif
 
index f090a86afdee3614d444fe6891bd904e5a06f44c..f71eff41852d7d0d1740f41be64c1640560bbd3e 100644 (file)
@@ -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 <sys/poll.h>
 
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
 typedef unsigned long int nfds_t;
 #endif
 
index f090a86afdee3614d444fe6891bd904e5a06f44c..f71eff41852d7d0d1740f41be64c1640560bbd3e 100644 (file)
@@ -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 <sys/poll.h>
 
-#ifdef GLIBC_2_1
+#ifndef HAVE_NFDS_T
 typedef unsigned long int nfds_t;
 #endif