Differential D129371 Diff 446064 compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
# include <sys/statfs.h> | # include <sys/statfs.h> | ||||
# include <linux/perf_event.h> | # include <linux/perf_event.h> | ||||
# endif | # endif | ||||
using namespace __sanitizer; | using namespace __sanitizer; | ||||
# if !defined(__powerpc64__) && !defined(__x86_64__) && \ | # if !defined(__powerpc64__) && !defined(__x86_64__) && \ | ||||
!defined(__aarch64__) && !defined(__mips__) && !defined(__s390__) && \ | !defined(__aarch64__) && !defined(__mips__) && !defined(__s390__) && \ | ||||
!defined(__sparc__) && !defined(__riscv) && !defined(__hexagon__) | !defined(__sparc__) && !defined(__riscv) && !defined(__hexagon__) && \ | ||||
!defined(__loongarch__) | |||||
COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat)); | COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat)); | ||||
#endif | #endif | ||||
COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); | COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); | ||||
MaskRay: Do newer kernel ports use another `struct stat`? | |||||
Initially I used "0" for struct_kernel_stat_sz, because the kernel does not provide struct stat anymore. At last it turn out we should use the size of struct stat in libc, not kernel. I'll remove this #if pair. But I'd say _kernel in the name struct_kernel_stat_sz is completely misleading, and it's [already causing misunderstandings][1]. Maybe we should rename struct_kernel_*_sz to struct_os_stat_sz or something later. [1]: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598096.html xry111: Initially I used "0" for `struct_kernel_stat_sz`, because the kernel does not provide `struct… | |||||
#if defined(__i386__) | #if defined(__i386__) | ||||
COMPILER_CHECK(struct_kernel_stat64_sz == sizeof(struct stat64)); | COMPILER_CHECK(struct_kernel_stat64_sz == sizeof(struct stat64)); | ||||
#endif | #endif | ||||
CHECK_TYPE_SIZE(io_event); | CHECK_TYPE_SIZE(io_event); | ||||
CHECK_SIZE_AND_OFFSET(io_event, data); | CHECK_SIZE_AND_OFFSET(io_event, data); | ||||
CHECK_SIZE_AND_OFFSET(io_event, obj); | CHECK_SIZE_AND_OFFSET(io_event, obj); | ||||
Show All 28 Lines |
Do newer kernel ports use another struct stat?