musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018年08月28日 18:12:17 -0400
committerRich Felker <dalias@aerifal.cx>2018年08月28日 18:12:17 -0400
commitbaf95a5aefe885ef8a675759c63d43649d312ec6 (patch)
tree8f7d87846ddcf203c93d4cf69cf5cd7df75f7580 /src
parent056f9d818eaf1dbe9e9d63b64b109fd9b608fa36 (diff)
downloadmusl-baf95a5aefe885ef8a675759c63d43649d312ec6.tar.gz
reject invalid arguments to pthread_barrierattr_setpshared
this is a POSIX requirement.
Diffstat (limited to 'src')
-rw-r--r--src/thread/pthread_barrierattr_setpshared.c 1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c
index b391461e..c2d2929d 100644
--- a/src/thread/pthread_barrierattr_setpshared.c
+++ b/src/thread/pthread_barrierattr_setpshared.c
@@ -2,6 +2,7 @@
int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared)
{
+ if (pshared > 1U) return EINVAL;
a->__attr = pshared ? INT_MIN : 0;
return 0;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月30日 12:27:26 +0000

AltStyle によって変換されたページ (->オリジナル) /