summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/scandir.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* All these files include <stdlib.h>, so do not need to castderaadt2015-08-201-3/+3
| | | | malloc/calloc/realloc* returns.
* Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@millert2015-02-051-2/+2
|
* Move to the <limits.h> universe.deraadt2015-01-161-3/+5
| | | | review by millert, binary checking process with doug, concept with guenther
* obvious reallocarray()deraadt2014-10-081-3/+3
|
* add some prototypes, casts, includes, parenthesis, and whatnot totedu2013-04-171-2/+3
| | | | silence some warnings.
* Change scandir()'s 'select' argument fromguenther2012-11-291-2/+2
| | | | | | | | | int (*)(struct dirent *) to int (*)(const struct dirent *) to match POSIX. ok millert@, ports check by naddy@
* Make DIR a private type within libc, give it the same underlyingmatthew2012-03-221-1/+2
| | | | | | typedef regardless of __BSD_VISIBLE, and eliminate the dirfd() macro. ok guenther@
* Update alphasort() and scandir()'s argument types to match POSIX:guenther2012-03-221-5/+5
| | | | | | | use "const struct dirent **" instead of "const void *". Also, add __restrict to readdir_r(). ok matthew@
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-2/+2
|
* It seems st_size is not always a good estimator for the number ofray2007-06-261-5/+7
| | | | | | | | | | | | | | | | directory entries. ZFS, for instance, sets st_size to the number of entries. Use the same algorithm for the initial estimate but keep a minimum to prevent a divide by zero. When the buffer is filled, instead of re-using the same flawed algorithm, double the buffer size. Also add check for integer overflow. Bug reported by Ed Ravin, ZFS testing environment provided by Bryan Allen. OK millert
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* ansify function definitions and zap some `register'jfb2004-05-181-9/+4
| | | | ok millert@
* don't leak memory. free and netbsd via Patrick Latifitedu2004-03-051-29/+37
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* malloc paranoia; it is unlikely that any filesystem will supportmillert2002-07-301-1/+7
| | | | | enough directory entries to cause a problem but it is good form anyway. deraadt@ OK.
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-3/+3
|
* realloc repairderaadt1998-08-141-3/+9
|
* copy d_type; giles@nemeton.com.auderaadt1997-07-241-1/+2
|
* Fix RCS idstholo1996-08-191-7/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+141