sanitizer_platform_limits_linux.cc revision 639df402c4925acd3ea7bebff729a535e3f79964
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 <linux/perf_event.h> 28#endif 29 30namespace __sanitizer { 31 unsigned struct___old_kernel_stat_sz = sizeof(struct __old_kernel_stat); 32 unsigned struct_kernel_stat_sz = sizeof(struct stat); 33 unsigned struct_io_event_sz = sizeof(struct io_event); 34 unsigned struct_iocb_sz = sizeof(struct iocb); 35 36#ifndef _LP64 37 unsigned struct_kernel_stat64_sz = sizeof(struct stat64); 38#else 39 unsigned struct_kernel_stat64_sz = 0; 40#endif 41 42#if !SANITIZER_ANDROID 43 unsigned struct_perf_event_attr_sz = sizeof(struct perf_event_attr); 44#endif 45} // namespace __sanitizer 46 47#endif // SANITIZER_LINUX 48