1 Star 0 Fork 5.1K

hzcc / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mqueue-h.md 9.16 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

mqueue.h

Overview

Related Modules:

IPC

Description:

Provides message queue operation functions and related structures.

For example, you can use the functions to create, open, close, delete, read, and write a message queue, and to obtain and set its attributes.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

mq_attr

Describes message queue attributes.

Functions

Function Name

Description

mq_close (mqd_t mqdes)

int 

Closes a message queue that is no longer used.

mq_getattr (mqd_t mqdes, struct mq_attr *attr)

int 

Obtains the attributes of the message queue specified by the descriptor. The values of mq_maxmsg, mq_msgsize, and mq_curmsgs are fixed.

mq_open (const char *name, int oflag,...)

mqd_t 

Creates a message queue or opens an existing message queue.

mq_receive (mqd_t mqdes, char *buffer, size_t size, unsigned *prioptr)

ssize_t 

Receives a message from a specified message queue.

mq_send (mqd_t mqdes, const char *buffer, size_t size, unsigned prio)

int 

Sends a message to a specified message queue.

mq_setattr (mqd_t mqdes, const struct mq_attr *__restrict newattr, struct mq_attr *__restrict oldattr)

int 

Sets the attributes of the message queue specified by the descriptor. The mq_maxmsg, mq_msgsize, and mq_curmsgs attributes cannot be modified. mq_flags supports the O_NONBLOCK attribute only.

mq_timedreceive (mqd_t mqdes, char *__restrict buffer, size_t size, unsigned *__restrict prioptr, const struct timespec *__restrict timeout)

ssize_t 

Receives a message from the message queue, with a timeout period specified.

mq_timedsend (mqd_t mqdes, const char *buffer, size_t size, unsigned prio, const struct timespec *timeout)

int 

Sends a message to a specified message queue, with a timeout period specified.

mq_unlink (const char *name)

int 

Decreases the reference count of the message queue by 1, or deletes the message queue if the reference count is 0.

1
https://gitee.com/hwang_zc/docs.git
git@gitee.com:hwang_zc/docs.git
hwang_zc
docs
docs
master

搜索帮助