Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Jul 2005 01:10:12 -0000
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/kern sys_generic.c
Message-ID:  <20050125111545.GC29791@nagual.pp.ru>
In-Reply-To: <81495.1106650943@critter.freebsd.dk>
References:  <20050125105811.GA29791@nagual.pp.ru> <81495.1106650943@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 25, 2005 at 12:02:23PM +0100, Poul-Henning Kamp wrote:
> >> >"This volume of IEEE Std 1003.1-2001 requires that no action be taken for 
> >> >read() or write() when nbyte is zero. This is not intended to take 
> >> >precedence over detection of errors (such as invalid buffer pointers or 
> >> >file descriptors). This is consistent with the rest of this volume of IEEE 
> >> >Std 1003.1-2001, but the phrasing here could be misread to require 
> >> >detection of the zero case before any other errors."
> 
> 	Std 1003.1-2001, but the phrasing here could be misread to require
> 	detection of the zero case before any other errors."
> 
> Does not say you are not allowed to check for the zero case first, only that
> you are not required to do so.

The quote above is not complete, last phrase slips in the exchange:

"A value of zero is to be considered a correct value, for which the 
semantics are a no-op."

For any correct value read() checks some FS-dependent errors conditions 
and may return errors, but not for zero value now. It means we can't now 
call zero value "correct". "No-op" does not means error conditions should 
be skipped. Instead, it means that non-error case operation is empty.

-- 
http://ache.pp.ru/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050125111545.GC29791>