diff options
Diffstat (limited to 'nptl/tst-clock2.c')
-rw-r--r-- | nptl/tst-clock2.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/nptl/tst-clock2.c b/nptl/tst-clock2.c index 4c716b0011..62e5752032 100644 --- a/nptl/tst-clock2.c +++ b/nptl/tst-clock2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -78,11 +78,25 @@ do_test (void) cl[0] = CLOCK_THREAD_CPUTIME_ID; #endif + pthread_attr_t at; + + if (pthread_attr_init (&at) != 0) + { + puts ("attr_init failed"); + return 1; + } + + if (pthread_attr_setstacksize (&at, 1 * 1024 * 1024) != 0) + { + puts ("attr_setstacksize failed"); + return 1; + } + int i; int e; for (i = 0; i < N; ++i) { - if (pthread_create (&th[i], NULL, tf, NULL) != 0) + if (pthread_create (&th[i], &at, tf, NULL) != 0) { puts ("create failed"); return 1; @@ -106,6 +120,12 @@ do_test (void) } } + if (pthread_attr_destroy (&at) != 0) + { + puts ("attr_destroy failed"); + return 1; + } + struct timespec t[N + 1]; for (i = 0; i < N + 1; ++i) if (clock_gettime (cl[i], &t[i]) != 0) |