History log of /netbsd-current/include/dirent.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.38 28-Dec-2022 nia

scandir(3) and alphasort(3) are part of POSIX-2008, so don't require
_NETBSD_SOURCE to use them.


Revision tags: netbsd-10-base
# 1.37 30-Dec-2021 nros

branches: 1.37.2;
Make fdopendir visible according to POSIX.1 spec.


Revision tags: netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.36 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.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base
# 1.35 30-Jul-2012 yamt

branches: 1.35.14;
comments


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.34 26-Sep-2010 yamt

branches: 1.34.6;
fix rewinddir on nfs. fix PR/42879 (and probably PR/40229.)


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.33 24-Feb-2009 christos

branches: 1.33.2;
version alphasort.


# 1.32 11-Jan-2009 christos

branches: 1.32.2;
merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.31 05-Dec-2008 ad

Add fdopendir(), from Solaris/Linux.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.30 09-Jan-2008 christos

branches: 1.30.14;
tell about getdents, not getdirentries


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.29 17-May-2006 christos

branches: 1.29.10;
rename dd_rewind to dd_internal so that it can be re-used to implement
telldir/seekdir/rewinddir differently. While there change the prototype
to telldir to take a non-const DIR, per:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html


# 1.28 26-Mar-2006 christos

PR/33124: Murray Armfield: readdir_r is missing a restrict qualifier.
http://www.opengroup.org/onlinepubs/000095399/basedefs/dirent.h.html


# 1.27 24-Jan-2006 christos

remove functions that we should not be exposing.


# 1.26 24-Jan-2006 christos

expose unlocked versions of readdir and telldir.


# 1.25 14-Sep-2005 christos

Fix opendir30 screwup and sort the compat defs for clarity.


# 1.24 13-Sep-2005 christos

compat code reorg


# 1.23 19-Aug-2005 christos

64 bit inode changes


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.22 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.21 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.20 28-May-2003 christos

add mutex locking and dirent_r.


# 1.19 29-Apr-2003 bjh21

Fix things so that _NETBSD_SOURCE correctly exposes the dirfd() and
the insides of struct _dirdesc. Also make the existence of struct
_dirdesc visible to POSIX applications since this is less ugly than
pretending that DIR is a void *.


# 1.18 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge nathanw_sa_end fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.17 16-Apr-2000 mrg

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.16 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.15 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 06-May-1998 kleink

Reorganize name space protection.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 10-Oct-1997 fvdl

oops. Checked in wrong dirent.h version. Add missing getdents prototype
to this one.


# 1.12 10-Oct-1997 fvdl

Correct comment: getdirentries() -> getdents()


# 1.11 13-Jul-1997 christos

Added missing __seekdir prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 05-Dec-1995 jtc

Changed to unconditionally include <sys/types.h> as required by X/Open XPG4.2.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 26-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.8 28-Dec-1994 mycroft

Sync with CSRG.


# 1.7 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.6 29-Aug-1994 mycroft

branches: 1.6.2;
Update to 4.4-Lite version.


Revision tags: netbsd-1-0-base
# 1.5 15-Dec-1993 jtc

Struct dirent definition moved to <sys/dirent.h>.


# 1.4 10-Dec-1993 jtc

Expand "u_long" & "u_short" to "unsigned long" and "unsigned short".
Some programs (like NSCA httpd) include <dirent.h> without first including
<sys/types.h> so the u_foo types aren't declared. I don't think POSIX.1
allows us to include <sys/types.h> in <dirent.h> either.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 04-Jun-1993 proven

Removed bugs and memory leaks from the directory functions.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.37 30-Dec-2021 nros

Make fdopendir visible according to POSIX.1 spec.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.36 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.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base
# 1.35 30-Jul-2012 yamt

branches: 1.35.14;
comments


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.34 26-Sep-2010 yamt

branches: 1.34.6;
fix rewinddir on nfs. fix PR/42879 (and probably PR/40229.)


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.33 24-Feb-2009 christos

branches: 1.33.2;
version alphasort.


# 1.32 11-Jan-2009 christos

branches: 1.32.2;
merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.31 05-Dec-2008 ad

Add fdopendir(), from Solaris/Linux.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.30 09-Jan-2008 christos

branches: 1.30.14;
tell about getdents, not getdirentries


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.29 17-May-2006 christos

branches: 1.29.10;
rename dd_rewind to dd_internal so that it can be re-used to implement
telldir/seekdir/rewinddir differently. While there change the prototype
to telldir to take a non-const DIR, per:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html


# 1.28 26-Mar-2006 christos

PR/33124: Murray Armfield: readdir_r is missing a restrict qualifier.
http://www.opengroup.org/onlinepubs/000095399/basedefs/dirent.h.html


# 1.27 24-Jan-2006 christos

remove functions that we should not be exposing.


# 1.26 24-Jan-2006 christos

expose unlocked versions of readdir and telldir.


# 1.25 14-Sep-2005 christos

Fix opendir30 screwup and sort the compat defs for clarity.


# 1.24 13-Sep-2005 christos

compat code reorg


# 1.23 19-Aug-2005 christos

64 bit inode changes


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.22 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.21 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.20 28-May-2003 christos

add mutex locking and dirent_r.


# 1.19 29-Apr-2003 bjh21

Fix things so that _NETBSD_SOURCE correctly exposes the dirfd() and
the insides of struct _dirdesc. Also make the existence of struct
_dirdesc visible to POSIX applications since this is less ugly than
pretending that DIR is a void *.


# 1.18 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge nathanw_sa_end fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.17 16-Apr-2000 mrg

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.16 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.15 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 06-May-1998 kleink

Reorganize name space protection.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 10-Oct-1997 fvdl

oops. Checked in wrong dirent.h version. Add missing getdents prototype
to this one.


# 1.12 10-Oct-1997 fvdl

Correct comment: getdirentries() -> getdents()


# 1.11 13-Jul-1997 christos

Added missing __seekdir prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 05-Dec-1995 jtc

Changed to unconditionally include <sys/types.h> as required by X/Open XPG4.2.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 26-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.8 28-Dec-1994 mycroft

Sync with CSRG.


# 1.7 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.6 29-Aug-1994 mycroft

branches: 1.6.2;
Update to 4.4-Lite version.


Revision tags: netbsd-1-0-base
# 1.5 15-Dec-1993 jtc

Struct dirent definition moved to <sys/dirent.h>.


# 1.4 10-Dec-1993 jtc

Expand "u_long" & "u_short" to "unsigned long" and "unsigned short".
Some programs (like NSCA httpd) include <dirent.h> without first including
<sys/types.h> so the u_foo types aren't declared. I don't think POSIX.1
allows us to include <sys/types.h> in <dirent.h> either.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 04-Jun-1993 proven

Removed bugs and memory leaks from the directory functions.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.36 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.


Revision tags: pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base
# 1.35 30-Jul-2012 yamt

comments


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.34 26-Sep-2010 yamt

branches: 1.34.6;
fix rewinddir on nfs. fix PR/42879 (and probably PR/40229.)


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.33 24-Feb-2009 christos

branches: 1.33.2;
version alphasort.


# 1.32 11-Jan-2009 christos

branches: 1.32.2;
merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.31 05-Dec-2008 ad

Add fdopendir(), from Solaris/Linux.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.30 09-Jan-2008 christos

branches: 1.30.14;
tell about getdents, not getdirentries


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.29 17-May-2006 christos

branches: 1.29.10;
rename dd_rewind to dd_internal so that it can be re-used to implement
telldir/seekdir/rewinddir differently. While there change the prototype
to telldir to take a non-const DIR, per:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html


# 1.28 26-Mar-2006 christos

PR/33124: Murray Armfield: readdir_r is missing a restrict qualifier.
http://www.opengroup.org/onlinepubs/000095399/basedefs/dirent.h.html


# 1.27 24-Jan-2006 christos

remove functions that we should not be exposing.


# 1.26 24-Jan-2006 christos

expose unlocked versions of readdir and telldir.


# 1.25 14-Sep-2005 christos

Fix opendir30 screwup and sort the compat defs for clarity.


# 1.24 13-Sep-2005 christos

compat code reorg


# 1.23 19-Aug-2005 christos

64 bit inode changes


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.22 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.21 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.20 28-May-2003 christos

add mutex locking and dirent_r.


# 1.19 29-Apr-2003 bjh21

Fix things so that _NETBSD_SOURCE correctly exposes the dirfd() and
the insides of struct _dirdesc. Also make the existence of struct
_dirdesc visible to POSIX applications since this is less ugly than
pretending that DIR is a void *.


# 1.18 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge nathanw_sa_end fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.17 16-Apr-2000 mrg

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.16 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.15 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 06-May-1998 kleink

Reorganize name space protection.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 10-Oct-1997 fvdl

oops. Checked in wrong dirent.h version. Add missing getdents prototype
to this one.


# 1.12 10-Oct-1997 fvdl

Correct comment: getdirentries() -> getdents()


# 1.11 13-Jul-1997 christos

Added missing __seekdir prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 05-Dec-1995 jtc

Changed to unconditionally include <sys/types.h> as required by X/Open XPG4.2.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 26-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.8 28-Dec-1994 mycroft

Sync with CSRG.


# 1.7 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.6 29-Aug-1994 mycroft

branches: 1.6.2;
Update to 4.4-Lite version.


Revision tags: netbsd-1-0-base
# 1.5 15-Dec-1993 jtc

Struct dirent definition moved to <sys/dirent.h>.


# 1.4 10-Dec-1993 jtc

Expand "u_long" & "u_short" to "unsigned long" and "unsigned short".
Some programs (like NSCA httpd) include <dirent.h> without first including
<sys/types.h> so the u_foo types aren't declared. I don't think POSIX.1
allows us to include <sys/types.h> in <dirent.h> either.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 04-Jun-1993 proven

Removed bugs and memory leaks from the directory functions.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision