sys._exit()

Ignacio Vazquez-Abrams ignacio at openservices.net
Wed Aug 22 18:49:09 EDT 2001


On Wed, 22 Aug 2001, Chuck Esterbrook wrote:

> The 2.1 docs say:
>
> -----------------------
> _exit(n)
>
> Exit to the system with status n, without calling cleanup handlers,
> flushing stdio buffers, etc. Availability: Unix, Windows.
>
> Note: the standard way to exit is sys.exit(n). _exit() should normally only
> be used in the child process after a fork().
> -----------------------
>
> What would be the motivation for a child process of a fork to _exit()
> instead of exit()? e.g., why wouldn't the child wish to cleanup handlers,
> flush stdio buffers, etc.? Does anyone use _exit()?
>
> -Chuck

Because then it would step all over the data of the parent, if it is still
running.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list