[PATCH 2/2] first stab at NOFORK applet support

Rob Landley rob at landley.net
Fri May 5 16:29:28 UTC 2006


On Friday 05 May 2006 2:41 am, Denis Vlasenko wrote:
> On Friday 05 May 2006 09:40, Denis Vlasenko wrote:
> > On Friday 05 May 2006 09:37, Denis Vlasenko wrote:
> > > Hi Rob,
> > >
> > > I looked at implementing NOFORK as discussed a while ago.
> >
> > This is a preparatory patch. It changes APPLET macros a bit.
> > No real code changes.
> >
> > Please apply regardless of patch #2.
>
> Patch #2 is a meat of the change. Please comment on it.
> --
> vda

Ok...

It's got unrelated cleanups in there (whitespace, etc) that make it hard to 
review.  Why is quickshell.h a separate header?  Why does APPLET_DATA_SIZE 
have two fields?  I really dislike having another table listing all applets.  
We have a table listing them all, in applets.h.  Needing to feed a decimal 
number into APPLET_DATA_SIZE is just evil.  Having to put CHECK_BSS_SIZE() in 
sed_main() is ugly.  Sticking BEGIN_BSS in the global declarations is black 
magic.  The list of #defines for each global variable is just icky.

Overall, the idea shows promise, but this implementation is opaque and looks 
really hard to debug and maintain.

The nofork bit and the global consolidation can be handled separately.  
Consolidating the globals helps nommu platforms anyway, and is something we 
should do first.  We can worry about nofork after we've made some headway on 
that.  I'll convert sed to using a structure to begin with, and see how that 
looks.  (Note: bunzip2 is already using such a structure, although if we 
consolidate that and tar tries to use it without forking...)

If we have to prefix the names of structure types used in globals to avoid 
namespace collision, we'll live.

Rummage rummage...  You know, sed's struct append_list can just go away, since 
we've _got_ a linked list type now...  (Hums to self, banging away on sed 
code...)

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list