1 //===-- sanitizer_platform_limits_posix.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 platform-specific POSIX data structures. 13 //===----------------------------------------------------------------------===// 14 15 16 #include "sanitizer_platform.h" 17 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC 18 19 #include <arpa/inet.h> 20 #include <dirent.h> 21 #include <errno.h> 22 #include <grp.h> 23 #include <limits.h> 24 #include <net/if.h> 25 #include <net/if_arp.h> 26 #include <net/route.h> 27 #include <netdb.h> 28 #include <poll.h> 29 #include <pthread.h> 30 #include <pwd.h> 31 #include <signal.h> 32 #include <stddef.h> 33 #include <sys/mman.h> 34 #include <sys/resource.h> 35 #include <sys/socket.h> 36 #include <sys/stat.h> 37 #include <sys/time.h> 38 #include <sys/times.h> 39 #include <sys/types.h> 40 #include <sys/utsname.h> 41 #include <termios.h> 42 #include <time.h> 43 #include <wchar.h> 44 45 #if !SANITIZER_ANDROID 46 #include <sys/mount.h> 47 #include <sys/timeb.h> 48 #endif 49 50 #if SANITIZER_LINUX 51 #include <malloc.h> 52 #include <mntent.h> 53 #include <netinet/ether.h> 54 #include <sys/sysinfo.h> 55 #include <sys/vt.h> 56 #include <linux/cdrom.h> 57 #include <linux/fd.h> 58 #include <linux/fs.h> 59 #include <linux/hdreg.h> 60 #include <linux/input.h> 61 #include <linux/ioctl.h> 62 #include <linux/soundcard.h> 63 #include <linux/sysctl.h> 64 #include <linux/utsname.h> 65 #include <linux/posix_types.h> 66 #endif 67 68 #if SANITIZER_FREEBSD 69 # include <sys/mount.h> 70 # include <sys/sockio.h> 71 # include <sys/socket.h> 72 # include <sys/filio.h> 73 # include <sys/signal.h> 74 # include <sys/timespec.h> 75 # include <sys/timex.h> 76 # include <sys/mqueue.h> 77 # include <sys/msg.h> 78 # include <sys/ipc.h> 79 # include <sys/msg.h> 80 # include <sys/statvfs.h> 81 # include <sys/soundcard.h> 82 # include <sys/mtio.h> 83 # include <sys/consio.h> 84 # include <sys/kbio.h> 85 # include <sys/link_elf.h> 86 # include <netinet/ip_mroute.h> 87 # include <netinet/in.h> 88 # include <netinet/ip_compat.h> 89 # include <net/ethernet.h> 90 # include <net/ppp_defs.h> 91 # include <glob.h> 92 # include <term.h> 93 94 #define _KERNEL // to declare 'shminfo' structure 95 # include <sys/shm.h> 96 #undef _KERNEL 97 98 #undef INLINE // to avoid clashes with sanitizers' definitions 99 #endif 100 101 #if SANITIZER_FREEBSD || SANITIZER_IOS 102 #undef IOC_DIRMASK 103 #endif 104 105 #if SANITIZER_LINUX || SANITIZER_FREEBSD 106 # include <utime.h> 107 # include <sys/ptrace.h> 108 #endif 109 110 #if !SANITIZER_ANDROID 111 #include <ifaddrs.h> 112 #include <sys/ucontext.h> 113 #include <wordexp.h> 114 #endif 115 116 #if SANITIZER_LINUX && !SANITIZER_ANDROID 117 #include <glob.h> 118 #include <obstack.h> 119 #include <mqueue.h> 120 #include <net/if_ppp.h> 121 #include <netax25/ax25.h> 122 #include <netipx/ipx.h> 123 #include <netrom/netrom.h> 124 #include <rpc/xdr.h> 125 #include <scsi/scsi.h> 126 #include <sys/mtio.h> 127 #include <sys/kd.h> 128 #include <sys/shm.h> 129 #include <sys/statvfs.h> 130 #include <sys/timex.h> 131 #include <sys/user.h> 132 #include <sys/ustat.h> 133 #include <linux/cyclades.h> 134 #include <linux/if_eql.h> 135 #include <linux/if_plip.h> 136 #include <linux/lp.h> 137 #include <linux/mroute.h> 138 #include <linux/mroute6.h> 139 #include <linux/scc.h> 140 #include <linux/serial.h> 141 #include <sys/msg.h> 142 #include <sys/ipc.h> 143 #endif // SANITIZER_LINUX && !SANITIZER_ANDROID 144 145 #if SANITIZER_ANDROID 146 #include <linux/kd.h> 147 #include <linux/mtio.h> 148 #include <linux/ppp_defs.h> 149 #include <linux/if_ppp.h> 150 #endif 151 152 #if SANITIZER_LINUX 153 #include <link.h> 154 #include <sys/vfs.h> 155 #include <sys/epoll.h> 156 #include <linux/capability.h> 157 #endif // SANITIZER_LINUX 158 159 #if SANITIZER_MAC 160 #include <net/ethernet.h> 161 #include <sys/filio.h> 162 #include <sys/sockio.h> 163 #endif 164 165 // Include these after system headers to avoid name clashes and ambiguities. 166 #include "sanitizer_internal_defs.h" 167 #include "sanitizer_platform_limits_posix.h" 168 169 namespace __sanitizer { 170 unsigned struct_utsname_sz = sizeof(struct utsname); 171 unsigned struct_stat_sz = sizeof(struct stat); 172 #if !SANITIZER_IOS && !SANITIZER_FREEBSD 173 unsigned struct_stat64_sz = sizeof(struct stat64); 174 #endif // !SANITIZER_IOS && !SANITIZER_FREEBSD 175 unsigned struct_rusage_sz = sizeof(struct rusage); 176 unsigned struct_tm_sz = sizeof(struct tm); 177 unsigned struct_passwd_sz = sizeof(struct passwd); 178 unsigned struct_group_sz = sizeof(struct group); 179 unsigned siginfo_t_sz = sizeof(siginfo_t); 180 unsigned struct_sigaction_sz = sizeof(struct sigaction); 181 unsigned struct_itimerval_sz = sizeof(struct itimerval); 182 unsigned pthread_t_sz = sizeof(pthread_t); 183 unsigned pthread_cond_t_sz = sizeof(pthread_cond_t); 184 unsigned pid_t_sz = sizeof(pid_t); 185 unsigned timeval_sz = sizeof(timeval); 186 unsigned uid_t_sz = sizeof(uid_t); 187 unsigned gid_t_sz = sizeof(gid_t); 188 unsigned mbstate_t_sz = sizeof(mbstate_t); 189 unsigned sigset_t_sz = sizeof(sigset_t); 190 unsigned struct_timezone_sz = sizeof(struct timezone); 191 unsigned struct_tms_sz = sizeof(struct tms); 192 unsigned struct_sigevent_sz = sizeof(struct sigevent); 193 unsigned struct_sched_param_sz = sizeof(struct sched_param); 194 195 196 #if SANITIZER_MAC && !SANITIZER_IOS 197 unsigned struct_statfs64_sz = sizeof(struct statfs64); 198 #endif // SANITIZER_MAC && !SANITIZER_IOS 199 200 #if !SANITIZER_ANDROID 201 unsigned struct_statfs_sz = sizeof(struct statfs); 202 unsigned struct_sockaddr_sz = sizeof(struct sockaddr); 203 unsigned ucontext_t_sz = sizeof(ucontext_t); 204 #endif // !SANITIZER_ANDROID 205 206 #if SANITIZER_LINUX 207 unsigned struct_epoll_event_sz = sizeof(struct epoll_event); 208 unsigned struct_sysinfo_sz = sizeof(struct sysinfo); 209 unsigned __user_cap_header_struct_sz = 210 sizeof(struct __user_cap_header_struct); 211 unsigned __user_cap_data_struct_sz = sizeof(struct __user_cap_data_struct); 212 unsigned struct_new_utsname_sz = sizeof(struct new_utsname); 213 unsigned struct_old_utsname_sz = sizeof(struct old_utsname); 214 unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname); 215 #endif // SANITIZER_LINUX 216 217 #if SANITIZER_LINUX || SANITIZER_FREEBSD 218 unsigned struct_rlimit_sz = sizeof(struct rlimit); 219 unsigned struct_timespec_sz = sizeof(struct timespec); 220 unsigned struct_utimbuf_sz = sizeof(struct utimbuf); 221 unsigned struct_itimerspec_sz = sizeof(struct itimerspec); 222 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 223 224 #if SANITIZER_LINUX && !SANITIZER_ANDROID 225 unsigned struct_ustat_sz = sizeof(struct ustat); 226 unsigned struct_rlimit64_sz = sizeof(struct rlimit64); 227 unsigned struct_statvfs64_sz = sizeof(struct statvfs64); 228 #endif // SANITIZER_LINUX && !SANITIZER_ANDROID 229 230 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 231 unsigned struct_timex_sz = sizeof(struct timex); 232 unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds); 233 unsigned struct_mq_attr_sz = sizeof(struct mq_attr); 234 unsigned struct_statvfs_sz = sizeof(struct statvfs); 235 #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 236 237 uptr sig_ign = (uptr)SIG_IGN; 238 uptr sig_dfl = (uptr)SIG_DFL; 239 uptr sa_siginfo = (uptr)SA_SIGINFO; 240 241 #if SANITIZER_LINUX 242 int e_tabsz = (int)E_TABSZ; 243 #endif 244 245 246 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 247 unsigned struct_shminfo_sz = sizeof(struct shminfo); 248 unsigned struct_shm_info_sz = sizeof(struct shm_info); 249 int shmctl_ipc_stat = (int)IPC_STAT; 250 int shmctl_ipc_info = (int)IPC_INFO; 251 int shmctl_shm_info = (int)SHM_INFO; 252 int shmctl_shm_stat = (int)SHM_STAT; 253 #endif 254 255 int map_fixed = MAP_FIXED; 256 257 int af_inet = (int)AF_INET; 258 int af_inet6 = (int)AF_INET6; 259 __sanitizer_in_addr_sz(int af)260 uptr __sanitizer_in_addr_sz(int af) { 261 if (af == AF_INET) 262 return sizeof(struct in_addr); 263 else if (af == AF_INET6) 264 return sizeof(struct in6_addr); 265 else 266 return 0; 267 } 268 269 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 270 int glob_nomatch = GLOB_NOMATCH; 271 int glob_altdirfunc = GLOB_ALTDIRFUNC; 272 #endif 273 274 #if SANITIZER_LINUX && !SANITIZER_ANDROID && \ 275 (defined(__i386) || defined(__x86_64)) 276 unsigned struct_user_regs_struct_sz = sizeof(struct user_regs_struct); 277 unsigned struct_user_fpregs_struct_sz = sizeof(struct user_fpregs_struct); 278 #ifdef __x86_64 279 unsigned struct_user_fpxregs_struct_sz = 0; 280 #else 281 unsigned struct_user_fpxregs_struct_sz = sizeof(struct user_fpxregs_struct); 282 #endif 283 284 int ptrace_peektext = PTRACE_PEEKTEXT; 285 int ptrace_peekdata = PTRACE_PEEKDATA; 286 int ptrace_peekuser = PTRACE_PEEKUSER; 287 int ptrace_getregs = PTRACE_GETREGS; 288 int ptrace_setregs = PTRACE_SETREGS; 289 int ptrace_getfpregs = PTRACE_GETFPREGS; 290 int ptrace_setfpregs = PTRACE_SETFPREGS; 291 int ptrace_getfpxregs = PTRACE_GETFPXREGS; 292 int ptrace_setfpxregs = PTRACE_SETFPXREGS; 293 int ptrace_geteventmsg = PTRACE_GETEVENTMSG; 294 #if (defined(PTRACE_GETSIGINFO) && defined(PTRACE_SETSIGINFO)) || \ 295 (defined(PT_GETSIGINFO) && defined(PT_SETSIGINFO)) 296 int ptrace_getsiginfo = PTRACE_GETSIGINFO; 297 int ptrace_setsiginfo = PTRACE_SETSIGINFO; 298 #else 299 int ptrace_getsiginfo = -1; 300 int ptrace_setsiginfo = -1; 301 #endif // PTRACE_GETSIGINFO/PTRACE_SETSIGINFO 302 #if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) 303 int ptrace_getregset = PTRACE_GETREGSET; 304 int ptrace_setregset = PTRACE_SETREGSET; 305 #else 306 int ptrace_getregset = -1; 307 int ptrace_setregset = -1; 308 #endif // PTRACE_GETREGSET/PTRACE_SETREGSET 309 #endif 310 311 unsigned path_max = PATH_MAX; 312 313 // ioctl arguments 314 unsigned struct_arpreq_sz = sizeof(struct arpreq); 315 unsigned struct_ifreq_sz = sizeof(struct ifreq); 316 unsigned struct_termios_sz = sizeof(struct termios); 317 unsigned struct_winsize_sz = sizeof(struct winsize); 318 319 #if SANITIZER_LINUX 320 unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf); 321 unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession); 322 unsigned struct_cdrom_read_audio_sz = sizeof(struct cdrom_read_audio); 323 unsigned struct_cdrom_subchnl_sz = sizeof(struct cdrom_subchnl); 324 unsigned struct_cdrom_ti_sz = sizeof(struct cdrom_ti); 325 unsigned struct_cdrom_tocentry_sz = sizeof(struct cdrom_tocentry); 326 unsigned struct_cdrom_tochdr_sz = sizeof(struct cdrom_tochdr); 327 unsigned struct_cdrom_volctrl_sz = sizeof(struct cdrom_volctrl); 328 unsigned struct_ff_effect_sz = sizeof(struct ff_effect); 329 unsigned struct_floppy_drive_params_sz = sizeof(struct floppy_drive_params); 330 unsigned struct_floppy_drive_struct_sz = sizeof(struct floppy_drive_struct); 331 unsigned struct_floppy_fdc_state_sz = sizeof(struct floppy_fdc_state); 332 unsigned struct_floppy_max_errors_sz = sizeof(struct floppy_max_errors); 333 unsigned struct_floppy_raw_cmd_sz = sizeof(struct floppy_raw_cmd); 334 unsigned struct_floppy_struct_sz = sizeof(struct floppy_struct); 335 unsigned struct_floppy_write_errors_sz = sizeof(struct floppy_write_errors); 336 unsigned struct_format_descr_sz = sizeof(struct format_descr); 337 unsigned struct_hd_driveid_sz = sizeof(struct hd_driveid); 338 unsigned struct_hd_geometry_sz = sizeof(struct hd_geometry); 339 unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo); 340 unsigned struct_input_id_sz = sizeof(struct input_id); 341 unsigned struct_mtpos_sz = sizeof(struct mtpos); 342 unsigned struct_termio_sz = sizeof(struct termio); 343 unsigned struct_vt_consize_sz = sizeof(struct vt_consize); 344 unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); 345 unsigned struct_vt_stat_sz = sizeof(struct vt_stat); 346 #endif // SANITIZER_LINUX 347 348 #if SANITIZER_LINUX || SANITIZER_FREEBSD 349 #if SOUND_VERSION >= 0x040000 350 unsigned struct_copr_buffer_sz = 0; 351 unsigned struct_copr_debug_buf_sz = 0; 352 unsigned struct_copr_msg_sz = 0; 353 #else 354 unsigned struct_copr_buffer_sz = sizeof(struct copr_buffer); 355 unsigned struct_copr_debug_buf_sz = sizeof(struct copr_debug_buf); 356 unsigned struct_copr_msg_sz = sizeof(struct copr_msg); 357 #endif 358 unsigned struct_midi_info_sz = sizeof(struct midi_info); 359 unsigned struct_mtget_sz = sizeof(struct mtget); 360 unsigned struct_mtop_sz = sizeof(struct mtop); 361 unsigned struct_rtentry_sz = sizeof(struct rtentry); 362 unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument); 363 unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec); 364 unsigned struct_synth_info_sz = sizeof(struct synth_info); 365 unsigned struct_vt_mode_sz = sizeof(struct vt_mode); 366 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 367 368 #if SANITIZER_LINUX && !SANITIZER_ANDROID 369 unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); 370 unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); 371 #if EV_VERSION > (0x010000) 372 unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); 373 #else 374 unsigned struct_input_keymap_entry_sz = 0; 375 #endif 376 unsigned struct_ipx_config_data_sz = sizeof(struct ipx_config_data); 377 unsigned struct_kbdiacrs_sz = sizeof(struct kbdiacrs); 378 unsigned struct_kbentry_sz = sizeof(struct kbentry); 379 unsigned struct_kbkeycode_sz = sizeof(struct kbkeycode); 380 unsigned struct_kbsentry_sz = sizeof(struct kbsentry); 381 unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo); 382 unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct); 383 unsigned struct_scc_modem_sz = sizeof(struct scc_modem); 384 unsigned struct_scc_stat_sz = sizeof(struct scc_stat); 385 unsigned struct_serial_multiport_struct_sz 386 = sizeof(struct serial_multiport_struct); 387 unsigned struct_serial_struct_sz = sizeof(struct serial_struct); 388 unsigned struct_sockaddr_ax25_sz = sizeof(struct sockaddr_ax25); 389 unsigned struct_unimapdesc_sz = sizeof(struct unimapdesc); 390 unsigned struct_unimapinit_sz = sizeof(struct unimapinit); 391 #endif // SANITIZER_LINUX && !SANITIZER_ANDROID 392 393 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 394 unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info); 395 unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats); 396 #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 397 398 #if !SANITIZER_ANDROID && !SANITIZER_MAC 399 unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req); 400 unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req); 401 #endif 402 403 unsigned IOCTL_NOT_PRESENT = 0; 404 405 unsigned IOCTL_FIOASYNC = FIOASYNC; 406 unsigned IOCTL_FIOCLEX = FIOCLEX; 407 unsigned IOCTL_FIOGETOWN = FIOGETOWN; 408 unsigned IOCTL_FIONBIO = FIONBIO; 409 unsigned IOCTL_FIONCLEX = FIONCLEX; 410 unsigned IOCTL_FIOSETOWN = FIOSETOWN; 411 unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI; 412 unsigned IOCTL_SIOCATMARK = SIOCATMARK; 413 unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI; 414 unsigned IOCTL_SIOCGIFADDR = SIOCGIFADDR; 415 unsigned IOCTL_SIOCGIFBRDADDR = SIOCGIFBRDADDR; 416 unsigned IOCTL_SIOCGIFCONF = SIOCGIFCONF; 417 unsigned IOCTL_SIOCGIFDSTADDR = SIOCGIFDSTADDR; 418 unsigned IOCTL_SIOCGIFFLAGS = SIOCGIFFLAGS; 419 unsigned IOCTL_SIOCGIFMETRIC = SIOCGIFMETRIC; 420 unsigned IOCTL_SIOCGIFMTU = SIOCGIFMTU; 421 unsigned IOCTL_SIOCGIFNETMASK = SIOCGIFNETMASK; 422 unsigned IOCTL_SIOCGPGRP = SIOCGPGRP; 423 unsigned IOCTL_SIOCSIFADDR = SIOCSIFADDR; 424 unsigned IOCTL_SIOCSIFBRDADDR = SIOCSIFBRDADDR; 425 unsigned IOCTL_SIOCSIFDSTADDR = SIOCSIFDSTADDR; 426 unsigned IOCTL_SIOCSIFFLAGS = SIOCSIFFLAGS; 427 unsigned IOCTL_SIOCSIFMETRIC = SIOCSIFMETRIC; 428 unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU; 429 unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK; 430 unsigned IOCTL_SIOCSPGRP = SIOCSPGRP; 431 unsigned IOCTL_TIOCCONS = TIOCCONS; 432 unsigned IOCTL_TIOCEXCL = TIOCEXCL; 433 unsigned IOCTL_TIOCGETD = TIOCGETD; 434 unsigned IOCTL_TIOCGPGRP = TIOCGPGRP; 435 unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ; 436 unsigned IOCTL_TIOCMBIC = TIOCMBIC; 437 unsigned IOCTL_TIOCMBIS = TIOCMBIS; 438 unsigned IOCTL_TIOCMGET = TIOCMGET; 439 unsigned IOCTL_TIOCMSET = TIOCMSET; 440 unsigned IOCTL_TIOCNOTTY = TIOCNOTTY; 441 unsigned IOCTL_TIOCNXCL = TIOCNXCL; 442 unsigned IOCTL_TIOCOUTQ = TIOCOUTQ; 443 unsigned IOCTL_TIOCPKT = TIOCPKT; 444 unsigned IOCTL_TIOCSCTTY = TIOCSCTTY; 445 unsigned IOCTL_TIOCSETD = TIOCSETD; 446 unsigned IOCTL_TIOCSPGRP = TIOCSPGRP; 447 unsigned IOCTL_TIOCSTI = TIOCSTI; 448 unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ; 449 #if ((SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID) 450 unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT; 451 unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT; 452 #endif 453 454 #if SANITIZER_LINUX 455 unsigned IOCTL_EVIOCGABS = EVIOCGABS(0); 456 unsigned IOCTL_EVIOCGBIT = EVIOCGBIT(0, 0); 457 unsigned IOCTL_EVIOCGEFFECTS = EVIOCGEFFECTS; 458 unsigned IOCTL_EVIOCGID = EVIOCGID; 459 unsigned IOCTL_EVIOCGKEY = EVIOCGKEY(0); 460 unsigned IOCTL_EVIOCGKEYCODE = EVIOCGKEYCODE; 461 unsigned IOCTL_EVIOCGLED = EVIOCGLED(0); 462 unsigned IOCTL_EVIOCGNAME = EVIOCGNAME(0); 463 unsigned IOCTL_EVIOCGPHYS = EVIOCGPHYS(0); 464 unsigned IOCTL_EVIOCGRAB = EVIOCGRAB; 465 unsigned IOCTL_EVIOCGREP = EVIOCGREP; 466 unsigned IOCTL_EVIOCGSND = EVIOCGSND(0); 467 unsigned IOCTL_EVIOCGSW = EVIOCGSW(0); 468 unsigned IOCTL_EVIOCGUNIQ = EVIOCGUNIQ(0); 469 unsigned IOCTL_EVIOCGVERSION = EVIOCGVERSION; 470 unsigned IOCTL_EVIOCRMFF = EVIOCRMFF; 471 unsigned IOCTL_EVIOCSABS = EVIOCSABS(0); 472 unsigned IOCTL_EVIOCSFF = EVIOCSFF; 473 unsigned IOCTL_EVIOCSKEYCODE = EVIOCSKEYCODE; 474 unsigned IOCTL_EVIOCSREP = EVIOCSREP; 475 unsigned IOCTL_BLKFLSBUF = BLKFLSBUF; 476 unsigned IOCTL_BLKGETSIZE = BLKGETSIZE; 477 unsigned IOCTL_BLKRAGET = BLKRAGET; 478 unsigned IOCTL_BLKRASET = BLKRASET; 479 unsigned IOCTL_BLKROGET = BLKROGET; 480 unsigned IOCTL_BLKROSET = BLKROSET; 481 unsigned IOCTL_BLKRRPART = BLKRRPART; 482 unsigned IOCTL_CDROMAUDIOBUFSIZ = CDROMAUDIOBUFSIZ; 483 unsigned IOCTL_CDROMEJECT = CDROMEJECT; 484 unsigned IOCTL_CDROMEJECT_SW = CDROMEJECT_SW; 485 unsigned IOCTL_CDROMMULTISESSION = CDROMMULTISESSION; 486 unsigned IOCTL_CDROMPAUSE = CDROMPAUSE; 487 unsigned IOCTL_CDROMPLAYMSF = CDROMPLAYMSF; 488 unsigned IOCTL_CDROMPLAYTRKIND = CDROMPLAYTRKIND; 489 unsigned IOCTL_CDROMREADAUDIO = CDROMREADAUDIO; 490 unsigned IOCTL_CDROMREADCOOKED = CDROMREADCOOKED; 491 unsigned IOCTL_CDROMREADMODE1 = CDROMREADMODE1; 492 unsigned IOCTL_CDROMREADMODE2 = CDROMREADMODE2; 493 unsigned IOCTL_CDROMREADRAW = CDROMREADRAW; 494 unsigned IOCTL_CDROMREADTOCENTRY = CDROMREADTOCENTRY; 495 unsigned IOCTL_CDROMREADTOCHDR = CDROMREADTOCHDR; 496 unsigned IOCTL_CDROMRESET = CDROMRESET; 497 unsigned IOCTL_CDROMRESUME = CDROMRESUME; 498 unsigned IOCTL_CDROMSEEK = CDROMSEEK; 499 unsigned IOCTL_CDROMSTART = CDROMSTART; 500 unsigned IOCTL_CDROMSTOP = CDROMSTOP; 501 unsigned IOCTL_CDROMSUBCHNL = CDROMSUBCHNL; 502 unsigned IOCTL_CDROMVOLCTRL = CDROMVOLCTRL; 503 unsigned IOCTL_CDROMVOLREAD = CDROMVOLREAD; 504 unsigned IOCTL_CDROM_GET_UPC = CDROM_GET_UPC; 505 unsigned IOCTL_FDCLRPRM = FDCLRPRM; 506 unsigned IOCTL_FDDEFPRM = FDDEFPRM; 507 unsigned IOCTL_FDFLUSH = FDFLUSH; 508 unsigned IOCTL_FDFMTBEG = FDFMTBEG; 509 unsigned IOCTL_FDFMTEND = FDFMTEND; 510 unsigned IOCTL_FDFMTTRK = FDFMTTRK; 511 unsigned IOCTL_FDGETDRVPRM = FDGETDRVPRM; 512 unsigned IOCTL_FDGETDRVSTAT = FDGETDRVSTAT; 513 unsigned IOCTL_FDGETDRVTYP = FDGETDRVTYP; 514 unsigned IOCTL_FDGETFDCSTAT = FDGETFDCSTAT; 515 unsigned IOCTL_FDGETMAXERRS = FDGETMAXERRS; 516 unsigned IOCTL_FDGETPRM = FDGETPRM; 517 unsigned IOCTL_FDMSGOFF = FDMSGOFF; 518 unsigned IOCTL_FDMSGON = FDMSGON; 519 unsigned IOCTL_FDPOLLDRVSTAT = FDPOLLDRVSTAT; 520 unsigned IOCTL_FDRAWCMD = FDRAWCMD; 521 unsigned IOCTL_FDRESET = FDRESET; 522 unsigned IOCTL_FDSETDRVPRM = FDSETDRVPRM; 523 unsigned IOCTL_FDSETEMSGTRESH = FDSETEMSGTRESH; 524 unsigned IOCTL_FDSETMAXERRS = FDSETMAXERRS; 525 unsigned IOCTL_FDSETPRM = FDSETPRM; 526 unsigned IOCTL_FDTWADDLE = FDTWADDLE; 527 unsigned IOCTL_FDWERRORCLR = FDWERRORCLR; 528 unsigned IOCTL_FDWERRORGET = FDWERRORGET; 529 unsigned IOCTL_HDIO_DRIVE_CMD = HDIO_DRIVE_CMD; 530 unsigned IOCTL_HDIO_GETGEO = HDIO_GETGEO; 531 unsigned IOCTL_HDIO_GET_32BIT = HDIO_GET_32BIT; 532 unsigned IOCTL_HDIO_GET_DMA = HDIO_GET_DMA; 533 unsigned IOCTL_HDIO_GET_IDENTITY = HDIO_GET_IDENTITY; 534 unsigned IOCTL_HDIO_GET_KEEPSETTINGS = HDIO_GET_KEEPSETTINGS; 535 unsigned IOCTL_HDIO_GET_MULTCOUNT = HDIO_GET_MULTCOUNT; 536 unsigned IOCTL_HDIO_GET_NOWERR = HDIO_GET_NOWERR; 537 unsigned IOCTL_HDIO_GET_UNMASKINTR = HDIO_GET_UNMASKINTR; 538 unsigned IOCTL_HDIO_SET_32BIT = HDIO_SET_32BIT; 539 unsigned IOCTL_HDIO_SET_DMA = HDIO_SET_DMA; 540 unsigned IOCTL_HDIO_SET_KEEPSETTINGS = HDIO_SET_KEEPSETTINGS; 541 unsigned IOCTL_HDIO_SET_MULTCOUNT = HDIO_SET_MULTCOUNT; 542 unsigned IOCTL_HDIO_SET_NOWERR = HDIO_SET_NOWERR; 543 unsigned IOCTL_HDIO_SET_UNMASKINTR = HDIO_SET_UNMASKINTR; 544 unsigned IOCTL_MTIOCPOS = MTIOCPOS; 545 unsigned IOCTL_PPPIOCGASYNCMAP = PPPIOCGASYNCMAP; 546 unsigned IOCTL_PPPIOCGDEBUG = PPPIOCGDEBUG; 547 unsigned IOCTL_PPPIOCGFLAGS = PPPIOCGFLAGS; 548 unsigned IOCTL_PPPIOCGUNIT = PPPIOCGUNIT; 549 unsigned IOCTL_PPPIOCGXASYNCMAP = PPPIOCGXASYNCMAP; 550 unsigned IOCTL_PPPIOCSASYNCMAP = PPPIOCSASYNCMAP; 551 unsigned IOCTL_PPPIOCSDEBUG = PPPIOCSDEBUG; 552 unsigned IOCTL_PPPIOCSFLAGS = PPPIOCSFLAGS; 553 unsigned IOCTL_PPPIOCSMAXCID = PPPIOCSMAXCID; 554 unsigned IOCTL_PPPIOCSMRU = PPPIOCSMRU; 555 unsigned IOCTL_PPPIOCSXASYNCMAP = PPPIOCSXASYNCMAP; 556 unsigned IOCTL_SIOCDARP = SIOCDARP; 557 unsigned IOCTL_SIOCDRARP = SIOCDRARP; 558 unsigned IOCTL_SIOCGARP = SIOCGARP; 559 unsigned IOCTL_SIOCGIFENCAP = SIOCGIFENCAP; 560 unsigned IOCTL_SIOCGIFHWADDR = SIOCGIFHWADDR; 561 unsigned IOCTL_SIOCGIFMAP = SIOCGIFMAP; 562 unsigned IOCTL_SIOCGIFMEM = SIOCGIFMEM; 563 unsigned IOCTL_SIOCGIFNAME = SIOCGIFNAME; 564 unsigned IOCTL_SIOCGIFSLAVE = SIOCGIFSLAVE; 565 unsigned IOCTL_SIOCGRARP = SIOCGRARP; 566 unsigned IOCTL_SIOCGSTAMP = SIOCGSTAMP; 567 unsigned IOCTL_SIOCSARP = SIOCSARP; 568 unsigned IOCTL_SIOCSIFENCAP = SIOCSIFENCAP; 569 unsigned IOCTL_SIOCSIFHWADDR = SIOCSIFHWADDR; 570 unsigned IOCTL_SIOCSIFLINK = SIOCSIFLINK; 571 unsigned IOCTL_SIOCSIFMAP = SIOCSIFMAP; 572 unsigned IOCTL_SIOCSIFMEM = SIOCSIFMEM; 573 unsigned IOCTL_SIOCSIFSLAVE = SIOCSIFSLAVE; 574 unsigned IOCTL_SIOCSRARP = SIOCSRARP; 575 # if SOUND_VERSION >= 0x040000 576 unsigned IOCTL_SNDCTL_COPR_HALT = IOCTL_NOT_PRESENT; 577 unsigned IOCTL_SNDCTL_COPR_LOAD = IOCTL_NOT_PRESENT; 578 unsigned IOCTL_SNDCTL_COPR_RCODE = IOCTL_NOT_PRESENT; 579 unsigned IOCTL_SNDCTL_COPR_RCVMSG = IOCTL_NOT_PRESENT; 580 unsigned IOCTL_SNDCTL_COPR_RDATA = IOCTL_NOT_PRESENT; 581 unsigned IOCTL_SNDCTL_COPR_RESET = IOCTL_NOT_PRESENT; 582 unsigned IOCTL_SNDCTL_COPR_RUN = IOCTL_NOT_PRESENT; 583 unsigned IOCTL_SNDCTL_COPR_SENDMSG = IOCTL_NOT_PRESENT; 584 unsigned IOCTL_SNDCTL_COPR_WCODE = IOCTL_NOT_PRESENT; 585 unsigned IOCTL_SNDCTL_COPR_WDATA = IOCTL_NOT_PRESENT; 586 unsigned IOCTL_SOUND_PCM_READ_BITS = IOCTL_NOT_PRESENT; 587 unsigned IOCTL_SOUND_PCM_READ_CHANNELS = IOCTL_NOT_PRESENT; 588 unsigned IOCTL_SOUND_PCM_READ_FILTER = IOCTL_NOT_PRESENT; 589 unsigned IOCTL_SOUND_PCM_READ_RATE = IOCTL_NOT_PRESENT; 590 unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = IOCTL_NOT_PRESENT; 591 unsigned IOCTL_SOUND_PCM_WRITE_FILTER = IOCTL_NOT_PRESENT; 592 # else // SOUND_VERSION 593 unsigned IOCTL_SNDCTL_COPR_HALT = SNDCTL_COPR_HALT; 594 unsigned IOCTL_SNDCTL_COPR_LOAD = SNDCTL_COPR_LOAD; 595 unsigned IOCTL_SNDCTL_COPR_RCODE = SNDCTL_COPR_RCODE; 596 unsigned IOCTL_SNDCTL_COPR_RCVMSG = SNDCTL_COPR_RCVMSG; 597 unsigned IOCTL_SNDCTL_COPR_RDATA = SNDCTL_COPR_RDATA; 598 unsigned IOCTL_SNDCTL_COPR_RESET = SNDCTL_COPR_RESET; 599 unsigned IOCTL_SNDCTL_COPR_RUN = SNDCTL_COPR_RUN; 600 unsigned IOCTL_SNDCTL_COPR_SENDMSG = SNDCTL_COPR_SENDMSG; 601 unsigned IOCTL_SNDCTL_COPR_WCODE = SNDCTL_COPR_WCODE; 602 unsigned IOCTL_SNDCTL_COPR_WDATA = SNDCTL_COPR_WDATA; 603 unsigned IOCTL_SOUND_PCM_READ_BITS = SOUND_PCM_READ_BITS; 604 unsigned IOCTL_SOUND_PCM_READ_CHANNELS = SOUND_PCM_READ_CHANNELS; 605 unsigned IOCTL_SOUND_PCM_READ_FILTER = SOUND_PCM_READ_FILTER; 606 unsigned IOCTL_SOUND_PCM_READ_RATE = SOUND_PCM_READ_RATE; 607 unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = SOUND_PCM_WRITE_CHANNELS; 608 unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER; 609 #endif // SOUND_VERSION 610 unsigned IOCTL_TCFLSH = TCFLSH; 611 unsigned IOCTL_TCGETA = TCGETA; 612 unsigned IOCTL_TCGETS = TCGETS; 613 unsigned IOCTL_TCSBRK = TCSBRK; 614 unsigned IOCTL_TCSBRKP = TCSBRKP; 615 unsigned IOCTL_TCSETA = TCSETA; 616 unsigned IOCTL_TCSETAF = TCSETAF; 617 unsigned IOCTL_TCSETAW = TCSETAW; 618 unsigned IOCTL_TCSETS = TCSETS; 619 unsigned IOCTL_TCSETSF = TCSETSF; 620 unsigned IOCTL_TCSETSW = TCSETSW; 621 unsigned IOCTL_TCXONC = TCXONC; 622 unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS; 623 unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR; 624 unsigned IOCTL_TIOCINQ = TIOCINQ; 625 unsigned IOCTL_TIOCLINUX = TIOCLINUX; 626 unsigned IOCTL_TIOCSERCONFIG = TIOCSERCONFIG; 627 unsigned IOCTL_TIOCSERGETLSR = TIOCSERGETLSR; 628 unsigned IOCTL_TIOCSERGWILD = TIOCSERGWILD; 629 unsigned IOCTL_TIOCSERSWILD = TIOCSERSWILD; 630 unsigned IOCTL_TIOCSLCKTRMIOS = TIOCSLCKTRMIOS; 631 unsigned IOCTL_TIOCSSOFTCAR = TIOCSSOFTCAR; 632 unsigned IOCTL_VT_DISALLOCATE = VT_DISALLOCATE; 633 unsigned IOCTL_VT_GETSTATE = VT_GETSTATE; 634 unsigned IOCTL_VT_RESIZE = VT_RESIZE; 635 unsigned IOCTL_VT_RESIZEX = VT_RESIZEX; 636 unsigned IOCTL_VT_SENDSIG = VT_SENDSIG; 637 #endif // SANITIZER_LINUX 638 639 #if SANITIZER_LINUX || SANITIZER_FREEBSD 640 unsigned IOCTL_MTIOCGET = MTIOCGET; 641 unsigned IOCTL_MTIOCTOP = MTIOCTOP; 642 unsigned IOCTL_SIOCADDRT = SIOCADDRT; 643 unsigned IOCTL_SIOCDELRT = SIOCDELRT; 644 unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE = SNDCTL_DSP_GETBLKSIZE; 645 unsigned IOCTL_SNDCTL_DSP_GETFMTS = SNDCTL_DSP_GETFMTS; 646 unsigned IOCTL_SNDCTL_DSP_NONBLOCK = SNDCTL_DSP_NONBLOCK; 647 unsigned IOCTL_SNDCTL_DSP_POST = SNDCTL_DSP_POST; 648 unsigned IOCTL_SNDCTL_DSP_RESET = SNDCTL_DSP_RESET; 649 unsigned IOCTL_SNDCTL_DSP_SETFMT = SNDCTL_DSP_SETFMT; 650 unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT = SNDCTL_DSP_SETFRAGMENT; 651 unsigned IOCTL_SNDCTL_DSP_SPEED = SNDCTL_DSP_SPEED; 652 unsigned IOCTL_SNDCTL_DSP_STEREO = SNDCTL_DSP_STEREO; 653 unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE = SNDCTL_DSP_SUBDIVIDE; 654 unsigned IOCTL_SNDCTL_DSP_SYNC = SNDCTL_DSP_SYNC; 655 unsigned IOCTL_SNDCTL_FM_4OP_ENABLE = SNDCTL_FM_4OP_ENABLE; 656 unsigned IOCTL_SNDCTL_FM_LOAD_INSTR = SNDCTL_FM_LOAD_INSTR; 657 unsigned IOCTL_SNDCTL_MIDI_INFO = SNDCTL_MIDI_INFO; 658 unsigned IOCTL_SNDCTL_MIDI_PRETIME = SNDCTL_MIDI_PRETIME; 659 unsigned IOCTL_SNDCTL_SEQ_CTRLRATE = SNDCTL_SEQ_CTRLRATE; 660 unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT = SNDCTL_SEQ_GETINCOUNT; 661 unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT = SNDCTL_SEQ_GETOUTCOUNT; 662 unsigned IOCTL_SNDCTL_SEQ_NRMIDIS = SNDCTL_SEQ_NRMIDIS; 663 unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS = SNDCTL_SEQ_NRSYNTHS; 664 unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND = SNDCTL_SEQ_OUTOFBAND; 665 unsigned IOCTL_SNDCTL_SEQ_PANIC = SNDCTL_SEQ_PANIC; 666 unsigned IOCTL_SNDCTL_SEQ_PERCMODE = SNDCTL_SEQ_PERCMODE; 667 unsigned IOCTL_SNDCTL_SEQ_RESET = SNDCTL_SEQ_RESET; 668 unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES = SNDCTL_SEQ_RESETSAMPLES; 669 unsigned IOCTL_SNDCTL_SEQ_SYNC = SNDCTL_SEQ_SYNC; 670 unsigned IOCTL_SNDCTL_SEQ_TESTMIDI = SNDCTL_SEQ_TESTMIDI; 671 unsigned IOCTL_SNDCTL_SEQ_THRESHOLD = SNDCTL_SEQ_THRESHOLD; 672 unsigned IOCTL_SNDCTL_SYNTH_INFO = SNDCTL_SYNTH_INFO; 673 unsigned IOCTL_SNDCTL_SYNTH_MEMAVL = SNDCTL_SYNTH_MEMAVL; 674 unsigned IOCTL_SNDCTL_TMR_CONTINUE = SNDCTL_TMR_CONTINUE; 675 unsigned IOCTL_SNDCTL_TMR_METRONOME = SNDCTL_TMR_METRONOME; 676 unsigned IOCTL_SNDCTL_TMR_SELECT = SNDCTL_TMR_SELECT; 677 unsigned IOCTL_SNDCTL_TMR_SOURCE = SNDCTL_TMR_SOURCE; 678 unsigned IOCTL_SNDCTL_TMR_START = SNDCTL_TMR_START; 679 unsigned IOCTL_SNDCTL_TMR_STOP = SNDCTL_TMR_STOP; 680 unsigned IOCTL_SNDCTL_TMR_TEMPO = SNDCTL_TMR_TEMPO; 681 unsigned IOCTL_SNDCTL_TMR_TIMEBASE = SNDCTL_TMR_TIMEBASE; 682 unsigned IOCTL_SOUND_MIXER_READ_ALTPCM = SOUND_MIXER_READ_ALTPCM; 683 unsigned IOCTL_SOUND_MIXER_READ_BASS = SOUND_MIXER_READ_BASS; 684 unsigned IOCTL_SOUND_MIXER_READ_CAPS = SOUND_MIXER_READ_CAPS; 685 unsigned IOCTL_SOUND_MIXER_READ_CD = SOUND_MIXER_READ_CD; 686 unsigned IOCTL_SOUND_MIXER_READ_DEVMASK = SOUND_MIXER_READ_DEVMASK; 687 unsigned IOCTL_SOUND_MIXER_READ_ENHANCE = SOUND_MIXER_READ_ENHANCE; 688 unsigned IOCTL_SOUND_MIXER_READ_IGAIN = SOUND_MIXER_READ_IGAIN; 689 unsigned IOCTL_SOUND_MIXER_READ_IMIX = SOUND_MIXER_READ_IMIX; 690 unsigned IOCTL_SOUND_MIXER_READ_LINE = SOUND_MIXER_READ_LINE; 691 unsigned IOCTL_SOUND_MIXER_READ_LINE1 = SOUND_MIXER_READ_LINE1; 692 unsigned IOCTL_SOUND_MIXER_READ_LINE2 = SOUND_MIXER_READ_LINE2; 693 unsigned IOCTL_SOUND_MIXER_READ_LINE3 = SOUND_MIXER_READ_LINE3; 694 unsigned IOCTL_SOUND_MIXER_READ_LOUD = SOUND_MIXER_READ_LOUD; 695 unsigned IOCTL_SOUND_MIXER_READ_MIC = SOUND_MIXER_READ_MIC; 696 unsigned IOCTL_SOUND_MIXER_READ_MUTE = SOUND_MIXER_READ_MUTE; 697 unsigned IOCTL_SOUND_MIXER_READ_OGAIN = SOUND_MIXER_READ_OGAIN; 698 unsigned IOCTL_SOUND_MIXER_READ_PCM = SOUND_MIXER_READ_PCM; 699 unsigned IOCTL_SOUND_MIXER_READ_RECLEV = SOUND_MIXER_READ_RECLEV; 700 unsigned IOCTL_SOUND_MIXER_READ_RECMASK = SOUND_MIXER_READ_RECMASK; 701 unsigned IOCTL_SOUND_MIXER_READ_RECSRC = SOUND_MIXER_READ_RECSRC; 702 unsigned IOCTL_SOUND_MIXER_READ_SPEAKER = SOUND_MIXER_READ_SPEAKER; 703 unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS = SOUND_MIXER_READ_STEREODEVS; 704 unsigned IOCTL_SOUND_MIXER_READ_SYNTH = SOUND_MIXER_READ_SYNTH; 705 unsigned IOCTL_SOUND_MIXER_READ_TREBLE = SOUND_MIXER_READ_TREBLE; 706 unsigned IOCTL_SOUND_MIXER_READ_VOLUME = SOUND_MIXER_READ_VOLUME; 707 unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM = SOUND_MIXER_WRITE_ALTPCM; 708 unsigned IOCTL_SOUND_MIXER_WRITE_BASS = SOUND_MIXER_WRITE_BASS; 709 unsigned IOCTL_SOUND_MIXER_WRITE_CD = SOUND_MIXER_WRITE_CD; 710 unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE = SOUND_MIXER_WRITE_ENHANCE; 711 unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN = SOUND_MIXER_WRITE_IGAIN; 712 unsigned IOCTL_SOUND_MIXER_WRITE_IMIX = SOUND_MIXER_WRITE_IMIX; 713 unsigned IOCTL_SOUND_MIXER_WRITE_LINE = SOUND_MIXER_WRITE_LINE; 714 unsigned IOCTL_SOUND_MIXER_WRITE_LINE1 = SOUND_MIXER_WRITE_LINE1; 715 unsigned IOCTL_SOUND_MIXER_WRITE_LINE2 = SOUND_MIXER_WRITE_LINE2; 716 unsigned IOCTL_SOUND_MIXER_WRITE_LINE3 = SOUND_MIXER_WRITE_LINE3; 717 unsigned IOCTL_SOUND_MIXER_WRITE_LOUD = SOUND_MIXER_WRITE_LOUD; 718 unsigned IOCTL_SOUND_MIXER_WRITE_MIC = SOUND_MIXER_WRITE_MIC; 719 unsigned IOCTL_SOUND_MIXER_WRITE_MUTE = SOUND_MIXER_WRITE_MUTE; 720 unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN = SOUND_MIXER_WRITE_OGAIN; 721 unsigned IOCTL_SOUND_MIXER_WRITE_PCM = SOUND_MIXER_WRITE_PCM; 722 unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV = SOUND_MIXER_WRITE_RECLEV; 723 unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC = SOUND_MIXER_WRITE_RECSRC; 724 unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER = SOUND_MIXER_WRITE_SPEAKER; 725 unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH = SOUND_MIXER_WRITE_SYNTH; 726 unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE = SOUND_MIXER_WRITE_TREBLE; 727 unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME = SOUND_MIXER_WRITE_VOLUME; 728 unsigned IOCTL_VT_ACTIVATE = VT_ACTIVATE; 729 unsigned IOCTL_VT_GETMODE = VT_GETMODE; 730 unsigned IOCTL_VT_OPENQRY = VT_OPENQRY; 731 unsigned IOCTL_VT_RELDISP = VT_RELDISP; 732 unsigned IOCTL_VT_SETMODE = VT_SETMODE; 733 unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE; 734 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 735 736 #if SANITIZER_LINUX && !SANITIZER_ANDROID 737 unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; 738 unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; 739 unsigned IOCTL_CYGETMON = CYGETMON; 740 unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; 741 unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; 742 unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; 743 unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; 744 unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; 745 unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; 746 unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; 747 unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; 748 unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; 749 unsigned IOCTL_EQL_GETSLAVECFG = EQL_GETSLAVECFG; 750 unsigned IOCTL_EQL_SETMASTRCFG = EQL_SETMASTRCFG; 751 unsigned IOCTL_EQL_SETSLAVECFG = EQL_SETSLAVECFG; 752 #if EV_VERSION > (0x010000) 753 unsigned IOCTL_EVIOCGKEYCODE_V2 = EVIOCGKEYCODE_V2; 754 unsigned IOCTL_EVIOCGPROP = EVIOCGPROP(0); 755 unsigned IOCTL_EVIOCSKEYCODE_V2 = EVIOCSKEYCODE_V2; 756 #else 757 unsigned IOCTL_EVIOCGKEYCODE_V2 = IOCTL_NOT_PRESENT; 758 unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; 759 unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; 760 #endif 761 unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; 762 unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; 763 unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; 764 unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; 765 unsigned IOCTL_GIO_CMAP = GIO_CMAP; 766 unsigned IOCTL_GIO_FONT = GIO_FONT; 767 unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; 768 unsigned IOCTL_GIO_UNISCRNMAP = GIO_UNISCRNMAP; 769 unsigned IOCTL_KDADDIO = KDADDIO; 770 unsigned IOCTL_KDDELIO = KDDELIO; 771 unsigned IOCTL_KDGETKEYCODE = KDGETKEYCODE; 772 unsigned IOCTL_KDGKBDIACR = KDGKBDIACR; 773 unsigned IOCTL_KDGKBENT = KDGKBENT; 774 unsigned IOCTL_KDGKBLED = KDGKBLED; 775 unsigned IOCTL_KDGKBMETA = KDGKBMETA; 776 unsigned IOCTL_KDGKBSENT = KDGKBSENT; 777 unsigned IOCTL_KDMAPDISP = KDMAPDISP; 778 unsigned IOCTL_KDSETKEYCODE = KDSETKEYCODE; 779 unsigned IOCTL_KDSIGACCEPT = KDSIGACCEPT; 780 unsigned IOCTL_KDSKBDIACR = KDSKBDIACR; 781 unsigned IOCTL_KDSKBENT = KDSKBENT; 782 unsigned IOCTL_KDSKBLED = KDSKBLED; 783 unsigned IOCTL_KDSKBMETA = KDSKBMETA; 784 unsigned IOCTL_KDSKBSENT = KDSKBSENT; 785 unsigned IOCTL_KDUNMAPDISP = KDUNMAPDISP; 786 unsigned IOCTL_LPABORT = LPABORT; 787 unsigned IOCTL_LPABORTOPEN = LPABORTOPEN; 788 unsigned IOCTL_LPCAREFUL = LPCAREFUL; 789 unsigned IOCTL_LPCHAR = LPCHAR; 790 unsigned IOCTL_LPGETIRQ = LPGETIRQ; 791 unsigned IOCTL_LPGETSTATUS = LPGETSTATUS; 792 unsigned IOCTL_LPRESET = LPRESET; 793 unsigned IOCTL_LPSETIRQ = LPSETIRQ; 794 unsigned IOCTL_LPTIME = LPTIME; 795 unsigned IOCTL_LPWAIT = LPWAIT; 796 unsigned IOCTL_MTIOCGETCONFIG = MTIOCGETCONFIG; 797 unsigned IOCTL_MTIOCSETCONFIG = MTIOCSETCONFIG; 798 unsigned IOCTL_PIO_CMAP = PIO_CMAP; 799 unsigned IOCTL_PIO_FONT = PIO_FONT; 800 unsigned IOCTL_PIO_UNIMAP = PIO_UNIMAP; 801 unsigned IOCTL_PIO_UNIMAPCLR = PIO_UNIMAPCLR; 802 unsigned IOCTL_PIO_UNISCRNMAP = PIO_UNISCRNMAP; 803 unsigned IOCTL_SCSI_IOCTL_GET_IDLUN = SCSI_IOCTL_GET_IDLUN; 804 unsigned IOCTL_SCSI_IOCTL_PROBE_HOST = SCSI_IOCTL_PROBE_HOST; 805 unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE = SCSI_IOCTL_TAGGED_DISABLE; 806 unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE = SCSI_IOCTL_TAGGED_ENABLE; 807 unsigned IOCTL_SIOCAIPXITFCRT = SIOCAIPXITFCRT; 808 unsigned IOCTL_SIOCAIPXPRISLT = SIOCAIPXPRISLT; 809 unsigned IOCTL_SIOCAX25ADDUID = SIOCAX25ADDUID; 810 unsigned IOCTL_SIOCAX25DELUID = SIOCAX25DELUID; 811 unsigned IOCTL_SIOCAX25GETPARMS = SIOCAX25GETPARMS; 812 unsigned IOCTL_SIOCAX25GETUID = SIOCAX25GETUID; 813 unsigned IOCTL_SIOCAX25NOUID = SIOCAX25NOUID; 814 unsigned IOCTL_SIOCAX25SETPARMS = SIOCAX25SETPARMS; 815 unsigned IOCTL_SIOCDEVPLIP = SIOCDEVPLIP; 816 unsigned IOCTL_SIOCIPXCFGDATA = SIOCIPXCFGDATA; 817 unsigned IOCTL_SIOCNRDECOBS = SIOCNRDECOBS; 818 unsigned IOCTL_SIOCNRGETPARMS = SIOCNRGETPARMS; 819 unsigned IOCTL_SIOCNRRTCTL = SIOCNRRTCTL; 820 unsigned IOCTL_SIOCNRSETPARMS = SIOCNRSETPARMS; 821 unsigned IOCTL_TIOCGSERIAL = TIOCGSERIAL; 822 unsigned IOCTL_TIOCSERGETMULTI = TIOCSERGETMULTI; 823 unsigned IOCTL_TIOCSERSETMULTI = TIOCSERSETMULTI; 824 unsigned IOCTL_TIOCSSERIAL = TIOCSSERIAL; 825 #endif // SANITIZER_LINUX && !SANITIZER_ANDROID 826 827 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 828 unsigned IOCTL_GIO_SCRNMAP = GIO_SCRNMAP; 829 unsigned IOCTL_KDDISABIO = KDDISABIO; 830 unsigned IOCTL_KDENABIO = KDENABIO; 831 unsigned IOCTL_KDGETLED = KDGETLED; 832 unsigned IOCTL_KDGETMODE = KDGETMODE; 833 unsigned IOCTL_KDGKBMODE = KDGKBMODE; 834 unsigned IOCTL_KDGKBTYPE = KDGKBTYPE; 835 unsigned IOCTL_KDMKTONE = KDMKTONE; 836 unsigned IOCTL_KDSETLED = KDSETLED; 837 unsigned IOCTL_KDSETMODE = KDSETMODE; 838 unsigned IOCTL_KDSKBMODE = KDSKBMODE; 839 unsigned IOCTL_KIOCSOUND = KIOCSOUND; 840 unsigned IOCTL_PIO_SCRNMAP = PIO_SCRNMAP; 841 unsigned IOCTL_SNDCTL_DSP_GETISPACE = SNDCTL_DSP_GETISPACE; 842 unsigned IOCTL_SNDCTL_DSP_GETOSPACE = SNDCTL_DSP_GETOSPACE; 843 #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 844 845 const int errno_EINVAL = EINVAL; 846 // EOWNERDEAD is not present in some older platforms. 847 #if defined(EOWNERDEAD) 848 const int errno_EOWNERDEAD = EOWNERDEAD; 849 #else 850 const int errno_EOWNERDEAD = -1; 851 #endif 852 853 const int si_SEGV_MAPERR = SEGV_MAPERR; 854 const int si_SEGV_ACCERR = SEGV_ACCERR; 855 } // namespace __sanitizer 856 857 COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t)); 858 859 COMPILER_CHECK(sizeof(socklen_t) == sizeof(unsigned)); 860 CHECK_TYPE_SIZE(pthread_key_t); 861 862 #if SANITIZER_LINUX 863 // FIXME: We define those on Linux and Mac, but only check on Linux. 864 COMPILER_CHECK(IOC_NRBITS == _IOC_NRBITS); 865 COMPILER_CHECK(IOC_TYPEBITS == _IOC_TYPEBITS); 866 COMPILER_CHECK(IOC_SIZEBITS == _IOC_SIZEBITS); 867 COMPILER_CHECK(IOC_DIRBITS == _IOC_DIRBITS); 868 COMPILER_CHECK(IOC_NRMASK == _IOC_NRMASK); 869 COMPILER_CHECK(IOC_TYPEMASK == _IOC_TYPEMASK); 870 COMPILER_CHECK(IOC_SIZEMASK == _IOC_SIZEMASK); 871 COMPILER_CHECK(IOC_DIRMASK == _IOC_DIRMASK); 872 COMPILER_CHECK(IOC_NRSHIFT == _IOC_NRSHIFT); 873 COMPILER_CHECK(IOC_TYPESHIFT == _IOC_TYPESHIFT); 874 COMPILER_CHECK(IOC_SIZESHIFT == _IOC_SIZESHIFT); 875 COMPILER_CHECK(IOC_DIRSHIFT == _IOC_DIRSHIFT); 876 COMPILER_CHECK(IOC_NONE == _IOC_NONE); 877 COMPILER_CHECK(IOC_WRITE == _IOC_WRITE); 878 COMPILER_CHECK(IOC_READ == _IOC_READ); 879 COMPILER_CHECK(EVIOC_ABS_MAX == ABS_MAX); 880 COMPILER_CHECK(EVIOC_EV_MAX == EV_MAX); 881 COMPILER_CHECK(IOC_SIZE(0x12345678) == _IOC_SIZE(0x12345678)); 882 COMPILER_CHECK(IOC_DIR(0x12345678) == _IOC_DIR(0x12345678)); 883 COMPILER_CHECK(IOC_NR(0x12345678) == _IOC_NR(0x12345678)); 884 COMPILER_CHECK(IOC_TYPE(0x12345678) == _IOC_TYPE(0x12345678)); 885 #endif // SANITIZER_LINUX 886 887 #if SANITIZER_LINUX || SANITIZER_FREEBSD 888 // There are more undocumented fields in dl_phdr_info that we are not interested 889 // in. 890 COMPILER_CHECK(sizeof(__sanitizer_dl_phdr_info) <= sizeof(dl_phdr_info)); 891 CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_addr); 892 CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_name); 893 CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); 894 CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); 895 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 896 897 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 898 CHECK_TYPE_SIZE(glob_t); 899 CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc); 900 CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv); 901 CHECK_SIZE_AND_OFFSET(glob_t, gl_offs); 902 CHECK_SIZE_AND_OFFSET(glob_t, gl_flags); 903 CHECK_SIZE_AND_OFFSET(glob_t, gl_closedir); 904 CHECK_SIZE_AND_OFFSET(glob_t, gl_readdir); 905 CHECK_SIZE_AND_OFFSET(glob_t, gl_opendir); 906 CHECK_SIZE_AND_OFFSET(glob_t, gl_lstat); 907 CHECK_SIZE_AND_OFFSET(glob_t, gl_stat); 908 #endif 909 910 CHECK_TYPE_SIZE(addrinfo); 911 CHECK_SIZE_AND_OFFSET(addrinfo, ai_flags); 912 CHECK_SIZE_AND_OFFSET(addrinfo, ai_family); 913 CHECK_SIZE_AND_OFFSET(addrinfo, ai_socktype); 914 CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); 915 CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); 916 CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen); 917 CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname); 918 CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr); 919 920 CHECK_TYPE_SIZE(hostent); 921 CHECK_SIZE_AND_OFFSET(hostent, h_name); 922 CHECK_SIZE_AND_OFFSET(hostent, h_aliases); 923 CHECK_SIZE_AND_OFFSET(hostent, h_addrtype); 924 CHECK_SIZE_AND_OFFSET(hostent, h_length); 925 CHECK_SIZE_AND_OFFSET(hostent, h_addr_list); 926 927 CHECK_TYPE_SIZE(iovec); 928 CHECK_SIZE_AND_OFFSET(iovec, iov_base); 929 CHECK_SIZE_AND_OFFSET(iovec, iov_len); 930 931 CHECK_TYPE_SIZE(msghdr); 932 CHECK_SIZE_AND_OFFSET(msghdr, msg_name); 933 CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen); 934 CHECK_SIZE_AND_OFFSET(msghdr, msg_iov); 935 CHECK_SIZE_AND_OFFSET(msghdr, msg_iovlen); 936 CHECK_SIZE_AND_OFFSET(msghdr, msg_control); 937 CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen); 938 CHECK_SIZE_AND_OFFSET(msghdr, msg_flags); 939 940 CHECK_TYPE_SIZE(cmsghdr); 941 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len); 942 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level); 943 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); 944 945 COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent)); 946 CHECK_SIZE_AND_OFFSET(dirent, d_ino); 947 #if SANITIZER_MAC 948 CHECK_SIZE_AND_OFFSET(dirent, d_seekoff); 949 #elif SANITIZER_FREEBSD 950 // There is no 'd_off' field on FreeBSD. 951 #else 952 CHECK_SIZE_AND_OFFSET(dirent, d_off); 953 #endif 954 CHECK_SIZE_AND_OFFSET(dirent, d_reclen); 955 956 #if SANITIZER_LINUX && !SANITIZER_ANDROID 957 COMPILER_CHECK(sizeof(__sanitizer_dirent64) <= sizeof(dirent64)); 958 CHECK_SIZE_AND_OFFSET(dirent64, d_ino); 959 CHECK_SIZE_AND_OFFSET(dirent64, d_off); 960 CHECK_SIZE_AND_OFFSET(dirent64, d_reclen); 961 #endif 962 963 CHECK_TYPE_SIZE(ifconf); 964 CHECK_SIZE_AND_OFFSET(ifconf, ifc_len); 965 CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu); 966 967 CHECK_TYPE_SIZE(pollfd); 968 CHECK_SIZE_AND_OFFSET(pollfd, fd); 969 CHECK_SIZE_AND_OFFSET(pollfd, events); 970 CHECK_SIZE_AND_OFFSET(pollfd, revents); 971 972 CHECK_TYPE_SIZE(nfds_t); 973 974 CHECK_TYPE_SIZE(sigset_t); 975 976 COMPILER_CHECK(sizeof(__sanitizer_sigaction) == sizeof(struct sigaction)); 977 // Can't write checks for sa_handler and sa_sigaction due to them being 978 // preprocessor macros. 979 CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_mask); 980 CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_flags); 981 #if SANITIZER_LINUX 982 CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer); 983 #endif 984 985 #if SANITIZER_LINUX 986 CHECK_TYPE_SIZE(__sysctl_args); 987 CHECK_SIZE_AND_OFFSET(__sysctl_args, name); 988 CHECK_SIZE_AND_OFFSET(__sysctl_args, nlen); 989 CHECK_SIZE_AND_OFFSET(__sysctl_args, oldval); 990 CHECK_SIZE_AND_OFFSET(__sysctl_args, oldlenp); 991 CHECK_SIZE_AND_OFFSET(__sysctl_args, newval); 992 CHECK_SIZE_AND_OFFSET(__sysctl_args, newlen); 993 994 CHECK_TYPE_SIZE(__kernel_uid_t); 995 CHECK_TYPE_SIZE(__kernel_gid_t); 996 CHECK_TYPE_SIZE(__kernel_old_uid_t); 997 CHECK_TYPE_SIZE(__kernel_old_gid_t); 998 CHECK_TYPE_SIZE(__kernel_off_t); 999 CHECK_TYPE_SIZE(__kernel_loff_t); 1000 CHECK_TYPE_SIZE(__kernel_fd_set); 1001 #endif 1002 1003 #if !SANITIZER_ANDROID 1004 CHECK_TYPE_SIZE(wordexp_t); 1005 CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc); 1006 CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv); 1007 CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs); 1008 #endif 1009 1010 CHECK_TYPE_SIZE(tm); 1011 CHECK_SIZE_AND_OFFSET(tm, tm_sec); 1012 CHECK_SIZE_AND_OFFSET(tm, tm_min); 1013 CHECK_SIZE_AND_OFFSET(tm, tm_hour); 1014 CHECK_SIZE_AND_OFFSET(tm, tm_mday); 1015 CHECK_SIZE_AND_OFFSET(tm, tm_mon); 1016 CHECK_SIZE_AND_OFFSET(tm, tm_year); 1017 CHECK_SIZE_AND_OFFSET(tm, tm_wday); 1018 CHECK_SIZE_AND_OFFSET(tm, tm_yday); 1019 CHECK_SIZE_AND_OFFSET(tm, tm_isdst); 1020 CHECK_SIZE_AND_OFFSET(tm, tm_gmtoff); 1021 CHECK_SIZE_AND_OFFSET(tm, tm_zone); 1022 1023 #if SANITIZER_LINUX 1024 CHECK_TYPE_SIZE(mntent); 1025 CHECK_SIZE_AND_OFFSET(mntent, mnt_fsname); 1026 CHECK_SIZE_AND_OFFSET(mntent, mnt_dir); 1027 CHECK_SIZE_AND_OFFSET(mntent, mnt_type); 1028 CHECK_SIZE_AND_OFFSET(mntent, mnt_opts); 1029 CHECK_SIZE_AND_OFFSET(mntent, mnt_freq); 1030 CHECK_SIZE_AND_OFFSET(mntent, mnt_passno); 1031 #endif 1032 1033 CHECK_TYPE_SIZE(ether_addr); 1034 1035 #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 1036 CHECK_TYPE_SIZE(ipc_perm); 1037 # if SANITIZER_FREEBSD 1038 CHECK_SIZE_AND_OFFSET(ipc_perm, key); 1039 CHECK_SIZE_AND_OFFSET(ipc_perm, seq); 1040 # else 1041 CHECK_SIZE_AND_OFFSET(ipc_perm, __key); 1042 CHECK_SIZE_AND_OFFSET(ipc_perm, __seq); 1043 # endif 1044 CHECK_SIZE_AND_OFFSET(ipc_perm, uid); 1045 CHECK_SIZE_AND_OFFSET(ipc_perm, gid); 1046 CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); 1047 CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); 1048 CHECK_SIZE_AND_OFFSET(ipc_perm, mode); 1049 1050 CHECK_TYPE_SIZE(shmid_ds); 1051 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm); 1052 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_segsz); 1053 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_atime); 1054 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_dtime); 1055 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_ctime); 1056 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_cpid); 1057 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_lpid); 1058 CHECK_SIZE_AND_OFFSET(shmid_ds, shm_nattch); 1059 #endif 1060 1061 CHECK_TYPE_SIZE(clock_t); 1062 1063 #if SANITIZER_LINUX 1064 CHECK_TYPE_SIZE(clockid_t); 1065 #endif 1066 1067 #if !SANITIZER_ANDROID 1068 CHECK_TYPE_SIZE(ifaddrs); 1069 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next); 1070 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name); 1071 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_addr); 1072 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netmask); 1073 #if SANITIZER_LINUX || SANITIZER_FREEBSD 1074 // Compare against the union, because we can't reach into the union in a 1075 // compliant way. 1076 #ifdef ifa_dstaddr 1077 #undef ifa_dstaddr 1078 #endif 1079 # if SANITIZER_FREEBSD 1080 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); 1081 # else 1082 COMPILER_CHECK(sizeof(((__sanitizer_ifaddrs *)NULL)->ifa_dstaddr) == 1083 sizeof(((ifaddrs *)NULL)->ifa_ifu)); 1084 COMPILER_CHECK(offsetof(__sanitizer_ifaddrs, ifa_dstaddr) == 1085 offsetof(ifaddrs, ifa_ifu)); 1086 # endif // SANITIZER_FREEBSD 1087 #else 1088 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); 1089 #endif // SANITIZER_LINUX 1090 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data); 1091 #endif 1092 1093 #if SANITIZER_LINUX 1094 COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo)); 1095 #endif 1096 1097 #if !SANITIZER_ANDROID 1098 CHECK_TYPE_SIZE(timeb); 1099 CHECK_SIZE_AND_OFFSET(timeb, time); 1100 CHECK_SIZE_AND_OFFSET(timeb, millitm); 1101 CHECK_SIZE_AND_OFFSET(timeb, timezone); 1102 CHECK_SIZE_AND_OFFSET(timeb, dstflag); 1103 #endif 1104 1105 CHECK_TYPE_SIZE(passwd); 1106 CHECK_SIZE_AND_OFFSET(passwd, pw_name); 1107 CHECK_SIZE_AND_OFFSET(passwd, pw_passwd); 1108 CHECK_SIZE_AND_OFFSET(passwd, pw_uid); 1109 CHECK_SIZE_AND_OFFSET(passwd, pw_gid); 1110 CHECK_SIZE_AND_OFFSET(passwd, pw_dir); 1111 CHECK_SIZE_AND_OFFSET(passwd, pw_shell); 1112 1113 #if !SANITIZER_ANDROID 1114 CHECK_SIZE_AND_OFFSET(passwd, pw_gecos); 1115 #endif 1116 1117 #if SANITIZER_MAC 1118 CHECK_SIZE_AND_OFFSET(passwd, pw_change); 1119 CHECK_SIZE_AND_OFFSET(passwd, pw_expire); 1120 CHECK_SIZE_AND_OFFSET(passwd, pw_class); 1121 #endif 1122 1123 1124 CHECK_TYPE_SIZE(group); 1125 CHECK_SIZE_AND_OFFSET(group, gr_name); 1126 CHECK_SIZE_AND_OFFSET(group, gr_passwd); 1127 CHECK_SIZE_AND_OFFSET(group, gr_gid); 1128 CHECK_SIZE_AND_OFFSET(group, gr_mem); 1129 1130 #if SANITIZER_LINUX && !SANITIZER_ANDROID 1131 CHECK_TYPE_SIZE(XDR); 1132 CHECK_SIZE_AND_OFFSET(XDR, x_op); 1133 CHECK_SIZE_AND_OFFSET(XDR, x_ops); 1134 CHECK_SIZE_AND_OFFSET(XDR, x_public); 1135 CHECK_SIZE_AND_OFFSET(XDR, x_private); 1136 CHECK_SIZE_AND_OFFSET(XDR, x_base); 1137 CHECK_SIZE_AND_OFFSET(XDR, x_handy); 1138 COMPILER_CHECK(__sanitizer_XDR_ENCODE == XDR_ENCODE); 1139 COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE); 1140 COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE); 1141 #endif 1142 1143 #if SANITIZER_LINUX && !SANITIZER_ANDROID 1144 COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE)); 1145 CHECK_SIZE_AND_OFFSET(FILE, _flags); 1146 CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr); 1147 CHECK_SIZE_AND_OFFSET(FILE, _IO_read_end); 1148 CHECK_SIZE_AND_OFFSET(FILE, _IO_read_base); 1149 CHECK_SIZE_AND_OFFSET(FILE, _IO_write_ptr); 1150 CHECK_SIZE_AND_OFFSET(FILE, _IO_write_end); 1151 CHECK_SIZE_AND_OFFSET(FILE, _IO_write_base); 1152 CHECK_SIZE_AND_OFFSET(FILE, _IO_buf_base); 1153 CHECK_SIZE_AND_OFFSET(FILE, _IO_buf_end); 1154 CHECK_SIZE_AND_OFFSET(FILE, _IO_save_base); 1155 CHECK_SIZE_AND_OFFSET(FILE, _IO_backup_base); 1156 CHECK_SIZE_AND_OFFSET(FILE, _IO_save_end); 1157 CHECK_SIZE_AND_OFFSET(FILE, _markers); 1158 CHECK_SIZE_AND_OFFSET(FILE, _chain); 1159 CHECK_SIZE_AND_OFFSET(FILE, _fileno); 1160 #endif 1161 1162 #if SANITIZER_LINUX && !SANITIZER_ANDROID 1163 COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk)); 1164 CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit); 1165 CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev); 1166 CHECK_TYPE_SIZE(obstack); 1167 CHECK_SIZE_AND_OFFSET(obstack, chunk_size); 1168 CHECK_SIZE_AND_OFFSET(obstack, chunk); 1169 CHECK_SIZE_AND_OFFSET(obstack, object_base); 1170 CHECK_SIZE_AND_OFFSET(obstack, next_free); 1171 #endif 1172 1173 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC 1174