1 .\" This file is part of the Public Domain C Library (PDCLib).
\r
2 .\" Permission is granted to use, modify, and / or redistribute at will.
\r
10 .Nd terminates the process
\r
14 .Fn "noreturn void exit" "int status"
\r
15 .Fn "noreturn void quick_exit" "int status"
\r
16 .Fn "noreturn void _Exit" "int exitcode"
\r
19 Calling any of these three functions terminates the current process, returning
\r
20 the exit code passed as a parameter. The interpretation of the exit code is
\r
21 undefined, except that 0 or
\r
23 shall indicate successful completion and
\r
25 shall indicate a non-successful completion.
\r
29 first destroys all objects with C++ thread local storage duration (the C
\r
30 standard leaves whether or not thread local objects are destroyed or not
\r
31 undefined). Next, the destructors of all C++ objects of static storage duration
\r
32 are invoked along with all functions passed to
\r
34 in reverse order of registration (the time of registration for C++ objects of
\r
35 static storage duration is taken to be the time at which the constructor
\r
36 completes). It then flushes all open
\r
38 streams with unwritten data and closes them. Finally, files created by
\r
40 are removed, before handing control back to the host environment. Note in
\r
41 particular that functions registered with
\r
49 invokes any functions registered with
\r
51 in reverse order of registration, then returns control to the host
\r
52 environment by calling
\r
54 No signal handlers are called, nor are any functions registered with
\r
59 returns control to the controlling environment without invoking any functions
\r
63 any signal handlers, or the destructors of any thread local objects or C++
\r
64 objects of static storage duration. Whether or not any open
\r
66 streams with unwritten data are flushed or not is undefined.
\r
69 The result of aborting a call to
\r
75 is undefined. If any function or destructor invoked by
\r
84 Undefined behaviour results if, while a call to
\r
88 is in progress, a call to
\r
94 .Sh IMPLEMENTATION NOTES
\r
95 PDCLib implements the process of flushing streams in
\r
101 handlers have been invoked.
\r
106 .Xr at_quick_exit 3
\r
110 is first defined in
\r
119 ISO/IEC 14882:2011 "C++ 2011" .