Syntax | #include <sys/msg.h> int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); | |
Description |
msgp points to a user-defined buffer that must contain first a field of type struct mymsg { long int mtype; /* Message type */ char mtext[1]; /* message text */ } The structure member The structure member msgflg specifies the action to be taken if one or more of the following conditions are true:
These actions are as follows:
Upon successful completion, the following actions are taken with respect to the data structure associated with msqid:
If threads are used, then the function affects the process or a thread in the following manner: The msgflg parameter refers to the calling thread. | |
Return val. | 0 | if successful. |
-1 | if an error occurs. | |
Errors |
| |
|
| Operation permission is denied to the calling process. |
|
| The message cannot be sent for one of the reasons cited above and |
| Extension | |
|
| msgp points to an invalid address. (End) |
|
| The message queue identifier msgid is removed from the system. |
|
|
|
|
| msqid is not a valid message queue identifier, or the value of |
Notes | The value of the msgp argument should be converted to type 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 |
|