diff options
author | Christopher Faylor <me@cgf.cx> | 2006-01-21 02:24:17 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-01-21 02:24:17 +0000 |
commit | 868fb2ff6992142de60d6ff31da0ac84ddcf9363 (patch) | |
tree | f03159b6200450e06f348f4b67ddcc3585e754c3 /winsup/cygwin/include/sys/dirent.h | |
parent | 54abc854d09c5b411a22406de19cbd7cdf88e748 (diff) | |
download | cygnal-868fb2ff6992142de60d6ff31da0ac84ddcf9363.tar.gz cygnal-868fb2ff6992142de60d6ff31da0ac84ddcf9363.tar.bz2 cygnal-868fb2ff6992142de60d6ff31da0ac84ddcf9363.zip |
* include/cygwin/version.h: Bump API minor number to 151.
* 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.
Diffstat (limited to 'winsup/cygwin/include/sys/dirent.h')
-rw-r--r-- | winsup/cygwin/include/sys/dirent.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys/dirent.h index b17c2e91d..511fbb373 100644 --- a/winsup/cygwin/include/sys/dirent.h +++ b/winsup/cygwin/include/sys/dirent.h @@ -16,27 +16,16 @@ #define __DIRENT_VERSION 2 #pragma pack(push,4) -#ifdef __INSIDE_CYGWIN__ +#if defined(__INSIDE_CYGWIN__) || defined (__CYGWIN_USE_BIG_TYPES__) struct dirent { - long d_version; /* Used since Cygwin 1.3.3. */ - __ino64_t __invalid_d_ino; /* DO NOT USE: No longer available since cygwin 1.5.19 */ - long d_fd; /* File descriptor of open directory. - Used since Cygwin 1.3.3. */ - unsigned __invalid_ino32; /* DO NOT USE: No longer available since cygwin 1.5.19 */ + long __d_version; /* Used internally */ + __ino64_t __dirent_internal; + __uint32_t __dirent_unused1; + __uint32_t __dirent_internal1; char d_name[256]; /* FIXME: use NAME_MAX? */ }; #else -#ifdef __CYGWIN_USE_BIG_TYPES__ -struct dirent -{ - long d_version; - ino_t __invalid_d_ino; /* DO NOT USE: No longer available since cygwin 1.5.19 */ - long d_fd; - unsigned long __invalid_ino32; /* DO NOT USE: No longer available since cygwin 1.5.19 */ - char d_name[256]; -}; -#else struct dirent { long d_version; @@ -46,7 +35,6 @@ struct dirent char d_name[256]; }; #endif -#endif #pragma pack(pop) #define __DIRENT_COOKIE 0xdede4242 @@ -59,14 +47,22 @@ typedef struct __DIR struct dirent *__d_dirent; char *__d_dirname; /* directory name with trailing '*' */ _off_t __d_position; /* used by telldir/seekdir */ - __ino64_t __d_dirhash; /* hash of directory name for use by readdir */ + int __d_fd; + unsigned __d_unused; void *__handle; void *__fh; unsigned __flags; } DIR; #pragma pack(pop) +#ifndef __USE_EXPENSIVE_CYGWIN_D_INO DIR *opendir (const char *); +#else +#define d_ino __dirent_internal +DIR *__opendir_with_d_ino (const char *); +#define opendir __opendir_with_d_ino +#endif + struct dirent *readdir (DIR *); int readdir_r (DIR *, struct dirent *, struct dirent **); void rewinddir (DIR *); |