source: rtems/testsuites/psxtests/psxmsgq02/init.c @ cafefbf

4.115
Last change on this file since cafefbf was cafefbf, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 09:47:36

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#define CONFIGURE_INIT
17#include "system.h"
18#include <errno.h>
19#include "tmacros.h"
20#include <rtems/score/wkspace.h>
21#include <rtems/score/heap.h>
22#include <mqueue.h>
23#include <sched.h>
24#include <fcntl.h>
25#include <time.h>
26#include <tmacros.h>
27#include <signal.h>   /* signal facilities */
28#include "test_support.h"
29
30pthread_t        Init_id;
31
32void *POSIX_Init(
33  void *argument
34)
35{
36  struct mq_attr         attr;
37  mqd_t                  mq;
38
39  puts( "\n\n*** POSIX MESSAGE QUEUE 02 TEST ***" );
40
41
42  /* set the time of day, and print our buffer in multiple ways */
43
44  set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
45
46  /* get id of this thread */
47
48  Init_id = pthread_self();
49  printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
50
51  Allocate_majority_of_workspace(NAME_MAX);
52
53  attr.mq_maxmsg  = MAXMSG;
54  attr.mq_msgsize = MSGSIZE;
55  puts("Init: mq_open - Workspace not available - ENOMEM");
56  mq = mq_open( Get_Longest_Name(), O_CREAT, 0x777, &attr );
57  fatal_posix_service_status_errno(mq, ENOMEM, "no workspace available");
58
59  puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" );
60  rtems_test_exit( 0 );
61
62  return NULL; /* just so the compiler thinks we returned something */
63}
Note: See TracBrowser for help on using the repository browser.