mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
sem_init(3): document process shared semaphores and their restrictions
This commit is contained in:
parent
9d7031a6d6
commit
461e296c49
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200274
@ -27,7 +27,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd February 15, 2000
|
.Dd December 8, 2009
|
||||||
.Dt SEM_INIT 3
|
.Dt SEM_INIT 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -48,8 +48,7 @@ to have the value
|
|||||||
.Fa value .
|
.Fa value .
|
||||||
A non-zero value for
|
A non-zero value for
|
||||||
.Fa pshared
|
.Fa pshared
|
||||||
specifies a shared semaphore that can be used by multiple processes, which this
|
specifies a shared semaphore that can be used by multiple processes.
|
||||||
implementation is not capable of.
|
|
||||||
.Pp
|
.Pp
|
||||||
Following a successful call to
|
Following a successful call to
|
||||||
.Fn sem_init ,
|
.Fn sem_init ,
|
||||||
@ -78,8 +77,6 @@ argument exceeds
|
|||||||
.Dv SEM_VALUE_MAX .
|
.Dv SEM_VALUE_MAX .
|
||||||
.It Bq Er ENOSPC
|
.It Bq Er ENOSPC
|
||||||
Memory allocation error.
|
Memory allocation error.
|
||||||
.It Bq Er EPERM
|
|
||||||
Unable to initialize a shared semaphore.
|
|
||||||
.El
|
.El
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr sem_destroy 3 ,
|
.Xr sem_destroy 3 ,
|
||||||
@ -93,16 +90,10 @@ The
|
|||||||
.Fn sem_init
|
.Fn sem_init
|
||||||
function conforms to
|
function conforms to
|
||||||
.St -p1003.1-96 .
|
.St -p1003.1-96 .
|
||||||
.Pp
|
.Sh BUGS
|
||||||
This implementation does not support shared semaphores, and reports this fact
|
A sem_t is a pointer to a separately allocated structure,
|
||||||
by setting
|
therefore process shared semaphores only work between related processes
|
||||||
.Va errno
|
and do not perform very well
|
||||||
to
|
(each operation is a system call,
|
||||||
.Er EPERM .
|
while single-process semaphores only do a system call
|
||||||
This is perhaps a stretch of the intention of
|
if they need to block or wake up a thread).
|
||||||
.Tn 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.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user