Syntax | #include <sys/msg.h> int msgctl(int msqid, int cmd, struct msqid_ds *buf); CRTE111A30 | |
Description | Description | |
|
| Place the current value of each member of the data structure associated with msqid into the structure pointed to by buf. The contents of this structure are defined in |
|
| Set the value of the following members of the msg_perm.uid msg_perm.gid msg_perm.mode msg_qbytes
|
|
| Remove the message queue identifier specified by msqid and destroy the message queue and the data structure associated with it. |
The function The contents of the structure pointed to by buf include the following members: struct ipc_perm msg_perm; /* operation permission struct */ struct msg *msg_first; /* ptr to first message on q */ struct msg *msg_last; /* ptr to last message on q */ ulong_t msg_cbytes; /* current # bytes on q */ msgqnum_t msg_qnum; /* # of messages on q */ msglen_t msg_qbytes; /* max # of bytes on q */ pid_t msg_lspid; /* pid of last msgsnd */ pid_t msg_lrpid; /* pid of last msgrcv */ time_t msg_stime; /* last msgsnd time */ time_t msg_rtime; /* last msgrcv time */ time_t msg_ctime; /* last change time */ msqid64_ds are defined like those of the structure msqid_ds , with the exception of the following components:time64_t msg_stime; time64_t msg_rtime; time64_t msg_ctime; | ||
Return val. | 0 | if successful. |
-1 | if an error occurs. | |
Errors |
| |
|
| cmd is |
| Extension | |
|
| buf points to an invalid address. (End) |
|
| msqid is not a valid message queue identifier, |
|
| cmd is |
|
| cmd is |
| ||
|
| POSIX-BC correction status < A47. |
Notes | The IEEE 1003.4 Standards Committee is developing alternative interfaces for interprocess communication. Application developers who need to use interprocess communication (IPC) should design their applications so that modules using the IPC routines described here can be easily modified at a later date. | |
See also |
|