aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-attr1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-16 10:57:38 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-16 10:57:38 +0000
commit0a37669aa5d98875e783df75681f035a905b7f31 (patch)
tree611caab21da3070beafe7c4739c2fae616321f04 /nptl/tst-attr1.c
parent1564916ab9ef4e2ce673cd5fb3123c067e4a787d (diff)
downloadglibc-0a37669aa5d98875e783df75681f035a905b7f31.tar
glibc-0a37669aa5d98875e783df75681f035a905b7f31.tar.gz
glibc-0a37669aa5d98875e783df75681f035a905b7f31.tar.bz2
glibc-0a37669aa5d98875e783df75681f035a905b7f31.zip
Update.
* tst-rwlock6.c: More pthread_rwlock_timedwrlock and pthread_rwlock_timedrdlock tests. * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Check for invalid tv_nsec field. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S: Likewise. * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect recursive mutex of overflow. * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
Diffstat (limited to 'nptl/tst-attr1.c')
-rw-r--r--nptl/tst-attr1.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/nptl/tst-attr1.c b/nptl/tst-attr1.c
index bfa7075018..c5870beb5b 100644
--- a/nptl/tst-attr1.c
+++ b/nptl/tst-attr1.c
@@ -35,6 +35,14 @@ do_test (void)
exit (1);
}
+ pthread_mutexattr_t ma;
+
+ if (pthread_mutexattr_init (&ma) != 0)
+ {
+ puts ("mutexattr_init failed");
+ exit (1);
+ }
+
/* XXX Remove if default value is clear. */
pthread_attr_setinheritsched (&a, PTHREAD_INHERIT_SCHED);
pthread_attr_setschedpolicy (&a, SCHED_OTHER);
@@ -143,6 +151,31 @@ contentionscope changed to %d by invalid setscope call\n", s);
exit (1);
}
}
+
+ if (r != PTHREAD_PROCESS_PRIVATE && r != PTHREAD_PROCESS_SHARED)
+ {
+ int e = pthread_mutexattr_setpshared (&ma, r);
+
+ if (e == 0)
+ {
+ printf ("mutexattr_setpshared with value %ld succeeded\n", r);
+ exit (1);
+ }
+
+ int s;
+ if (pthread_mutexattr_getpshared (&ma, &s) != 0)
+ {
+ puts ("mutexattr_getpshared failed");
+ exit (1);
+ }
+
+ if (s != PTHREAD_PROCESS_PRIVATE)
+ {
+ printf ("\
+pshared changed to %d by invalid mutexattr_setpshared call\n", s);
+ exit (1);
+ }
+ }
}
return 0;