[PATCH v3] Add support for Linux/no-mmu with vfork

Dmitry V. Levin ldv at altlinux.org
Thu Oct 8 00:13:04 UTC 2009


On Wed, Oct 07, 2009 at 07:53:54PM -0400, Mike Frysinger wrote:
> On Wednesday 07 October 2009 19:35:02 Dmitry V. Levin wrote:
> > On Wed, Oct 07, 2009 at 04:10:53AM -0400, Mike Frysinger wrote:
> > > Systems that lack a MMU cannot use fork() to create the child process.
> > > First we detect if the toolchain has the fork() symbol and if it does
> > > not, we just always use vfork().  If it does, then we try that first.  If
> > > it fails due to ENOSYS, we fall back to using vfork().
> > 
> > I wonder is there any way to implement this without runtime penalty for
> > systems where fork() never returns ENOSYS?
> 
> the original reason i wrote it that way was that some people configure their 
> no-mmu C library in a non-standard way where the fork() symbol does exist but 
> only returns an error with ENOSYS.  i'm ok if you dont want to support this 
> scenario as it doesnt affect me anymore :).
> 
> so it'd be:
> #ifdef HAVE_FORK
> # define strace_vforked false
> #else
> # define fork() vfork()
> # define strace_vforked true
> #endif
> 
> then there wouldnt be any need for the other fork()->strace_fork() changes.

Yes, such variant is better.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20091008/1b27cb96/attachment.bin>


More information about the Strace-devel mailing list