source: rtems/testsuites/mptests/mp10/task1.c @ 48e02af

4.115
Last change on this file since 48e02af was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  Test_task1
2 *
3 *  This task attempts to receive a message from a global message queue.
4 *  It should never actually receive the message.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include "system.h"
26
27rtems_task Test_task1(
28  rtems_task_argument argument
29)
30{
31  char              receive_buffer[16];
32  size_t            size;
33  rtems_status_code status;
34
35  puts( "Getting QID of message queue" );
36
37  do {
38    status = rtems_message_queue_ident(
39      Queue_name[ 1 ],
40      RTEMS_SEARCH_ALL_NODES,
41      &Queue_id[ 1 ]
42    );
43  } while ( !rtems_is_status_successful( status ) );
44
45  puts( "Attempting to receive message ..." );
46  status = rtems_message_queue_receive(
47    Queue_id[ 1 ],
48    receive_buffer,
49    &size,
50    RTEMS_DEFAULT_OPTIONS,
51    RTEMS_NO_TIMEOUT
52  );
53  directive_failed( status, "rtems_message_queue_receive" );
54
55}
Note: See TracBrowser for help on using the repository browser.