Update contrib.
3 * Portions Copyright (c) 1990-1999 Nokia Corporation and/or its subsidiary(-ies).
8 * Copyright (c) 1990 Regents of the University of California.
11 * %sccs.include.redist.c%
16 <<exit>>---end program execution
23 void exit(int <[code]>);
31 Use <<exit>> to return control from a program to the host operating
32 environment. Use the argument <[code]> to pass an exit status to the
33 operating environment: two particular values, <<EXIT_SUCCESS>> and
34 <<EXIT_FAILURE>>, are defined in `<<stdlib.h>>' to indicate success or
35 failure in a portable fashion.
37 <<exit>> does two kinds of cleanup before ending execution of your
38 program. First, it calls all application-defined cleanup functions
39 you have enrolled with <<atexit>>. Second, files and streams are
40 cleaned up: any pending output is delivered to the host system, each
41 open file or stream is closed, and files created by <<tmpfile>> are
45 <<exit>> does not return to its caller.
48 ANSI C requires <<exit>>, and specifies that <<EXIT_SUCCESS>> and
49 <<EXIT_FAILURE>> must be defined.
51 Supporting OS subroutines required: <<_exit>>.
55 #include <unistd.h> /* for _exit() declaration */
57 #include <stdlib_r.h> /* for _atexit_processing() */
61 /* GCC knows that exit() should not return, but prior to GCC 2.5 there is
62 * no way of declaring the function as __attribute__ ((noreturn)).
63 * Expect to be warned about this function in MARM builds.
66 exit (int code) _ATTRIBUTE((noreturn))
68 _atexit_processing_r(_REENT);
71 /* GCC may insert a call to abort() here. */