projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
elf.h: add ELFCOMPRESS_ZSTD
[musl]
/
src
/
thread
/
sem_getvalue.c
diff --git
a/src/thread/sem_getvalue.c
b/src/thread/sem_getvalue.c
index
643c096
..
c0b7762
100644
(file)
--- a/
src/thread/sem_getvalue.c
+++ b/
src/thread/sem_getvalue.c
@@
-1,8
+1,9
@@
#include <semaphore.h>
+#include <limits.h>
-int sem_getvalue(sem_t *
sem, int *
valp)
+int sem_getvalue(sem_t *
restrict sem, int *restrict
valp)
{
int val = sem->__val[0];
- *valp = val
< 0 ? 0 : val
;
+ *valp = val
& SEM_VALUE_MAX
;
return 0;
}