freebsd-dev/lib/libc
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
..
amd64
arm
compat-43
db
gdtoa
gen scandir(3) previously used st_size to obtain an initial estimate 2008-03-16 19:08:53 +00:00
gmon
i386
ia64
include
inet
isc
locale
nameser
net
nls
posix1e Add __FBSDID() tags. 2008-03-07 15:25:56 +00:00
powerpc
quad
regex
resolv
rpc
softfloat
sparc64
stdio Add <limits.h> for SHRT_MAX. 2008-02-27 21:25:19 +00:00
stdlib Remove stale #include <machine/atomic.h>, which as needed by lazy 2008-03-07 16:54:03 +00:00
stdtime
string
sys Fix bugs in previous revision (missing comma, misspelled syscall name). 2008-03-13 10:33:24 +00:00
uuid
xdr
yp
Makefile
Versions.def