diff options
Diffstat (limited to 'nptl/tst-cond4.c')
-rw-r--r-- | nptl/tst-cond4.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/nptl/tst-cond4.c b/nptl/tst-cond4.c index ffc83c7668..6b57fbc7ee 100644 --- a/nptl/tst-cond4.c +++ b/nptl/tst-cond4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -140,12 +140,36 @@ main (void) exit (1); } + if (pthread_condattr_getpshared (&ca, &p) != 0) + { + puts ("1st condattr_getpshared failed"); + exit (1); + } + + if (p != PTHREAD_PROCESS_PRIVATE) + { + puts ("default value for pshared in condattr wrong"); + exit (1); + } + if (pthread_condattr_setpshared (&ca, PTHREAD_PROCESS_SHARED) != 0) { puts ("condattr_setpshared failed"); exit (1); } + if (pthread_condattr_getpshared (&ca, &p) != 0) + { + puts ("2nd condattr_getpshared failed"); + exit (1); + } + + if (p != PTHREAD_PROCESS_SHARED) + { + puts ("pshared condattr still not set"); + exit (1); + } + if (pthread_cond_init (cond, &ca) != 0) { puts ("cond_init failed"); |