Sign in
mojo
/
mojo-tools
/
74b0cac9bdd351dc67c6fc99a7a8b64e85de2f5d
/
.
/
fusl
/
src
/
thread
/
sem_getvalue.c
blob: 94e0e2b0c10c6ed34941e18f1ca93e8356252649 [
file
]
#include
<semaphore.h>
int
sem_getvalue
(
sem_t
*
restrict sem
,
int
*
restrict valp
)
{
int
val
=
sem
->
__val
[
0
];
*
valp
=
val
<
0
?
0
:
val
;
return
0
;
}