Removed double NAME entry.
[AROS.git] / compiler / clib / exit.c
bloba4982865052e971565e71190a2aea74a77c7285b
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function exit()
6 */
8 #include "__arosc_privdata.h"
10 #include <aros/debug.h>
11 #include <aros/startup.h>
12 #include <exec/types.h>
14 #include <assert.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_jmp2exit(1, code);
66 /* never reached */
67 assert(0);
68 } /* exit */