From owner-freebsd-standards@FreeBSD.ORG Thu Jan 7 16:01:44 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 891E81065697 for ; Thu, 7 Jan 2010 16:01:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 2483B8FC22 for ; Thu, 7 Jan 2010 16:01:43 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o07G1WZc007303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jan 2010 03:01:34 +1100 Date: Fri, 8 Jan 2010 03:01:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Garrett Wollman In-Reply-To: <19269.8963.733084.213387@khavrinen.csail.mit.edu> Message-ID: <20100108025519.U56232@delplex.bde.org> References: <201001031500.o03F0BO3042964@freefall.freebsd.org> <19269.8963.733084.213387@khavrinen.csail.mit.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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: Thu, 07 Jan 2010 16:01:44 -0000 On Wed, 6 Jan 2010, Garrett Wollman wrote: > < said: > 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. There's no trace of it in the opengroup man page for alphasort+scandir most easily found by google (not clear how recent or authoritative this is), and I couldn't find the complaint either. >> @@ -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.) This is done. What do you think about the single `const' in the broken prototypes? For fts, you preserved the struct pointer part of the brokenness but added a second `const'. I suppose the Standard intentionally left out the second `const' for the same reasons as for execve() and strtol(). Bruce