2 * mq_send.c - functions for sending to message queue.
5 #include <sys/syscall.h>
7 #ifdef __NR_mq_timedsend
12 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
13 # ifndef __UCLIBC_HAS_ADVANCED_REALTIME__
14 extern int mq_timedsend(mqd_t mqdes
, const char *msg_ptr
, size_t msg_len
,
15 unsigned int msg_prio
, const struct timespec
*abs_timeout
);
17 librt_hidden_proto(mq_timedsend
)
20 # define __NR___syscall_mq_timedsend __NR_mq_timedsend
21 static _syscall5(int, __syscall_mq_timedsend
, int, mqdes
,
22 const char *, msg_ptr
, size_t, msg_len
, unsigned int,
23 msg_prio
, const void *, abs_timeout
)
25 # ifdef __UCLIBC_HAS_ADVANCED_REALTIME__
27 * Add a message to queue. If O_NONBLOCK is set and queue is full, wait
28 * for sufficient room in the queue until abs_timeout expires.
30 int mq_timedsend(mqd_t mqdes
, const char *msg_ptr
, size_t msg_len
,
31 unsigned int msg_prio
, const struct timespec
*abs_timeout
)
33 return __syscall_mq_timedsend(mqdes
, msg_ptr
, msg_len
, msg_prio
,
39 /* Add a message to queue */
40 int mq_send(mqd_t mqdes
, const char *msg_ptr
, size_t msg_len
,
41 unsigned int msg_prio
)
43 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
44 return mq_timedsend(mqdes
, msg_ptr
, msg_len
, msg_prio
, NULL
);
46 return __syscall_mq_timedsend(mqdes
, msg_ptr
, msg_len
, msg_prio
, NULL
);