sanitizer_platform_limits_linux.cc revision 1bb2229028dd78280d24c26b9efbe8476d966e05
1//===-- sanitizer_platform_limits_linux.cc --------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file is a part of Sanitizer common code. 11// 12// Sizes and layouts of linux kernel data structures. 13//===----------------------------------------------------------------------===// 14 15// This is a separate compilation unit for linux headers that conflict with 16// userspace headers. 17// Most "normal" includes go in sanitizer_platform_limits_posix.cc 18 19#include "sanitizer_platform.h" 20#if SANITIZER_LINUX 21 22// This header seems to contain the definitions of _kernel_ stat* structs. 23#include <asm/stat.h> 24#include <linux/aio_abi.h> 25 26#if SANITIZER_ANDROID 27#include <asm/statfs.h> 28#else 29#include <sys/statfs.h> 30#endif 31 32#if !SANITIZER_ANDROID 33#include <linux/perf_event.h> 34#endif 35 36namespace __sanitizer { 37 unsigned struct___old_kernel_stat_sz = sizeof(struct __old_kernel_stat); 38 unsigned struct_kernel_stat_sz = sizeof(struct stat); 39 unsigned struct_io_event_sz = sizeof(struct io_event); 40 unsigned struct_iocb_sz = sizeof(struct iocb); 41 unsigned struct_statfs64_sz = sizeof(struct statfs64); 42 43#ifndef _LP64 44 unsigned struct_kernel_stat64_sz = sizeof(struct stat64); 45#else 46 unsigned struct_kernel_stat64_sz = 0; 47#endif 48 49#if !SANITIZER_ANDROID 50 unsigned struct_perf_event_attr_sz = sizeof(struct perf_event_attr); 51#endif 52} // namespace __sanitizer 53 54#endif // SANITIZER_LINUX 55