os._exit when invoked, the process that is calling it terminates immediately without doing any clean-ups (however system.exit() can be handled by the Python program, a much safer/clean way). The parent process receives the exit status when the parent process calls "wait" or "waitpid. os._exit calls _exit of OS
The following code demonstrates it. Beware, os._exit exits the process abruptly.
For more information on exit and _exit refer - https://en.wikipedia.org/wiki/Exit_(system_call)
Refer the Code in GIT Hub
Here is the code in Python (being Python, it is self-explanatory :-))
No comments:
Post a Comment