Next: , Previous: msgget, Up: Messages


1.5.2 msgsnd

     int msgsnd (int msqid, struct msgbuf *msgp, int msgsz, int msgflg);

The message text and type are stored in the internal msg structure. msg_cbytes, msg_qnum, msg_lspid, and msg_stime fields are updated. Readers waiting on the queue are awakened.

Errors:
EACCES : Do not have write permission on queue.
EAGAIN : IPC_NOWAIT specified and queue is full.
EFAULT : msgp not accessible.
EIDRM : The message queue was removed.
EINTR : Full queue ... would have slept but ... was interrupted.
EINVAL : mtype < 1, msgsz > MSGMAX, msgsz < 0, msqid < 0 or unused.
ENOMEM : Could not allocate space for header and text.