posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
mqueue.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
20#ifndef ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_
21#define ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_
22
23#include <time.h>
24#include <signal.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
31typedef void *mqd_t;
32
34struct mq_attr {
35 long mq_flags;
36 long mq_maxmsg;
39};
40
50mqd_t mq_open(const char *name, int oflags, ...);
51
59int mq_close(mqd_t mqdes);
60
68int mq_unlink(const char *name);
69
78int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
79
90int mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio);
91
102int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio);
103
113int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat);
114
126int mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio,
127 const struct timespec *abstime);
128
140int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio,
141 const struct timespec *abstime);
142
151int mq_notify(mqd_t mqdes, const struct sigevent *notification);
152
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_ */
int mq_close(mqd_t mqdes)
Close a message queue descriptor.
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat)
Get the attributes of a message queue.
int mq_notify(mqd_t mqdes, const struct sigevent *notification)
Register for notification when a message arrives on an empty queue.
mqd_t mq_open(const char *name, int oflags,...)
Open or create a message queue.
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat)
Set the attributes of a message queue.
void * mqd_t
Opaque message queue descriptor returned by mq_open().
Definition mqueue.h:31
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_unlink(const char *name)
Remove a named 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.
Message queue attributes used with mq_getattr() and mq_setattr().
Definition mqueue.h:34
long mq_curmsgs
Number of messages currently queued.
Definition mqueue.h:38
long mq_flags
Message queue flags (O_NONBLOCK).
Definition mqueue.h:35
long mq_maxmsg
Maximum number of messages.
Definition mqueue.h:36
long mq_msgsize
Maximum message size in bytes.
Definition mqueue.h:37
Structure describing how to notify about an asynchronous event.
Time value with nanosecond resolution.
Definition aio.h:62
POSIX time-of-day types and functions (<sys/time.h>)