From owner-svn-src-all@FreeBSD.ORG Sun Jan 10 23:21:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A80F106566C; Sun, 10 Jan 2010 23:21:41 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 76A008FC12; Sun, 10 Jan 2010 23:21:40 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0ANLcKs048314; Mon, 11 Jan 2010 02:21:38 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263165698; bh=xwQWj0zqgZJ3YRlhbuxvZEFg58Cu+FeNGbNngIS5lXY=; l=844; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=I3N2BqolWHvKhTvH/3mvh+T648qZkeIclwsS7DvOesaPWnkCGJZ201rPa6a+yssZ+ T+vnvJscCkE3Xh+ODxFDb3e1kN/J2pFUzXDXwSZ0migFkgeGJe7UPJAf7Uzq94KTHd EHMQjNz3XTmDwFQI3bKRB7w3svcthYsnDS2MgyFU= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0ANLbDQ048313; Mon, 11 Jan 2010 02:21:38 +0300 (MSK) (envelope-from ache) Date: Mon, 11 Jan 2010 02:21:35 +0300 From: Andrey Chernov To: Jilles Tjoelker Message-ID: <20100110232134.GA48128@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Jilles Tjoelker , Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> <20100110230618.GA6756@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100110230618.GA6756@stack.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 23:21:41 -0000 On Mon, Jan 11, 2010 at 12:06:18AM +0100, Jilles Tjoelker wrote: > > I picked EINVAL because this is the code used by read(2) and write(2) if they > > are passed nbytes > INT_MAX. It would seem odd to use one error code for a > > number of bytes between INT_MAX and SIZE_MAX and then switch to a different > > error code for > SIZE_MAX bytes. > > I think the fact that you can only read(2)/write(2) INT_MAX at a time is > a bug, so basing additional code on it seems inappropriate. > > Even then, fread()/fwrite() will not generate such large > read(2)/write(2) requests as they always go through the buffer which is > filled using smaller requests. > > Also, EOVERFLOW will give a more understandable error message for users. Agreed. F.e. POSIX limit for write(2) is {SSIZE_MAX}, not INT_MAX. -- http://ache.pp.ru/