hush: initial trap support

Mike Frysinger vapier at gentoo.org
Sun Mar 29 20:29:37 UTC 2009


On Sunday 29 March 2009 15:53:16 Denys Vlasenko wrote:
> 2009/3/29 Mike Frysinger <vapier at gentoo.org>:
> > On Sunday 29 March 2009 11:24:10 Denys Vlasenko wrote:
> >> (a) I prefer all data to go to struct globals, never to .data.
> >> (b) It would be nice to allocate it on first use, it's big
> >>     (so that scripts which never use traps don't waste memory for it).
> >> (c) int sig; const char *name; is wasting 8 bytes,
> >>     uint8_t sig; char name[7]; is more compact.
> >> (d) libbb has get_signum(str) which already does signal name or number
> >> -> signal number conversion. get_signame(num) is an opposite convertor.
> >> Use them, this allows you to not duplicate signal names.
> >
> > using the common sig funcs to do translation allows for quite a bit of
> > reduction.  delaying the alloc also saves on bloat.  i was hoping there
> > was a way we could unify the code so that hush wouldnt have to
> > save/restore the sigaction at all though.
>
> This is possible, but is it worth the trouble? struct sigaction is not
> THAT big. Let's make it work correctly first.

fair enough.  next iteration attached.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hush-trap.patch
Type: text/x-patch
Size: 5633 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090329/0ba93c11/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090329/0ba93c11/attachment.pgp>


More information about the busybox mailing list