结构体 | |
struct | mq_attr |
类型定义 | |
typedef UINTPTR | mqd_t |
函数 | |
mqd_t | mq_open (const char *mqName, int openFlag,...) |
int | mq_close (mqd_t personal) |
int | mq_unlink (const char *mqName) |
int | mq_send (mqd_t personal, const char *msg, size_t msgLen, unsigned int msgPrio) |
ssize_t | mq_receive (mqd_t personal, char *msg, size_t msgLen, unsigned int *msgPrio) |
int | mq_getsetattr (mqd_t personal, const struct mq_attr *mqSetAttr, struct mq_attr *MqOldAttr) |
int | mq_timedsend (mqd_t personal, const char *msg, size_t msgLen, unsigned int msgPrio, const struct timespec *absTimeout) |
ssize_t | mq_timedreceive (mqd_t personal, char *msg, size_t msgLen, unsigned int *msgPrio, const struct timespec *absTimeout) |
personal | [IN] Message queue descriptor. |
0 | The message queue is successfully closed. |
-1 | The message queue fails to be closed, with either of the following error codes in errno. |
personal | [IN] Message queue descriptor. |
mqSetAttr | [IN] New attribute of the message queue. |
MqOldAttr | [OUT] Old attribute of the message queue. |
0 | The message queue attributes are successfully set or get. |
-1 | The message queue attributes fail to be set or get, with either of the following error codes in the errno. |
mqName | [IN] Message queue name. |
openFlag | [IN] Permission attributes of the message queue. The value range is [O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_NONBLOCK]. |
mode | [IN] Message queue mode (variadic argument). When oflag is O_CREAT, it requires two additional arguments: mode, which shall be of type mode_t, and attr, which shall be a pointer to an mq_attr structure. |
attr | [IN] Message queue attribute (variadic argument). |
mqd_t | The message queue is successfully opened or created. |
(mqd_t)-1 | The message queue fails to be opened or created, with any of the following error codes in errno. |
personal | [IN] Message queue descriptor. |
msg | [IN] Pointer to the message content to be received. |
msgLen | [IN] Length of the message to be received. |
msgPrio | [OUT] Priority of the message to be received because priority-based message processing is not supported, this parameter is useless). |
0 | The message is successfully received. |
-1 | The message fails to be received, with any of the following error codes in the errno. |
personal | [IN] Message queue descriptor. |
msg | [IN] Pointer to the message content to be sent. |
msgLen | [IN] Length of the message to be sent. |
msgPrio | [IN] Priority of the message to be sent (the value of this parameter must be 0 because priority-based message sending is not supported. If the value is not 0, this API will cease to work.) |
0 | The message is successfully sent. |
-1 | The message fails to be sent, with any of the following error codes in errno. |
ssize_t mq_timedreceive | ( | mqd_t | personal, |
char * | msg, | ||
size_t | msgLen, | ||
unsigned int * | msgPrio, | ||
const struct timespec * | absTimeout | ||
) |
personal | [IN] Message queue descriptor. |
msg | [IN] Pointer to the message content to be received. |
msgLen | [IN] Length of the message to be received. |
msgPrio | [OUT] Priority of the message to be received (because priority-based message processing is not supported, this parameter is useless ). |
absTimeout | [IN] Scheduled time at which the messagewill be received. If the value is 0, the message is an instant message. |
0 | The message is successfully received. |
-1 | The message fails to be received, with any of the following error codes in errno. |
int mq_timedsend | ( | mqd_t | personal, |
const char * | msg, | ||
size_t | msgLen, | ||
unsigned int | msgPrio, | ||
const struct timespec * | absTimeout | ||
) |
mqdes | [IN] Message queue descriptor. |
msg | [IN] Pointer to the message content to be sent. |
msgLen | [IN] Length of the message to be sent. |
msgPrio | [IN] Priority of the message to be sent (the value of this parameter must be 0 because priority-based message processing is not supported). |
absTimeout | [IN] Scheduled time at which the message will be sent. If the value is 0, the message is an instant message. |
0 | The message is successfully sent. |
-1 | The message fails to be sent, with any of the following error codes in errno. |
int mq_unlink | ( | const char * | mqName | ) |
mqName | [IN] Message queue name. |
0 | The message queue is successfully removed. |
-1 | The message queue fails to be removed, with any of the following error codes in errno. |