Explain the difference between exit() and _exit() function. exit() does cleanup work like closing file descriptor, file stream and so on, while _exit() does not.
The following are the differences between exit() and _exit() functions:
- io buffers are flushed by exit() and executes some functions those are registered by atexit().
- _exit() ends the process without invoking the functions which are registered by atexit().
|