2 * mq_receive.c - functions for receiving from message queue.
5 #include <sys/syscall.h>
7 #ifdef __NR_mq_timedreceive
12 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
13 librt_hidden_proto(mq_timedreceive)
16 # define __NR___syscall_mq_timedreceive __NR_mq_timedreceive
17 static _syscall5(int, __syscall_mq_timedreceive, int, mqdes,
18 char *, msg_ptr, size_t, msg_len, unsigned int *,
19 msg_prio, const void *, abs_timeout);
21 # ifdef __UCLIBC_HAS_ADVANCED_REALTIME__
23 * Receive the oldest from highest priority messages.
24 * Stop waiting if abs_timeout expires.
26 ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
27 unsigned int *msg_prio,
28 const struct timespec *abs_timeout)
30 return __syscall_mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio,
37 /* Receive the oldest from highest priority messages */
38 ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
39 unsigned int *msg_prio)
41 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
42 return mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, NULL);
44 return __syscall_mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, NULL);