From: Tim Hockin <thockin@sun.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: read() called twice for /proc files
Date: Mon, 24 Sep 2001 18:34:14 -0700 [thread overview]
Message-ID: <3BAFDF16.4BD38E7C@sun.com> (raw)
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
next reply other threads:[~2001-09-25 1:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-25 1:34 Tim Hockin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BAFDF16.4BD38E7C@sun.com \
--to=thockin@sun.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®