summaryrefslogtreecommitdiff
path: root/dosish.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-10-06 17:07:00 +1100
committerTony Cook <tony@develop-help.com>2020-12-01 15:29:33 +1100
commit92b3a3ebc05e3ce0e84a1ccff46487ca2200b471 (patch)
treefbeb49a61e3dca1e48e9382b4e316b430628623a /dosish.h
parentc1ec4bdd803f587dd2ae76548bca0ae59d0fe84b (diff)
downloadperl-92b3a3ebc05e3ce0e84a1ccff46487ca2200b471.tar.gz
Win32: add lstat(), fetch st_dev and st_ino and fetch st_nlink for fstat
We need lstat() for various modules to work well with symlinks, and the same modules often want to check for matches on the device and inode number. The values we're using for st_ino match those that the Python and Rust libraries use, and Go uses the same volume and file index values for testing if two stat objects refer to the same file. They aren't entirely unique, given ReFS uses 128-bit file ids, but the API used to check for this (GetFileInformationByHandleEx() for FileIdInfo) is only available on server operating systems, so I can't directly test it anyway.
Diffstat (limited to 'dosish.h')
-rw-r--r--dosish.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/dosish.h b/dosish.h
index 1860a0f066..3580693c90 100644
--- a/dosish.h
+++ b/dosish.h
@@ -70,7 +70,11 @@
* to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
* information.
*/
-#define Stat_t struct _stati64
+#if defined(WIN32)
+# define Stat_t struct w32_stat
+#else
+# define Stat_t struct _stati64
+#endif
/* USE_STAT_RDEV:
* This symbol is defined if this system has a stat structure declaring