47
53
unsigned struct_rusage_sz = sizeof(struct rusage);
48
54
unsigned struct_tm_sz = sizeof(struct tm);
49
55
unsigned struct_passwd_sz = sizeof(struct passwd);
56
unsigned struct_group_sz = sizeof(struct group);
50
57
unsigned siginfo_t_sz = sizeof(siginfo_t);
51
58
unsigned struct_sigaction_sz = sizeof(struct sigaction);
52
59
unsigned struct_itimerval_sz = sizeof(struct itimerval);
53
60
unsigned pthread_t_sz = sizeof(pthread_t);
61
unsigned struct_sockaddr_sz = sizeof(struct sockaddr);
55
63
#if !SANITIZER_ANDROID
56
64
unsigned ucontext_t_sz = sizeof(ucontext_t);
103
111
struct sigaction *a = (struct sigaction *)act;
104
112
return a->sa_flags & SA_SIGINFO;
115
uptr __sanitizer_in_addr_sz(int af) {
117
return sizeof(struct in_addr);
118
else if (af == AF_INET6)
119
return sizeof(struct in6_addr);
106
123
} // namespace __sanitizer
108
125
COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t));
109
126
COMPILER_CHECK(sizeof(__sanitizer::struct_sigaction_max_sz) >=
110
127
sizeof(__sanitizer::struct_sigaction_sz));
129
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_addr) ==
130
offsetof(struct dl_phdr_info, dlpi_addr));
131
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_name) ==
132
offsetof(struct dl_phdr_info, dlpi_name));
133
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_phdr) ==
134
offsetof(struct dl_phdr_info, dlpi_phdr));
135
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_phnum) ==
136
offsetof(struct dl_phdr_info, dlpi_phnum));
139
COMPILER_CHECK(sizeof(struct __sanitizer_addrinfo) == sizeof(struct addrinfo));
140
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_addr) ==
141
offsetof(struct addrinfo, ai_addr));
142
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_canonname) ==
143
offsetof(struct addrinfo, ai_canonname));
144
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_next) ==
145
offsetof(struct addrinfo, ai_next));
147
COMPILER_CHECK(sizeof(struct __sanitizer_hostent) == sizeof(struct hostent));
148
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_name) ==
149
offsetof(struct hostent, h_name));
150
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_aliases) ==
151
offsetof(struct hostent, h_aliases));
152
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_addr_list) ==
153
offsetof(struct hostent, h_addr_list));
111
155
#endif // SANITIZER_LINUX || SANITIZER_MAC