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

Mike Frysinger vapier at gentoo.org
Wed Oct 7 23:53:54 UTC 2009


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.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20091007/886cd1e5/attachment.bin>


More information about the Strace-devel mailing list