*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> msqid_ds (4)              



NAME    [Toc]    [Back]

       msqid_ds - Defines a message queue

SYNOPSIS    [Toc]    [Back]

       #include <sys/msg.h>

       struct msqid_ds(
               struct ipc_perm msg_perm,
               struct msg *msg_first,
               struct msg *msg_last,
               u_short msg_cbytes,
               u_short msg_qnum,
               u_short msg_qbytes,
               u_short msg_lspid,
               ushort msg_lrpid,
               time_t msg_stime,
               time_t msg_rtime,
               time_t msg_ctime );

DESCRIPTION    [Toc]    [Back]

       The  msqid_ds structure defines a message queue associated
       with a message queue ID. There is one  queue  per  message
       queue  ID.   Collectively,  the  queues  are  stored as an
       array, with message queue IDs serving as an index into the

       A  message  queue  is implemented as a linked list of messages,
 with msg_first amd msg_last pointing to  the  first
       and last messages on the queue.

       The  IPC permissions for the message queue are implemented
       in a separate, but associated, ipc_perm structure.

       A message queue is  created  indirectly  by  the  msgget()
       call.   If  msgget() is called with a non-existent message
       queue ID, the kernel allocates a new  msqid_ds  structure,
       initializes  it,  and returns the message queue ID that is
       to be associated with the message queue.

       The following sections describe the fields in the msqid_ds
       structure  and  show  the ipc_perm structure identified by
       the msg_perm field.

FIELDS    [Toc]    [Back]

       The ipc_perm structure that defines permissions  for  message
  operations.   A  pointer to the first message on the
       queue.  A pointer to the last message on the  queue.   The
       current  number of bytes on the queue.  The number of messages
 currently on the queue.  The maximum number of bytes
       allowed  on the queue.  The process ID of the last process
       that called msgsnd() for the queue.  The process ID of the
       last process that called msgrcv() for the queue.  The time
       of the last msgsnd() operation.   The  time  of  the  last
       msgrcv()  operation.  The time of the last msgctl() operation
 that changed a member of the ipc_perm structure  designated
 by the msg_perm field.


       The  msg_perm  field  identifies  the  associated ipc_perm
       structure that defines the permissions for  operations  on
       the message queue.  The ipc_perm structure (defined in the
       sys/ipc.h header file) is as follows:

       struct ipc_perm {
             ushort    uid;      /* owner's user id            */
             ushort    gid;      /* owner's group id           */
             ushort    cuid;     /* creator's user id          */
             ushort    cgid;     /* creator's group id         */
             ushort    mode;     /* access modes               */
             ushort    seq;      /* slot usage sequence number */
             key_t     key;      /* key                        */

       The  mode field of the ipc_perm structure is a 9-bit field
       that contains the permissions for message operations.  The
       first  three  bits  identify owner permissions; the second
       three bits identify group permissions; and the last  three
       bits identify other permissions.  In each group, the first
       bit indicates read permission; the  second  bit  indicates
       write permission; and the third bit is not used.

SEE ALSO    [Toc]    [Back]

       Functions: msgctl(2), msgget(2), msgrcv(2), msgsnd(2)

[ Back ]
 Similar pages
Name OS Title
mq_open Tru64 Establishes the connection between a message queue and a message queue descriptor (P1003.1b)
sel_queue Tru64 General: Defines a queue of select events
mq_receive Tru64 Receives the oldest, highest-priority message from the message queue (P1003.1b)
msgb Tru64 Defines a STREAMS message block
mq_send Tru64 Places a message in the message queue (P1003.1b)
msgsnd Tru64 Send a message to a message queue
msgsnd OpenBSD send a message to a message queue
msgsnd FreeBSD send a message to a message queue
mq_send HP-UX send a message to a message queue
msgrcv FreeBSD receive a message from a message queue
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service