source: rtems/testsuites/mptests/mp09/recvmsg.c @ 60b791ad

4.104.114.84.9
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 17, 1998 at 11:46:28 PM

updated copyright to 1998

  • Property mode set to 100644
File size: 1.1 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-1998.
11 *  On-Line Applications Research Corporation (OAR).
12 *  Copyright assigned to U.S. Government, 1994.
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.OARcorp.com/rtems/license.html.
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.