source: rtems/testsuites/psxtests/psxenosys/init.c @ 1e2d7510

4.104.11
Last change on this file since 1e2d7510 was 1e2d7510, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 14, 2009 at 12:15:55 AM

2009-09-13 Joel Sherrill <joel.sherrill@…>

  • psxclock/init.c, psxclock/psxclock.scn, psxenosys/init.c, psxenosys/psxenosys.scn, psxsignal03/Makefile.am, psxsignal03/init.c, psxsignal04/Makefile.am: Move test cases which needed to be executed when POSIX is disabled to psxclock so they will be.
  • Property mode set to 100644
File size: 3.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#define CONFIGURE_INIT
13#include "system.h"
14#include "tmacros.h"
15
16#include <aio.h>
17#include <sys/types.h>
18#include <time.h>
19#include <devctl.h>
20#include <unistd.h>
21#include <sched.h>
22
23void check_enosys(int status);
24
25void check_enosys(int status)
26{
27  if ( (status == -1) && (errno == ENOSYS) ) 
28    return;
29  puts( "ERROR -- did not return ENOSYS as expected" );
30  rtems_test_exit(0);
31}
32
33void *POSIX_Init(
34  void *argument
35)
36{
37  int             sc;
38
39  puts( "\n\n*** POSIX TEST -- ENOSYS ***" );
40
41  puts( "aio_read -- ENOSYS" );
42  sc = aio_read( NULL );
43  check_enosys( sc );
44
45  puts( "aio_write -- ENOSYS" );
46  sc = aio_write( NULL );
47  check_enosys( sc );
48
49  puts( "lio_listio -- ENOSYS" );
50  sc = lio_listio( 0, NULL, 0, NULL );
51  check_enosys( sc );
52
53  puts( "aio_error -- ENOSYS" );
54  sc = aio_error( NULL );
55  check_enosys( sc );
56
57  puts( "aio_return -- ENOSYS" );
58  sc = aio_return( NULL );
59  check_enosys( sc );
60
61  puts( "aio_cancel -- ENOSYS" );
62  sc = aio_cancel( 0, NULL );
63  check_enosys( sc );
64
65  puts( "aio_suspend -- ENOSYS" );
66  sc = aio_suspend( NULL, 0, NULL );
67  check_enosys( sc );
68
69  puts( "aio_fsync -- ENOSYS" );
70  sc = aio_fsync( 0, NULL );
71  check_enosys( sc );
72
73  puts( "clock_getcpuclockid -- ENOSYS" );
74  sc = clock_getcpuclockid( 0, NULL );
75  check_enosys( sc );
76
77  puts( "clock_getenable_attr -- ENOSYS" );
78  sc = clock_getenable_attr( 0, NULL );
79  check_enosys( sc );
80
81  puts( "clock_setenable_attr -- ENOSYS" );
82  sc = clock_setenable_attr( 0, 0 );
83  check_enosys( sc );
84
85  puts( "devctl -- ENOSYS" );
86  sc = devctl( 0, NULL, 0, NULL );
87  check_enosys( sc );
88
89  puts( "execl -- ENOSYS" );
90  sc = execl( NULL, NULL );
91  check_enosys( sc );
92
93  puts( "execle -- ENOSYS" );
94  sc = execle( NULL, NULL );
95  check_enosys( sc );
96
97  puts( "execlp -- ENOSYS" );
98  sc = execlp( NULL, NULL );
99  check_enosys( sc );
100
101  puts( "execv -- ENOSYS" );
102  sc = execv( NULL, NULL );
103  check_enosys( sc );
104
105  puts( "execve -- ENOSYS" );
106  sc = execve( NULL, NULL, NULL );
107  check_enosys( sc );
108
109  puts( "execvp -- ENOSYS" );
110  sc = execvp( NULL, NULL );
111  check_enosys( sc );
112
113  puts( "fork -- ENOSYS" );
114  sc = fork();
115  check_enosys( sc );
116
117  puts( "pthread_atfork -- ENOSYS" );
118  sc = pthread_atfork( NULL, NULL, NULL );
119  check_enosys( sc );
120
121  puts( "pthread_getcpuclockid -- ENOSYS" );
122  sc = pthread_getcpuclockid( 0, NULL );
123  check_enosys( sc );
124
125  puts( "sched_setparam -- ENOSYS" );
126  sc = sched_setparam( 0, NULL );
127  check_enosys( sc );
128
129  puts( "sched_getparam -- ENOSYS" );
130  sc = sched_getparam( 0, NULL );
131  check_enosys( sc );
132
133  puts( "sched_setscheduler -- ENOSYS" );
134  sc = sched_setscheduler( 0, 0, NULL );
135  check_enosys( sc );
136
137  puts( "sched_getscheduler -- ENOSYS" );
138  sc = sched_getscheduler( 0 );
139  check_enosys( sc );
140
141  puts( "wait -- ENOSYS" );
142  sc = wait( NULL );
143  check_enosys( sc );
144
145  puts( "waitpid -- ENOSYS" );
146  sc = waitpid( 0, NULL, 0 );
147  check_enosys( sc );
148
149  puts( "mprotect -- stub implementation - OK" );
150  sc = mprotect( NULL, 0, 0 );
151  posix_service_failed( sc, "mprotect" );
152
153  puts( "vfork -- stub implementation - OK" );
154  sc = vfork();
155  if ( sc != -1 ) {
156    puts( "vfork did not return -1" );
157    rtems_test_exit( 0 );
158  }
159
160  puts( "*** END OF POSIX TEST ENOSYS ***" );
161  rtems_test_exit( 0 );
162
163  return NULL; /* just so the compiler thinks we returned something */
164}
Note: See TracBrowser for help on using the repository browser.