Use the detected no-builtin flag. (NicJA)
[AROS.git] / compiler / stdc / exit.c
blob6c393860776f3a59ad683181a2db61990109721e
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function exit()
6 */
8 #include <libraries/stdc.h>
10 #include <aros/debug.h>
12 #include <assert.h>
14 /*****************************************************************************
16 NAME */
17 #include <stdlib.h>
19 void exit (
21 /* SYNOPSIS */
22 int code)
24 /* FUNCTION
25 Terminates the running program. The code is returned to the
26 program which has called the running program.
28 INPUTS
29 code - Exit code. 0 for success, other values for failure.
31 RESULT
32 None. This function does not return.
34 NOTES
35 This function must not be used in a shared library or
36 in a threaded application.
38 EXAMPLE
39 if (no_problems)
40 exit (0);
42 if (warning)
43 exit (5);
45 if (error)
46 exit (10);
48 if (fatal)
49 exit (20);
51 BUGS
53 SEE ALSO
54 atexit(), on_exit()
56 INTERNALS
58 ******************************************************************************/
60 D(bug("[arosc] exit(%d)\n", code));
62 __stdc_jmp2exit(1, code);
64 /* never reached */
65 assert(0);
66 } /* exit */