[Patches] getpath patch (repost)

Skip Montanaro skip@mojam.com (Skip Montanaro)
Tue, 23 May 2000 15:48:02 -0500 (CDT)


>>>>> "M-A" == M -A Lemburg <mal@lemburg.com> writes:

    M-A> "Fred L. Drake" wrote:
    >>
    >> On Tue, 23 May 2000, M.-A. Lemburg wrote:
    >> > The fatal error produces the core dump... so its not all that bad
    >> > ;-)
    >>
    >> Sigh.  Perhaps we need a non-coring Py_FatalErrorXXX()?

    M-A> Hmm, the core dump is caused by abort() -- I don't think we can
    M-A> change that behaviour since it is defined by the C lib and using
    M-A> exit() is not an option since that would cause atexit() hooks to be
    M-A> called.

Can't you use the _exit() system call or is that a Unix-only thing?
According to my Linux man page _exit is part of the defined APIs for SVr4,
SVID, POSIX, X/OPEN and BSD 4.3.  It also states:

    _exit does not call any functions registered with the ANSI C atexit
    function and does not flush standard I/O buffers. To do these things,
    use exit(3).

so you might have to flush all open stdio buffers manually.

Maybe call _exit()+stdio flushes where _exit() is available and abort()
otherwise...

-- 
Skip Montanaro, skip@mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"We have become ... the stewards of life's continuity on earth.  We did not
ask for this role...  We may not be suited to it, but here we are."
- Stephen Jay Gould