forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
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-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* psxhdrs/clock01.c, psxhdrs/clock02.c, psxhdrs/clock03.c,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -25,7 +25,7 @@ void *POSIX_Init(
|
||||
pthread_t thread_id;
|
||||
time_t seconds;
|
||||
time_t seconds1;
|
||||
time_t remaining;
|
||||
unsigned int remaining;
|
||||
struct tm tm;
|
||||
struct utsname uts;
|
||||
useconds_t useconds;
|
||||
@@ -58,12 +58,12 @@ void *POSIX_Init(
|
||||
rtems_test_assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
|
||||
status = clock_gettime( -1, &tv );
|
||||
status = clock_gettime( (clockid_t)-1, &tv );
|
||||
rtems_test_assert( status == -1 );
|
||||
rtems_test_assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_settime - EINVAL (invalid clockid)" );
|
||||
status = clock_settime( -1, &tv );
|
||||
status = clock_settime( (clockid_t)-1, &tv );
|
||||
rtems_test_assert( status == -1 );
|
||||
rtems_test_assert( errno == EINVAL );
|
||||
|
||||
@@ -79,7 +79,7 @@ void *POSIX_Init(
|
||||
/* exercise clock_getres */
|
||||
|
||||
puts( "Init: clock_getres - EINVAL (invalid clockid)" );
|
||||
status = clock_getres( -1, &tv );
|
||||
status = clock_getres( (clockid_t) -1, &tv );
|
||||
rtems_test_assert( status == -1 );
|
||||
rtems_test_assert( errno == EINVAL );
|
||||
|
||||
@@ -195,7 +195,7 @@ void *POSIX_Init(
|
||||
|
||||
puts( "Init: usleep - 1.35 seconds" );
|
||||
useconds = usleep ( 1350000 );
|
||||
rtems_test_assert( useconds < 1350000);
|
||||
rtems_test_assert( useconds < 1350000 );
|
||||
|
||||
/* print the current real time again */
|
||||
status = clock_gettime( CLOCK_REALTIME, &tv );
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void Test_init_routine( void );
|
||||
|
||||
void Test_init_routine( void )
|
||||
{
|
||||
puts( "Test_init_routine: invoked" );
|
||||
@@ -61,11 +63,11 @@ void *Task_1_through_3(
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_equal - first id bad" );
|
||||
status = pthread_equal( -1, Task_id );
|
||||
status = pthread_equal( (pthread_t) -1, Task_id );
|
||||
assert( !status );
|
||||
|
||||
puts( "Task_1: pthread_equal - second id bad" );
|
||||
status = pthread_equal( Init_id, -1 );
|
||||
status = pthread_equal( Init_id, (pthread_t) -1 );
|
||||
assert( !status );
|
||||
|
||||
/* exercise pthread_once */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
void Signal_handler( int signo );
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -25,9 +25,9 @@ void *Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int seconds;
|
||||
int i;
|
||||
int status;
|
||||
unsigned int seconds;
|
||||
int i;
|
||||
int status;
|
||||
|
||||
for ( i=0 ; i<5 ; i++ ) {
|
||||
print_current_time( "Task1: ", "" );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
void Signal_handler( int signo );
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -16,6 +16,12 @@
|
||||
|
||||
volatile int Signal_occurred;
|
||||
volatile int Signal_count;
|
||||
void Signal_handler( int signo );
|
||||
void Signal_info_handler(
|
||||
int signo,
|
||||
siginfo_t *info,
|
||||
void *context
|
||||
);
|
||||
|
||||
void Signal_handler(
|
||||
int signo
|
||||
@@ -54,6 +60,7 @@ void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
unsigned int remaining;
|
||||
int status;
|
||||
struct sigaction act;
|
||||
sigset_t mask;
|
||||
@@ -198,7 +205,7 @@ void *POSIX_Init(
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: sleep so the other task can block" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
@@ -212,7 +219,7 @@ void *POSIX_Init(
|
||||
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
|
||||
|
||||
puts( "Init: sleep so the other task can catch signal" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
@@ -244,17 +251,17 @@ void *POSIX_Init(
|
||||
/* schedule the alarm */
|
||||
|
||||
puts( "Init: Firing alarm in 5 seconds" );
|
||||
status = alarm( 5 );
|
||||
remaining = alarm( 5 );
|
||||
printf( "Init: %d seconds left on previous alarm\n", status );
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: Firing alarm in 2 seconds" );
|
||||
status = alarm( 2 );
|
||||
remaining = alarm( 2 );
|
||||
printf( "Init: %d seconds left on previous alarm\n", status );
|
||||
assert( status );
|
||||
|
||||
puts( "Init: Wait 4 seconds for alarm" );
|
||||
status = sleep( 4 );
|
||||
remaining = sleep( 4 );
|
||||
printf( "Init: %d seconds left in sleep\n", status );
|
||||
assert( status );
|
||||
|
||||
@@ -324,7 +331,7 @@ void *POSIX_Init(
|
||||
sigaction( SIGUSR1, &act, NULL );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* switch to task 1 */
|
||||
@@ -348,7 +355,7 @@ void *POSIX_Init(
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Send SIGUSR1, Task_3 has issued a sigwait */
|
||||
@@ -368,7 +375,7 @@ void *POSIX_Init(
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Send SIGUSR1, Task_3 has issued a sigwaitinfo */
|
||||
@@ -388,7 +395,7 @@ void *POSIX_Init(
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: sleep so the Task_3 can receive SIGUSR2" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* Suspend for signal that has already be sent */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -24,7 +24,7 @@ void *Task_1(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int seconds;
|
||||
unsigned int seconds;
|
||||
|
||||
printf( "Task_1: sleeping for 5 seconds\n" );
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -24,6 +24,7 @@ void *Task_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
unsigned int remaining;
|
||||
int status;
|
||||
int sig;
|
||||
union sigval value;
|
||||
@@ -105,7 +106,7 @@ void *Task_3(
|
||||
assert( !status );
|
||||
|
||||
printf( "Task_3: sleep so the Init task can reguest a signal\n" );
|
||||
status = sleep( 1 );
|
||||
remaining = sleep( 1 );
|
||||
assert( !status );
|
||||
|
||||
/* end of task 3 */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -16,6 +16,17 @@
|
||||
|
||||
#define MUTEX_BAD_ID 0xfffffffe
|
||||
|
||||
void Print_mutexattr(
|
||||
char *msg,
|
||||
pthread_mutexattr_t *attr
|
||||
);
|
||||
|
||||
void calculate_abstimeout(
|
||||
struct timespec *times,
|
||||
uint32_t seconds,
|
||||
uint32_t nanoseconds
|
||||
);
|
||||
|
||||
void Print_mutexattr(
|
||||
char *msg,
|
||||
pthread_mutexattr_t *attr
|
||||
@@ -89,7 +100,7 @@ void calculate_abstimeout(
|
||||
|
||||
while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
|
||||
times->tv_sec++;
|
||||
times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
|
||||
times->tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -13,8 +13,10 @@
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void Key_destructor( void *key_data );
|
||||
|
||||
void Key_destructor(
|
||||
void *key_data
|
||||
void *key_data
|
||||
)
|
||||
{
|
||||
Destructor_invoked++;
|
||||
@@ -73,15 +75,15 @@ void *POSIX_Init(
|
||||
assert( status == EAGAIN );
|
||||
|
||||
puts( "Init: pthread_setspecific - EINVAL (invalid key)" );
|
||||
status = pthread_setspecific( -1, &Data_array[ 0 ] );
|
||||
status = pthread_setspecific( (pthread_t) -1, &Data_array[ 0 ] );
|
||||
assert( status == EINVAL );
|
||||
|
||||
puts( "Init: pthread_getspecific - EINVAL (invalid key)" );
|
||||
key_data = pthread_getspecific( -1 );
|
||||
key_data = pthread_getspecific( (pthread_t) -1 );
|
||||
assert( !key_data );
|
||||
|
||||
puts( "Init: pthread_key_delete - EINVAL (invalid key)" );
|
||||
status = pthread_key_delete( -1 );
|
||||
status = pthread_key_delete( (pthread_t) -1 );
|
||||
assert( status == EINVAL );
|
||||
|
||||
printf( "Init: Setting the key to %d\n", 0 );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -14,6 +14,11 @@
|
||||
#include <errno.h>
|
||||
#include "tmacros.h"
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
);
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
@@ -474,7 +479,7 @@ void *POSIX_Init(
|
||||
fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
|
||||
|
||||
puts( "Init: pthread_getschedparam - ESRCH (bad thread)" );
|
||||
status = pthread_getschedparam( -1, &schedpolicy, &schedparam );
|
||||
status = pthread_getschedparam( (pthread_t) -1, &schedpolicy, &schedparam );
|
||||
fatal_directive_check_status_only( status, ESRCH, "bad thread" );
|
||||
|
||||
puts( "Init: pthread_getschedparam - SUCCESSFUL" );
|
||||
@@ -506,7 +511,7 @@ void *POSIX_Init(
|
||||
fatal_directive_check_status_only( status, EINVAL, "invalid policy" );
|
||||
|
||||
puts( "Init: pthread_setschedparam - ESRCH (invalid thread)" );
|
||||
status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam );
|
||||
status = pthread_setschedparam( (pthread_t) -1, SCHED_OTHER, &schedparam );
|
||||
fatal_directive_check_status_only( status, ESRCH, "invalid thread" );
|
||||
|
||||
/* now get sporadic server errors */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -32,7 +32,7 @@ void *POSIX_Init(
|
||||
printf( "Init's ID is 0x%08x\n", Init_id );
|
||||
|
||||
puts( "Init: pthread_detach - ESRCH (invalid id)" );
|
||||
status = pthread_detach( -1 );
|
||||
status = pthread_detach( (pthread_t) -1 );
|
||||
assert( status == ESRCH );
|
||||
|
||||
/* detach this thread */
|
||||
@@ -47,7 +47,7 @@ void *POSIX_Init(
|
||||
assert( !status );
|
||||
|
||||
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
||||
status = pthread_join( -1, &return_pointer );
|
||||
status = pthread_join( (pthread_t) -1, &return_pointer );
|
||||
assert( status == ESRCH );
|
||||
|
||||
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -13,6 +13,11 @@
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
);
|
||||
|
||||
int HIGH_PRIORITY;
|
||||
int MEDIUM_PRIORITY;
|
||||
int LOW_PRIORITY;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -22,6 +22,12 @@
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
|
||||
void diff_timespec(
|
||||
struct timespec *start,
|
||||
struct timespec *stop,
|
||||
struct timespec *result
|
||||
);
|
||||
|
||||
void diff_timespec(
|
||||
struct timespec *start,
|
||||
struct timespec *stop,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -13,6 +13,11 @@
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
);
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
struct sched_param *schedparam
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Simple test program -- simplified version of sample test hello.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -17,6 +17,9 @@
|
||||
#include <pmacros.h>
|
||||
|
||||
void test_main( void );
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
);
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* umask - test implemented
|
||||
* utime - test implemented
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -37,6 +37,18 @@
|
||||
|
||||
#include <pmacros.h>
|
||||
|
||||
int InitFiles(void);
|
||||
int DeviceLSeekTest(void);
|
||||
int DupTest(void);
|
||||
int Dup2Test(void);
|
||||
int FDataSyncTest(void);
|
||||
int UMaskTest(void);
|
||||
int UTimeTest(void);
|
||||
int PipeTest(void);
|
||||
int PathConfTest(void);
|
||||
int FPathConfTest(void);
|
||||
int FSyncTest(void);
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
* InitFiles function
|
||||
*
|
||||
@@ -53,8 +65,8 @@
|
||||
* ------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int InitFiles (void) {
|
||||
|
||||
int InitFiles (void)
|
||||
{
|
||||
int count;
|
||||
FILE *fp1, *fp2, *fp3;
|
||||
char letter;
|
||||
@@ -117,8 +129,8 @@ int InitFiles (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int DeviceLSeekTest (void) {
|
||||
|
||||
int DeviceLSeekTest (void)
|
||||
{
|
||||
int error = -1, retval = FALSE;
|
||||
|
||||
int fd = open ("/dev/console", O_RDONLY);
|
||||
@@ -133,7 +145,6 @@ int DeviceLSeekTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -152,8 +163,8 @@ int DeviceLSeekTest (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int DupTest(void) {
|
||||
|
||||
int DupTest(void)
|
||||
{
|
||||
int fd1, fd2;
|
||||
|
||||
int flags = 0, retval = FALSE;
|
||||
@@ -179,7 +190,6 @@ int DupTest(void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -200,8 +210,8 @@ int DupTest(void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int Dup2Test(void) {
|
||||
|
||||
int Dup2Test(void)
|
||||
{
|
||||
int fd1, fd2;
|
||||
|
||||
int flags = 0, retval = FALSE;
|
||||
@@ -251,7 +261,6 @@ int Dup2Test(void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -266,14 +275,15 @@ int Dup2Test(void) {
|
||||
* attempts to fdatasync an invalid file descriptor (-1).
|
||||
* attempts to fdatasync a perfectly valid fd opened as RDWR
|
||||
*
|
||||
* returns: TRUE if attempt to fdatasync invalid and read-only filed escriptor fail, and fdatasync succeeds on valid fd.
|
||||
* returns: TRUE if attempt to fdatasync invalid and read-only filed
|
||||
* descriptor fail, and fdatasync succeeds on valid fd.
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FDataSyncTest(void) {
|
||||
|
||||
int FDataSyncTest(void)
|
||||
{
|
||||
int fd = -1;
|
||||
int error = 0, retval = TRUE;
|
||||
|
||||
@@ -314,7 +324,6 @@ int FDataSyncTest(void) {
|
||||
retval = FALSE;
|
||||
|
||||
close (fd);
|
||||
|
||||
}
|
||||
|
||||
/* assert (retval == TRUE);*/
|
||||
@@ -338,11 +347,12 @@ int FDataSyncTest(void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int UMaskTest (void) {
|
||||
int UMaskTest (void)
|
||||
{
|
||||
mode_t error = 0;
|
||||
int retval = FALSE;
|
||||
|
||||
int error = 0, retval = FALSE;
|
||||
|
||||
umask (023);
|
||||
umask(023);
|
||||
error = umask(022);
|
||||
|
||||
if (error == 023)
|
||||
@@ -353,7 +363,6 @@ int UMaskTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -367,14 +376,15 @@ int UMaskTest (void) {
|
||||
* actions: set utime for an invalid filename.
|
||||
* set utime for a valid filename.
|
||||
*
|
||||
* returns: TRUE if time on valid file is set correctly and utime failed on an invaid filename.
|
||||
* returns: TRUE if time on valid file is set correctly and utime failed on
|
||||
* an invalid filename.
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int UTimeTest (void) {
|
||||
|
||||
int UTimeTest (void)
|
||||
{
|
||||
int error = 0, retval = FALSE;
|
||||
struct utimbuf time;
|
||||
struct stat fstat;
|
||||
@@ -413,7 +423,6 @@ int UTimeTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return (retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -431,8 +440,8 @@ int UTimeTest (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int PipeTest (void) {
|
||||
|
||||
int PipeTest (void)
|
||||
{
|
||||
int error = 0, retval = FALSE;
|
||||
int fd[2];
|
||||
|
||||
@@ -446,7 +455,6 @@ int PipeTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -465,8 +473,8 @@ int PipeTest (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int PathConfTest (void) {
|
||||
|
||||
int PathConfTest (void)
|
||||
{
|
||||
int error = 0, retval = FALSE;
|
||||
|
||||
error = pathconf("thisfiledoesnotexist", _PC_LINK_MAX);
|
||||
@@ -486,7 +494,6 @@ int PathConfTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -503,8 +510,8 @@ int PathConfTest (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FPathConfTest (void) {
|
||||
|
||||
int FPathConfTest (void)
|
||||
{
|
||||
int error = 0, retval = TRUE;
|
||||
|
||||
int fd = -1;
|
||||
@@ -537,7 +544,6 @@ int FPathConfTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -556,8 +562,8 @@ int FPathConfTest (void) {
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int FSyncTest (void) {
|
||||
|
||||
int FSyncTest (void)
|
||||
{
|
||||
int error = 0, retval = FALSE;
|
||||
int fd = -1;
|
||||
|
||||
@@ -581,7 +587,6 @@ int FSyncTest (void) {
|
||||
/* assert (retval == TRUE);*/
|
||||
|
||||
return(retval);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
@@ -593,6 +598,7 @@ int FSyncTest (void) {
|
||||
*/
|
||||
|
||||
#if defined(__rtems__)
|
||||
int test_main(void);
|
||||
int test_main(void)
|
||||
#else
|
||||
int main(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This test exercises the POSIX Barrier manager.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2006.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -22,6 +22,7 @@
|
||||
#define NUMBER_THREADS 2
|
||||
pthread_t ThreadIds[NUMBER_THREADS];
|
||||
pthread_barrier_t Barrier;
|
||||
void *BarrierThread(void *arg);
|
||||
|
||||
void *BarrierThread(void *arg)
|
||||
{
|
||||
@@ -41,6 +42,8 @@ void *BarrierThread(void *arg)
|
||||
*/
|
||||
|
||||
#if defined(__rtems__)
|
||||
int test_main(void);
|
||||
|
||||
int test_main(void)
|
||||
#else
|
||||
int main(
|
||||
|
||||
@@ -51,7 +51,11 @@ rtems_task Init( rtems_task_argument argument);
|
||||
|
||||
#endif /* __rtems__ */
|
||||
|
||||
void countTaskDeferred() {
|
||||
void countTaskAsync(void);
|
||||
void countTaskDeferred(void);
|
||||
|
||||
void countTaskDeferred(void)
|
||||
{
|
||||
int i=0;
|
||||
int type,state;
|
||||
|
||||
@@ -64,7 +68,8 @@ void countTaskDeferred() {
|
||||
}
|
||||
}
|
||||
|
||||
void countTaskAsync() {
|
||||
void countTaskAsync(void)
|
||||
{
|
||||
int i=0;
|
||||
int type,state;
|
||||
|
||||
|
||||
@@ -38,6 +38,16 @@ volatile bool reader_cleanup_ran;
|
||||
volatile bool release_read_lock_ran;
|
||||
volatile bool writer_cleanup_ran;
|
||||
|
||||
void waiting_reader_cleanup(void *arg);
|
||||
void lock_for_read(void *arg);
|
||||
void release_read_lock(void *arg);
|
||||
void waiting_writer_cleanup(void *arg);
|
||||
void lock_for_write(lock_t *l);
|
||||
void release_write_lock(void *arg);
|
||||
void initialize_lock_t(lock_t *l);
|
||||
void *ReaderThread(void *arg);
|
||||
void *WriterThread(void *arg);
|
||||
|
||||
void waiting_reader_cleanup(void *arg)
|
||||
{
|
||||
lock_t *l;
|
||||
@@ -211,7 +221,7 @@ void *WriterThread(void *arg)
|
||||
* main entry point to the test
|
||||
*/
|
||||
|
||||
void *POSIX_Init (
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2007.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
|
||||
void check_enosys(int status);
|
||||
|
||||
void check_enosys(int status)
|
||||
{
|
||||
if ( (status == -1) && (errno == ENOSYS) )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -56,7 +56,7 @@ void *POSIX_Init(
|
||||
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( mq, ENOMEM, "no workspace available" );
|
||||
fatal_posix_service_status_errno((int)mq, ENOMEM, "no workspace available");
|
||||
|
||||
puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Simple test program -- simplified version of sample test hello.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -17,6 +17,9 @@
|
||||
#include <tmacros.h> /* instantiate buffering code if needed */
|
||||
|
||||
void test_main( void );
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
);
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This test exercises the time of day services via the Classic
|
||||
* and POSIX APIs to make sure they are consistent.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -23,6 +23,11 @@
|
||||
#include <rtems.h>
|
||||
#include <rtems/libio.h>
|
||||
|
||||
void test_adjtime(void);
|
||||
void check_a_tod(
|
||||
rtems_time_of_day *the_tod
|
||||
);
|
||||
|
||||
/*
|
||||
* List of dates and times to test.
|
||||
*/
|
||||
@@ -86,7 +91,7 @@ void check_a_tod(
|
||||
} while( i < 6 );
|
||||
}
|
||||
|
||||
void test_adjtime()
|
||||
void test_adjtime(void)
|
||||
{
|
||||
int sc;
|
||||
rtems_status_code status;
|
||||
@@ -145,6 +150,8 @@ void test_adjtime()
|
||||
*/
|
||||
|
||||
#if defined(__rtems__)
|
||||
int test_main(void);
|
||||
|
||||
int test_main(void)
|
||||
#else
|
||||
int main(
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
* Other POSIX facilities such as timers, condition, .. is also used
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -32,6 +32,10 @@
|
||||
#include <stdio.h> /* console facilities */
|
||||
#include <rtems/score/timespec.h>
|
||||
|
||||
void StopTimer(
|
||||
timer_t timer_id,
|
||||
struct itimerspec *timerdata
|
||||
);
|
||||
|
||||
/* temporal parameters of a task */
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
* Other POSIX facilities such as timers, condition, .. is also used
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -51,7 +51,7 @@ void *POSIX_Init (
|
||||
puts( "\n\n*** POSIX Timers Test 02 ***" );
|
||||
|
||||
puts( "timer_create - bad clock id - EINVAL" );
|
||||
status = timer_create( -1, &event, &timer );
|
||||
status = timer_create( (timer_t) -1, &event, &timer );
|
||||
fatal_posix_service_status_errno( status, EINVAL, "bad clock id" );
|
||||
|
||||
puts( "timer_create - bad timer id pointer - EINVAL" );
|
||||
|
||||
Reference in New Issue
Block a user