lkml.org 
[lkml]   [2000]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: getting more that 4K out of a proc file?
Date
Alan Cox wrote:
> Yuck.

;-)

> Take a look at the routing code for IP stuff. We use fixed width records
> with space padding. Then you just shift right to get the item counter
> and it still works byte level

Doesn't work that well in cases where information is quite variable-length,
e.g. drivers/atm/eni.c:eni_proc_read. Besides, all of the /proc/atm files
are meant to be human-read, so the usual formatting policy is "try to stay
within 80 columns, but overflow if necessary". One would have to \0-pad in
order to get this, which is probably worse than funny file positions.

IMHO, seeking to non-zero positions in /proc is a little bogus anyway,
because many files have sufficiently variable content that you can't
really tell where you might end up.

Would be nice if once could flag /proc as non-seekable and make them
appear as pipes, though.

- Werner

--
_________________________________________________________________________
/ Werner Almesberger, ICA, EPFL, CH werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

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

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.062 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site