about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv')
-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