Files
rtems/testsuites/psxtests/psxmsgq02/init.c
Joel Sherrill 2e7e636f75 2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx01/init.c, psx01/task.c, psx02/init.c, psx02/task.c, psx03/init.c,
	psx04/init.c, psx04/task1.c, psx04/task3.c, psx05/init.c,
	psx06/init.c, psx07/init.c, psx08/init.c, psx09/init.c, psx11/task.c,
	psx12/init.c, psx13/main.c, psx13/test.c, psxbarrier01/test.c,
	psxcancel/init.c, psxcleanup/psxcleanup.c, psxenosys/init.c,
	psxmsgq02/init.c, psxtime/main.c, psxtime/test.c,
	psxtimer01/psxtimer.c, psxtimer02/psxtimer.c: Fix warnings.
2009-05-11 01:41:16 +00:00

66 lines
1.6 KiB
C

/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#define CONFIGURE_INIT
#include "system.h"
#include <errno.h>
#include "tmacros.h"
#include <rtems/score/wkspace.h>
#include <rtems/score/heap.h>
#include <mqueue.h>
#include <sched.h>
#include <fcntl.h>
#include <time.h>
#include <tmacros.h>
#include <signal.h> /* signal facilities */
#include "test_support.h"
pthread_t Init_id;
void *POSIX_Init(
void *argument
)
{
int status;
unsigned int remaining;
struct mq_attr attr;
int que;
Heap_Information_block info;
void *temp;
mqd_t mq;
int i;
puts( "\n\n*** POSIX MESSAGE QUEUE 02 TEST ***" );
/* set the time of day, and print our buffer in multiple ways */
set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
/* get id of this thread */
Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id );
Allocate_majority_of_workspace(NAME_MAX);
attr.mq_maxmsg = MAXMSG;
attr.mq_msgsize = MSGSIZE;
puts("Init: mq_open - Workspace not available - ENOMEM");
mq = mq_open( Get_Longest_Name(), O_CREAT, 0x777, &attr );
fatal_posix_service_status_errno((int)mq, ENOMEM, "no workspace available");
puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" );
rtems_test_exit( 0 );
return NULL; /* just so the compiler thinks we returned something */
}