summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-tumbleweed/man3/sem_init.3
diff options
context:
space:
mode:
Diffstat (limited to 'upstream/opensuse-tumbleweed/man3/sem_init.3')
-rw-r--r--upstream/opensuse-tumbleweed/man3/sem_init.315
1 files changed, 7 insertions, 8 deletions
diff --git a/upstream/opensuse-tumbleweed/man3/sem_init.3 b/upstream/opensuse-tumbleweed/man3/sem_init.3
index 5f9c352a..8ea6b64a 100644
--- a/upstream/opensuse-tumbleweed/man3/sem_init.3
+++ b/upstream/opensuse-tumbleweed/man3/sem_init.3
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH sem_init 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH sem_init 3 2024-05-02 "Linux man-pages (unreleased)"
.SH NAME
sem_init \- initialize an unnamed semaphore
.SH LIBRARY
@@ -12,7 +12,7 @@ POSIX threads library
.SH SYNOPSIS
.nf
.B #include <semaphore.h>
-.PP
+.P
.BI "int sem_init(sem_t *" sem ", int " pshared ", unsigned int " value );
.fi
.SH DESCRIPTION
@@ -22,12 +22,12 @@ initializes the unnamed semaphore at the address pointed to by
The
.I value
argument specifies the initial value for the semaphore.
-.PP
+.P
The
.I pshared
argument indicates whether this semaphore is to be shared
between the threads of a process, or between processes.
-.PP
+.P
If
.I pshared
has the value 0,
@@ -35,7 +35,7 @@ then the semaphore is shared between the threads of a process,
and should be located at some address that is visible to all threads
(e.g., a global variable, or a variable allocated dynamically on
the heap).
-.PP
+.P
If
.I pshared
is nonzero, then the semaphore is shared between processes,
@@ -52,7 +52,7 @@ can operate on the semaphore using
.BR sem_post (3),
.BR sem_wait (3),
and so on.
-.PP
+.P
Initializing a semaphore that has already been initialized
results in undefined behavior.
.SH RETURN VALUE
@@ -87,12 +87,11 @@ T{
.BR sem_init ()
T} Thread safety MT-Safe
.TE
-.sp 1
.SH STANDARDS
POSIX.1-2008.
.SH HISTORY
POSIX.1-2001.
-.PP
+.P
Bizarrely, POSIX.1-2001 does not specify the value that should
be returned by a successful call to
.BR sem_init ().