The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


sys/msg.h - message queue structures


#include <sys/msg.h>


The <sys/msg.h> header defines the following constant and members of the structure msqid_ds.

The following data types are defined through typedef:

Used for the number of messages in the message queue.
Used for the number of bytes allowed in a message queue.

These types are unsigned integer types that are able to store values at least as large as a type unsigned short.

Message operation flag:

No error if big message.

The structure msqid_ds contains the following members:

struct ipc_perm msg_perm   operation permission structure
msgqnum_t       msg_qnum   number of messages currently on queue
msglen_t        msg_qbytes maximum number of bytes allowed on queue
pid_t           msg_lspid  process ID of last msgsnd()
pid_t           msg_lrpid  process ID 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 change

The pid_t, time_t, key_t and size_t types are defined as described in <sys/types.h>.

The following are declared as functions and may also be defined as macros. Function prototypes must be provided for use with an ISO C compiler.

int       msgctl(int, int, struct msqid_ds *);
int       msgget(key_t, int);
ssize_t   msgrcv(int, void *, size_t, long int, int);
int       msgsnd(int, const void *, size_t, int);

In addition, all of the symbols from <sys/ipc.h> will be defined when this header is included.






msgctl(), msgget(), msgrcv(), msgsnd(), <sys/types.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]