This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Configure patch for vfork et al on VMS


On Thu, Dec 06, 2001 at 03:40:55PM -0800, Douglas B. Rupp wrote:
> Zack Weinberg writes:
> 
> > (In case you're wondering what the problem is:
> >
> >       fprintf (stderr, "%s: ", this_pname);
> >       fprintf (stderr, install_error_msg, program);
> >       fprintf (stderr, ": %s\n", xstrerror (errno));
> >       exit (-1);
> > 
> > None of that is safe after vfork().  You may not have noticed since
> > it's only executed if exec fails.)
> 
> It might not be safe after a Unix vfork(), but VMS is Not Unix. It seems to be
> exactly what should be done on VMS after a failed exec.
> 
> >From the DEC C reference manual:
> 
> "When an exec function fails, a value of -1 is returned. After such
> a failure, the parent is expected to call either the exit or _exit
> function. Both functions then return to the parent's vfork call,
> which returns the child's process ID."

I'm much more worried about the printf than the exit, but if you're
confident that stdio internal data structures will not be scrambled,
I'll take your word for it.

(Your opinion of the code in collect2.c that does vforks would also be
appreciated.)

zw


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