1 //===-- sanitizer_platform_limits_posix.h ---------------------------------===// 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 platform-specific POSIX data structures. 13 //===----------------------------------------------------------------------===// 14 15 #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H 16 #define SANITIZER_PLATFORM_LIMITS_POSIX_H 17 18 namespace __sanitizer { 19 extern unsigned struct_utsname_sz; 20 extern unsigned struct_stat_sz; 21 extern unsigned struct_stat64_sz; 22 extern unsigned struct_rusage_sz; 23 extern unsigned struct_tm_sz; 24 25 #if defined(__linux__) 26 extern unsigned struct_rlimit_sz; 27 extern unsigned struct_dirent_sz; 28 extern unsigned struct_statfs_sz; 29 extern unsigned struct_epoll_event_sz; 30 #endif // __linux__ 31 32 #if defined(__linux__) && !defined(__ANDROID__) 33 extern unsigned struct_dirent64_sz; 34 extern unsigned struct_rlimit64_sz; 35 extern unsigned struct_statfs64_sz; 36 #endif // __linux__ && !__ANDROID__ 37 38 void* __sanitizer_get_msghdr_iov_iov_base(void* msg, int idx); 39 uptr __sanitizer_get_msghdr_iov_iov_len(void* msg, int idx); 40 uptr __sanitizer_get_msghdr_iovlen(void* msg); 41 uptr __sanitizer_get_socklen_t(void* socklen_ptr); 42 43 // This thing depends on the platform. We are only interested in the upper 44 // limit. Verified with a compiler assert in .cc. 45 const int pthread_attr_t_max_sz = 128; 46 union __sanitizer_pthread_attr_t { 47 char size[pthread_attr_t_max_sz]; // NOLINT 48 void *align; 49 }; 50 } // namespace __sanitizer 51 52 #endif 53