SYNOPSIS
#include <semaphore.h>
DESCRIPTION
The <semaphore.h> header file is designed for use with semaphore operations. This header file defines the sem_t type, used in performing semaphore operations.
The SEM_FAILED symbol is also defined
(see
The following are declared as functions:
int sem_close(sem_t *); int sem_destroy(sem_t *); int sem_getvalue(sem_t *, int *); int sem_init(sem_t *, int, unsigned int); sem_t *sem_open(const char *, int, ...); int sem_post(sem_t *); int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *);
Inclusion of the <semaphore.h> header makes visible symbols defined in the headers <fcntl.h> and <sys/types.h>.
Additionally, the following semaphore-related symbols are defined in the <limits> header file:
- _POSIX_SEM_NSEMS_MAX
-
Specifies the maximum number of semaphores. By default, this is 255, but it can be overridden by changing the value in the Max Number of Semaphores field in the Semaphore Settings category on the Runtime Settings tab of the MKS Toolkit control panel applet.
- _POSIX_SEM_VALUE_MAX
-
Specifies the maximum value for use when initializing a semaphore.
CONFORMANCE
UNIX 03.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
sem_close() ,sem_destroy() ,sem_getvalue() ,sem_init() ,sem_open() ,sem_post() ,sem_timedwait() ,sem_unlink() ,sem_wait()
PTC MKS Toolkit 10.4 Documentation Build 39.