Re: more fun with procfs (netfilter)

Alexander Viro (viro@math.psu.edu)
Mon, 19 Nov 2001 04:22:49 -0500 (EST)


On Mon, 19 Nov 2001, Herbert Xu wrote:

> Alexander Viro <viro@math.psu.edu> wrote:
>
> > PS: with bash-2.03:
> > $ while read i; do echo $i; done < /proc/ip_tables_names
> > $ while read i; do echo $i; done < /proc/ip_conntrack
> > $
> > 'cause this beast reads byte-by-byte...
>
> Actually, there is no easy way of implementing a read(1) that doesn't
> read byte-by-byte...

Some shells (pdksh 5.2.14-1, bash 2.04 as shipped by SuSE) are trying to be
smart if stdin is from regular file - they hope that third argument of
lseek() is in bytes and is consistent with read() return value.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/