All of lore.kernel.org
 help / color / mirror / Atom feed
* read() called twice for /proc files
@ 2001-09-25  1:34 Tim Hockin
  2001-09-25  2:16 ` Jonathan Lundell
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Hockin @ 2001-09-25  1:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List

woops!  sent too early!

Is there a general solution to the case of read() being called minimum
twice for a file in /proc?  I have a small file in /proc, whose data takes
a fair time to generate.  My read() handler gets called once for the data,
and once so I can return 0 to terminate read().

This results in the actual read taking twice as long.  Perhaps I am missing
something...

What if the proc generic stuff used file->private_data as an EOF flag.  It
seems really bizarre that the read loop loops until return 0 or eof is
set.  We promptly throw away the EOF information that the read() handler
set.

Would it break anything?  Is there something I am not seeing in the larger
picture?

-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

^ permalink raw reply	[flat|nested] 4+ messages in thread
* read() called twice for /proc files
@ 2001-09-25  1:29 Tim Hockin
  2001-09-25  1:35 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Hockin @ 2001-09-25  1:29 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Is there a general solution to the case of read() being called minimum
twice for a file in /proc?  I have a small file in /proc, whose data takes
a fair time to generate.  My read() handler gets called once for the data,
and once so I can return 0 to terminate read().

This results in the actual read taking twice as long.  Perhaps I am missing
something...

-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-25  2:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-25  1:34 read() called twice for /proc files Tim Hockin
2001-09-25  2:16 ` Jonathan Lundell
  -- strict thread matches above, loose matches on Subject: below --
2001-09-25  1:29 Tim Hockin
2001-09-25  1:35 ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.