From 92b3a3ebc05e3ce0e84a1ccff46487ca2200b471 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 6 Oct 2020 17:07:00 +1100 Subject: 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. --- dosish.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dosish.h') diff --git a/dosish.h b/dosish.h index 1860a0f066..3580693c90 100644 --- a/dosish.h +++ b/dosish.h @@ -70,7 +70,11 @@ * to include and 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 -- cgit v1.2.1