[BusyBox] read_gz patch

Glenn McGrath bug1 at optushome.com.au
Sun Nov 17 02:29:03 UTC 2002


On Sun, 17 Nov 2002 01:10:54 +0000
Laurence Anderson <l.d.anderson at warwick.ac.uk> wrote:

> When I was adapting my rpm applet and had to fork to uncompress the cpio
> 
> archive, which I based on get_header_tar_gz I noticed that for bzip2
> archives you didn't have to, due to the read_bz2 method. Just out of
> interest I wrote a similar thing for gzip too, so there is no need to
> fork on unzipping archives. However there's a catch - its slower as it
> copies the data twice (but then a pipe does that) and i've seen it use
> about 400k memory on highly compressed files (like the kernel source).
> 
> Anyway, its at 
> http://www.warwick.ac.uk/~esvld/programming/patches/busybox/busybox-read_gz.diff
> 
> I dunno what people think, is it useful? The main thing it that it
> removes the need to fork.
> 

It would be much nicer to do it as you suggest, both for consistency with
bzip2 and avoiding fork and pipe.

I tried to modify unzip.c to be able to read x number of bytes rather than
all or nothing, but put it in the too hard basket.

I will have a look at your work now.


Glenn



More information about the busybox mailing list