summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1999-08-25 20:30:05 +0000
committerthorpej <thorpej@NetBSD.org>1999-08-25 20:30:05 +0000
commite9fc9322cc7f2cbb19df3ac047cc2298786f942f (patch)
tree9cf6199ad03bd3051851eecc0a26a91a343548ec /lib
parentcee9ac24adef232e929b37419e1b51dc8c800dce (diff)
Update for XSH5.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/msgctl.267
-rw-r--r--lib/libc/sys/msgget.217
-rw-r--r--lib/libc/sys/msgrcv.224
-rw-r--r--lib/libc/sys/msgsnd.229
4 files changed, 66 insertions, 71 deletions
diff --git a/lib/libc/sys/msgctl.2 b/lib/libc/sys/msgctl.2
index 18b92a8d1d9..33aaafecc14 100644
--- a/lib/libc/sys/msgctl.2
+++ b/lib/libc/sys/msgctl.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: msgctl.2,v 1.6 1999/03/22 19:45:06 garbled Exp $
+.\" $NetBSD: msgctl.2,v 1.7 1999/08/25 20:30:05 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -29,68 +29,50 @@
.\" (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 MSGCTL 2
.Os
.Sh NAME
.Nm msgctl
.Nd message control operations
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/msg.h>
.Ft int
.Fn msgctl "int msqid" "int cmd" "struct msqid_ds *buf"
.Sh DESCRIPTION
The
.Fn msgctl
-system call performs some control operations on the message queue specified
+system call performs control operations on the message queue specified
by
.Fa msqid .
.Pp
-Each message queue has a data structure associated with it, parts of which
-may be altered by
-.Fn msgctl
-and parts of which determine the actions of
-.Fn msgctl .
-The data structure is defined in
-.Aq Pa sys/msg.h
-and contains (amongst others) the following members:
+Each message queue has a
+.Sy msqid_ds
+structure associated with it which contains the following members:
.Bd -literal
-struct msqid_ds {
- struct ipc_perm msg_perm; /* msg queue permission bits */
- u_long msg_cbytes; /* # of bytes in use on the queue */
- u_long msg_qnum; /* # of msgs in the queue */
- u_long msg_qbytes; /* max # of bytes on the queue */
- pid_t msg_lspid; /* pid of last msgsnd() */
- pid_t msg_lrpid; /* pid of last msgrcv() */
- time_t msg_stime; /* time of last msgsnd() */
- time_t msg_rtime; /* time of last msgrcv() */
- time_t msg_ctime; /* time of last msgctl() */
-};
+ struct ipc_perm msg_perm; /* msg queue permission bits */
+ msgqnum_t msg_qnum; /* # of msgs in the queue */
+ msglen_t msg_qbytes; /* max # of bytes on the queue */
+ pid_t msg_lspid; /* pid of last msgsnd() */
+ pid_t msg_lrpid; /* pid of last msgrcv() */
+ time_t msg_stime; /* time of last msgsnd() */
+ time_t msg_rtime; /* time of last msgrcv() */
+ time_t msg_ctime; /* time of last msgctl() */
.Ed
.Pp
The
-.Bf -literal
-ipc_perm
-.Ef
+.Sy ipc_perm
structure used inside the
-.Bf -literal
-msgid_ds
-.Ef
+.Sy msgid_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; /* permission (9 bits, see chmod(2)) */
- ushort seq; /* sequence # (to generate unique 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
The operation to be performed by
@@ -205,6 +187,11 @@ specifies an invalid address.
.Xr msgget 2 ,
.Xr msgrcv 2 ,
.Xr msgsnd 2
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
.Sh HISTORY
Message queues appeared in the first release of
.At V .
diff --git a/lib/libc/sys/msgget.2 b/lib/libc/sys/msgget.2
index 712f674204c..17f8cf7f5d6 100644
--- a/lib/libc/sys/msgget.2
+++ b/lib/libc/sys/msgget.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: msgget.2,v 1.4 1999/03/22 19:45:06 garbled Exp $
+.\" $NetBSD: msgget.2,v 1.5 1999/08/25 20:30:05 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -29,21 +29,20 @@
.\" (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 MSGGET 2
.Os
.Sh NAME
.Nm msgget
-.Nd get message queue
+.Nd get message queue identifier
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/msg.h>
.Ft int
.Fn msgget "key_t key" "int msgflg"
.Sh DESCRIPTION
+The
.Fn msgget
-returns the message queue identifier associated with
+system call returns the message queue identifier associated with
.Fa key .
A message queue identifier is a unique integer greater than zero.
.Pp
@@ -79,7 +78,6 @@ are set to the effective gid of the calling process.
is set to the lower 9 bits of
.Fa msgflg .
.It
-.Va msg_cbytes ,
.Va msg_qnum ,
.Va msg_lspid ,
.Va msg_lrpid ,
@@ -130,6 +128,11 @@ was found.
.Xr msgctl 2 ,
.Xr msgrcv 2 ,
.Xr msgsnd 2
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
.Sh HISTORY
Message queues appeared in the first release of
.At V .
diff --git a/lib/libc/sys/msgrcv.2 b/lib/libc/sys/msgrcv.2
index e19d80cc0a3..680dd0b1777 100644
--- a/lib/libc/sys/msgrcv.2
+++ b/lib/libc/sys/msgrcv.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: msgrcv.2,v 1.8 1999/03/22 19:45:06 garbled Exp $
+.\" $NetBSD: msgrcv.2,v 1.9 1999/08/25 20:30:05 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 February 8, 1998
+.Dd August 25, 1999
.Dt MSGRCV 2
.Os
.Sh NAME
.Nm msgrcv
.Nd receive a message from a message queue
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/msg.h>
.Ft ssize_t
.Fn msgrcv "int msqid" "void *msgp" "size_t msgsz" "long msgtyp" "int msgflg"
@@ -46,12 +44,18 @@ The
.Fn msgrcv
function receives a message from the message queue specified in
.Fa msqid ,
-and places it into the structure pointed to by
+and places it into the user-defined structure pointed to by
.Fa msgp .
-This structure should consist of the following members:
+This structure must contain a first field of type
+.Sy long
+that will indicate the user-defined type of the message. The remaining
+fields will contain the contents of the message. The following is
+an example of what this user-defined structure might look like:
.Bd -literal
+struct mymsg {
long mtype; /* message type */
char mtext[1]; /* body of message */
+};
.Ed
.Pp
.Va mtype
@@ -129,9 +133,6 @@ If a message is successfully received, the data structure associated with
is updated as follows:
.Bl -bullet
.It
-.Va msg_cbytes
-is decremented by the size of the message.
-.It
.Va msg_lrpid
is set to the pid of the caller.
.It
@@ -198,6 +199,11 @@ is set.
.Xr msgctl 2 ,
.Xr msgget 2 ,
.Xr msgsnd 2
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
.Sh HISTORY
Message queues appeared in the first release of
.At V .
diff --git a/lib/libc/sys/msgsnd.2 b/lib/libc/sys/msgsnd.2
index 8733f75cf25..4e14dcc6482 100644
--- a/lib/libc/sys/msgsnd.2
+++ b/lib/libc/sys/msgsnd.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: msgsnd.2,v 1.7 1999/03/22 19:45:06 garbled Exp $
+.\" $NetBSD: msgsnd.2,v 1.8 1999/08/25 20:30:05 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@@ -36,8 +36,6 @@
.Nm msgsnd
.Nd send a message to a message queue
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/ipc.h>
.Fd #include <sys/msg.h>
.Ft int
.Fn msgsnd "int msqid" "const void *msgp" "size_t msgsz" "int msgflg"
@@ -47,11 +45,17 @@ The
function sends a message from the message queue specified in
.Fa msqid .
.Fa msgp
-points to a structure containing the message. This structure should
-consist of the following members:
+points to a user-defined structure containing the message. This structure
+must contain a first field of type
+.Sy long
+that will indicate the user-defined type of the message. The remaining
+fields will contain the contents of the message. The following is
+an example of what this user-defined structure might look like:
.Bd -literal
+struct mymsg {
long mtype; /* message type */
char mtext[1]; /* body of message */
+};
.Ed
.Pp
.Va mtype
@@ -101,10 +105,6 @@ After a successful call, the data structure associated with the message
queue is updated in the following way:
.Bl -bullet
.It
-.Va msg_cbytes
-is incremented by
-.Fa msgsz .
-.It
.Va msg_qnum
is incremented by 1.
.It
@@ -155,12 +155,11 @@ The system call was interrupted by the delivery of a signal.
.Xr msgctl 2 ,
.Xr msgget 2 ,
.Xr msgrcv 2
-.Sh BUGS
-.Nx
-does not define the
-.Er EIDRM
-error value, which should be used
-in the case of a removed message queue.
+.Sh STANDARDS
+The
+.Nm
+system call conforms to
+.St -xsh5 .
.Sh HISTORY
Message queues appeared in the first release of
.At V .