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, _exit
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The exit and _exit functions terminate the calling process. The
exit function first calls, in "last in, first out" order, the
functions registered by atexit and onexit. It then flushes all
file buffers before terminating the process.
The _exit function terminates the process without processing
atexit or onexit functions or flushing 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.
-♦-