Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
615629bd6fcd6ddb69ad762e679f088c7bd878e2
/
.
/
src
/
thread
/
sem_getvalue.c
blob: d9d830717730d238182b249849d7aaa1100c9501 [
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
;
}