lkml.org 
[lkml]   [2000]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjecttell eof from eob? how?
Date

I'm reading a buffer in the kernel, the buffer having been delivered
by a VFS write operation. But I need to interpret complete lines, so
if I get given a 4096 char buffer and the last linefeed is at the
4090 char mark, I reply that I've seen 4090 chars. The kernel
then gives me the remaining 6 chars again in a following call.

Great.

But I need the next 6+n chars, or we'll play this game forever.

How can I tell that there is more to come? If I try to save the
leftovers from call to call, how do I know that the next call
is the remaining part that I'm interested in? Or how can I persuade the
kernel to give me 6chars of the old buffer plus 4090 of the next?

This results from a cat foo > /proc/bar, by the way. This is what I
see:

Mar 19 20:40:51 bambam kernel: write_proc entered with
file c22ebc20, buff bfffd194, count 4096, data 0
Mar 19 20:40:51 bambam kernel: write_proc returned count 4074
Mar 19 20:40:51 bambam kernel: write_proc entered with
file c22ebc20, buff bfffe17e, count 22, data 0
Mar 19 20:40:51 bambam kernel: write_proc returned count 1
Mar 19 20:40:51 bambam kernel: write_proc entered with
file c22ebc20, buff bfffe17f, count 21, data 0
Mar 19 20:40:51 bambam kernel: write_proc returned count 1
...

Well, the file pointer might be a clue, I suppose. I'm returning 1
instead of 0 to avoid infinite gameplay here.

Peter

-
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:57    [W:0.074 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site