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