source: rtems/testsuites/psxtests/psxenosys/init.c @ b422aa3f

5
Last change on this file since b422aa3f was b422aa3f, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 26, 2018 at 2:05:45 PM

tests: Remove configure feature checks

Update #3409.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <sys/types.h>
15#include <sys/wait.h>
16#include <sys/mman.h>
17#include <pthread.h>
18
19#define CONFIGURE_INIT
20#include "system.h"
21#include "tmacros.h"
22
23#include <aio.h>
24#include <time.h>
25#include <unistd.h>
26#include <sched.h>
27
28const char rtems_test_name[] = "PSXENOSYS";
29
30void check_enosys(int status);
31
32void check_enosys(int status)
33{
34  if ( (status == -1) && (errno == ENOSYS) )
35    return;
36  puts( "ERROR -- did not return ENOSYS as expected" );
37  rtems_test_exit(0);
38}
39
40void *POSIX_Init(
41  void *argument
42)
43{
44  int             sc;
45
46  TEST_BEGIN();
47
48  puts( "lio_listio -- ENOSYS" );
49  sc = lio_listio( 0, NULL, 0, NULL );
50  check_enosys( sc );
51
52  puts( "aio_suspend -- ENOSYS" );
53  sc = aio_suspend( NULL, 0, NULL );
54  check_enosys( sc );
55
56  puts( "clock_getcpuclockid -- ENOSYS" );
57  sc = clock_getcpuclockid( 0, NULL );
58  check_enosys( sc );
59
60  puts( "execl -- ENOSYS" );
61  sc = execl( NULL, NULL, (char*)0 );
62  check_enosys( sc );
63
64  puts( "execle -- ENOSYS" );
65  sc = execle( NULL, NULL, (char*)0, NULL );
66  check_enosys( sc );
67
68  puts( "execlp -- ENOSYS" );
69  sc = execlp( NULL, NULL, (char*)0 );
70  check_enosys( sc );
71
72  puts( "execv -- ENOSYS" );
73  sc = execv( NULL, NULL );
74  check_enosys( sc );
75
76  puts( "execve -- ENOSYS" );
77  sc = execve( NULL, NULL, NULL );
78  check_enosys( sc );
79
80  puts( "execvp -- ENOSYS" );
81  sc = execvp( NULL, NULL );
82  check_enosys( sc );
83
84  puts( "fork -- ENOSYS" );
85  sc = fork();
86  check_enosys( sc );
87
88  puts( "pthread_atfork -- ENOSYS" );
89  sc = pthread_atfork( NULL, NULL, NULL );
90  check_enosys( sc );
91
92  puts( "pthread_getcpuclockid -- ENOSYS" );
93  sc = pthread_getcpuclockid( 0, NULL );
94  check_enosys( sc );
95
96  puts( "sched_setparam -- ENOSYS" );
97  sc = sched_setparam( 0, NULL );
98  check_enosys( sc );
99
100  puts( "sched_getparam -- ENOSYS" );
101  sc = sched_getparam( 0, NULL );
102  check_enosys( sc );
103
104  puts( "sched_setscheduler -- ENOSYS" );
105  sc = sched_setscheduler( 0, 0, NULL );
106  check_enosys( sc );
107
108  puts( "sched_getscheduler -- ENOSYS" );
109  sc = sched_getscheduler( 0 );
110  check_enosys( sc );
111
112  puts( "wait -- ENOSYS" );
113  sc = wait( NULL );
114  check_enosys( sc );
115
116  puts( "waitpid -- ENOSYS" );
117  sc = waitpid( 0, NULL, 0 );
118  check_enosys( sc );
119
120  puts( "mprotect -- stub implementation - OK" );
121  sc = mprotect( NULL, 0, 0 );
122  posix_service_failed( sc, "mprotect" );
123
124  puts( "vfork -- stub implementation - OK" );
125  sc = vfork();
126  if ( sc != -1 ) {
127    puts( "vfork did not return -1" );
128    rtems_test_exit( 0 );
129  }
130
131  TEST_END();
132  rtems_test_exit( 0 );
133
134  return NULL; /* just so the compiler thinks we returned something */
135}
Note: See TracBrowser for help on using the repository browser.