Sign in
mojo
/
mojo-tools
/
862d13b6f591fb83034e80ed5a8c59fb9d0b7b56
/
.
/
fusl
/
src
/
thread
/
sem_getvalue.c
blob: 94e0e2b0c10c6ed34941e18f1ca93e8356252649 [
file
] [
log
] [
blame
]
#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
;
}