source: rtems/testsuites/mptests/mp09/recvmsg.c @ 80e2c29e

4.104.114.84.95
Last change on this file since 80e2c29e was 4b374f36, checked in by Joel Sherrill <joel.sherrill@…>, on 08/17/95 at 19:36:43

maximum number of messages removed and include statement cleanup

  • Property mode set to 100644
File size: 1.3 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 *  recvmsg.c,v 1.2 1995/05/31 17:03:14 joel Exp
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.