__d_internal.
* fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
(d_dirname): Remove useless "struct".
(d_cachepos): Ditto.
(d_cache): Ditto.
(class __DIR_mounts): New class, implementing mount point tracking
for readdir.
(d_mounts): New macro for easy access to __DIR_mounts structure.
(fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
let __d_internal element of dir point to it.
(fhandler_disk_file::readdir_helper): Add mount points in the current
directory, which don't have a real directory backing them.
Don't generate an inode number for /dev. Add comment, why.
(fhandler_disk_file::readdir): Move filling fname to an earlier point.
Check if current entry is a mount point and evaluate correct inode
number for it.
(fhandler_disk_file::readdir_9x): Ditto.
(fhandler_disk_file::rewinddir): Set all mount points in this directory
to "not found" so that they are listed again after calling rewinddir().
(fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
* path.cc (mount_info::get_mounts_here): New method to evaluate a list
of mount points in a given parent directory.
* shared_info.h (class mount_info): Declare get_mounts_here.
* dir.cc (__opendir_with_d_ino): Just call opendir.
(opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
(readdir_worker): Only try generating d_ino if it's 0.
Utilize namehash of directories fhandler. Call readdir_get_ino to
generate d_ino for "..".
(seekdir64): Keep dirent_set_d_ino flag.
* fhandler.h (enum dirent_states): Add dirent_get_d_ino.
(class fhandler_disk_file): Declare new private methods readdir_helper
and readdir_9x.
* fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
evaluate if a filesystem has reliable inode numbers.
(fhandler_base::fstat_by_handle): Accomodate structure member name
change from IndexNumber to FileId.
(fhandler_base::fstat_helper): Call hasgood_inode here.
(fhandler_disk_file::opendir): Call fhaccess only for real files.
Don't append '*' to __d_dirname here, move to readdir_9x. On NT,
open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino
flags according to wincap and filesystem.
(fhandler_disk_file::readdir_helper): New method to implement readdir
postprocessing only once.
(readdir_get_ino_by_handle): New static function.
(readdir_get_ino): New function to centralize inode number evaluation
in case inode number hasn't been returned by NtQueryDirectoryFile.
(fhandler_disk_file::readdir): Move old functionality to readdir_9x.
Call readdir_9x when on 9x/Me. Implement NT specific readdir here.
(fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
(fhandler_disk_file::seekdir): Accomodate new NT readdir method.
(fhandler_disk_file::closedir): Ditto.
(fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
(fhandler_cygdrive::opendir): Call get_namehash to prepare later
correct evaluation of d_ino.
(fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
drive's d_ino by calling readdir_get_ino.
* fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
dirent_saw_dot_dot to avoid seeing . and .. entries twice.
* fhandler_process.cc (fhandler_process::readdir): Ditto.
* fhandler_registry.cc (fhandler_registry::readdir): Ditto.
* ntdll.h (STATUS_INVALID_PARAMETER): New define.
(STATUS_INVALID_LEVEL): New define.
(struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
FileId (as in Nebbitt).
* path.h (path_conv::hasgood_inode): Now implemented in
fhandler_disk_file.cc.
* wincap.h (wincaps::has_fileid_dirinfo): New element.
* wincap.cc: Implement above element throughout.
* winsup.h (readdir_get_ino): Add declaration.
* include/sys/dirent.h (struct dirent): Slightly rename structure
members to accomodate changes.
Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
__opendir_with_d_ino.
* dir.cc (__opendir_with_d_ino): New function.
(opendir): Set flag if we should be calculating inodes.
(readdir_worker): Calculate d_ino by calling stat if the user has asked for it.
(seekdir64): Maintain all persistent flag settings.
* fhandler.h (dirent_states): Add dirent_set_d_ino.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes to
dirent structure.
* fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
* include/sys/dirent.h (struct dirent): Coalesce two similar structures.
Remove all threads of the apparently highly confusing references to inodes.
Add support for calculating a real inode if __USE_EXPENSIVE_CYGWIN_D_INO is
defined.
* include/cygwin/version.h: Bump api minor number to 147, reflecting
obsolescence of d_ino.
(CYGWIN_VERSION_USER_API_VERSION_COMBINED): New convenience macro.
(CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): New convenience macro.
linux.
* include/cygwin/types.h: Include endian.h.
* include/sys/dirent.h: Define DT_* types and conversion macros.
* pinfo.cc (pinfo::init): Remove special handling for PID_ALLPIDS and execed
code, even though it probably still isn't quite right.
* include/sys/dirent.h (dirent): Remvoe old_d_ino.
(DIR): Make __d_dirhash a 64 bit value. Remove __d_data and __d_u. Add
__flags.
* dir.cc (opendir_states): New enum.
(opendir): Clear new DIR __flags field.
(readdir): Fill in '.' and '..' entries if we hit EOF and we haven't seen them
already. Nuke setting of old_d_ino.
(rewinddir): Reset DIR __flags field.
(seekdir64): Ditto.
* fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove special
handling of "." and ".." since they are now handled automatically.