Sign in
fuchsia
/
zircon
/
c830a868f9c3841f574fa57d2f86587595552928
/
.
/
third_party
/
ulib
/
musl
/
pthread
/
sem_getvalue.c
blob: 088a7d60305265f5cb4351310840b87b3733c710 [
file
] [
log
] [
blame
]
#include
<semaphore.h>
#include
<stdatomic.h>
int
sem_getvalue
(
sem_t
*
restrict sem
,
int
*
restrict valp
)
{
int
val
=
atomic_load
(&
sem
->
_s_value
);
*
valp
=
val
<
0
?
0
:
val
;
return
0
;
}