David Schultz 18798c64f0 scandir(3) previously used st_size to obtain an initial estimate
of the array length needed to store all the directory entries.
Although BSD has historically guaranteed that st_size is the size
of the directory file, POSIX does not, and more to the point, some
recent filesystems such as ZFS use st_size to mean something else.

The fix is to not stat the directory at all, set the initial
array size to 32 entries, and realloc it in powers of 2 if that
proves insufficient.

PR:	113668
2008-03-16 19:08:53 +00:00
..
2007-12-02 22:21:30 +00:00
2007-06-10 19:06:09 +00:00
2008-02-06 23:25:29 +00:00
2007-12-21 12:00:16 +00:00
2007-10-16 02:10:44 +00:00
2007-04-09 01:45:30 +00:00