diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-09-06 10:00:42 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2018-10-24 12:53:27 +0200 |
commit | 3500dd283b8e5d8a4916423855514cdbfee36eac (patch) | |
tree | 1a4a7a09096f94d446db94617b86b5b10ebe4ea7 /sysdeps/nptl/pthread.h | |
parent | f1869e11225d9aa054fb11474887d8f109af0949 (diff) | |
download | glibc-aaribaud/y2038.tar glibc-aaribaud/y2038.tar.gz glibc-aaribaud/y2038.tar.bz2 glibc-aaribaud/y2038.zip |
Y2038: add _TIME_BITS supportaaribaud/y2038
This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).
Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.
Diffstat (limited to 'sysdeps/nptl/pthread.h')
-rw-r--r-- | sysdeps/nptl/pthread.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index df049abf74..5fb8a3f292 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -765,6 +765,17 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (pthread_mutex_timedlock, + (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_mutex_timedlock64) + __THROWNL __nonnull ((1, 2)); +# else +# define pthread_mutex_timedlock __pthread_mutex_timedlock64 +# endif +#endif extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -904,6 +915,17 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (pthread_rwlock_timedrdlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedrdlock64) + __THROWNL __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64 +# endif +#endif extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -919,6 +941,17 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (pthread_rwlock_timedwrlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedwrlock64) + __THROWNL __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64 +# endif +#endif extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -998,6 +1031,18 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (pthread_cond_timedwait, + (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_cond_timedwait64) + __nonnull ((1, 2, 3)); +# else +# define pthread_cond_timedwait __pthread_cond_timedwait64 +# endif +#endif extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) |