From owner-freebsd-standards@FreeBSD.ORG Wed Jan 6 23:55:49 2010 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 426941065697 for ; Wed, 6 Jan 2010 23:55:49 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [128.30.28.20]) by mx1.freebsd.org (Postfix) with ESMTP id 01AEF8FC0C for ; Wed, 6 Jan 2010 23:55:48 +0000 (UTC) Received: from khavrinen.csail.mit.edu (localhost [127.0.0.1]) by khavrinen.csail.mit.edu (8.14.3/8.14.3) with ESMTP id o06Ntlx0018731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL CN=khavrinen.csail.mit.edu issuer=Client+20CA); Wed, 6 Jan 2010 18:55:47 -0500 (EST) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.14.3/8.14.3/Submit) id o06NtlSJ018728; Wed, 6 Jan 2010 18:55:47 -0500 (EST) (envelope-from wollman) From: Garrett Wollman MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19269.8963.733084.213387@khavrinen.csail.mit.edu> Date: Wed, 6 Jan 2010 18:55:47 -0500 To: Kostik Belousov In-Reply-To: <201001031500.o03F0BO3042964@freefall.freebsd.org> References: <201001031500.o03F0BO3042964@freefall.freebsd.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.2.3 (khavrinen.csail.mit.edu [127.0.0.1]); Wed, 06 Jan 2010 18:55:48 -0500 (EST) Cc: freebsd-standards@freebsd.org Subject: Re: standards/142255: scandir prototype in dirent.h isn't compliant with POSIX 2008 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:55:49 -0000 < said: > The change of the prototype shall also fix alphasort(3). And then, each > in-tree consumer should be updated. > scandir(3) is historical BSD interface, that only appeared in SUSv4. > It seems that Solaris and possibly glibc are conforming, so FreeBSD > should probably follow the route. I believe someone at least complained about the Standard's broken prototypes, subsequent to the approval of the current standard, although I don't recall what the outcome was. > @@ -95,7 +95,7 @@ typedef void * DIR; > __BEGIN_DECLS > #if __BSD_VISIBLE > DIR *__opendir2(const char *, int); > -int alphasort(const void *, const void *); > +int alphasort(const struct dirent **, const struct dirent **); > int getdents(int, char *, int); > int getdirentries(int, char *, int, long *); > #endif If we're going to break the historical 4.4BSD prototype to match the broken one in SUSv4, the declaration should be moved to an appropriate section of the header file. (I haven't checked -- is this interface in the base standard or the XSI option? If the latter we should just ignore it -- we should not be trying to implement XSI's mistakes.) -GAWollman