diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-06-03 21:44:09 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-06-03 21:44:09 +0400 |
commit | b3c297314238dad32354d819bce0e6b94f632a65 (patch) | |
tree | 86d1100668ed5550dc6d788c3039de78ae9c7a4b /winsup/cygwin/include | |
parent | 656c31920bcccd705d53e15f0184fc0e5e769a6a (diff) |
* syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
(fstat64): Add evaluating st_ino and st_dev.
(stat_worker): Evaluate st_dev as 32 bit value.
* include/cygwin/stat.h: Use new dev_t definition throughout.
* include/cygwin/types.h: Define __dev16_t and __dev32_t. Define
dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
* include/sys/sysmacros.h: Define major, minor and makedev
according to __CYGWIN_USE_BIG_TYPES__ setting.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/cygwin/stat.h | 8 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/types.h | 8 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/sysmacros.h | 8 |
3 files changed, 19 insertions, 5 deletions
diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h index 90abc3999..0ac22a679 100644 --- a/winsup/cygwin/include/cygwin/stat.h +++ b/winsup/cygwin/include/cygwin/stat.h @@ -19,13 +19,13 @@ extern "C" { #ifdef __INSIDE_CYGWIN__ struct __stat32 { - dev_t st_dev; + __dev16_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid16_t st_uid; __gid16_t st_gid; - dev_t st_rdev; + __dev16_t st_rdev; __off32_t st_size; time_t st_atime; long st_spare1; @@ -40,13 +40,13 @@ struct __stat32 struct __stat64 { - dev_t st_dev; + __dev32_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid32_t st_uid; __gid32_t st_gid; - dev_t st_rdev; + __dev32_t st_rdev; __off64_t st_size; time_t st_atime; long st_spare1; diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index 92b60b7a3..8f9f16105 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -27,6 +27,14 @@ typedef __off64_t off_t; typedef __off32_t off_t; #endif +typedef short __dev16_t; +typedef unsigned long __dev32_t; +#ifdef __CYGWIN_USE_BIG_TYPES__ +typedef __dev32_t dev_t; +#else +typedef __dev16_t dev_t; +#endif + typedef long blksize_t; typedef long __blkcnt32_t; diff --git a/winsup/cygwin/include/sys/sysmacros.h b/winsup/cygwin/include/sys/sysmacros.h index cc3a69160..2c9c69923 100644 --- a/winsup/cygwin/include/sys/sysmacros.h +++ b/winsup/cygwin/include/sys/sysmacros.h @@ -11,8 +11,14 @@ details. */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H +#ifdef __CYGWIN_USE_BIG_TYPES__ +#define major(dev) ((int)(((dev) >> 16) & 0xffff)) +#define minor(dev) ((int)((dev) & 0xffff)) +#define makedev(major, minor) (((major) << 16) | ((minor) & 0xffff)) +#else #define major(dev) ((int)(((dev) >> 8) & 0xff)) #define minor(dev) ((int)((dev) & 0xff)) -#define makedev(major, minor) (((major) << 8) | (minor)) +#define makedev(major, minor) (((major) << 8) | ((minor) & 0xff)) +#endif #endif /* _SYS_SYSMACROS_H */ |