This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [BZ #18433] Check file access/existence before forking.


> > The same argument applies to setjmp, and the solution in GCC is the
> > same for both: GCC internally recognizes vfork, setjmp, and a few other
> > functions as functions that "return twice".
> >
> > (after all, if it was broken like you describe, one would expect to witness
> > such breakage in practice, for instance with GNU Make prior to 4.0)
> >
> 
> that's surprising: setjmp is standard c
> and it is a macro so it cannot be called
> through a function pointer.. this is not
> true for vfork so it's not clear why gcc
> recognizes it.

Because a minor change to GCC (extending setjmp treatment to vfork) is overall
a more acceptable compromise than demanding fixes to every vfork-in-C usage?

(I can see your argument in a way that an abstract C compiler cannot be
required to treat vfork specially, unlike setjmp; but fwiw, not only GCC, but
Clang and cparser also appear to treat vfork similar to setjmp)

Alexander


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]