implement POSIX semaphores

This commit is contained in:
Rich Felker 2011-03-04 00:45:59 -05:00
commit 6fc5fdbdc7
10 changed files with 201 additions and 0 deletions

View file

@ -0,0 +1,8 @@
#include <semaphore.h>
int sem_getvalue(sem_t *sem, int *valp)
{
int val = sem->__val[0];
*valp = val < 0 ? 0 : val;
return 0;
}