Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 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 | |
Sergey Matveev | 70db33e | 2013-10-11 14:19:14 +0000 | [diff] [blame] | 18 | #include "sanitizer_internal_defs.h" |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 19 | #include "sanitizer_platform.h" |
| 20 | |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 21 | namespace __sanitizer { |
| 22 | extern unsigned struct_utsname_sz; |
| 23 | extern unsigned struct_stat_sz; |
| 24 | extern unsigned struct_stat64_sz; |
| 25 | extern unsigned struct_rusage_sz; |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 26 | extern unsigned struct_passwd_sz; |
Evgeniy Stepanov | 103a63e | 2013-04-23 12:01:20 +0000 | [diff] [blame] | 27 | extern unsigned struct_group_sz; |
Evgeniy Stepanov | 897a4ae | 2013-04-09 14:34:59 +0000 | [diff] [blame] | 28 | extern unsigned siginfo_t_sz; |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 29 | extern unsigned struct_itimerval_sz; |
| 30 | extern unsigned pthread_t_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 31 | extern unsigned pid_t_sz; |
| 32 | extern unsigned timeval_sz; |
| 33 | extern unsigned uid_t_sz; |
Evgeniy Stepanov | 57a1095 | 2013-07-10 14:17:46 +0000 | [diff] [blame] | 34 | extern unsigned mbstate_t_sz; |
Evgeniy Stepanov | 639df40 | 2013-09-06 14:20:01 +0000 | [diff] [blame] | 35 | extern unsigned struct_timezone_sz; |
| 36 | extern unsigned struct_tms_sz; |
| 37 | extern unsigned struct_itimerspec_sz; |
| 38 | extern unsigned struct_sigevent_sz; |
| 39 | extern unsigned struct_sched_param_sz; |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 40 | |
| 41 | #if !SANITIZER_ANDROID |
Evgeniy Stepanov | 0727702 | 2013-04-04 09:03:56 +0000 | [diff] [blame] | 42 | extern unsigned ucontext_t_sz; |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 43 | #endif // !SANITIZER_ANDROID |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 44 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 45 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 639df40 | 2013-09-06 14:20:01 +0000 | [diff] [blame] | 46 | extern unsigned struct___old_kernel_stat_sz; |
| 47 | extern unsigned struct_kernel_stat_sz; |
| 48 | extern unsigned struct_kernel_stat64_sz; |
| 49 | extern unsigned struct_io_event_sz; |
| 50 | extern unsigned struct_iocb_sz; |
| 51 | extern unsigned struct_utimbuf_sz; |
| 52 | extern unsigned struct_new_utsname_sz; |
| 53 | extern unsigned struct_old_utsname_sz; |
| 54 | extern unsigned struct_oldold_utsname_sz; |
| 55 | extern unsigned struct_msqid_ds_sz; |
| 56 | extern unsigned struct_shmid_ds_sz; |
| 57 | extern unsigned struct_mq_attr_sz; |
| 58 | extern unsigned struct_perf_event_attr_sz; |
| 59 | extern unsigned struct_timex_sz; |
| 60 | extern unsigned struct_ustat_sz; |
| 61 | |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 62 | extern unsigned struct_rlimit_sz; |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 63 | extern unsigned struct_statfs_sz; |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 64 | extern unsigned struct_epoll_event_sz; |
Evgeniy Stepanov | 359d7fc | 2013-06-24 14:25:33 +0000 | [diff] [blame] | 65 | extern unsigned struct_sysinfo_sz; |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 66 | extern unsigned struct_timespec_sz; |
Evgeniy Stepanov | 639df40 | 2013-09-06 14:20:01 +0000 | [diff] [blame] | 67 | extern unsigned __user_cap_header_struct_sz; |
| 68 | extern unsigned __user_cap_data_struct_sz; |
| 69 | const unsigned old_sigset_t_sz = sizeof(unsigned long); |
| 70 | const unsigned struct_kexec_segment_sz = 4 * sizeof(unsigned long); |
| 71 | |
| 72 | struct __sanitizer___sysctl_args { |
| 73 | int *name; |
| 74 | int nlen; |
| 75 | void *oldval; |
| 76 | uptr *oldlenp; |
| 77 | void *newval; |
| 78 | uptr newlen; |
Evgeniy Stepanov | 9a4a159 | 2013-09-06 14:58:49 +0000 | [diff] [blame] | 79 | unsigned long ___unused[4]; |
Evgeniy Stepanov | 639df40 | 2013-09-06 14:20:01 +0000 | [diff] [blame] | 80 | }; |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 81 | #endif // SANITIZER_LINUX |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 82 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 83 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | b711ca6 | 2013-02-19 11:06:41 +0000 | [diff] [blame] | 84 | extern unsigned struct_rlimit64_sz; |
| 85 | extern unsigned struct_statfs64_sz; |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 86 | #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | b711ca6 | 2013-02-19 11:06:41 +0000 | [diff] [blame] | 87 | |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 88 | struct __sanitizer_iovec { |
| 89 | void *iov_base; |
| 90 | uptr iov_len; |
| 91 | }; |
| 92 | |
Evgeniy Stepanov | 8be684c | 2013-07-05 15:04:56 +0000 | [diff] [blame] | 93 | #if SANITIZER_MAC |
| 94 | typedef unsigned long __sanitizer_pthread_key_t; |
| 95 | #else |
Evgeniy Stepanov | 737da2f | 2013-07-05 12:31:07 +0000 | [diff] [blame] | 96 | typedef unsigned __sanitizer_pthread_key_t; |
Evgeniy Stepanov | 8be684c | 2013-07-05 15:04:56 +0000 | [diff] [blame] | 97 | #endif |
Evgeniy Stepanov | 737da2f | 2013-07-05 12:31:07 +0000 | [diff] [blame] | 98 | |
Evgeniy Stepanov | cf39032 | 2013-10-02 14:30:03 +0000 | [diff] [blame] | 99 | struct __sanitizer_tm { |
| 100 | int tm_sec; |
| 101 | int tm_min; |
| 102 | int tm_hour; |
| 103 | int tm_mday; |
| 104 | int tm_mon; |
| 105 | int tm_year; |
| 106 | int tm_wday; |
| 107 | int tm_yday; |
| 108 | int tm_isdst; |
| 109 | long int tm_gmtoff; |
| 110 | const char *tm_zone; |
| 111 | }; |
| 112 | |
Evgeniy Stepanov | e215980 | 2013-05-29 11:55:27 +0000 | [diff] [blame] | 113 | #if SANITIZER_ANDROID || SANITIZER_MAC |
| 114 | struct __sanitizer_msghdr { |
| 115 | void *msg_name; |
| 116 | unsigned msg_namelen; |
| 117 | struct __sanitizer_iovec *msg_iov; |
| 118 | unsigned msg_iovlen; |
| 119 | void *msg_control; |
| 120 | unsigned msg_controllen; |
| 121 | int msg_flags; |
| 122 | }; |
| 123 | struct __sanitizer_cmsghdr { |
| 124 | unsigned cmsg_len; |
| 125 | int cmsg_level; |
| 126 | int cmsg_type; |
| 127 | }; |
| 128 | #else |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 129 | struct __sanitizer_msghdr { |
| 130 | void *msg_name; |
| 131 | unsigned msg_namelen; |
| 132 | struct __sanitizer_iovec *msg_iov; |
| 133 | uptr msg_iovlen; |
| 134 | void *msg_control; |
| 135 | uptr msg_controllen; |
| 136 | int msg_flags; |
| 137 | }; |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 138 | struct __sanitizer_cmsghdr { |
| 139 | uptr cmsg_len; |
| 140 | int cmsg_level; |
| 141 | int cmsg_type; |
| 142 | }; |
Evgeniy Stepanov | e215980 | 2013-05-29 11:55:27 +0000 | [diff] [blame] | 143 | #endif |
Evgeniy Stepanov | 10fd322 | 2013-03-13 09:01:40 +0000 | [diff] [blame] | 144 | |
Evgeniy Stepanov | a0379b5 | 2013-06-27 09:37:27 +0000 | [diff] [blame] | 145 | #if SANITIZER_MAC |
| 146 | struct __sanitizer_dirent { |
Alexey Samsonov | b6bde4d | 2013-07-16 11:54:40 +0000 | [diff] [blame] | 147 | unsigned long long d_ino; |
| 148 | unsigned long long d_seekoff; |
Evgeniy Stepanov | a0379b5 | 2013-06-27 09:37:27 +0000 | [diff] [blame] | 149 | unsigned short d_reclen; |
| 150 | // more fields that we don't care about |
| 151 | }; |
| 152 | #elif SANITIZER_ANDROID |
| 153 | struct __sanitizer_dirent { |
| 154 | unsigned long long d_ino; |
| 155 | unsigned long long d_off; |
| 156 | unsigned short d_reclen; |
| 157 | // more fields that we don't care about |
| 158 | }; |
| 159 | #else |
| 160 | struct __sanitizer_dirent { |
| 161 | uptr d_ino; |
| 162 | uptr d_off; |
| 163 | unsigned short d_reclen; |
| 164 | // more fields that we don't care about |
| 165 | }; |
| 166 | #endif |
| 167 | |
| 168 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 169 | struct __sanitizer_dirent64 { |
Chandler Carruth | 5a482cd | 2013-07-11 18:51:40 +0000 | [diff] [blame] | 170 | unsigned long long d_ino; |
| 171 | unsigned long long d_off; |
Evgeniy Stepanov | a0379b5 | 2013-06-27 09:37:27 +0000 | [diff] [blame] | 172 | unsigned short d_reclen; |
| 173 | // more fields that we don't care about |
| 174 | }; |
| 175 | #endif |
| 176 | |
Evgeniy Stepanov | a3cb27e | 2013-09-06 15:34:17 +0000 | [diff] [blame] | 177 | #if SANITIZER_LINUX |
| 178 | #ifdef _LP64 |
| 179 | typedef unsigned __sanitizer___kernel_uid_t; |
| 180 | typedef unsigned __sanitizer___kernel_gid_t; |
| 181 | #else |
Evgeniy Stepanov | 85626e8 | 2013-09-09 06:18:07 +0000 | [diff] [blame] | 182 | typedef unsigned short __sanitizer___kernel_uid_t; |
Evgeniy Stepanov | a3cb27e | 2013-09-06 15:34:17 +0000 | [diff] [blame] | 183 | typedef unsigned short __sanitizer___kernel_gid_t; |
| 184 | #endif |
| 185 | typedef unsigned short __sanitizer___kernel_old_uid_t; |
| 186 | typedef unsigned short __sanitizer___kernel_old_gid_t; |
| 187 | typedef long __sanitizer___kernel_off_t; |
| 188 | typedef long long __sanitizer___kernel_loff_t; |
| 189 | typedef struct { |
| 190 | unsigned long fds_bits[1024 / (8 * sizeof(long))]; |
| 191 | } __sanitizer___kernel_fd_set; |
| 192 | #endif |
| 193 | |
Evgeniy Stepanov | 10fd322 | 2013-03-13 09:01:40 +0000 | [diff] [blame] | 194 | // This thing depends on the platform. We are only interested in the upper |
| 195 | // limit. Verified with a compiler assert in .cc. |
| 196 | const int pthread_attr_t_max_sz = 128; |
| 197 | union __sanitizer_pthread_attr_t { |
Evgeniy Stepanov | 0ecc437 | 2013-03-13 10:20:35 +0000 | [diff] [blame] | 198 | char size[pthread_attr_t_max_sz]; // NOLINT |
Evgeniy Stepanov | 10fd322 | 2013-03-13 09:01:40 +0000 | [diff] [blame] | 199 | void *align; |
| 200 | }; |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 201 | |
Evgeniy Stepanov | b32d1bf | 2013-08-27 11:10:04 +0000 | [diff] [blame] | 202 | #if SANITIZER_ANDROID |
| 203 | typedef unsigned long __sanitizer_sigset_t; |
| 204 | #elif SANITIZER_MAC |
| 205 | typedef unsigned __sanitizer_sigset_t; |
| 206 | #elif SANITIZER_LINUX |
| 207 | struct __sanitizer_sigset_t { |
| 208 | // The size is determined by looking at sizeof of real sigset_t on linux. |
| 209 | uptr val[128 / sizeof(uptr)]; |
| 210 | }; |
| 211 | #endif |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 212 | |
Evgeniy Stepanov | b32d1bf | 2013-08-27 11:10:04 +0000 | [diff] [blame] | 213 | struct __sanitizer_sigaction { |
| 214 | union { |
| 215 | void (*sa_handler)(int sig); |
| 216 | void (*sa_sigaction)(int sig, void *siginfo, void *uctx); |
| 217 | }; |
| 218 | __sanitizer_sigset_t sa_mask; |
| 219 | int sa_flags; |
| 220 | #if SANITIZER_LINUX |
| 221 | void (*sa_restorer)(); |
| 222 | #endif |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 223 | }; |
| 224 | |
Dmitry Vyukov | 5f4984d | 2013-10-15 12:57:59 +0000 | [diff] [blame^] | 225 | struct __sanitizer_kernel_sigset_t { |
| 226 | u8 sig[8]; |
| 227 | }; |
| 228 | |
| 229 | struct __sanitizer_kernel_sigaction_t { |
| 230 | union { |
| 231 | void (*sigaction)(int signo, void *info, void *ctx); |
| 232 | void (*handler)(int signo); |
| 233 | }; |
| 234 | unsigned long sa_flags; |
| 235 | void (*sa_restorer)(void); |
| 236 | __sanitizer_kernel_sigset_t sa_mask; |
| 237 | }; |
| 238 | |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 239 | extern uptr sig_ign; |
| 240 | extern uptr sig_dfl; |
Evgeniy Stepanov | b32d1bf | 2013-08-27 11:10:04 +0000 | [diff] [blame] | 241 | extern uptr sa_siginfo; |
Evgeniy Stepanov | 9530eb7 | 2013-04-23 14:05:15 +0000 | [diff] [blame] | 242 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 243 | #if SANITIZER_LINUX |
| 244 | extern int e_tabsz; |
| 245 | #endif |
| 246 | |
Evgeniy Stepanov | 9d60087 | 2013-06-24 13:56:14 +0000 | [diff] [blame] | 247 | extern int af_inet; |
| 248 | extern int af_inet6; |
Evgeniy Stepanov | 9530eb7 | 2013-04-23 14:05:15 +0000 | [diff] [blame] | 249 | uptr __sanitizer_in_addr_sz(int af); |
Evgeniy Stepanov | 1aad6b5 | 2013-05-17 12:51:13 +0000 | [diff] [blame] | 250 | |
| 251 | #if SANITIZER_LINUX |
| 252 | struct __sanitizer_dl_phdr_info { |
| 253 | uptr dlpi_addr; |
| 254 | const char *dlpi_name; |
| 255 | const void *dlpi_phdr; |
| 256 | short dlpi_phnum; |
| 257 | }; |
| 258 | #endif |
Evgeniy Stepanov | 447ef19 | 2013-05-22 12:50:26 +0000 | [diff] [blame] | 259 | |
| 260 | struct __sanitizer_addrinfo { |
| 261 | int ai_flags; |
| 262 | int ai_family; |
| 263 | int ai_socktype; |
| 264 | int ai_protocol; |
Evgeniy Stepanov | a05fd31 | 2013-05-22 15:21:04 +0000 | [diff] [blame] | 265 | #if SANITIZER_ANDROID || SANITIZER_MAC |
Evgeniy Stepanov | 73c9878 | 2013-05-22 14:26:52 +0000 | [diff] [blame] | 266 | unsigned ai_addrlen; |
| 267 | char *ai_canonname; |
| 268 | void *ai_addr; |
| 269 | #else // LINUX |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 270 | unsigned ai_addrlen; |
Evgeniy Stepanov | 73c9878 | 2013-05-22 14:26:52 +0000 | [diff] [blame] | 271 | void *ai_addr; |
| 272 | char *ai_canonname; |
| 273 | #endif |
Evgeniy Stepanov | 447ef19 | 2013-05-22 12:50:26 +0000 | [diff] [blame] | 274 | struct __sanitizer_addrinfo *ai_next; |
| 275 | }; |
Evgeniy Stepanov | 0a2cc37 | 2013-05-23 11:10:23 +0000 | [diff] [blame] | 276 | |
| 277 | struct __sanitizer_hostent { |
| 278 | char *h_name; |
| 279 | char **h_aliases; |
| 280 | int h_addrtype; |
| 281 | int h_length; |
| 282 | char **h_addr_list; |
| 283 | }; |
| 284 | |
Evgeniy Stepanov | e18e3f0 | 2013-08-12 13:19:53 +0000 | [diff] [blame] | 285 | struct __sanitizer_pollfd { |
| 286 | int fd; |
| 287 | short events; |
| 288 | short revents; |
| 289 | }; |
| 290 | |
| 291 | #if SANITIZER_ANDROID || SANITIZER_MAC |
| 292 | typedef unsigned __sanitizer_nfds_t; |
| 293 | #else |
| 294 | typedef unsigned long __sanitizer_nfds_t; |
| 295 | #endif |
| 296 | |
Evgeniy Stepanov | d50d29e | 2013-06-28 14:18:10 +0000 | [diff] [blame] | 297 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | 906f2c1 | 2013-07-02 14:08:52 +0000 | [diff] [blame] | 298 | struct __sanitizer_glob_t { |
| 299 | uptr gl_pathc; |
| 300 | char **gl_pathv; |
Evgeniy Stepanov | 3fa122e | 2013-07-09 12:07:59 +0000 | [diff] [blame] | 301 | uptr gl_offs; |
| 302 | int gl_flags; |
Timur Iskhodzhanov | eaca82c | 2013-07-15 16:11:39 +0000 | [diff] [blame] | 303 | |
| 304 | void (*gl_closedir)(void *dirp); |
| 305 | void *(*gl_readdir)(void *dirp); |
Evgeniy Stepanov | 3fa122e | 2013-07-09 12:07:59 +0000 | [diff] [blame] | 306 | void *(*gl_opendir)(const char *); |
| 307 | int (*gl_lstat)(const char *, void *); |
| 308 | int (*gl_stat)(const char *, void *); |
Evgeniy Stepanov | 906f2c1 | 2013-07-02 14:08:52 +0000 | [diff] [blame] | 309 | }; |
| 310 | |
| 311 | extern int glob_nomatch; |
Evgeniy Stepanov | 3fa122e | 2013-07-09 12:07:59 +0000 | [diff] [blame] | 312 | extern int glob_altdirfunc; |
Evgeniy Stepanov | 906f2c1 | 2013-07-02 14:08:52 +0000 | [diff] [blame] | 313 | #endif |
| 314 | |
Evgeniy Stepanov | 12eb79d | 2013-07-09 09:53:37 +0000 | [diff] [blame] | 315 | extern unsigned path_max; |
| 316 | |
Evgeniy Stepanov | c5a3855 | 2013-09-24 14:38:22 +0000 | [diff] [blame] | 317 | struct __sanitizer_wordexp_t { |
| 318 | uptr we_wordc; |
| 319 | char **we_wordv; |
| 320 | uptr we_offs; |
| 321 | }; |
| 322 | |
Evgeniy Stepanov | 22d8767 | 2013-07-05 08:57:47 +0000 | [diff] [blame] | 323 | #if SANITIZER_LINUX && !SANITIZER_ANDROID && \ |
Timur Iskhodzhanov | eaca82c | 2013-07-15 16:11:39 +0000 | [diff] [blame] | 324 | (defined(__i386) || defined (__x86_64)) // NOLINT |
Evgeniy Stepanov | 341b9e6 | 2013-06-28 11:02:43 +0000 | [diff] [blame] | 325 | extern unsigned struct_user_regs_struct_sz; |
| 326 | extern unsigned struct_user_fpregs_struct_sz; |
| 327 | extern unsigned struct_user_fpxregs_struct_sz; |
| 328 | |
| 329 | extern int ptrace_getregs; |
| 330 | extern int ptrace_setregs; |
| 331 | extern int ptrace_getfpregs; |
| 332 | extern int ptrace_setfpregs; |
| 333 | extern int ptrace_getfpxregs; |
| 334 | extern int ptrace_setfpxregs; |
| 335 | extern int ptrace_getsiginfo; |
| 336 | extern int ptrace_setsiginfo; |
| 337 | extern int ptrace_getregset; |
| 338 | extern int ptrace_setregset; |
| 339 | #endif |
| 340 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 341 | // ioctl arguments |
Evgeniy Stepanov | 4757c47 | 2013-06-07 15:49:38 +0000 | [diff] [blame] | 342 | struct __sanitizer_ifconf { |
| 343 | int ifc_len; |
| 344 | union { |
| 345 | void *ifcu_req; |
| 346 | } ifc_ifcu; |
Evgeniy Stepanov | 89d1eee | 2013-06-19 13:21:38 +0000 | [diff] [blame] | 347 | #if SANITIZER_MAC |
| 348 | } __attribute__((packed)); |
| 349 | #else |
Evgeniy Stepanov | 4757c47 | 2013-06-07 15:49:38 +0000 | [diff] [blame] | 350 | }; |
Evgeniy Stepanov | 89d1eee | 2013-06-19 13:21:38 +0000 | [diff] [blame] | 351 | #endif |
Evgeniy Stepanov | 4757c47 | 2013-06-07 15:49:38 +0000 | [diff] [blame] | 352 | |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 353 | #define IOC_SIZE(nr) (((nr) >> 16) & 0x3fff) |
| 354 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 355 | extern unsigned struct_arpreq_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 356 | extern unsigned struct_ifreq_sz; |
| 357 | extern unsigned struct_termios_sz; |
| 358 | extern unsigned struct_winsize_sz; |
| 359 | |
| 360 | #if SANITIZER_LINUX |
| 361 | extern unsigned struct_cdrom_msf_sz; |
| 362 | extern unsigned struct_cdrom_multisession_sz; |
| 363 | extern unsigned struct_cdrom_read_audio_sz; |
| 364 | extern unsigned struct_cdrom_subchnl_sz; |
| 365 | extern unsigned struct_cdrom_ti_sz; |
| 366 | extern unsigned struct_cdrom_tocentry_sz; |
| 367 | extern unsigned struct_cdrom_tochdr_sz; |
| 368 | extern unsigned struct_cdrom_volctrl_sz; |
| 369 | extern unsigned struct_copr_buffer_sz; |
| 370 | extern unsigned struct_copr_debug_buf_sz; |
| 371 | extern unsigned struct_copr_msg_sz; |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 372 | extern unsigned struct_ff_effect_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 373 | extern unsigned struct_floppy_drive_params_sz; |
| 374 | extern unsigned struct_floppy_drive_struct_sz; |
| 375 | extern unsigned struct_floppy_fdc_state_sz; |
| 376 | extern unsigned struct_floppy_max_errors_sz; |
| 377 | extern unsigned struct_floppy_raw_cmd_sz; |
| 378 | extern unsigned struct_floppy_struct_sz; |
| 379 | extern unsigned struct_floppy_write_errors_sz; |
| 380 | extern unsigned struct_format_descr_sz; |
| 381 | extern unsigned struct_hd_driveid_sz; |
| 382 | extern unsigned struct_hd_geometry_sz; |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 383 | extern unsigned struct_input_absinfo_sz; |
| 384 | extern unsigned struct_input_id_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 385 | extern unsigned struct_midi_info_sz; |
| 386 | extern unsigned struct_mtget_sz; |
| 387 | extern unsigned struct_mtop_sz; |
| 388 | extern unsigned struct_mtpos_sz; |
| 389 | extern unsigned struct_rtentry_sz; |
| 390 | extern unsigned struct_sbi_instrument_sz; |
| 391 | extern unsigned struct_seq_event_rec_sz; |
| 392 | extern unsigned struct_synth_info_sz; |
| 393 | extern unsigned struct_termio_sz; |
| 394 | extern unsigned struct_vt_consize_sz; |
| 395 | extern unsigned struct_vt_mode_sz; |
| 396 | extern unsigned struct_vt_sizes_sz; |
| 397 | extern unsigned struct_vt_stat_sz; |
| 398 | #endif |
| 399 | |
| 400 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 401 | extern unsigned struct_audio_buf_info_sz; |
| 402 | extern unsigned struct_ax25_parms_struct_sz; |
| 403 | extern unsigned struct_cyclades_monitor_sz; |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 404 | extern unsigned struct_input_keymap_entry_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 405 | extern unsigned struct_ipx_config_data_sz; |
| 406 | extern unsigned struct_kbdiacrs_sz; |
| 407 | extern unsigned struct_kbentry_sz; |
| 408 | extern unsigned struct_kbkeycode_sz; |
| 409 | extern unsigned struct_kbsentry_sz; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 410 | extern unsigned struct_mtconfiginfo_sz; |
| 411 | extern unsigned struct_nr_parms_struct_sz; |
| 412 | extern unsigned struct_ppp_stats_sz; |
| 413 | extern unsigned struct_scc_modem_sz; |
| 414 | extern unsigned struct_scc_stat_sz; |
| 415 | extern unsigned struct_serial_multiport_struct_sz; |
| 416 | extern unsigned struct_serial_struct_sz; |
| 417 | extern unsigned struct_sockaddr_ax25_sz; |
| 418 | extern unsigned struct_unimapdesc_sz; |
| 419 | extern unsigned struct_unimapinit_sz; |
| 420 | #endif |
Dmitry Vyukov | 4f0fd8e | 2013-06-10 10:00:54 +0000 | [diff] [blame] | 421 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 422 | #if !SANITIZER_ANDROID |
| 423 | extern unsigned struct_sioc_sg_req_sz; |
| 424 | extern unsigned struct_sioc_vif_req_sz; |
| 425 | #endif |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 426 | |
| 427 | // ioctl request identifiers |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 428 | |
| 429 | // A special value to mark ioctls that are not present on the target platform, |
| 430 | // when it can not be determined without including any system headers. |
| 431 | extern unsigned IOCTL_NOT_PRESENT; |
| 432 | |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 433 | extern unsigned IOCTL_FIOASYNC; |
| 434 | extern unsigned IOCTL_FIOCLEX; |
| 435 | extern unsigned IOCTL_FIOGETOWN; |
| 436 | extern unsigned IOCTL_FIONBIO; |
| 437 | extern unsigned IOCTL_FIONCLEX; |
| 438 | extern unsigned IOCTL_FIOSETOWN; |
| 439 | extern unsigned IOCTL_SIOCADDMULTI; |
| 440 | extern unsigned IOCTL_SIOCATMARK; |
| 441 | extern unsigned IOCTL_SIOCDELMULTI; |
| 442 | extern unsigned IOCTL_SIOCGIFADDR; |
| 443 | extern unsigned IOCTL_SIOCGIFBRDADDR; |
| 444 | extern unsigned IOCTL_SIOCGIFCONF; |
| 445 | extern unsigned IOCTL_SIOCGIFDSTADDR; |
| 446 | extern unsigned IOCTL_SIOCGIFFLAGS; |
| 447 | extern unsigned IOCTL_SIOCGIFMETRIC; |
| 448 | extern unsigned IOCTL_SIOCGIFMTU; |
| 449 | extern unsigned IOCTL_SIOCGIFNETMASK; |
| 450 | extern unsigned IOCTL_SIOCGPGRP; |
| 451 | extern unsigned IOCTL_SIOCSIFADDR; |
| 452 | extern unsigned IOCTL_SIOCSIFBRDADDR; |
| 453 | extern unsigned IOCTL_SIOCSIFDSTADDR; |
| 454 | extern unsigned IOCTL_SIOCSIFFLAGS; |
| 455 | extern unsigned IOCTL_SIOCSIFMETRIC; |
| 456 | extern unsigned IOCTL_SIOCSIFMTU; |
| 457 | extern unsigned IOCTL_SIOCSIFNETMASK; |
| 458 | extern unsigned IOCTL_SIOCSPGRP; |
| 459 | extern unsigned IOCTL_TIOCCONS; |
| 460 | extern unsigned IOCTL_TIOCEXCL; |
| 461 | extern unsigned IOCTL_TIOCGETD; |
| 462 | extern unsigned IOCTL_TIOCGPGRP; |
| 463 | extern unsigned IOCTL_TIOCGWINSZ; |
| 464 | extern unsigned IOCTL_TIOCMBIC; |
| 465 | extern unsigned IOCTL_TIOCMBIS; |
| 466 | extern unsigned IOCTL_TIOCMGET; |
| 467 | extern unsigned IOCTL_TIOCMSET; |
| 468 | extern unsigned IOCTL_TIOCNOTTY; |
| 469 | extern unsigned IOCTL_TIOCNXCL; |
| 470 | extern unsigned IOCTL_TIOCOUTQ; |
| 471 | extern unsigned IOCTL_TIOCPKT; |
| 472 | extern unsigned IOCTL_TIOCSCTTY; |
| 473 | extern unsigned IOCTL_TIOCSETD; |
| 474 | extern unsigned IOCTL_TIOCSPGRP; |
| 475 | extern unsigned IOCTL_TIOCSTI; |
| 476 | extern unsigned IOCTL_TIOCSWINSZ; |
| 477 | #if (SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_MAC |
| 478 | extern unsigned IOCTL_SIOCGETSGCNT; |
| 479 | extern unsigned IOCTL_SIOCGETVIFCNT; |
| 480 | #endif |
| 481 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 482 | extern unsigned IOCTL_EVIOCGABS; |
| 483 | extern unsigned IOCTL_EVIOCGBIT; |
| 484 | extern unsigned IOCTL_EVIOCGEFFECTS; |
| 485 | extern unsigned IOCTL_EVIOCGID; |
| 486 | extern unsigned IOCTL_EVIOCGKEY; |
| 487 | extern unsigned IOCTL_EVIOCGKEYCODE; |
| 488 | extern unsigned IOCTL_EVIOCGLED; |
| 489 | extern unsigned IOCTL_EVIOCGNAME; |
| 490 | extern unsigned IOCTL_EVIOCGPHYS; |
| 491 | extern unsigned IOCTL_EVIOCGRAB; |
| 492 | extern unsigned IOCTL_EVIOCGREP; |
| 493 | extern unsigned IOCTL_EVIOCGSND; |
| 494 | extern unsigned IOCTL_EVIOCGSW; |
| 495 | extern unsigned IOCTL_EVIOCGUNIQ; |
| 496 | extern unsigned IOCTL_EVIOCGVERSION; |
| 497 | extern unsigned IOCTL_EVIOCRMFF; |
| 498 | extern unsigned IOCTL_EVIOCSABS; |
| 499 | extern unsigned IOCTL_EVIOCSFF; |
| 500 | extern unsigned IOCTL_EVIOCSKEYCODE; |
| 501 | extern unsigned IOCTL_EVIOCSREP; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 502 | extern unsigned IOCTL_BLKFLSBUF; |
| 503 | extern unsigned IOCTL_BLKGETSIZE; |
| 504 | extern unsigned IOCTL_BLKRAGET; |
| 505 | extern unsigned IOCTL_BLKRASET; |
| 506 | extern unsigned IOCTL_BLKROGET; |
| 507 | extern unsigned IOCTL_BLKROSET; |
| 508 | extern unsigned IOCTL_BLKRRPART; |
| 509 | extern unsigned IOCTL_CDROMAUDIOBUFSIZ; |
| 510 | extern unsigned IOCTL_CDROMEJECT; |
| 511 | extern unsigned IOCTL_CDROMEJECT_SW; |
| 512 | extern unsigned IOCTL_CDROMMULTISESSION; |
| 513 | extern unsigned IOCTL_CDROMPAUSE; |
| 514 | extern unsigned IOCTL_CDROMPLAYMSF; |
| 515 | extern unsigned IOCTL_CDROMPLAYTRKIND; |
| 516 | extern unsigned IOCTL_CDROMREADAUDIO; |
| 517 | extern unsigned IOCTL_CDROMREADCOOKED; |
| 518 | extern unsigned IOCTL_CDROMREADMODE1; |
| 519 | extern unsigned IOCTL_CDROMREADMODE2; |
| 520 | extern unsigned IOCTL_CDROMREADRAW; |
| 521 | extern unsigned IOCTL_CDROMREADTOCENTRY; |
| 522 | extern unsigned IOCTL_CDROMREADTOCHDR; |
| 523 | extern unsigned IOCTL_CDROMRESET; |
| 524 | extern unsigned IOCTL_CDROMRESUME; |
| 525 | extern unsigned IOCTL_CDROMSEEK; |
| 526 | extern unsigned IOCTL_CDROMSTART; |
| 527 | extern unsigned IOCTL_CDROMSTOP; |
| 528 | extern unsigned IOCTL_CDROMSUBCHNL; |
| 529 | extern unsigned IOCTL_CDROMVOLCTRL; |
| 530 | extern unsigned IOCTL_CDROMVOLREAD; |
| 531 | extern unsigned IOCTL_CDROM_GET_UPC; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 532 | extern unsigned IOCTL_FDCLRPRM; |
| 533 | extern unsigned IOCTL_FDDEFPRM; |
| 534 | extern unsigned IOCTL_FDFLUSH; |
| 535 | extern unsigned IOCTL_FDFMTBEG; |
| 536 | extern unsigned IOCTL_FDFMTEND; |
| 537 | extern unsigned IOCTL_FDFMTTRK; |
| 538 | extern unsigned IOCTL_FDGETDRVPRM; |
| 539 | extern unsigned IOCTL_FDGETDRVSTAT; |
| 540 | extern unsigned IOCTL_FDGETDRVTYP; |
| 541 | extern unsigned IOCTL_FDGETFDCSTAT; |
| 542 | extern unsigned IOCTL_FDGETMAXERRS; |
| 543 | extern unsigned IOCTL_FDGETPRM; |
| 544 | extern unsigned IOCTL_FDMSGOFF; |
| 545 | extern unsigned IOCTL_FDMSGON; |
| 546 | extern unsigned IOCTL_FDPOLLDRVSTAT; |
| 547 | extern unsigned IOCTL_FDRAWCMD; |
| 548 | extern unsigned IOCTL_FDRESET; |
| 549 | extern unsigned IOCTL_FDSETDRVPRM; |
| 550 | extern unsigned IOCTL_FDSETEMSGTRESH; |
| 551 | extern unsigned IOCTL_FDSETMAXERRS; |
| 552 | extern unsigned IOCTL_FDSETPRM; |
| 553 | extern unsigned IOCTL_FDTWADDLE; |
| 554 | extern unsigned IOCTL_FDWERRORCLR; |
| 555 | extern unsigned IOCTL_FDWERRORGET; |
| 556 | extern unsigned IOCTL_HDIO_DRIVE_CMD; |
| 557 | extern unsigned IOCTL_HDIO_GETGEO; |
| 558 | extern unsigned IOCTL_HDIO_GET_32BIT; |
| 559 | extern unsigned IOCTL_HDIO_GET_DMA; |
| 560 | extern unsigned IOCTL_HDIO_GET_IDENTITY; |
| 561 | extern unsigned IOCTL_HDIO_GET_KEEPSETTINGS; |
| 562 | extern unsigned IOCTL_HDIO_GET_MULTCOUNT; |
| 563 | extern unsigned IOCTL_HDIO_GET_NOWERR; |
| 564 | extern unsigned IOCTL_HDIO_GET_UNMASKINTR; |
| 565 | extern unsigned IOCTL_HDIO_SET_32BIT; |
| 566 | extern unsigned IOCTL_HDIO_SET_DMA; |
| 567 | extern unsigned IOCTL_HDIO_SET_KEEPSETTINGS; |
| 568 | extern unsigned IOCTL_HDIO_SET_MULTCOUNT; |
| 569 | extern unsigned IOCTL_HDIO_SET_NOWERR; |
| 570 | extern unsigned IOCTL_HDIO_SET_UNMASKINTR; |
| 571 | extern unsigned IOCTL_MTIOCGET; |
| 572 | extern unsigned IOCTL_MTIOCPOS; |
| 573 | extern unsigned IOCTL_MTIOCTOP; |
| 574 | extern unsigned IOCTL_PPPIOCGASYNCMAP; |
| 575 | extern unsigned IOCTL_PPPIOCGDEBUG; |
| 576 | extern unsigned IOCTL_PPPIOCGFLAGS; |
| 577 | extern unsigned IOCTL_PPPIOCGUNIT; |
| 578 | extern unsigned IOCTL_PPPIOCGXASYNCMAP; |
| 579 | extern unsigned IOCTL_PPPIOCSASYNCMAP; |
| 580 | extern unsigned IOCTL_PPPIOCSDEBUG; |
| 581 | extern unsigned IOCTL_PPPIOCSFLAGS; |
| 582 | extern unsigned IOCTL_PPPIOCSMAXCID; |
| 583 | extern unsigned IOCTL_PPPIOCSMRU; |
| 584 | extern unsigned IOCTL_PPPIOCSXASYNCMAP; |
| 585 | extern unsigned IOCTL_SIOCADDRT; |
| 586 | extern unsigned IOCTL_SIOCDARP; |
| 587 | extern unsigned IOCTL_SIOCDELRT; |
| 588 | extern unsigned IOCTL_SIOCDRARP; |
| 589 | extern unsigned IOCTL_SIOCGARP; |
| 590 | extern unsigned IOCTL_SIOCGIFENCAP; |
| 591 | extern unsigned IOCTL_SIOCGIFHWADDR; |
| 592 | extern unsigned IOCTL_SIOCGIFMAP; |
| 593 | extern unsigned IOCTL_SIOCGIFMEM; |
| 594 | extern unsigned IOCTL_SIOCGIFNAME; |
| 595 | extern unsigned IOCTL_SIOCGIFSLAVE; |
| 596 | extern unsigned IOCTL_SIOCGRARP; |
| 597 | extern unsigned IOCTL_SIOCGSTAMP; |
| 598 | extern unsigned IOCTL_SIOCSARP; |
| 599 | extern unsigned IOCTL_SIOCSIFENCAP; |
| 600 | extern unsigned IOCTL_SIOCSIFHWADDR; |
| 601 | extern unsigned IOCTL_SIOCSIFLINK; |
| 602 | extern unsigned IOCTL_SIOCSIFMAP; |
| 603 | extern unsigned IOCTL_SIOCSIFMEM; |
| 604 | extern unsigned IOCTL_SIOCSIFSLAVE; |
| 605 | extern unsigned IOCTL_SIOCSRARP; |
| 606 | extern unsigned IOCTL_SNDCTL_COPR_HALT; |
| 607 | extern unsigned IOCTL_SNDCTL_COPR_LOAD; |
| 608 | extern unsigned IOCTL_SNDCTL_COPR_RCODE; |
| 609 | extern unsigned IOCTL_SNDCTL_COPR_RCVMSG; |
| 610 | extern unsigned IOCTL_SNDCTL_COPR_RDATA; |
| 611 | extern unsigned IOCTL_SNDCTL_COPR_RESET; |
| 612 | extern unsigned IOCTL_SNDCTL_COPR_RUN; |
| 613 | extern unsigned IOCTL_SNDCTL_COPR_SENDMSG; |
| 614 | extern unsigned IOCTL_SNDCTL_COPR_WCODE; |
| 615 | extern unsigned IOCTL_SNDCTL_COPR_WDATA; |
| 616 | extern unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE; |
| 617 | extern unsigned IOCTL_SNDCTL_DSP_GETFMTS; |
| 618 | extern unsigned IOCTL_SNDCTL_DSP_NONBLOCK; |
| 619 | extern unsigned IOCTL_SNDCTL_DSP_POST; |
| 620 | extern unsigned IOCTL_SNDCTL_DSP_RESET; |
| 621 | extern unsigned IOCTL_SNDCTL_DSP_SETFMT; |
| 622 | extern unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT; |
| 623 | extern unsigned IOCTL_SNDCTL_DSP_SPEED; |
| 624 | extern unsigned IOCTL_SNDCTL_DSP_STEREO; |
| 625 | extern unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE; |
| 626 | extern unsigned IOCTL_SNDCTL_DSP_SYNC; |
| 627 | extern unsigned IOCTL_SNDCTL_FM_4OP_ENABLE; |
| 628 | extern unsigned IOCTL_SNDCTL_FM_LOAD_INSTR; |
| 629 | extern unsigned IOCTL_SNDCTL_MIDI_INFO; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 630 | extern unsigned IOCTL_SNDCTL_MIDI_PRETIME; |
| 631 | extern unsigned IOCTL_SNDCTL_SEQ_CTRLRATE; |
| 632 | extern unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT; |
| 633 | extern unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT; |
| 634 | extern unsigned IOCTL_SNDCTL_SEQ_NRMIDIS; |
| 635 | extern unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS; |
| 636 | extern unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND; |
| 637 | extern unsigned IOCTL_SNDCTL_SEQ_PANIC; |
| 638 | extern unsigned IOCTL_SNDCTL_SEQ_PERCMODE; |
| 639 | extern unsigned IOCTL_SNDCTL_SEQ_RESET; |
| 640 | extern unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES; |
| 641 | extern unsigned IOCTL_SNDCTL_SEQ_SYNC; |
| 642 | extern unsigned IOCTL_SNDCTL_SEQ_TESTMIDI; |
| 643 | extern unsigned IOCTL_SNDCTL_SEQ_THRESHOLD; |
| 644 | extern unsigned IOCTL_SNDCTL_SYNTH_INFO; |
| 645 | extern unsigned IOCTL_SNDCTL_SYNTH_MEMAVL; |
| 646 | extern unsigned IOCTL_SNDCTL_TMR_CONTINUE; |
| 647 | extern unsigned IOCTL_SNDCTL_TMR_METRONOME; |
| 648 | extern unsigned IOCTL_SNDCTL_TMR_SELECT; |
| 649 | extern unsigned IOCTL_SNDCTL_TMR_SOURCE; |
| 650 | extern unsigned IOCTL_SNDCTL_TMR_START; |
| 651 | extern unsigned IOCTL_SNDCTL_TMR_STOP; |
| 652 | extern unsigned IOCTL_SNDCTL_TMR_TEMPO; |
| 653 | extern unsigned IOCTL_SNDCTL_TMR_TIMEBASE; |
| 654 | extern unsigned IOCTL_SOUND_MIXER_READ_ALTPCM; |
| 655 | extern unsigned IOCTL_SOUND_MIXER_READ_BASS; |
| 656 | extern unsigned IOCTL_SOUND_MIXER_READ_CAPS; |
| 657 | extern unsigned IOCTL_SOUND_MIXER_READ_CD; |
| 658 | extern unsigned IOCTL_SOUND_MIXER_READ_DEVMASK; |
| 659 | extern unsigned IOCTL_SOUND_MIXER_READ_ENHANCE; |
| 660 | extern unsigned IOCTL_SOUND_MIXER_READ_IGAIN; |
| 661 | extern unsigned IOCTL_SOUND_MIXER_READ_IMIX; |
| 662 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE1; |
| 663 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE2; |
| 664 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE3; |
| 665 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE; |
| 666 | extern unsigned IOCTL_SOUND_MIXER_READ_LOUD; |
| 667 | extern unsigned IOCTL_SOUND_MIXER_READ_MIC; |
| 668 | extern unsigned IOCTL_SOUND_MIXER_READ_MUTE; |
| 669 | extern unsigned IOCTL_SOUND_MIXER_READ_OGAIN; |
| 670 | extern unsigned IOCTL_SOUND_MIXER_READ_PCM; |
| 671 | extern unsigned IOCTL_SOUND_MIXER_READ_RECLEV; |
| 672 | extern unsigned IOCTL_SOUND_MIXER_READ_RECMASK; |
| 673 | extern unsigned IOCTL_SOUND_MIXER_READ_RECSRC; |
| 674 | extern unsigned IOCTL_SOUND_MIXER_READ_SPEAKER; |
| 675 | extern unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS; |
| 676 | extern unsigned IOCTL_SOUND_MIXER_READ_SYNTH; |
| 677 | extern unsigned IOCTL_SOUND_MIXER_READ_TREBLE; |
| 678 | extern unsigned IOCTL_SOUND_MIXER_READ_VOLUME; |
| 679 | extern unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM; |
| 680 | extern unsigned IOCTL_SOUND_MIXER_WRITE_BASS; |
| 681 | extern unsigned IOCTL_SOUND_MIXER_WRITE_CD; |
| 682 | extern unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE; |
| 683 | extern unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN; |
| 684 | extern unsigned IOCTL_SOUND_MIXER_WRITE_IMIX; |
| 685 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE1; |
| 686 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE2; |
| 687 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE3; |
| 688 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE; |
| 689 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LOUD; |
| 690 | extern unsigned IOCTL_SOUND_MIXER_WRITE_MIC; |
| 691 | extern unsigned IOCTL_SOUND_MIXER_WRITE_MUTE; |
| 692 | extern unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN; |
| 693 | extern unsigned IOCTL_SOUND_MIXER_WRITE_PCM; |
| 694 | extern unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV; |
| 695 | extern unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC; |
| 696 | extern unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER; |
| 697 | extern unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH; |
| 698 | extern unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE; |
| 699 | extern unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME; |
| 700 | extern unsigned IOCTL_SOUND_PCM_READ_BITS; |
| 701 | extern unsigned IOCTL_SOUND_PCM_READ_CHANNELS; |
| 702 | extern unsigned IOCTL_SOUND_PCM_READ_FILTER; |
| 703 | extern unsigned IOCTL_SOUND_PCM_READ_RATE; |
| 704 | extern unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS; |
| 705 | extern unsigned IOCTL_SOUND_PCM_WRITE_FILTER; |
| 706 | extern unsigned IOCTL_TCFLSH; |
| 707 | extern unsigned IOCTL_TCGETA; |
| 708 | extern unsigned IOCTL_TCGETS; |
| 709 | extern unsigned IOCTL_TCSBRK; |
| 710 | extern unsigned IOCTL_TCSBRKP; |
| 711 | extern unsigned IOCTL_TCSETA; |
| 712 | extern unsigned IOCTL_TCSETAF; |
| 713 | extern unsigned IOCTL_TCSETAW; |
| 714 | extern unsigned IOCTL_TCSETS; |
| 715 | extern unsigned IOCTL_TCSETSF; |
| 716 | extern unsigned IOCTL_TCSETSW; |
| 717 | extern unsigned IOCTL_TCXONC; |
| 718 | extern unsigned IOCTL_TIOCGLCKTRMIOS; |
| 719 | extern unsigned IOCTL_TIOCGSOFTCAR; |
| 720 | extern unsigned IOCTL_TIOCINQ; |
| 721 | extern unsigned IOCTL_TIOCLINUX; |
| 722 | extern unsigned IOCTL_TIOCSERCONFIG; |
| 723 | extern unsigned IOCTL_TIOCSERGETLSR; |
| 724 | extern unsigned IOCTL_TIOCSERGWILD; |
| 725 | extern unsigned IOCTL_TIOCSERSWILD; |
| 726 | extern unsigned IOCTL_TIOCSLCKTRMIOS; |
| 727 | extern unsigned IOCTL_TIOCSSOFTCAR; |
| 728 | extern unsigned IOCTL_VT_ACTIVATE; |
| 729 | extern unsigned IOCTL_VT_DISALLOCATE; |
| 730 | extern unsigned IOCTL_VT_GETMODE; |
| 731 | extern unsigned IOCTL_VT_GETSTATE; |
| 732 | extern unsigned IOCTL_VT_OPENQRY; |
| 733 | extern unsigned IOCTL_VT_RELDISP; |
| 734 | extern unsigned IOCTL_VT_RESIZE; |
| 735 | extern unsigned IOCTL_VT_RESIZEX; |
| 736 | extern unsigned IOCTL_VT_SENDSIG; |
| 737 | extern unsigned IOCTL_VT_SETMODE; |
| 738 | extern unsigned IOCTL_VT_WAITACTIVE; |
| 739 | #endif |
| 740 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 741 | extern unsigned IOCTL_CYGETDEFTHRESH; |
| 742 | extern unsigned IOCTL_CYGETDEFTIMEOUT; |
| 743 | extern unsigned IOCTL_CYGETMON; |
| 744 | extern unsigned IOCTL_CYGETTHRESH; |
| 745 | extern unsigned IOCTL_CYGETTIMEOUT; |
| 746 | extern unsigned IOCTL_CYSETDEFTHRESH; |
| 747 | extern unsigned IOCTL_CYSETDEFTIMEOUT; |
| 748 | extern unsigned IOCTL_CYSETTHRESH; |
| 749 | extern unsigned IOCTL_CYSETTIMEOUT; |
| 750 | extern unsigned IOCTL_EQL_EMANCIPATE; |
| 751 | extern unsigned IOCTL_EQL_ENSLAVE; |
| 752 | extern unsigned IOCTL_EQL_GETMASTRCFG; |
| 753 | extern unsigned IOCTL_EQL_GETSLAVECFG; |
| 754 | extern unsigned IOCTL_EQL_SETMASTRCFG; |
| 755 | extern unsigned IOCTL_EQL_SETSLAVECFG; |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 756 | extern unsigned IOCTL_EVIOCGKEYCODE_V2; |
| 757 | extern unsigned IOCTL_EVIOCGPROP; |
| 758 | extern unsigned IOCTL_EVIOCSKEYCODE_V2; |
Evgeniy Stepanov | 7028c1e | 2013-06-18 13:56:12 +0000 | [diff] [blame] | 759 | extern unsigned IOCTL_FS_IOC_GETFLAGS; |
| 760 | extern unsigned IOCTL_FS_IOC_GETVERSION; |
| 761 | extern unsigned IOCTL_FS_IOC_SETFLAGS; |
| 762 | extern unsigned IOCTL_FS_IOC_SETVERSION; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 763 | extern unsigned IOCTL_GIO_CMAP; |
| 764 | extern unsigned IOCTL_GIO_FONT; |
| 765 | extern unsigned IOCTL_GIO_SCRNMAP; |
| 766 | extern unsigned IOCTL_GIO_UNIMAP; |
| 767 | extern unsigned IOCTL_GIO_UNISCRNMAP; |
| 768 | extern unsigned IOCTL_KDADDIO; |
| 769 | extern unsigned IOCTL_KDDELIO; |
| 770 | extern unsigned IOCTL_KDDISABIO; |
| 771 | extern unsigned IOCTL_KDENABIO; |
| 772 | extern unsigned IOCTL_KDGETKEYCODE; |
| 773 | extern unsigned IOCTL_KDGETLED; |
| 774 | extern unsigned IOCTL_KDGETMODE; |
| 775 | extern unsigned IOCTL_KDGKBDIACR; |
| 776 | extern unsigned IOCTL_KDGKBENT; |
| 777 | extern unsigned IOCTL_KDGKBLED; |
| 778 | extern unsigned IOCTL_KDGKBMETA; |
| 779 | extern unsigned IOCTL_KDGKBMODE; |
| 780 | extern unsigned IOCTL_KDGKBSENT; |
| 781 | extern unsigned IOCTL_KDGKBTYPE; |
| 782 | extern unsigned IOCTL_KDMAPDISP; |
| 783 | extern unsigned IOCTL_KDMKTONE; |
| 784 | extern unsigned IOCTL_KDSETKEYCODE; |
| 785 | extern unsigned IOCTL_KDSETLED; |
| 786 | extern unsigned IOCTL_KDSETMODE; |
| 787 | extern unsigned IOCTL_KDSIGACCEPT; |
| 788 | extern unsigned IOCTL_KDSKBDIACR; |
| 789 | extern unsigned IOCTL_KDSKBENT; |
| 790 | extern unsigned IOCTL_KDSKBLED; |
| 791 | extern unsigned IOCTL_KDSKBMETA; |
| 792 | extern unsigned IOCTL_KDSKBMODE; |
| 793 | extern unsigned IOCTL_KDSKBSENT; |
| 794 | extern unsigned IOCTL_KDUNMAPDISP; |
| 795 | extern unsigned IOCTL_KIOCSOUND; |
| 796 | extern unsigned IOCTL_LPABORT; |
| 797 | extern unsigned IOCTL_LPABORTOPEN; |
| 798 | extern unsigned IOCTL_LPCAREFUL; |
| 799 | extern unsigned IOCTL_LPCHAR; |
| 800 | extern unsigned IOCTL_LPGETIRQ; |
| 801 | extern unsigned IOCTL_LPGETSTATUS; |
| 802 | extern unsigned IOCTL_LPRESET; |
| 803 | extern unsigned IOCTL_LPSETIRQ; |
| 804 | extern unsigned IOCTL_LPTIME; |
| 805 | extern unsigned IOCTL_LPWAIT; |
Chandler Carruth | 8766b81 | 2013-08-18 08:47:06 +0000 | [diff] [blame] | 806 | extern unsigned IOCTL_MTIOCGETCONFIG; |
| 807 | extern unsigned IOCTL_MTIOCSETCONFIG; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 808 | extern unsigned IOCTL_PIO_CMAP; |
| 809 | extern unsigned IOCTL_PIO_FONT; |
| 810 | extern unsigned IOCTL_PIO_SCRNMAP; |
| 811 | extern unsigned IOCTL_PIO_UNIMAP; |
| 812 | extern unsigned IOCTL_PIO_UNIMAPCLR; |
| 813 | extern unsigned IOCTL_PIO_UNISCRNMAP; |
| 814 | extern unsigned IOCTL_SCSI_IOCTL_GET_IDLUN; |
| 815 | extern unsigned IOCTL_SCSI_IOCTL_PROBE_HOST; |
| 816 | extern unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE; |
| 817 | extern unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE; |
| 818 | extern unsigned IOCTL_SIOCAIPXITFCRT; |
| 819 | extern unsigned IOCTL_SIOCAIPXPRISLT; |
Chandler Carruth | 8766b81 | 2013-08-18 08:47:06 +0000 | [diff] [blame] | 820 | extern unsigned IOCTL_SIOCAX25ADDUID; |
| 821 | extern unsigned IOCTL_SIOCAX25DELUID; |
| 822 | extern unsigned IOCTL_SIOCAX25GETPARMS; |
| 823 | extern unsigned IOCTL_SIOCAX25GETUID; |
| 824 | extern unsigned IOCTL_SIOCAX25NOUID; |
| 825 | extern unsigned IOCTL_SIOCAX25SETPARMS; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 826 | extern unsigned IOCTL_SIOCDEVPLIP; |
| 827 | extern unsigned IOCTL_SIOCIPXCFGDATA; |
Chandler Carruth | 8766b81 | 2013-08-18 08:47:06 +0000 | [diff] [blame] | 828 | extern unsigned IOCTL_SIOCNRDECOBS; |
| 829 | extern unsigned IOCTL_SIOCNRGETPARMS; |
| 830 | extern unsigned IOCTL_SIOCNRRTCTL; |
| 831 | extern unsigned IOCTL_SIOCNRSETPARMS; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 832 | extern unsigned IOCTL_SNDCTL_DSP_GETISPACE; |
| 833 | extern unsigned IOCTL_SNDCTL_DSP_GETOSPACE; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 834 | extern unsigned IOCTL_TIOCGSERIAL; |
| 835 | extern unsigned IOCTL_TIOCSERGETMULTI; |
| 836 | extern unsigned IOCTL_TIOCSERSETMULTI; |
| 837 | extern unsigned IOCTL_TIOCSSERIAL; |
| 838 | #endif |
Sergey Matveev | 70db33e | 2013-10-11 14:19:14 +0000 | [diff] [blame] | 839 | |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 840 | } // namespace __sanitizer |
| 841 | |
| 842 | #endif |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 843 | |