aboutsummaryrefslogtreecommitdiff
path: root/src/thread/sem_getvalue.c
blob: a05d9022c3cd3f625875c02d3ce252eb1e6d7e27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <semaphore.h>
#include <limits.h>

int sem_getvalue(sem_t *restrict sem, int *restrict valp)
{
	int val = sem->__val[0];
	*valp = val & SEM_VALUE_MAX;
	return 0;
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif