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

更新时间:2023-06-30 10:03:20 阅读: 评论:0

最近看到的一些关于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);
conjDESCRIPTION
The mq_receive()function is ud 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. Otherwi, the lected 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 lected message is stored in the location referenced by msg_prio.
If the specified message queue is empty and O_NONBLOCK is not t 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 lected to receive the message. Otherwi, it is unspecified which waiting thread receives the message. If the specified message queue is empty and O_NONBLOCK is t 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 lected message in bytes and th
e message is removed from the queue. Otherwi, no message is removed from the queue, the function returns a value of -1, and ts errno to indicate the error.
ERRORS
The mq_receive() function will fail if:
[EAGAIN]
O_NONBLOCK was t in the message description associated with mqdes, and the specified message queue is empty.
[EBADF]
The mqdes argument is not a valid message queue descriptor open for reading.
[EMSGSIZE]
The specified message buffer size, msg_len, is less than the message size attribute of the message queue.
捎口信
[EINTR]
The mq_receive() operation was interrupted by a signal.
[ENOSYS]
成时京The mq_receive() function is not supported by this implementation.
The mq_receive() function may fail if:
[EBADMSG]
The implementation has detected a data corruption problem with the message.
EXAMPLES
None.
APPLICATION USAGE
None.
NAME
cisomq_nd - nd a message to a message queue (REALTIME)
时刻表英文SYNOPSIS
#include <mqueue.h>
int mq_nd(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
unsigned int msg_prio);
DESCRIPTION
buckingham palace
The mq_nd() function adds the message pointed to by the argument msg_ptr to the message queue specified by mqdes. The msg_len argument specifies the length of the message in bytes pointed to by msg_ptr. The value of msg_len is less than or equal to the mq_msgsize attribute of the message queue, or mq_nd() fails.
If the specified message queue is not full, mq_nd() behaves as if the message is inrted into the
message queue at the position indicated by the msg_prio argument. A message with a larger numeric value of msg_prio is inrted before messages with lower values of msg_prio. A message will be inrted after other messages in the queue, if any, with equal msg_prio. The value of msg_prio will be less than MQ_PRIO_MAX.
If the specified message queue is full and O_NONBLOCK is not t in the message queue description associated with mqdes, mq_nd() blocks until space becomes available to enqueue the message, or until
mq_nd() is interrupted by a signal. If more than one thread is waiting to nd when space becomes available in the message queue and the Priority Scheduling option is supported, then the thread of the highest priority that has been waiting the longest will be unblocked to nd its message. Otherwi, it is unspecified which waiting thread is unblocked. If the specified message queue is full and
O_NONBLOCK is t in the message queue description associated with mqdes, the message is not queued and mq_nd() returns an error.
RETURN VALUE
Upon successful completion, the mq_nd()function returns a value of zero. Otherwi, no message is enqueued, the function returns -1, and is t to indicate the error.
ERRORS
The mq_nd() function will fail if:
简爱英文简介
[EAGAIN]
The O_NONBLOCK flag is t in the message queue description associated with mqdes, and the specified message queue is full.
[EBADF]
The mqdes argument is not a valid message queue descriptor open for writing.
[EINTR]
A signal interrupted the call to mq_nd().
[EINVAL]
reliable的意思
The value of msg_prio was outside the valid range.
[EMSGSIZE]
The specified message length, msg_len, exceeds the message size attribute of the message queue.
[ENOSYS]
翻译英文
The function mq_nd() is not supported by this implementation.
EXAMPLES
None.
APPLICATION USAGE
None.
NAME
mq_tattr - t message queue attributes (REALTIME)
SYNOPSIS
#include <mqueue.h>
int mq_tattr(mqd_t mqdes, const struct mq_attr *mqstat,
struct mq_attr *omqstat);
DESCRIPTION
The mq_tattr()function is ud to t attributes associated with the open message queue description referenced by the message queue descriptor specified by mqdes.
The message queue attributes corresponding to the following members defined in the mq_attr structure are t to the specified values upon successful completion of mq_tattr():
mq_flags
The value of this member is the bitwi logical OR of zero or more of O_NONBLOCK and any implementation-dependent flags.
The values of the mq_maxmsg, mq_msgsize and mq_curmsgs members of the mq_attr structure are ignored by mq_tattr().
cd rom是什么If omqstat is non-NULL, the function mq_tattr() stores, in the location referenced by omqstat, the previous message queue attributes and the current queue status. The values are the same as would be returned by a call to mq_getattr() at that point.
RETURN VALUE
Upon successful completion, the function returns a value of zero and the attributes of the message queue will have been changed as specified. Otherwi, the message queue attributes are unchanged, and the function returns a value of -1 and ts errno to indicate the error.

本文发布于:2023-06-30 10:03:20,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1070003.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:说明   接口   粗略   队列   消息   提供
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图