Home | History | Annotate | Download | only in gen
History log of /src/lib/libc/gen/scandir.c
RevisionDateAuthorComments
 1.30  12-Mar-2022  christos reallocarr returns errno. preserve it.
 1.29  29-Oct-2021  nia scandir(3): Convert malloc(x * y) and realloc(x * y) to reallocarr
 1.28  16-Dec-2016  mrg scandir/alphasort take "const struct dirent **" not "const void *" in
modern unix. since we claim to be 'IEEE Std 1003.1-2008', make it so.
 1.27  13-Mar-2012  christos branches: 1.27.14;
PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.26  09-Jun-2007  christos branches: 1.26.36;
PR/36464: scandir(3) corrupts heap when run on ZFS directories because ZFS
returns the number of entries as the directory size.
Use a new, more conservative entries estimator.
 1.25  13-Sep-2005  christos branches: 1.25.4; 1.25.6;
compat core reorg.
 1.24  19-Aug-2005  christos 64 bit inode changes
 1.23  17-Mar-2005  kleink Rename select argument to selectfn to avoid a shadowing warning.
 1.22  07-Aug-2003  agc branches: 1.22.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.21  21-Nov-2001  enami Cosmetic changse.
 1.20  21-Nov-2001  enami Extend an array before allocating an element. This makes cleanup code a bit
simpler since we no longer need to worry about an element not in an array yet.
 1.19  25-Oct-2001  yamt avoid leaks in the case of error.
 1.18  16-Apr-2000  mrg branches: 1.18.6;
make scandir(3)'s 3rd argument take a function that takes a *const*
struct dirent *, rather than non-const. this makes scandir(3) the
same as the scandir implementations in libiberty and glibc, and the
select function has no need to modify the dirent.
 1.17  22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.16  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.15  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.14  13-Nov-1998  christos delint
 1.13  26-Aug-1998  perry fix bcopy->memcpy with memcpy->memmove -- not strictly needed, but...
 1.12  10-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.11  27-Feb-1998  perry trivial changes to quiet lint.
 1.10  03-Feb-1998  perry remove obsolete register declarations
 1.9  03-Aug-1997  mikel don't forget d_type when copying dirent structure; from Giles Lean in
PR lib/3913. also, replace d_ino with d_fileno.
 1.8  21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7  13-Jul-1997  christos Fix RCSID's
 1.6  25-Feb-1995  cgd branches: 1.6.4;
clean up Id's on files previously imported...
 1.5  27-Jul-1994  jtc branches: 1.5.2; 1.5.4;
Add RCS Id's
 1.4  27-Jul-1994  jtc Sync with 4.4 lite
 1.3  26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2  30-Jul-1993  mycroft Add even more RCS frobs.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  27-Jul-1994  jtc opendir() & friends from 4.4lite.
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.4.1  26-Apr-1995  jtc #include "namespace.h"
Added __weak_reference defns.
 1.5.2.2  27-Jul-1994  jtc Add RCS Id's
 1.5.2.1  27-Jul-1994  jtc file scandir.c was added on branch netbsd-1-0 on 1994-07-27 14:39:51 +0000
 1.6.4.1  16-Sep-1996  jtc snapshot namespace cleanup
 1.18.6.2  28-Jan-2002  nathanw Catch up to -current.
 1.18.6.1  14-Nov-2001  nathanw Catch up to -current.
 1.22.6.1  12-Jun-2007  liamjfoy Pull up following revision(s) (requested by christos in ticket #1803):

Be more conservative about computing the number of entries in
the directory. Avoids core-dump with ZFS filesystems (they return
the number of entries in stat(2) instead of the size in st_size)
 1.25.6.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.25.4.1  12-Jun-2007  liamjfoy Pull up following revision(s) (requested by christos in ticket #717):
lib/libc/gen/scandir.c: revision 1.26
PR/36464: scandir(3) corrupts heap when run on ZFS directories because ZFS
returns the number of entries as the directory size.
Use a new, more conservative entries estimator.
 1.26.36.1  17-Apr-2012  yamt sync with head
 1.27.14.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)

RSS XML Feed