diff options
author | Bruno Haible <bruno@clisp.org> | 2017-05-14 14:20:01 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2017-05-14 17:38:24 +0200 |
commit | 8123b614e616eaa951d842f10730ba7b914f75b3 (patch) | |
tree | 73e656f9915d2cf1a033e90641ef136d9420f273 /doc/windows-stat-inodes.texi | |
parent | d75a6cfc4125de5b0ed14ca7d08e93ca98d5b16c (diff) | |
download | gnulib-8123b614e616eaa951d842f10730ba7b914f75b3.tar.gz |
windows-stat-inodes: New module.
* m4/windows-stat-inodes.m4: New file.
* m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_STAT_INODES.
* modules/sys_types (Makefile.am): Substitute WINDOWS_STAT_INODES.
* lib/sys_types.in.h [WINDOWS_STAT_INODES]: Override dev_t and ino_t.
(_GL_WINDOWS_STAT_INODES): New macro.
* lib/stat-w32.c: Set _WIN32_WINNT. Include <string.h>, verify.h.
(GetFileInformationByHandleExFunc): New variable.
(initialize): Initialize it.
(_gl_fstat_by_handle) [_GL_WINDOWS_STAT_INODES]: Initialize st_dev and
st_ino appropriately.
* lib/stat.c (rpl_stat): Use the directory entry based approach only as
a fallback, because it does not provide st_dev and st_ino values.
* modules/fstat (Depends-on): Add 'verify'.
* modules/windows-stat-inodes: New file.
* doc/windows-stat-inodes.texi: New file.
* doc/gnulib.texi: Include it.
* doc/posix-headers/sys_stat.texi: Mention the new module.
Diffstat (limited to 'doc/windows-stat-inodes.texi')
-rw-r--r-- | doc/windows-stat-inodes.texi | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/windows-stat-inodes.texi b/doc/windows-stat-inodes.texi new file mode 100644 index 0000000000..f3c05815e9 --- /dev/null +++ b/doc/windows-stat-inodes.texi @@ -0,0 +1,14 @@ +@node Inode numbers on Windows +@section Inode numbers on Windows + +The module @samp{windows-stat-inodes} ensures that, +on native Windows platforms, @code{struct stat} contains +@code{st_dev}, @code{st_ino} fields that are able to distinguish +different inodes. + +Note: Such values can only be provided for most files on the +file system. For a few files (such as inaccessible files), +@code{st_dev} and @code{st_ino} are set to 0. Therefore, +you should test whether @code{st_dev != 0 && st_ino != 0}, +before going to make inferences based on the file identity +based on @code{st_dev} and @code{st_ino}. |