compiler/clib: Rename IoErr2errno() to __arosc_ioerr2errno(); function is now defined...
[AROS.git] / compiler / clib / exit.c
blobb066e8cbac39835a4e19e7f7f1375b8cc9ca3e1e
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ANSI C function exit()
6 Lang: english
7 */
9 #include "__arosc_privdata.h"
11 #include <aros/debug.h>
12 #include <exec/types.h>
13 #include <setjmp.h>
14 #include <aros/startup.h>
16 /*****************************************************************************
18 NAME */
19 #include <stdlib.h>
21 void exit (
23 /* SYNOPSIS */
24 int code)
26 /* FUNCTION
27 Terminates the running program. The code is returned to the
28 program which has called the running program.
30 INPUTS
31 code - Exit code. 0 for success, other values for failure.
33 RESULT
34 None. This function does not return.
36 NOTES
37 This function must not be used in a shared library or
38 in a threaded application.
40 EXAMPLE
41 if (no_problems)
42 exit (0);
44 if (warning)
45 exit (5);
47 if (error)
48 exit (10);
50 if (fatal)
51 exit (20);
53 BUGS
55 SEE ALSO
56 atexit(), on_exit()
58 INTERNALS
60 ******************************************************************************/
62 D(bug("[arosc] exit(%d)\n", code));
64 __arosc_startup_error = code;
65 longjmp (__arosc_startup_jmp_buf, 1);
67 /* never reached */
68 } /* exit */