svn commit: r201604 - head/lib/libc/gen

Bruce Evans brde at
Thu Jan 7 15:37:14 UTC 2010

On Tue, 5 Jan 2010, Konstantin Belousov wrote:

> Log:
>  Do not rely on behaviour undefined by ANSI C, use thunks to adapt
>  alphasort-like interface to the comparision function required by
>  qsort() and qsort_r().
>  For opendir() thunk and alphasort(), comment on why we deviated from
>  POSIX by using strcmp() instead of strcoll().
>  Requested and reviewed by:	bde
>  MFC after:	2 weeks


FreeBSD (wollman) fixed the corresponding undefined behaviour (which was
inherited from 4.4BSD) in fts's comparison function in 2002.  fts uses
extra indirections and mostly-wasted space instead of qsort_r().


More information about the svn-src-all mailing list