On Wednesday 22 October 2008, Rob Landley wrote:
> On Tuesday 21 October 2008 00:01:56 Mike Frysinger wrote:
> > - if ((pid = fork()) == -1)
> > +#ifdef __uClinux__
> > + pid = vfork();
> > +#else
> > + pid = fork();
> > +#endif /* __uClinux__ */
> > + if (pid == -1)
> > fatal("do_local_cmd: fork: %s", strerror(errno));
>
> If it's ever safe to call vfork() from a given place, then it should always
> be safe to call it from that place, so the #ifdef isn't really necessary.
>
> Although vfork() has more restrictive semantics than fork() does, it's not
> really less efficient than doing a fork(). Just less flexible. A system
> with an mmu can do a vfork() just fine, so if you've cleared that it's ok
> to use it there, there's no real reason for not to just do it all the time.
> In fact, being consistent means you have a single codepath and the same
> behavior on uClinux as everywhere else.this is certainly all true ... ive just given up on trying to convince people as vfork() tends to scare them. especially if they dont understand vfork() semantics and the app starts behaving in ways they dont recognize. -mike
signature.asc
Description: This is a digitally signed message part.
