source: rtems/testsuites/mptests/mp09/recvmsg.c @ 8bdcfc4

4.104.114.84.95
Last change on this file since 8bdcfc4 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on 08/23/95 at 19:30:23

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  Receive_messages
2 *
3 *  This routine receives and prints three messages.
4 *  an error condition.
5 *
6 *  Input parameters:  NONE
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
11 *  On-Line Applications Research Corporation (OAR).
12 *  All rights assigned to U.S. Government, 1994.
13 *
14 *  This material may be reproduced by or for the U.S. Government pursuant
15 *  to the copyright license under the clause at DFARS 252.227-7013.  This
16 *  notice must appear in all copies of this file and its derivatives.
17 *
18 *  $Id$
19 */
20
21#include "system.h"
22
23void Receive_messages()
24{
25 rtems_status_code status;
26 rtems_unsigned32  index;
27 rtems_unsigned32  size;
28 char              receive_buffer[16];
29
30 for ( index=1 ; index <=3 ; index++ ) {
31   puts( "Receiving message ..." );
32   status = rtems_message_queue_receive(
33     Queue_id[ 1 ],
34     (long (*)[4])receive_buffer,
35     &size,
36     RTEMS_DEFAULT_OPTIONS,
37     RTEMS_NO_TIMEOUT
38   );
39   directive_failed( status, "rtems_message_queue_receive" );
40   puts_nocr( "Received : ");
41   puts( receive_buffer );
42 }
43
44  puts( "Receiver delaying for a second" );
45  status = rtems_task_wake_after( TICKS_PER_SECOND );
46  directive_failed( status, "rtems_task_wake_after" );
47}
Note: See TracBrowser for help on using the repository browser.