aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-cond18.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-27 14:25:55 -0700
committerDavid S. Miller <davem@davemloft.net>2012-03-27 14:25:55 -0700
commit7ac88e383150ef3722bc58c541f261528bc25d22 (patch)
treed9618d11aba815988d3494eab024709390988bb9 /nptl/tst-cond18.c
parent6143dc8d006030f7235129015b988952072f4553 (diff)
downloadglibc-7ac88e383150ef3722bc58c541f261528bc25d22.tar
glibc-7ac88e383150ef3722bc58c541f261528bc25d22.tar.gz
glibc-7ac88e383150ef3722bc58c541f261528bc25d22.tar.bz2
glibc-7ac88e383150ef3722bc58c541f261528bc25d22.zip
Fix nptl/tst-cond1{6,7,8}.c on 32-bit with many cpus.
* tst-cond16.c (do_test): Use a thread stack size which is either PTHREAD_STACK_MIN or the page size, whichever is larger. * tst-cond18.c (do_test): Likewise.
Diffstat (limited to 'nptl/tst-cond18.c')
-rw-r--r--nptl/tst-cond18.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nptl/tst-cond18.c b/nptl/tst-cond18.c
index a1bb947ac4..264c93238b 100644
--- a/nptl/tst-cond18.c
+++ b/nptl/tst-cond18.c
@@ -87,10 +87,16 @@ do_test (void)
count *= 8;
pthread_t th[count + 1];
- int i, ret;
+ pthread_attr_t attr;
+ int i, ret, sz;
+ pthread_attr_init (&attr);
+ sz = __getpagesize ();
+ if (sz < PTHREAD_STACK_MIN)
+ sz = PTHREAD_STACK_MIN;
+ pthread_attr_setstacksize (&attr, sz);
for (i = 0; i <= count; ++i)
- if ((ret = pthread_create (&th[i], NULL, tf, (void *) (long) i)) != 0)
+ if ((ret = pthread_create (&th[i], &attr, tf, (void *) (long) i)) != 0)
{
errno = ret;
printf ("pthread_create %d failed: %m\n", i);