]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/tst-cond18.c
nptl: Turn libpthread.so into a symbolic link to the real DSO
[thirdparty/glibc.git] / nptl / tst-cond18.c
index 264c93238b858f58ab3c167311b6f06a778ba3a5..f02ffe6d025747012d90b7458d96f7385ead343e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
 
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <limits.h>
 #include <fcntl.h>
 #include <pthread.h>
 #include <stdbool.h>
@@ -27,7 +28,8 @@
 pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
 bool exiting;
-int fd, count, spins, nn;
+int fd, spins, nn;
+enum { count = 8 };            /* Number of worker threads.  */
 
 void *
 tf (void *id)
@@ -81,16 +83,11 @@ do_test (void)
       return 1;
     }
 
-  count = sysconf (_SC_NPROCESSORS_ONLN);
-  if (count <= 0)
-    count = 1;
-  count *= 8;
-
   pthread_t th[count + 1];
   pthread_attr_t attr;
   int i, ret, sz;
   pthread_attr_init (&attr);
-  sz = __getpagesize ();
+  sz = sysconf (_SC_PAGESIZE);
   if (sz < PTHREAD_STACK_MIN)
          sz = PTHREAD_STACK_MIN;
   pthread_attr_setstacksize (&attr, sz);