Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/sys Update for XSH5.
details: https://anonhg.NetBSD.org/src/rev/1e944eecd9d3
branches: trunk
changeset: 475797:1e944eecd9d3
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Aug 25 20:55:35 1999 +0000
description:
Update for XSH5.
diffstat:
lib/libc/sys/semctl.2 | 96 +++++++++++++++++++++++++++-----------------------
lib/libc/sys/semget.2 | 16 +++++--
lib/libc/sys/semop.2 | 30 +++++++--------
3 files changed, 77 insertions(+), 65 deletions(-)
diffs (279 lines):
diff -r 2489d2fd6e27 -r 1e944eecd9d3 lib/libc/sys/semctl.2
--- a/lib/libc/sys/semctl.2 Wed Aug 25 20:53:15 1999 +0000
+++ b/lib/libc/sys/semctl.2 Wed Aug 25 20:55:35 1999 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: semctl.2,v 1.6 1999/03/22 19:45:08 garbled Exp $
+.\" $NetBSD: semctl.2,v 1.7 1999/08/25 20:55:35 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -29,18 +29,16 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 17, 1995
+.Dd August 25, 1999
.Dt SEMCTL 2
.Os
.Sh NAME
.Nm semctl
.Nd semaphore control operations
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/sem.h>
.Ft int
-.Fn semctl "int semid" "int semnum" "int cmd" "union semun arg"
+.Fn semctl "int semid" "int semnum" "int cmd" "..."
.Sh DESCRIPTION
The
.Fn semctl
@@ -52,8 +50,8 @@
The operation to be performed is specified in
.Fa cmd
(see below).
-.Fa arg
-is a union of the following fields:
+The fourth argument is optional and depends upon the opration requested.
+If required, it is a union of the following fields:
.Bd -literal
int val; /* value for SETVAL */
struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */
@@ -61,46 +59,34 @@
.Ed
.Pp
The
-.Bf -literal
-semid_ds
-.Ef
+.Sy semid_ds
structure used in the
.Dv IPC_SET
and
.Dv IPC_STAT
-commands is defined as follows in
-.Aq Pa sys/sem.h :
+commands is defined in
+.Aq Pa sys/sem.h
+and contains the following members:
.Bd -literal
-struct semid_ds {
- struct ipc_perm sem_perm; /* operation permissions */
- struct sem *sem_base; /* semaphore set */
- u_short sem_nsems; /* number of sems in set */
- time_t sem_otime; /* last operation time */
- time_t sem_ctime; /* last change time */
-};
+ struct ipc_perm sem_perm; /* operation permissions */
+ unsigned short sem_nsems; /* number of sems in set */
+ time_t sem_otime; /* last operation time */
+ time_t sem_ctime; /* last change time */
.Ed
.Pp
The
-.Bf -literal
-ipc_perm
-.Ef
+.Sy ipc_perm
structure used inside the
-.Bf -literal
-semid_ds
-.Ef
+.Sy semid_ds
structure is defined in
.Aq Pa sys/ipc.h
-and looks like this:
+and contains the following members:
.Bd -literal
-struct ipc_perm {
- ushort cuid; /* creator user id */
- ushort cgid; /* creator group id */
- ushort uid; /* user id */
- ushort gid; /* group id */
- ushort mode; /* r/w permission (see chmod(2)) */
- ushort seq; /* sequence # (to generate unique msg/sem/shm id) */
- key_t key; /* user specified msg/sem/shm key */
-};
+ uid_t cuid; /* creator user id */
+ gid_t cgid; /* creator group id */
+ uid_t uid; /* user id */
+ gid_t gid; /* group id */
+ mode_t mode; /* permission (lower 9 bits) */
.Ed
.Pp
.Fn semctl
@@ -110,7 +96,11 @@
Return the value of the semaphore.
.It Dv SETVAL
Set the value of the semaphore to
-.Fa arg.val .
+.Fa arg.val ,
+where
+.Fa arg
+is the fourth arument to
+.Fn semctl .
.It Dv GETPID
Return the pid of the last process that did an operation on this semaphore.
.It Dv GETNCNT
@@ -126,15 +116,19 @@
identifier
.Fa semid
to the corresponding values in
-.Fa arg.array .
+.Fa arg.array ,
+where
+.Fa arg
+is the fourth argument to
+.Fn semctl .
.It Dv IPC_STAT
-Gather statistics about a semaphore and place the information in the
-.Bf -literal
-semid_ds
-.Ef
+Gather information about a semaphore and place the information in the
structure pointed to by
-.Fa arg.buf
-(see above).
+.Fa arg.buf ,
+where
+.Fa arg
+is the fourth argument to
+.Fn semctl .
.It Dv IPC_SET
Set the value of the
.Va sem_perm.uid ,
@@ -144,7 +138,11 @@
fields in the structure associated with the semaphore.
The values are taken from the corresponding fields in the structure
pointed to by
-.Fa arg.buf .
+.Fa arg.buf ,
+there
+.Fa arg
+is the fourth argument to
+.Fn semctl .
This operation can only be executed by the super-user, or a process that
has an effective user id equal to either
.Va sem_perm.cuid
@@ -219,8 +217,18 @@
is not a valid command.
.It Bq Er EFAULT
.Fa arg.buf
+or
+.Fa arg.array
specifies an invalid address.
.El
.Sh SEE ALSO
.Xr semget 2 ,
.Xr semop 2
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
+.Sh HISTORY
+Semaphores appeared in the first release of
+.At V .
diff -r 2489d2fd6e27 -r 1e944eecd9d3 lib/libc/sys/semget.2
--- a/lib/libc/sys/semget.2 Wed Aug 25 20:53:15 1999 +0000
+++ b/lib/libc/sys/semget.2 Wed Aug 25 20:55:35 1999 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: semget.2,v 1.6 1999/03/22 19:45:08 garbled Exp $
+.\" $NetBSD: semget.2,v 1.7 1999/08/25 20:55:36 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -29,15 +29,13 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 17, 1995
+.Dd August 25, 1999
.Dt SEMGET 2
.Os
.Sh NAME
.Nm semget
-.Nd get semaphore set
+.Nd get set of semaphores
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/sem.h>
.Ft int
.Fn semget "key_t key" "int nsems" "int semflg"
@@ -136,3 +134,11 @@
.Sh SEE ALSO
.Xr semctl 2 ,
.Xr semop 2
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
+.Sh HISTORY
+Semaphores appeared in the first release of
+.At V .
diff -r 2489d2fd6e27 -r 1e944eecd9d3 lib/libc/sys/semop.2
--- a/lib/libc/sys/semop.2 Wed Aug 25 20:53:15 1999 +0000
+++ b/lib/libc/sys/semop.2 Wed Aug 25 20:55:35 1999 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: semop.2,v 1.6 1999/03/22 19:45:08 garbled Exp $
+.\" $NetBSD: semop.2,v 1.7 1999/08/25 20:55:36 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -29,15 +29,13 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 17, 1995
+.Dd August 25, 1999
.Dt SEMOP 2
.Os
.Sh NAME
.Nm semop
.Nd semaphore operations
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/sem.h>
.Ft int
.Fn semop "int semid" "struct sembuf *sops" "size_t nsops"
@@ -49,13 +47,13 @@
.Fa sops
is an array of semaphore operations, and
.Fa nsops
-is the number of operations in this array. The
+is the number of operations in this array. The
.Va sembuf
structures in the array contain the following members:
.Bd -literal
- u_short sem_num; /* semaphore # */
- short sem_op; /* semaphore operation */
- short sem_flg; /* operation flags */
+ unsigned short sem_num; /* semaphore # */
+ short sem_op; /* semaphore operation */
+ short sem_flg; /* operation flags */
.Ed
.Pp
Each operation (specified in
@@ -154,11 +152,11 @@
.Sh SEE ALSO
.Xr semctl 2 ,
.Xr semget 2
-.Sh BUGS
-In case of a removed semaphore identifier,
-.Va errno
-should be set to
-.Er EIDRM ,
-but
-.Nx
-does not define that error.
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
+.Sh HISTORY
+Semaphores appeared in the first release of
+.At V .
Home |
Main Index |
Thread Index |
Old Index