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#include <sys/types.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
40typedef int mqd_t;
41
43struct mq_attr {
44 long mq_flags;
45 long mq_maxmsg;
48};
49
59mqd_t mq_open(const char *name, int oflags, ...);
60
68int mq_close(mqd_t mqdes);
69
77int mq_unlink(const char *name);
78
87int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
88
99ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio);
100
111int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio);
112
122int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat);
123
124#if defined(_POSIX_TIMEOUTS) || defined(__DOXYGEN__)
136ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio,
137 const struct timespec *abstime);
138#endif
139
140#if defined(_POSIX_TIMEOUTS) || defined(__DOXYGEN__)
152int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio,
153 const struct timespec *abstime);
154#endif
155
164int mq_notify(mqd_t mqdes, const struct sigevent *notification);
165
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_ */
int mq_close(mqd_t mqdes)
Close a message queue descriptor.
int mqd_t
Message queue descriptor returned by mq_open().
Definition mqueue.h:40
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.
ssize_t 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_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.
ssize_t 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_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:43
long mq_curmsgs
Number of messages currently queued.
Definition mqueue.h:47
long mq_flags
Message queue flags (O_NONBLOCK).
Definition mqueue.h:44
long mq_maxmsg
Maximum number of messages.
Definition mqueue.h:45
long mq_msgsize
Maximum message size in bytes.
Definition mqueue.h:46
Structure describing how to notify about an asynchronous event.
Time value with nanosecond resolution.
Definition aio.h:65
POSIX time-of-day types and functions (<sys/time.h>)
POSIX fundamental types (<sys/types.h>)