diff options
author | Tony Cook <tony@develop-help.com> | 2021-07-09 10:22:40 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2021-09-01 10:59:44 +1000 |
commit | 9b5699737a6b587546239d586832f420cf7f2dea (patch) | |
tree | 37f4fec318866b00f20095ba66f60faa44788cd6 /uconfig.h | |
parent | b852e1da77b497e086508451bebff00541073fb1 (diff) | |
download | perl-9b5699737a6b587546239d586832f420cf7f2dea.tar.gz |
detect struct stat.st_dev's size and signedness, and return it safely
On FreeBSD dev_t (and hence the st_dev member of struct stat) is an
unsigned 64-bit integer, and the previous simple PUSHi() corrupted
that.
A previous version of this reflected the st_ino code and implemented
our own number to string conversion, but a system with such a large
st_dev should be assumed to have inttypes.h, and an intmax_t which is
no smaller than st_dev.
The st_ino code could probably be changed similarly, but 64-bit inode
numbers are not a new thing, so it may be riskier.
Diffstat (limited to 'uconfig.h')
-rw-r--r-- | uconfig.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -4163,6 +4163,13 @@ */ #define SELECT_MIN_BITS 32 /**/ +/* ST_DEV_SIZE: + * This variable contains the size of struct stat's st_dev in bytes. + */ +/* ST_DEV_SIGN: + * This symbol holds the signedness of struct stat's st_dev. + * 1 for unsigned, -1 for signed. + */ /* ST_INO_SIZE: * This variable contains the size of struct stat's st_ino in bytes. */ @@ -4170,6 +4177,8 @@ * This symbol holds the signedness of struct stat's st_ino. * 1 for unsigned, -1 for signed. */ +#define ST_DEV_SIGN 1 /* st_dev sign */ +#define ST_DEV_SIZE 4 /* st_dev size */ #define ST_INO_SIGN 1 /* st_ino sign */ #define ST_INO_SIZE 4 /* st_ino size */ @@ -5318,6 +5327,6 @@ #endif /* Generated from: - * f88762343858d290ac1b2bce8613d97ce15c18eada7a5a587fb9b8a8053d0d7f config_h.SH - * 24570f2ff38b22b436d34127ff85a3f3a075a4dea1359c56f16196bdbe376b1c uconfig.sh + * 4769474cd122c46e0efc0224475eb6401d7837cf93c9484af644422d1c5a68e3 config_h.SH + * 9aacfe7bf1c55c60b2116e885bafc3f0852a9f52f1ba926d598dd6aa271aa8a2 uconfig.sh * ex: set ro: */ |