1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Receive Message from Message Queue |
---|
5 | * @ingroup POSIXAPI |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * NOTE: The structure of the routines is identical to that of POSIX |
---|
10 | * Message_queues to leave the option of having unnamed message |
---|
11 | * queues at a future date. They are currently not part of the |
---|
12 | * POSIX standard but unnamed message_queues are. This is also |
---|
13 | * the reason for the apparently unnecessary tracking of |
---|
14 | * the process_shared attribute. [In addition to the fact that |
---|
15 | * it would be trivial to add pshared to the mq_attr structure |
---|
16 | * and have process private message queues.] |
---|
17 | * |
---|
18 | * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open |
---|
19 | * time. |
---|
20 | */ |
---|
21 | |
---|
22 | /* |
---|
23 | * COPYRIGHT (c) 1989-2008. |
---|
24 | * On-Line Applications Research Corporation (OAR). |
---|
25 | * |
---|
26 | * The license and distribution terms for this file may be |
---|
27 | * found in the file LICENSE in this distribution or at |
---|
28 | * http://www.rtems.org/license/LICENSE. |
---|
29 | */ |
---|
30 | |
---|
31 | #if HAVE_CONFIG_H |
---|
32 | #include "config.h" |
---|
33 | #endif |
---|
34 | |
---|
35 | #include <rtems/posix/mqueueimpl.h> |
---|
36 | |
---|
37 | /* |
---|
38 | * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279 |
---|
39 | * |
---|
40 | * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive(). |
---|
41 | */ |
---|
42 | |
---|
43 | ssize_t mq_timedreceive( |
---|
44 | mqd_t mqdes, |
---|
45 | char *__restrict msg_ptr, |
---|
46 | size_t msg_len, |
---|
47 | unsigned int *__restrict msg_prio, |
---|
48 | const struct timespec *__restrict abstime |
---|
49 | ) |
---|
50 | { |
---|
51 | return _POSIX_Message_queue_Receive_support( |
---|
52 | mqdes, |
---|
53 | msg_ptr, |
---|
54 | msg_len, |
---|
55 | msg_prio, |
---|
56 | abstime, |
---|
57 | _Thread_queue_Add_timeout_realtime_timespec |
---|
58 | ); |
---|
59 | } |
---|