aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
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/sysdeps
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/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S10
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S12
3 files changed, 20 insertions, 5 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
index 97b94a3074..756ece29e0 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
@@ -1,6 +1,5 @@
-/* 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.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
index 2e99ac669a..b275b8b922 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
@@ -27,6 +27,7 @@
#define FUTEX_WAKE 1
#define EAGAIN 11
+#define EINVAL 22
#define EDEADLK 35
#define ETIMEDOUT 110
@@ -71,7 +72,11 @@ pthread_rwlock_timedrdlock:
cmpl $0, FLAGS(%ebp)
je 5f
-3: incl READERS_QUEUED(%ebp)
+ /* Check the value of the timeout parameter. */
+3: cmpl $1000000000, 4(%edi)
+ jae 19f
+
+ incl READERS_QUEUED(%ebp)
je 4f
LOCK
@@ -189,4 +194,7 @@ pthread_rwlock_timedrdlock:
18: movl $ETIMEDOUT, %ecx
jmp 9b
+
+19: movl $EINVAL, %ecx
+ jmp 9b
.size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
index bf8f1d48db..ec8f4b9f6d 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
@@ -27,6 +27,7 @@
#define FUTEX_WAKE 1
#define EAGAIN 11
+#define EINVAL 22
#define EDEADLK 35
#define ETIMEDOUT 110
@@ -69,7 +70,11 @@ pthread_rwlock_timedwrlock:
cmp $0, NR_READERS(%ebp)
je 5f
-3: incl WRITERS_QUEUED(%ebp)
+ /* Check the value of the timeout parameter. */
+3: cmpl $1000000000, 4(%edi)
+ jae 19f
+
+ incl WRITERS_QUEUED(%ebp)
je 4f
LOCK
@@ -156,7 +161,7 @@ pthread_rwlock_timedwrlock:
14: cmpl %gs:8, %eax
jne 3b
- movl $EDEADLK, %ecx
+20: movl $EDEADLK, %ecx
jmp 9b
6: movl %ebp, %eax
@@ -181,4 +186,7 @@ pthread_rwlock_timedwrlock:
18: movl $ETIMEDOUT, %ecx
jmp 9b
+
+19: movl $EINVAL, %ecx
+ jmp 9b
.size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock