Posix消息队列接口说明(英文版).doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
最近看到的一些关于POSIX消息队列接口中文说明很粗略,现在提供其英文版详细说明 NAME mq_receive - receive a message from a message queue (REALTIME) ?SYNOPSIS #include mqueue.h ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio); ?DESCRIPTION The mq_receive() function is used to receive the oldest of the highest priority message(s) from the message queue specified by mqdes. If the size of the buffer in bytes, specified by the msg_len argument, is less than the mq_msgsize attribute of the message queue, the function fails and returns an error. Otherwise, the selected message is removed from the queue and copied to the buffer pointed to by the msg_ptr argument. If the value of msg_len is greater than {SSIZE_MAX}, the result is implementation-dependent. If the argument msg_prio is not NULL, the priority of the selected message is stored in the location referenced by msg_prio. If the specified message queue is empty and O_NONBLOCK is not set in the message queue description associated with mqdes, mq_receive() blocks until a message is enqueued on the message queue or until mq_receive() is interrupted by a signal. If more than one thread is waiting to receive a message when a message arrives at an empty queue and the Priority Scheduling option is supported, then the thread of highest priority that has been waiting the longest will be selected to receive the message. Otherwise, it is unspecified which waiting thread receives the message. If the specified message queue is empty and O_NONBLOCK is set in the message queue description associated with mqdes, no message is removed from the queue, and mq_receive() returns an error. ?RETURN VALUE Upon successful completion, mq_receive() returns the length of the selected message in bytes and the message is removed from the queue. Otherwise, no message is removed from the queue, the function returns a value of -1, and sets errno to indicate the error. ?ERRORS The mq_receive() function will fail if: [EAGAIN] O_NONBLOC

您可能关注的文档

文档评论(0)

enxyuio + 关注
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档