fork() on NOMMU

Denys Vlasenko vda.linux at googlemail.com
Fri Aug 31 16:34:45 UTC 2007


On Thursday 30 August 2007 09:28, Alex Landau wrote:
> Hi,
> 
> It's a pity I haven't spotted this earlier...
> 1.7.0 contains in libbb.h:
> #define fork() BUG_fork_is_unavailable_on_nommu()
> Last time I checked (1.4.1) this define wasn't there.
> 
> The problem I see is the following: fork() is used in several places, notably
> util-linux/mount.c:731
> archival/libunarchive/open_transformer.c:18
> 
> With the above #define, the build fails on my NOMMU board, despite not reaching the code
> path using fork(). (e.g. in 1.4.1 I couldn't use "tar -czf" - it bailed out at runtime
> with "fork() - not supported" or something similar, but could use "tar -xzf", and "mount"
> worked too).

So you had some dead code in your busybox binary. Not good.
 
> Any thoughts of the "right" way to solve this?

To ifdef out things that do not work on NOMMU (for example,
mount's NFS-related option to auto-background should be disabled).

You already did it for httpd by adding #ifdefs which basically
enforced httpd -i. Send similar patches for tar/mount/whatever.

Note that this is not a best solution. More like as
a stopgap fix.

For example, in 1.7.0 httpd goes further and actually
does NOMMU specific things to retain ability to run
in standalone mode: it vforks + re-exec itself as child.
--
vda



More information about the busybox mailing list