]> pd.if.org Git - pdclib/blob - platform/example/functions/_PDCLIB/_Exit.c
c3ecfbc373b26718be4d43024f17aedb801d9c3e
[pdclib] / platform / example / functions / _PDCLIB / _Exit.c
1 /* $Id$ */
2
3 /* _PDCLIB_exit( int )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 /* This is an example implementation of _PDCLIB_exit() fit for use with POSIX
10    kernels.
11 */
12
13 #include <stdlib.h>
14
15 #ifndef REGTEST
16 #include <_PDCLIB_glue.h>
17 #include <unistd.h>
18
19 void _PDCLIB_Exit( int status )
20 {
21     _exit( status );
22 }
23
24 #endif
25
26 #ifdef TEST
27 /* TODO: Work around the following undef */
28 #undef SEEK_SET
29 #include <_PDCLIB_test.h>
30
31 int main( void )
32 {
33     int UNEXPECTED_RETURN = 0;
34     _PDCLIB_Exit( 0 );
35     TESTCASE( UNEXPECTED_RETURN );
36     return TEST_RESULTS;
37 }
38
39 #endif