C Language and Libraries Help (clang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
exit Functions
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
─────Run-Time Library───────────────────────────────────────────────────────
The exit and _exit functions perform cleanup operations and
terminate the calling process. The _cexit and _c_exit functions
perform cleanup operations and return to the caller without
terminating the process.
The complete cleanup operation performed by exit and _cexit
consists of calling, in "last in, first out" order, the
functions registered by atexit and _onexit. The _exit function
flushes all I/O buffers and closes all open streams before
returning. The "quick" cleanup operation performed by _exit and
_c_exit does not process atexit or _onexit functions or flush
stream buffers.
The <status> value is typically set to 0 to indicate a normal exit
and set to some other value to indicate an error.
Although the exit and _exit calls do not return a value, the
low-order byte of <status> is made available to the waiting parent
process, if one exists, after the calling process exits. The
<status> value is available to the operating-system batch command
ERRORLEVEL.
The behavior of the exit, _exit, _cexit, and _c_exit functions is
as follows:
Function Action
exit Performs complete C library termination procedures,
terminates the process, and exits with the supplied
status code.
_exit Performs "quick" C library termination procedures,
terminates the process, and exits with the supplied
status code.
_cexit Performs complete C library termination procedures
and returns to caller, but does not terminate
the process.
_c_exit Performs "quick" C library termination procedures
and returns to caller, but does not terminate the
process.
Return Value
None.
-♦-