shut up GCC, part 2
[uclibc-ng.git] / librt / mq_receive.c
blob2be1c1a98e8383bbab2c710a532fe8e81b4b4ecf
1 /*
2 * mq_receive.c - functions for receiving from message queue.
3 */
5 #include <sys/syscall.h>
7 #ifdef __NR_mq_timedreceive
9 #include <stddef.h>
10 #include <mqueue.h>
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);
17 # endif
18 librt_hidden_proto(mq_timedreceive)
19 #else
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,
36 abs_timeout);
38 # endif
40 #endif
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);
48 #else
49 return __syscall_mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, NULL);
50 #endif
53 #endif