[[noreturn]] void _Exit (int status) noexcept;
Terminate calling process
Terminates the process normally by returning control to the host environment, but without performing any of the regular cleanup tasks for terminating processes (as function exit does).
No object destructors, nor functions registered by atexit or at_quick_exit are called.
Whether C streams are closed and/or flushed, and files open with tmpfile are removed depends on the particular system or library implementation.
If status is zero or EXIT_SUCCESS, a successful termination status is returned to the host environment.
If status is EXIT_FAILURE, an unsuccessful termination status is returned to the host environment.
Otherwise, the status returned depends on the system and library implementation.
- Status code.
If this is
0 or EXIT_SUCCESS, it indicates success.
If it is EXIT_FAILURE, it indicates failure.
none (the function never returns).
/* _Exit example */
#include <stdio.h> /* printf, fopen */
#include <stdlib.h> /* _Exit, EXIT_FAILURE */
int main ()
FILE * pFile;
pFile = fopen ("myfile.txt","r");
printf ("Error opening file");
/* file operations here */
Concurrently calling this function multiple times has no effect.
No-throw guarantee: this function never throws exceptions.
- Terminate calling process (function)
- Terminate calling process quick (function)
- Abort current process (function)