#include <stdlib.h>
void exit(int status);
Safe
The C function exit() first calls any functions registered through the atexit(3C) function in the reverse order of their registration. exit() then calls _exit, which circumvents all such functions and cleanup.
The symbols EXIT_SUCCESS and EXIT_FAILURE are defined in the header <stdlib.h> and may be used as the value of status to indicate successful or unsuccessful termination, respectively.