sem_getvalue3
Get the value of a semaphore
Usage
#include <semaphore.h>
int
sem_getvalue(sem_t * restrict sem, int * restrict sval);
Library
Standard C Library (libc, -lc)
Overview
The sem_getvalue() function sets the variable pointed to by sval to the current value of the semaphore pointed to by sem, as of the time that the call to sem_getvalue() is actually run.
Return values
The sem_getvalue() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
Errors
The sem_getvalue() function will fail if:
- [EINVAL]
-
The sem argument points to an invalid semaphore.
Releases
70 releases since FreeBSD 4.0-RELEASE; the text changed 39 times.