exit, atexit - terminate a process after flushing any pending output
void exit(int status)
int atexit(void (*func)(void))
Exit first calls all functions registered by atexit, flushes all data
buffered by the Standard I/O library, and finally terminates the process.
Exit never returns.
Atexit registers the function func into a table of functions to be called
Atexit returns 0 on success, -1 if malloc cannot allocate more memory for
the list of registered functions.