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/055a9ba9e753
branches:  trunk
changeset: 475793:055a9ba9e753
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 25 20:30:05 1999 +0000

description:
Update for XSH5.

diffstat:

 lib/libc/sys/msgctl.2 |  67 ++++++++++++++++++++------------------------------
 lib/libc/sys/msgget.2 |  17 +++++++-----
 lib/libc/sys/msgrcv.2 |  24 +++++++++++------
 lib/libc/sys/msgsnd.2 |  29 ++++++++++-----------
 4 files changed, 66 insertions(+), 71 deletions(-)

diffs (truncated from 302 to 300 lines):

diff -r fcf9ae8cd0d8 -r 055a9ba9e753 lib/libc/sys/msgctl.2
--- a/lib/libc/sys/msgctl.2     Wed Aug 25 20:07:33 1999 +0000
+++ b/lib/libc/sys/msgctl.2     Wed Aug 25 20:30:05 1999 +0000
@@ -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 @@
 .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 -r fcf9ae8cd0d8 -r 055a9ba9e753 lib/libc/sys/msgget.2
--- a/lib/libc/sys/msgget.2     Wed Aug 25 20:07:33 1999 +0000
+++ b/lib/libc/sys/msgget.2     Wed Aug 25 20:30:05 1999 +0000
@@ -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 @@
 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 @@
 .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 -r fcf9ae8cd0d8 -r 055a9ba9e753 lib/libc/sys/msgrcv.2
--- a/lib/libc/sys/msgrcv.2     Wed Aug 25 20:07:33 1999 +0000
+++ b/lib/libc/sys/msgrcv.2     Wed Aug 25 20:30:05 1999 +0000
@@ -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 @@
 .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 @@
 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 @@
 .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 -r fcf9ae8cd0d8 -r 055a9ba9e753 lib/libc/sys/msgsnd.2
--- a/lib/libc/sys/msgsnd.2     Wed Aug 25 20:07:33 1999 +0000
+++ b/lib/libc/sys/msgsnd.2     Wed Aug 25 20:30:05 1999 +0000
@@ -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 @@
 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 @@
 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 @@
 .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



Home | Main Index | Thread Index | Old Index