summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2003-01-18 01:48:21 +0000
committermarc <marc@openbsd.org>2003-01-18 01:48:21 +0000
commit5fb35c8ffbe5300260a0c09ed7b4fa4cd5d92947 (patch)
treeb0261caa06ea0e0b85671714d06357bec65879a8
parentallow setting com baudrate up to 115200; req and testing by Sourabh Ladha <ladha@mail.eecis.udel.edu> (diff)
downloadwireguard-openbsd-5fb35c8ffbe5300260a0c09ed7b4fa4cd5d92947.tar.xz
wireguard-openbsd-5fb35c8ffbe5300260a0c09ed7b4fa4cd5d92947.zip
set stack size for threads, the default is too small for this test.
-rw-r--r--regress/lib/libc_r/getaddrinfo/getaddrinfo.c17
-rw-r--r--regress/lib/libpthread/getaddrinfo/getaddrinfo.c17
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);
-}