From owner-svn-src-all@FreeBSD.ORG Wed Jan 20 12:18:33 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 0EF8C106566B; Wed, 20 Jan 2010 12:18:33 +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 7A4988FC28; Wed, 20 Jan 2010 12:18:32 +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 o0KCITru055680; Wed, 20 Jan 2010 15:18:29 +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=1263989909; bh=soIkJbpzY+jfEwe5JnvRhgatMNy/dFCo9f/MQbGLbiw=; l=1297; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=uKAeSA3LHQx5O9edRVciXFIzdmgZqRjHQisa371pea0XmjGlcJMjyvctOfmfhHGeI KAd7Dl/6JJU/sHzn+iythbtdgySdrsGU38QI+q7pLCUD4x1IW4cG5PKZBYA3xERySh xso+l7NgGUAg+Ql+DxGV++bYOiloQ4St1GuQH5LQ= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0KCISaE055679; Wed, 20 Jan 2010 15:18:28 +0300 (MSK) (envelope-from ache) Date: Wed, 20 Jan 2010 15:18:28 +0300 From: Andrey Chernov To: Bruce Evans Message-ID: <20100120121827.GA55236@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201001181344.o0IDiiEL079037@svn.freebsd.org> <20100120012639.B67517@delplex.bde.org> <20100120070843.GA45937@nagual.pp.ru> <20100120191752.Q2120@besplex.bde.org> <20100120094627.GA53020@nagual.pp.ru> <20100120211722.S2451@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100120211722.S2451@besplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r202572 - head/lib/libc/gen 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: Wed, 20 Jan 2010 12:18:33 -0000 On Wed, Jan 20, 2010 at 09:33:08PM +1100, Bruce Evans wrote: > > But there is > > nothing said about opendir() & strcoll() relation in the mentioned > > standards. The only word I found is that opendir() returns "ordered" > > sequence, but nowhere mentioned ordered by what criteria, so perhaps they > > mean "stable": > > As I said before, sorting in opendir() has nothing to do with POSIX! It > is an implementation detail for union file systems/mounts. Moreover, even sorting itself is not required here. We sort just to remove dups. > It should also give the FreeBSD > extension of POSIX. POSIX says: "If the strcoll() function fails, > then the return value of alphasort() is unspecified.", but this makes > alphasort() unusable since a qsort() comparison function must return > a specified value. To be used in practice, strcoll() should never fails, doing fallback to strcmp() instead, not only in that, but in lots of other cases too (it may set errno like EILSEQ, but not fails). The next important thing is to return 0 only for true binary equals, additionaly ranking (f.e. by strcmp()) anything inside classes of equality to stabilize result. I hope our strcoll() will be kept in that state after implementing UCA too. -- http://ache.pp.ru/