bug #434: bb_full_read vs. safe_read

Rob Landley rob at landley.net
Fri Oct 7 01:01:48 UTC 2005


On Thursday 06 October 2005 15:16, Bernhard Fischer wrote:
> Hi,
>
> Any other opinions on https://bugs.busybox.net/view.php?id=434 ?
>
> Any takers?

Oh yeah, I remember looking at this before.

Our entire copyfd infrastructure is way overcomplicated.  It's not a simple 
read from A write to B until an error from either one or until A returns a 
length 0 read meaning EOF.  No, it tries to get fancy, and this fancy keeps 
breaking.

Notice that our "tee" used to do something similar (reading only in 4k chunks) 
before I hit it on the head way back.  (svn r8869)

When anything that sits on a pipe (or potentially sits on a pipe) gets partial 
input it should consume it and pass it on in the chunk sizes it gets.  
Aggregating is asking for trouble in lots of fun little ways.  (Aggregating 
is the OS's job; the pipe infrastructure in linux, the nagle agorithm in the 
network stack, etc.  The job of busybox is to be small and simple.)

Rob



More information about the busybox mailing list