diff options
Diffstat (limited to 'libpthread/linuxthreads/semaphore.h')
-rw-r--r-- | libpthread/linuxthreads/semaphore.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libpthread/linuxthreads/semaphore.h b/libpthread/linuxthreads/semaphore.h index 3084209f6..3924a471d 100644 --- a/libpthread/linuxthreads/semaphore.h +++ b/libpthread/linuxthreads/semaphore.h @@ -17,6 +17,7 @@ #include <features.h> #include <sys/types.h> +#include <limits.h> #ifdef __USE_XOPEN2K # define __need_timespec # include <time.h> @@ -42,7 +43,9 @@ typedef struct #define SEM_FAILED ((sem_t *) 0) /* Maximum value the semaphore can have. */ -#define SEM_VALUE_MAX (2147483647) +#ifndef SEM_VALUE_MAX +#define SEM_VALUE_MAX ((int) ((~0u) >> 1)) +#endif __BEGIN_DECLS @@ -55,13 +58,13 @@ extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) __THROW; extern int sem_destroy (sem_t *__sem) __THROW; /* Open a named semaphore NAME with open flags OFLAG. */ -extern sem_t *sem_open (__const char *__name, int __oflag, ...) __THROW; +extern sem_t *sem_open (const char *__name, int __oflag, ...) __THROW; /* Close descriptor for named semaphore SEM. */ extern int sem_close (sem_t *__sem) __THROW; /* Remove named semaphore NAME. */ -extern int sem_unlink (__const char *__name) __THROW; +extern int sem_unlink (const char *__name) __THROW; /* Wait for SEM being posted. @@ -75,14 +78,14 @@ extern int sem_wait (sem_t *__sem); This function is a cancellation point and therefore not marked with __THROW. */ extern int sem_timedwait (sem_t *__restrict __sem, - __const struct timespec *__restrict __abstime); + const struct timespec *__restrict __abstime); #endif /* Test whether SEM is posted. */ -extern int sem_trywait (sem_t *__sem) __THROW; +extern int sem_trywait (sem_t *__sem) __THROWNL; /* Post SEM. */ -extern int sem_post (sem_t *__sem) __THROW; +extern int sem_post (sem_t *__sem) __THROWNL; /* Get current value of SEM and store it in *SVAL. */ extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval) |