|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Msgget problems I sentence code ~ ~
Msgget (rcv_msgid, 0)
The parameters of how to use the back 0???
A book that msgget (rcv_msgid, IPC_CREAT | 0777), which controls
I do not know why the use 0? What does this mean? |
Msgget problems --> |
Msgget problems Msgget (rcv_msgid, 0) has been created Queue ID
Msgget (rcv_msgid, IPC_CREAT | 0777) is to set up queue
Generally, first msgget (rcv_msgid, 0), not to create shows not, then msgget (rcv_msgid, IPC_CREAT | 0777) to create it |
Msgget problems Guangzhou Trade Fair necessary? Direct msgget (rcv_msgid, IPC_CREAT | 0777), can it not? |
Msgget problems If the queue has been established (this process or other processes), msgget (rcv_msgid, IPC_CREAT | 0777) to be wrong, not its Queue |
Msgget problems Sorry! I say msgget (rcv_msgid, IPC_CREAT | 0777) can build on the Queue ID |
Msgget problems ~ ~ Thank you, oh 哈~~ know the book there is a message queue to judge whether to create ~ ~ If established, another old building to be wrong, here is the original true weighty ~ ~ Oh 呀~~
Let us look at the label of the code should be very good ~~~
If ((_id_request = msgget (rcv_msgid, 0)) "0)
If ((_id_request = msgget (rcv_msgid, IPC_CREAT | 0777)) "0)
{
Perror ( "msgget rcv_msgid error");
Return (-1);
}
If ((_id_response = msgget (snd_msgid, 0)) "0)
If ((_id_response = msgget (snd_msgid, IPC_CREAT | 0777)) "0)
{
Perror ( "msgget snd_msgid error");
Return (-1);
} |
| |