summaryrefslogtreecommitdiff
path: root/lib/libc/sys/semget.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/semget.2')
-rw-r--r--lib/libc/sys/semget.223
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/libc/sys/semget.2 b/lib/libc/sys/semget.2
index 00863ab13c5..b22f85bf4c4 100644
--- a/lib/libc/sys/semget.2
+++ b/lib/libc/sys/semget.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: semget.2,v 1.5 1998/07/20 07:37:24 deraadt Exp $
+.\" $OpenBSD: semget.2,v 1.6 1999/05/25 13:06:47 aaron Exp $
.\" $NetBSD: semget.2,v 1.2 1997/03/27 08:20:41 mikel Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
@@ -47,7 +47,7 @@ The
.Fn semget
system call returns the semaphore identifier associated with
.Fa key .
-
+.Pp
A new set containing
.Fa nsems
semaphores is created if either
@@ -56,26 +56,25 @@ is equal to IPC_PRIVATE, or
.Fa key
does not have a semaphore set associated with it and the IPC_CREAT bit is
set in
-.Fa semflg.
-
+.Fa semflg .
+.Pp
The access modes of the created semaphores is specified in
.Fa semflg
by
.Em or Ns 'ing
-the following values
+the following values:
.Pp
.Bd -literal -offset indent -compact
SEM_A alter permission for owner
SEM_R read permission for owner
-
+.Pp
SEM_A >> 3 alter permission for group
SEM_R >> 3 read permission for group
-
+.Pp
SEM_A >> 6 alter permission for other
SEM_R >> 6 read permission for other
.Ed
.Pp
-
If a new set of semaphores is created, the data structure associated with it
(the
.Va semid_ds
@@ -87,12 +86,12 @@ is intialized as follows:
.Va sem_perm.cuid
and
.Va sem_perm.uid
-are set to the effective uid of the calling process.
+are set to the effective UID of the calling process.
.It
.Va sem_perm.gid
and
.Va sem_perm.cgid
-are set to the effective gid of the calling process.
+are set to the effective GID of the calling process.
.It
.Va sem_perm.mode
is set to the lower 9 bits of
@@ -118,7 +117,7 @@ is set to reflect the error.
.Bl -tag -width Er
.It Bq Er EACCES
The caller has no permission to access a semaphore set already associated with
-.Fa key.
+.Fa key .
.It Bq Er EEXIST
Both IPC_CREAT and IPC_EXCL are set in
.Fa semflg ,
@@ -128,7 +127,7 @@ and a semaphore set is already associated with
.Va nsems
is less than 0 or greater than the system limit for the number in a semaphore
set.
-
+.Pp
A semaphore set associated with
.Fa key
exists, but has fewer semaphores than the number specified in