diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2019-08-13 13:18:06 -0700 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2019-10-23 12:43:31 -0700 |
commit | c82005921ed25cf22959d952c2aded4752f67d99 (patch) | |
tree | ea26b60c667aa0623a6eb36548cfa37074c04053 /sysdeps/unix/sysv/linux/generic/wordsize-32 | |
parent | 76aaa13d5d654a2ba0d59cd328b3f5425809aa7e (diff) | |
download | glibc-c82005921ed25cf22959d952c2aded4752f67d99.tar.gz glibc-c82005921ed25cf22959d952c2aded4752f67d99.tar.xz glibc-c82005921ed25cf22959d952c2aded4752f67d99.zip |
sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
On a 32-bit platform with a 64-bit ino_t type (__INO_T_MATCHES_INO64_T defined) we want to update the stat struct to remove the padding as it isn't required. As we don't have the padding we also need to update the overflow checker to not access the undefined members.
Diffstat (limited to 'sysdeps/unix/sysv/linux/generic/wordsize-32')
-rw-r--r-- | sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h index 45efcd8fd3..66546b07cc 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h @@ -36,12 +36,16 @@ static inline off_t lseek_overflow (loff_t res) static inline int stat_overflow (struct stat *buf) { +#if defined __INO_T_MATCHES_INO64_T + return 0; +#else if (buf->__st_ino_pad == 0 && buf->__st_size_pad == 0 && buf->__st_blocks_pad == 0) return 0; __set_errno (EOVERFLOW); return -1; +#endif } /* Note that f_files and f_ffree may validly be a sign-extended -1. */ |