From: Adam Kropelin <akropel1@rochester.rr.com>
To: Clayton Weaver <cgweav@email.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.4.19] read(2) and page aligned buffers
Date: Wed, 6 Nov 2002 14:38:49 -0500 [thread overview]
Message-ID: <20021106193849.GA640@www.kroptech.com> (raw)
In-Reply-To: <20021106181358.11684.qmail@email.com>
On Wed, Nov 06, 2002 at 01:13:57PM -0500, Clayton Weaver wrote:
> a short count with errno == 0, the wrapper loops
> and tries to read the rest of the file to the
> offset into the buffer past what it already read,
> read() returns 0 with errno still == 0, and of
> course the wrapper decides that it must be at
> EOF (read() == 0 && errno == 0) and returns.
This isn't necessarily the cause of your problem, but your description
here smells an awful lot like classic errno abuse. errno is only valid
when read() returns -1. The check you cite in your last sentence is
illegal.
If read() returns 0, you're done. You're at EOF. If you're not actually
at EOF then *that* is a bug.
--Adam
next prev parent reply other threads:[~2002-11-06 19:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-06 18:13 [2.4.19] read(2) and page aligned buffers Clayton Weaver
2002-11-06 19:38 ` Adam Kropelin [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-11-07 6:54 Clayton Weaver
2002-11-07 13:43 ` Adam Kropelin
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=20021106193849.GA640@www.kroptech.com \
--to=akropel1@rochester.rr.com \
--cc=cgweav@email.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 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.