diff options
author | mike <mike@FreeBSD.org> | 2002-10-04 21:31:33 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-10-04 21:31:33 +0000 |
commit | 308c69ee6a0c88f6783afba7505bc043dbc4e918 (patch) | |
tree | 82bea680d71147f2d60a180167c7f814485a14c4 /sys | |
parent | 1ed00d451b97e1d2bddbaad5568f86b26b9082e4 (diff) | |
download | FreeBSD-src-308c69ee6a0c88f6783afba7505bc043dbc4e918.zip FreeBSD-src-308c69ee6a0c88f6783afba7505bc043dbc4e918.tar.gz |
o Adjust the SEM_VALUE_MAX macro so that <machine/limits.h> isn't
needed.
o Remove unneeded includes which only add namespace pollution.
o Sort function prototypes.
o Add restrict type-qualifier to sem_getvalue().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/posix4/semaphore.h | 20 | ||||
-rw-r--r-- | sys/sys/semaphore.h | 20 |
2 files changed, 12 insertions, 28 deletions
diff --git a/sys/posix4/semaphore.h b/sys/posix4/semaphore.h index a4ee56e5..b717b98 100644 --- a/sys/posix4/semaphore.h +++ b/sys/posix4/semaphore.h @@ -37,34 +37,26 @@ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ -#include <sys/_posix.h> -#include <machine/limits.h> - -#ifdef _P1003_1B_INCLUDE_MAYBES -#include <sys/types.h> -#include <fcntl.h> -#endif - /* Opaque type definition. */ struct sem; typedef struct sem * sem_t; #define SEM_FAILED ((sem_t *)0) -#define SEM_VALUE_MAX UINT_MAX +#define SEM_VALUE_MAX (~0U) /* Equivalent to UINT_MAX. */ #ifndef _KERNEL #include <sys/cdefs.h> __BEGIN_DECLS -int sem_init(sem_t *, int, unsigned int); +int sem_close(sem_t *); int sem_destroy(sem_t *); +int sem_getvalue(sem_t * __restrict, int * __restrict); +int sem_init(sem_t *, int, unsigned int); sem_t *sem_open(const char *, int, ...); -int sem_close(sem_t *); +int sem_post(sem_t *); +int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *); -int sem_trywait(sem_t *); -int sem_post(sem_t *); -int sem_getvalue(sem_t *, int *); __END_DECLS #endif diff --git a/sys/sys/semaphore.h b/sys/sys/semaphore.h index a4ee56e5..b717b98 100644 --- a/sys/sys/semaphore.h +++ b/sys/sys/semaphore.h @@ -37,34 +37,26 @@ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ -#include <sys/_posix.h> -#include <machine/limits.h> - -#ifdef _P1003_1B_INCLUDE_MAYBES -#include <sys/types.h> -#include <fcntl.h> -#endif - /* Opaque type definition. */ struct sem; typedef struct sem * sem_t; #define SEM_FAILED ((sem_t *)0) -#define SEM_VALUE_MAX UINT_MAX +#define SEM_VALUE_MAX (~0U) /* Equivalent to UINT_MAX. */ #ifndef _KERNEL #include <sys/cdefs.h> __BEGIN_DECLS -int sem_init(sem_t *, int, unsigned int); +int sem_close(sem_t *); int sem_destroy(sem_t *); +int sem_getvalue(sem_t * __restrict, int * __restrict); +int sem_init(sem_t *, int, unsigned int); sem_t *sem_open(const char *, int, ...); -int sem_close(sem_t *); +int sem_post(sem_t *); +int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *); -int sem_trywait(sem_t *); -int sem_post(sem_t *); -int sem_getvalue(sem_t *, int *); __END_DECLS #endif |