summaryrefslogtreecommitdiffstats
path: root/man3/sem_init.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
commit3af6d22bb3850ab2bac67287e3a3d3b0e32868e5 (patch)
tree3ee7a3ec64525911fa865bb984c86d997d855527 /man3/sem_init.3
parentAdding debian version 6.05.01-1. (diff)
downloadmanpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.tar.xz
manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.zip
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'man3/sem_init.3')
-rw-r--r--man3/sem_init.315
1 files changed, 7 insertions, 8 deletions
diff --git a/man3/sem_init.3 b/man3/sem_init.3
index 5f9c352..0cae896 100644
--- a/man3/sem_init.3
+++ b/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 2023-10-31 "Linux man-pages 6.7"
.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 ().