Sign in
fuchsia
/
fuchsia
/
83854f31e881f0f9aa2bd848a84a94e01fb09dd9
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
pthread
/
sem_getvalue.c
blob: 4495ec6ffa8251393908243cfe358cae10be71e5 [
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
;
}