diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-10 17:26:58 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-10 17:26:58 +0000 |
commit | 91de3d6539ca93366cf5f5de0a26b4474ccecab2 (patch) | |
tree | cb55186ebd1f798232d7665e1dd2fb0a3f74d255 /include/ruby/win32.h | |
parent | 4cfc1aa9591714b0d9ccc9a8f5ce4461a82db899 (diff) | |
download | ruby-91de3d6539ca93366cf5f5de0a26b4474ccecab2.tar.gz |
support 128bit ino on Windows (if available)
* win32/win32.c, include/ruby/win32.h (stati128, rb_{,u,l,ul}stati128): rename
from stati64ns, change the type of st_ino to 64bit and added st_inohigh.
* dir.c, file.c (stat, lstat): follow above changes.
* file.c (rb_stat_ino): support 128bit ino.
* win32/win32.c (rb_{,u,l,ul}stati128): ditto.
[Feature #13731]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/win32.h')
-rw-r--r-- | include/ruby/win32.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 82613a866a..6db757b6e3 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -172,10 +172,11 @@ typedef int clockid_t; #define unlink(p) rb_w32_unlink(p) #endif /* RUBY_EXPORT */ -/* same with stati64 except nanosecond timestamps */ -struct stati64ns { +/* same with stati64 except the size of st_ino and nanosecond timestamps */ +struct stati128 { _dev_t st_dev; - _ino_t st_ino; + unsigned __int64 st_ino; + __int64 st_inohigh; unsigned short st_mode; short st_nlink; short st_uid; @@ -192,19 +193,21 @@ struct stati64ns { #if SIZEOF_OFF_T == 8 #define off_t __int64 -#define stat stati64ns +#define stat stati128 +#define SIZEOF_STRUCT_STAT_ST_INO sizeof(unsigned __int64) +#define HAVE_STRUCT_STAT_ST_INOHIGH #define HAVE_STRUCT_STAT_ST_ATIMENSEC #define HAVE_STRUCT_STAT_ST_MTIMENSEC #define HAVE_STRUCT_STAT_ST_CTIMENSEC -#define fstat(fd,st) rb_w32_fstati64ns(fd,st) -#define stati64ns(path, st) rb_w32_stati64ns(path, st) +#define fstat(fd,st) rb_w32_fstati128(fd,st) +#define stati128(path, st) rb_w32_stati128(path,st) #else #define stat(path,st) rb_w32_stat(path,st) #define fstat(fd,st) rb_w32_fstat(fd,st) extern int rb_w32_stat(const char *, struct stat *); extern int rb_w32_fstat(int, struct stat *); #endif -#define lstat(path,st) rb_w32_lstati64ns(path,st) +#define lstat(path,st) rb_w32_lstati128(path,st) #define access(path,mode) rb_w32_access(path,mode) #define strcasecmp _stricmp @@ -335,14 +338,14 @@ extern int rb_w32_urmdir(const char *); extern int rb_w32_unlink(const char *); extern int rb_w32_uunlink(const char *); extern int rb_w32_uchmod(const char *, int); -extern int rb_w32_stati64ns(const char *, struct stati64ns *); -extern int rb_w32_ustati64ns(const char *, struct stati64ns *); -extern int rb_w32_lstati64ns(const char *, struct stati64ns *); -extern int rb_w32_ulstati64ns(const char *, struct stati64ns *); +extern int rb_w32_stati128(const char *, struct stati128 *); +extern int rb_w32_ustati128(const char *, struct stati128 *); +extern int rb_w32_lstati128(const char *, struct stati128 *); +extern int rb_w32_ulstati128(const char *, struct stati128 *); extern int rb_w32_access(const char *, int); extern int rb_w32_uaccess(const char *, int); extern char rb_w32_fd_is_text(int); -extern int rb_w32_fstati64ns(int, struct stati64ns *); +extern int rb_w32_fstati128(int, struct stati128 *); extern int rb_w32_dup2(int, int); #include <float.h> |