[patch] minor size optimization for dmesg.c

Rob Landley rob at landley.net
Sun Mar 19 18:26:18 PST 2006


On Saturday 18 March 2006 8:32 am, Bernhard Fischer wrote:
> Hi,
>
> Attached patch touches dmesg and saves a very few bytes.
>
>    text	   data	    bss	    dec	    hex	filename
>     276	      0	      0	    276	    114	util-linux/dmesg.o.orig
>     271	      0	      0	    271	    10f	util-linux/dmesg.o.01
>      44	      0	      0	     44	     2c	util-linux/dmesg.o.mine
>
>
> PS: the .mine is just a quick and dirty minimal dump of the buffer, à la
> $ cat dmess.c
> #include <sys/klog.h>
> #include <stdlib.h>
> #include <unistd.h>
> int main(int argc, char **argv)
> {
> 	char *buffer = malloc(128*1024);
> 	int i;
>
> 	i = klogctl(3, buffer, sizeof(buffer));
> 	if (i > 0)
> 		write(1, buffer, i);
> }

That looks like the busybox approach to things.  Why aren't we doing that now?

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list