- 1、本文档共13页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Posix消息队列接口说明(英文版)
最近看到的一些关于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_NONBLOCK was s
您可能关注的文档
最近下载
- 2024年智慧树《中华国学》考试题库(含答案).pdf VIP
- 2023年江苏省泰州市中考地理试卷真题(附答案)+2022年地理试卷及答案.docx
- 二年级下册 看图写话 助人为乐.ppt
- GB-50618-2011房屋建筑和市政基础设施工程质量检测技术管理规范.pdf VIP
- 李澄-急性原发性肠脂垂炎CT诊断只是课件.ppt
- 考低压电工证模拟试题(练习题附答案).doc VIP
- 2025高中英语外刊时文阅读 《黑神话:悟空》英文介绍课件.pptx
- DB34T 1589-2012 建筑节能门窗应用技术规程.pdf VIP
- 第四课 共同开发建设祖国 《中华民族大团结》七年级全一册(初中).pptx VIP
- 新审计法党课培训.ppt VIP
文档评论(0)