summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-rwlock-timedwrlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/pt-rwlock-timedwrlock.c')
-rw-r--r--sysdeps/generic/pt-rwlock-timedwrlock.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sysdeps/generic/pt-rwlock-timedwrlock.c b/sysdeps/generic/pt-rwlock-timedwrlock.c
index edf6413..04eab51 100644
--- a/sysdeps/generic/pt-rwlock-timedwrlock.c
+++ b/sysdeps/generic/pt-rwlock-timedwrlock.c
@@ -1,5 +1,5 @@
/* Acquire a rwlock for writing. Generic version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,13 +22,6 @@
#include <pt-internal.h>
-int
-pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock,
- const struct timespec *abstime)
-{
- return __pthread_rwlock_timedwrlock_internal (rwlock, abstime);
-}
-
/* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get
it. As a special GNU extension, if ABSTIME is NULL then the wait
shall not time out. */
@@ -52,6 +45,9 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock,
/* The lock is busy. */
+ if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
self = _pthread_self ();
/* Add ourselves to the queue. */
@@ -90,3 +86,10 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock,
return 0;
}
+
+int
+pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock,
+ const struct timespec *abstime)
+{
+ return __pthread_rwlock_timedwrlock_internal (rwlock, abstime);
+}