int sem_getvalue(sem_t *sem, int *sval);
The sem_getvalue() function updates the
memory location pointed to by the sval argument
to have the value of the semaphore specified by sem.
The value used to update the memory location is an actual semaphore
value that occurred at some time during the call but, not necessarily, the
value of the semaphore when it is returned to the calling process.
This function does not change the state of the semaphore.
If the specified semaphore (sem) is locked,
sem_getvalue() returns either zero or a positive number
whose value represents the number of processes waiting for the
semaphore at some unspecified time during the call.
Specifies the semaphore whose value is used to update a memory location.
Specifies the memory location whose value is to be updated by this function.
When successful, the sem_getvalue() returns zero.
Otherwise, it returns
-1 and sets errno to one of the following values:
The sem argument does not refer to a valid semaphore.
Derived from the POSIX Realtime Extension
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
- sem_post(), sem_trywait(), sem_wait(), semctl(), semget(), semop()
PTC MKS Toolkit 10.3 Documentation Build 39.