摘要: msgget()函数被用来创建新的消息队列或获取已有的消息队列。其函数定义如下:系统调用: msgget()函数声明: int msgget ( key_t key, int msgflg )返回值: message queue identifier on success-1 on error: errno = EACCESS (permission denied)EEXIST (Queue exists, cannot create)EIDRM (Queue is marked for deletion)ENOENT (Queue does not exist)ENOMEM (Not eno 阅读全文
posted @ 2012-11-07 11:46 梓涵VV 阅读(800) 评论(0) 推荐(0) 编辑
摘要: msgrcv()函数被用来从消息队列中取出消息。它在linux/msg.h中的定义是这样的:系统调用: msgrcv()函数声明: int msgrcv ( int msqid, struct msgbuf *msgp, int msgsz, longmtype,int msgflg )返回值: Number of bytes copied into message buffer-1 on error: errno = E2BIG (Message length is greater thanmsgsz,no MSG_NOERROR)EACCES (No read permission)EFA 阅读全文
posted @ 2012-11-07 11:45 梓涵VV 阅读(3081) 评论(0) 推荐(1) 编辑
摘要: msgsnd()函数是用来向消息队列发送消息的。在linux/msg.h 它的函数定义是这样的:系统调用: msgsnd()函数声明: int msgsnd ( int msqid, struct msgbuf *msgp, int msgsz, int msgflg )返回值: 0 on success-1 on error: errno = EAGAIN (queue is full, and IPC_NOWAIT was asserted)EACCES (permission denied, no write permission)EFAULT (msgp address isn' 阅读全文
posted @ 2012-11-07 11:44 梓涵VV 阅读(1241) 评论(0) 推荐(0) 编辑