Source Compatibility Guide

alphasort and scandir

These routines combine the functions of readdir and qsort to process directory information. scandir reads a directory and builds an array of pointers to directory entries, returning the number of entries in the array and a pointer to the array through the parameter, namelist. namelist is a pointer to an arrangement of directory structure pointers. If the directory cannot be opened for reading or if malloc cannot allocate enough memory to hold all the data structures, scandir returns -1. alphasort is a routine that alphabetically sorts an array of pointers to directory entries (built by the routine, scandir).

These routines are not available in the default SunOS 5.x release.