[BusyBox] Re: [patch] Why busybox xargs is broken.

Erik Andersen andersen at codepoet.org
Fri Oct 3 10:23:59 UTC 2003

On Fri Oct 03, 2003 at 01:39:12PM +0400, Vladimir N. Oleynik wrote:
> Erik,
> >>+			waitpid(p,&retval,0);
> >
> >
> >I recommend using just wait(&retval) 
> >
> >
> >>+			return retval>>8;
> I do not understand, what for to change this my piece of a code.
> I for a long time have noticed, that many do not understand
> as vfork() function works and try to get rid of it. :-(

The problem is on some Linux architectures (such as powerpc)
vfork does not work or is not implemented at all (for example
with all 2.0.x kernels).  In glibc (and in uClibc to try and
match glibc behavior) for these architectures, vfork() is
implemented with just a call to fork() and there is not even a
call to wait() in the fake vfork implementation...

So unfortunately, we can not really rely on the vfork semantics
-- sometimes the parent process will not actually be blocked
until the child exits.  So adding the extra call to wait() is a
good idea to avoid wierd sequencing problems.


Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

More information about the busybox mailing list