From owner-cvs-src@FreeBSD.ORG Tue Jan 25 11:02:26 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17FDD16A4CE; Tue, 25 Jan 2005 11:02:26 +0000 (GMT) Received: from critter.freebsd.dk (f170.freebsd.dk [212.242.86.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DE1643D3F; Tue, 25 Jan 2005 11:02:25 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id j0PB2Nfk081496; Tue, 25 Jan 2005 12:02:23 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Andrey Chernov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 25 Jan 2005 13:58:11 +0300." <20050125105811.GA29791@nagual.pp.ru> Date: Tue, 25 Jan 2005 12:02:23 +0100 Message-ID: <81495.1106650943@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern sys_generic.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 11:02:26 -0000 In message <20050125105811.GA29791@nagual.pp.ru>, Andrey Chernov writes: >> >"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." >> >> Notice the "require" it doesn't ban the practice. >What's about "invalid buffer pointers" detection, directly mentioned in >the standard (above)? Now it is broken for zero bytes read because your >newly inserted check takes precedence. 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. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.