summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2021-04-06 19:59:33 +0000
committerkn <kn@cvs.openbsd.org>2021-04-06 19:59:33 +0000
commit9063d52834b4998edb65968157abd763f8d15d7d (patch)
treee173e6440b1b26289eae5fb1b2cde377a9295c21 /lib/libpthread
parent40509f494d63f8650eb925bfe0b515838ed36f3c (diff)
Shared semaphores are not supported
Shared semaphores were reverted with lib/librthread/rthread_sem.c r1.18 in 2013 but corresponding manual bits were not; revert sem_init.3 r1.6 (modulo the unrelated "named semaphores" hunk). Reported by Rubén Llorente, thanks. Prodding OK jmc
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/man/sem_init.320
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/libpthread/man/sem_init.3 b/lib/libpthread/man/sem_init.3
index 92bd6d274fa..3d23004e014 100644
--- a/lib/libpthread/man/sem_init.3
+++ b/lib/libpthread/man/sem_init.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sem_init.3,v 1.6 2013/11/20 03:26:56 tedu Exp $
+.\" $OpenBSD: sem_init.3,v 1.7 2021/04/06 19:59:32 kn Exp $
.\"
.\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>.
.\" All rights reserved.
@@ -28,7 +28,7 @@
.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/lib/libc_r/man/sem_init.3,v 1.11 2001/10/01 16:09:09 ru Exp $
-.Dd $Mdocdate: November 20 2013 $
+.Dd $Mdocdate: April 6 2021 $
.Dt SEM_INIT 3
.Os
.Sh NAME
@@ -47,7 +47,8 @@ to have the value
.Fa value .
A non-zero value for
.Fa pshared
-specifies a shared semaphore that can be used by multiple processes.
+specifies a shared semaphore that can be used by multiple processes, which this
+implementation is not capable of.
.Pp
Following a successful call to
.Fn sem_init ,
@@ -77,6 +78,8 @@ will fail if:
exceeds SEM_VALUE_MAX.
.It Bq Er ENOSPC
Memory allocation error.
+.It Bq Er EPERM
+Unable to initialize a shared semaphore.
.El
.Sh SEE ALSO
.Xr sem_destroy 3 ,
@@ -88,3 +91,14 @@ Memory allocation error.
.Fn sem_init
conforms to
.St -p1003.1-96 .
+.Pp
+This implementation does not support shared semaphores, and reports this fact
+by setting
+.Va errno
+to
+.Er EPERM .
+This is perhaps a stretch of the intention of POSIX, but is
+compliant, with the caveat that
+.Fn sem_init
+always reports a permissions error when an attempt to create a shared semaphore
+is made.