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 # ifndef __UCLIBC_HAS_ADVANCED_REALTIME__
14 extern ssize_t
mq_timedreceive(mqd_t mqdes
, char *msg_ptr
, size_t msg_len
,
15 unsigned int *msg_prio
,
16 const struct timespec
*abs_timeout
);
18 librt_hidden_proto(mq_timedreceive
)
21 # define __NR___syscall_mq_timedreceive __NR_mq_timedreceive
22 static _syscall5(int, __syscall_mq_timedreceive
, int, mqdes
,
23 char *, msg_ptr
, size_t, msg_len
, unsigned int *,
24 msg_prio
, const void *, abs_timeout
)
26 # ifdef __UCLIBC_HAS_ADVANCED_REALTIME__
28 * Receive the oldest from highest priority messages.
29 * Stop waiting if abs_timeout expires.
31 ssize_t
mq_timedreceive(mqd_t mqdes
, char *msg_ptr
, size_t msg_len
,
32 unsigned int *msg_prio
,
33 const struct timespec
*abs_timeout
)
35 return __syscall_mq_timedreceive(mqdes
, msg_ptr
, msg_len
, msg_prio
,
42 /* Receive the oldest from highest priority messages */
43 ssize_t
mq_receive(mqd_t mqdes
, char *msg_ptr
, size_t msg_len
,
44 unsigned int *msg_prio
)
46 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
47 return mq_timedreceive(mqdes
, msg_ptr
, msg_len
, msg_prio
, NULL
);
49 return __syscall_mq_timedreceive(mqdes
, msg_ptr
, msg_len
, msg_prio
, NULL
);