MFC r235647 for newsyslog (by gleb):
Hide DIR definition by making it an opaque struct typedef.
Introduce dirfd() libc exported symbol replacing macro with same name,
preserve _dirfd() macro for internal use.
Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable
name to prevent shadowing global symbol.
MFC r250545:
Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.
MFC r251240:
We want to stat the archived log file rather than the logfile itself.
git-svn-id: svn://svn.freebsd.org/base/stable/8@251533
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f