![]() |
posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
|
POSIX Message Passing option. More...
Files | |
| file | mqueue.h |
| POSIX message queues (<mqueue.h>) | |
Typedefs | |
| typedef void * | mqd_t |
| Opaque message queue descriptor returned by mq_open(). | |
Functions | |
| mqd_t | mq_open (const char *name, int oflags,...) |
| Open or create a message queue. | |
| int | mq_close (mqd_t mqdes) |
| Close a message queue descriptor. | |
| int | mq_unlink (const char *name) |
| Remove a named message queue. | |
| int | mq_getattr (mqd_t mqdes, struct mq_attr *mqstat) |
| Get the attributes of a message queue. | |
| int | mq_receive (mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio) |
| Receive the oldest highest-priority message from a queue. | |
| int | mq_send (mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio) |
| Add a message to a queue. | |
| int | mq_setattr (mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat) |
| Set the attributes of a message queue. | |
| int | mq_timedreceive (mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio, const struct timespec *abstime) |
| Receive a message from a queue with an absolute timeout. | |
| int | mq_timedsend (mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec *abstime) |
| Send a message to a queue with an absolute timeout. | |
| int | mq_notify (mqd_t mqdes, const struct sigevent *notification) |
| Register for notification when a message arrives on an empty queue. | |
POSIX Message Passing option.
| typedef void* mqd_t |
| int mq_close | ( | mqd_t | mqdes | ) |
Close a message queue descriptor.
| mqdes | Message queue descriptor. |
Get the attributes of a message queue.
| mqdes | Message queue descriptor. |
| mqstat | Output: current attributes. |
Register for notification when a message arrives on an empty queue.
| mqdes | Message queue descriptor. |
| notification | Notification specification, or NULL to cancel. |
| mqd_t mq_open | ( | const char * | name, |
| int | oflags, | ||
| ... | |||
| ) |
Open or create a message queue.
| name | Queue name (must start with '/'). |
| oflags | Open flags (O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_NONBLOCK). |
| ... | If O_CREAT: mode_t mode, struct mq_attr *attr. |
(mqd_t)-1 on failure. Receive the oldest highest-priority message from a queue.
| mqdes | Message queue descriptor (opened with O_RDONLY or O_RDWR). |
| msg_ptr | Buffer to receive the message. |
| msg_len | Size of msg_ptr (must be >= mq_msgsize). |
| msg_prio | Output: priority of the received message, or NULL. |
Add a message to a queue.
| mqdes | Message queue descriptor (opened with O_WRONLY or O_RDWR). |
| msg_ptr | Message to send. |
| msg_len | Size of the message in bytes. |
| msg_prio | Priority of the message (higher value = higher priority). |
Set the attributes of a message queue.
| mqdes | Message queue descriptor. |
| mqstat | New attributes (only mq_flags is used). |
| omqstat | Output: previous attributes, or NULL. |
| int mq_timedreceive | ( | mqd_t | mqdes, |
| char * | msg_ptr, | ||
| size_t | msg_len, | ||
| unsigned int * | msg_prio, | ||
| const struct timespec * | abstime | ||
| ) |
Receive a message from a queue with an absolute timeout.
| mqdes | Message queue descriptor. |
| msg_ptr | Buffer to receive the message. |
| msg_len | Size of msg_ptr. |
| msg_prio | Output: message priority, or NULL. |
| abstime | Absolute timeout (CLOCK_REALTIME). |
| int mq_timedsend | ( | mqd_t | mqdes, |
| const char * | msg_ptr, | ||
| size_t | msg_len, | ||
| unsigned int | msg_prio, | ||
| const struct timespec * | abstime | ||
| ) |
Send a message to a queue with an absolute timeout.
| mqdes | Message queue descriptor. |
| msg_ptr | Message to send. |
| msg_len | Size of the message in bytes. |
| msg_prio | Priority of the message. |
| abstime | Absolute timeout (CLOCK_REALTIME). |
| int mq_unlink | ( | const char * | name | ) |
Remove a named message queue.
| name | Queue name. |