10#ifndef STK_C_MQUEUE_H_
11#define STK_C_MQUEUE_H_
28#ifndef _SYS__PTHREADTYPES_H_
29 #define _SYS__PTHREADTYPES_H_
30 #define STK_C_PTHREADTYPES_GUARD
42#ifndef STK_C_MQ_MAX_QUEUES
43 #define STK_C_MQ_MAX_QUEUES (4U)
45#ifndef STK_C_MQ_MAX_DESCRIPTORS
46 #define STK_C_MQ_MAX_DESCRIPTORS (8U)
48#ifndef STK_C_MQ_NAME_MAX
49 #define STK_C_MQ_NAME_MAX (32U)
51#ifndef STK_C_MQ_DEFAULT_MAXMSG
52 #define STK_C_MQ_DEFAULT_MAXMSG (8)
54#ifndef STK_C_MQ_DEFAULT_MSGSIZE
55 #define STK_C_MQ_DEFAULT_MSGSIZE (64)
58#define MQ_PRIO_MAX (32U)
91int mq_send(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio);
95int mq_timedsend(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio,
96 const struct timespec *abstime);
102ssize_t
mq_receive(
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio);
107 const struct timespec *abstime);
int mq_close(mqd_t mqdes)
Close a descriptor; an unlinked queue is destroyed with its last descriptor.
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat)
Get the attributes of the queue (mq_flags is that of this descriptor).
int mq_notify(mqd_t mqdes, const struct sigevent *notification)
Not supported (no signals): fails with ENOSYS.
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat)
Set the descriptor flags: only O_NONBLOCK of mq_flags is used.
struct stk_mq_desc * mqd_t
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio)
Receive the oldest message of the highest priority.
int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec *abstime)
mq_send() with an absolute deadline (STK timeline). Additionally ETIMEDOUT.
int mq_unlink(const char *name)
Remove the name of a queue (existing descriptors keep working).
ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio, const struct timespec *abstime)
mq_receive() with an absolute deadline (STK timeline). Additionally ETIMEDOUT.
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio)
Send a message. Blocks while the queue is full unless O_NONBLOCK is set.
mqd_t mq_open(const char *name, int oflag,...)
Open (and optionally create) a named queue.
POSIX time extensions for STK: clock_gettime(), clock_getres(), nanosleep(), clock_nanosleep(),...