[uClibc]popen failing on i386 -- vfork issue?

Manuel Novoa III mnovoa3 at bellsouth.net
Thu Mar 1 15:02:34 UTC 2001


On Wed, 28 Feb 2001, David McCullough wrote:
> It appears to work fine.  I looked at the source,  the child does not seem
> to modify any data structures, variables or stack after the vfork.  It
> looks fairly safe to me.  Where does it SEGV ?

I'm not sure.  When I run it under gdb though, it gives fails with a SIGPIPE
when closing the pipe's file descriptor.  From reading the vfork man page, that
makes sense.  If parent is suspended until the child exits and then writes to
the pipe, the reading end of the pipe is already closed so the write system
call generates a SIGPIPE.  What am I missing?  Why should this work with vfork
at all?

> Of course SEGV's just don't happen without an MMU and it may have merrily
> trashed some memory that no one was using ;-) 

Hadn't thought of that, but of course it make sense.  ;-)

> > 2) Is a seperate vfork really needed under i386, or could we just silently
> >    fork instead?
> 
> It's a tough call,  but I think that if the user calls vfork,  they should
> get vfork.  If you want to change to using fork then use an
> "ifndef__NO_MMU__" or whatever the define is ?

Again from the vfork man page, 

The requirements put on vfork by the standards are weaker than those put on
fork, so an implementation where the two are synonymous is compliant.

Does anyone know of an i386 clone _without_ an MMU?

Manuel





More information about the uClibc mailing list