From owner-freebsd-standards@FreeBSD.ORG Fri Jan 24 19:26:42 2014 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA1EE3A9 for ; Fri, 24 Jan 2014 19:26:42 +0000 (UTC) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [IPv6:2001:470:8b2d:1e1c:21b:21ff:feb8:d7b0]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B771F10EE for ; Fri, 24 Jan 2014 19:26:42 +0000 (UTC) Received: from khavrinen.csail.mit.edu (localhost [127.0.0.1]) by khavrinen.csail.mit.edu (8.14.7/8.14.7) with ESMTP id s0OJQfVE008327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL CN=khavrinen.csail.mit.edu issuer=Client+20CA); Fri, 24 Jan 2014 14:26:41 -0500 (EST) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.14.7/8.14.7/Submit) id s0OJQeiW008324; Fri, 24 Jan 2014 14:26:40 -0500 (EST) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21218.48752.949231.855028@khavrinen.csail.mit.edu> Date: Fri, 24 Jan 2014 14:26:40 -0500 From: Garrett Wollman To: Bruce Evans Subject: Re: closedir(3) handling NULL In-Reply-To: <20140125041504.Y986@besplex.bde.org> References: <20140124014105.GC37334@admin.xzibition.com> <20140124132435.GA90996@stack.nl> <20140124165509.GA73838@admin.xzibition.com> <20140125041504.Y986@besplex.bde.org> X-Mailer: VM 7.17 under 21.4 (patch 22) "Instant Classic" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (khavrinen.csail.mit.edu [127.0.0.1]); Fri, 24 Jan 2014 14:26:41 -0500 (EST) Cc: freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2014 19:26:43 -0000 < said: > I don't know how the fd can be invalid for a (necessarily valid) stream. > Maybe because the fd for a stdio stream is not private, and POSIX actually > allows closing it directly. At least this says "shall fail" instead of > "may fail". I think the "may fail" for closedir() is just buggy wording. > The "may" is for the implementation not being required to use fd's at all. > But when it uses them, errors from them should be "shall fail" like they > are for fclose(). "may fail" has a very specific meaning in the "ERRORS" section: if the implementation detects the condition described, it must use the specified error number. -GAWollman