I\'ve been trying to figure out how the fork-exec mechanism is used inside Linux. Everything was going on according to the plan until some web pages started to confuse me.<
exit() is on the top of _exit(), using conventional C library.
There are the differences:
_exit() won't flushes the stdio buffer while exit() flushes the stdio buffer prior to exit.
_exit() can not perform clean-up process while exit() can be registered with some function ( i.e on_exit or at_exit) to perform some clean-up process if anything is required before existing the program.
exit(status) simply passes the exit status to _exit(status). It is recommended that whenever to perform fork(), one of them between child and parent, one use _exit() and another use exit().