about summary refs log tree commit diff
path: root/nptl/tst-basic2.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-basic2.c')
-rw-r--r--nptl/tst-basic2.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/nptl/tst-basic2.c b/nptl/tst-basic2.c
index b9478c0812..1c4632ceb0 100644
--- a/nptl/tst-basic2.c
+++ b/nptl/tst-basic2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -49,6 +49,20 @@ do_test (void)
       exit (1);
     }
 
+  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;
   for (i = 0; i < N; ++i)
     {
@@ -64,7 +78,7 @@ do_test (void)
 	  exit (1);
 	}
 
-      if (pthread_create (&th[i], NULL, tf, (void *) (long int) i) != 0)
+      if (pthread_create (&th[i], &at, tf, (void *) (long int) i) != 0)
 	{
 	  puts ("create failed");
 	  exit (1);
@@ -79,6 +93,12 @@ do_test (void)
       printf ("created thread %d\n", i);
     }
 
+  if (pthread_attr_destroy (&at) != 0)
+    {
+      puts ("attr_destroy failed");
+      return 1;
+    }
+
   int result = 0;
   for (i = 0; i < N; ++i)
     {