bump version to 1.0.8
[uclibc-ng.git] / librt / mq_send.c
blob5e50d1a19dcb93c89c0f786ff14992f89b618891
1 /*
2 * mq_send.c - functions for sending to message queue.
3 */
5 #include <sys/syscall.h>
7 #ifdef __NR_mq_timedsend
9 #include <stddef.h>
10 #include <mqueue.h>
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);
16 # endif
17 librt_hidden_proto(mq_timedsend)
18 #else
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,
34 abs_timeout);
36 # endif
37 #endif
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);
45 #else
46 return __syscall_mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, NULL);
47 #endif
50 #endif