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]

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


This was meant to be a reply to list.


---------- Forwarded message ----------
From: Zack Weinberg <zackw@panix.com>
Date: Fri, Sep 18, 2015 at 12:42 PM
Subject: Re: [PATCH] [BZ #18433] Check file access/existence before forking.
To: Szabolcs Nagy <szabolcs.nagy@arm.com>


On Fri, Sep 18, 2015 at 11:32 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>
> 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.

Any function can be annotated with these semantics using __attribute__
((returns_twice)), but glibc's headers don't do that, so GCC must have
special knowledge of the name 'vfork'; and this probably _is_ a
conformance violation, in that a program that doesn't include
<unistd.h> (or includes it in a feature-selection mode that doesn't
bring in a declaration of 'vfork') ought to be allowed to define its
own 'vfork' that has no such semantics.  (As far as I know, vfork is
_not_ in POSIX nor XSI.)  I don't see any way around it, though.
Breaking programs that call vfork, expecting it to have its special
behavior, would be worse.  And I expect the code-generation changes
are not _wrong_ in the case that vfork doesn't return twice, just less
optimal.

And yes, I expect Bad Things happen if someone calls vfork through a
function pointer.

zw


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