diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2003-01-18 01:48:22 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2003-01-18 01:48:22 +0000 |
commit | c87eadaca6533084ee1082a045f75c777f548a5d (patch) | |
tree | 4caa6057b8965d1e7d1ab3c2a4dd9af5bb40b8d4 /regress | |
parent | c510630c5b9a7171c4701c842e2f5af2b86dc755 (diff) |
set stack size for threads, the default is too small for this test.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libc_r/getaddrinfo/getaddrinfo.c | 17 | ||||
-rw-r--r-- | regress/lib/libpthread/getaddrinfo/getaddrinfo.c | 17 |
2 files changed, 14 insertions, 20 deletions
diff --git a/regress/lib/libc_r/getaddrinfo/getaddrinfo.c b/regress/lib/libc_r/getaddrinfo/getaddrinfo.c index 47437b8a2f1..9629022fbdd 100644 --- a/regress/lib/libc_r/getaddrinfo/getaddrinfo.c +++ b/regress/lib/libc_r/getaddrinfo/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.2 2002/02/01 21:49:51 fgsch Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.3 2003/01/18 01:48:21 marc Exp $ */ /* * Copyright (c) 2002 Todd T. Fries <todd@OpenBSD.org> * All rights reserved. @@ -33,19 +33,23 @@ #include "test.h" +#define STACK_SIZE (2 * 1024 * 1024) + void *func(void *); -void *foo(void *); int main(argc, argv) int argc; char **argv; { + pthread_attr_t attr; pthread_t threads[2]; int i; + CHECKr(pthread_attr_init(&attr)); + CHECKr(pthread_attr_setstacksize(&attr, (size_t) STACK_SIZE)); for (i = 0; i < 2; i++) { - CHECKr(pthread_create(&threads[i], NULL, func, NULL)); + CHECKr(pthread_create(&threads[i], &attr, func, NULL)); } pthread_yield(); @@ -85,10 +89,3 @@ func(arg) return (NULL); } -void * -foo(arg) - void *arg; -{ - sleep(5); - exit(NOTOK); -} diff --git a/regress/lib/libpthread/getaddrinfo/getaddrinfo.c b/regress/lib/libpthread/getaddrinfo/getaddrinfo.c index 47437b8a2f1..9629022fbdd 100644 --- a/regress/lib/libpthread/getaddrinfo/getaddrinfo.c +++ b/regress/lib/libpthread/getaddrinfo/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.2 2002/02/01 21:49:51 fgsch Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.3 2003/01/18 01:48:21 marc Exp $ */ /* * Copyright (c) 2002 Todd T. Fries <todd@OpenBSD.org> * All rights reserved. @@ -33,19 +33,23 @@ #include "test.h" +#define STACK_SIZE (2 * 1024 * 1024) + void *func(void *); -void *foo(void *); int main(argc, argv) int argc; char **argv; { + pthread_attr_t attr; pthread_t threads[2]; int i; + CHECKr(pthread_attr_init(&attr)); + CHECKr(pthread_attr_setstacksize(&attr, (size_t) STACK_SIZE)); for (i = 0; i < 2; i++) { - CHECKr(pthread_create(&threads[i], NULL, func, NULL)); + CHECKr(pthread_create(&threads[i], &attr, func, NULL)); } pthread_yield(); @@ -85,10 +89,3 @@ func(arg) return (NULL); } -void * -foo(arg) - void *arg; -{ - sleep(5); - exit(NOTOK); -} |