日期:2014-05-16  浏览次数:20651 次

消息队列的长度
请问消息队列的长度。如果设置过短,什么情况会导致溢出。

------解决方案--------------------
消息队列不是字节流,是报文形式。

msgsnd()
The msgsnd() system call appends a copy of the message pointed to by msgp to the message queue whose identifier is specified by msqid.

If sufficient space is available in the queue, msgsnd() succeeds immediately. (The queue capacity is defined by the msg_qbytes field in the associated
data structure for the message queue. During queue creation this field is initialized to MSGMNB bytes, but this limit can be modified using msgctl(2).)
If insufficient space is available in the queue, then the default behavior of msgsnd() is to block until space becomes available. If IPC_NOWAIT is
specified in msgflg, then the call instead fails with the error EAGAIN.



fifo/pipe才是字节流。