Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 1 | //===-- sanitizer_platform_limits_posix.cc --------------------------------===// |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 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 | // |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 10 | // This file is a part of Sanitizer common code. |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 11 | // |
| 12 | // Sizes and layouts of platform-specific POSIX data structures. |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 15 | |
| 16 | #include "sanitizer_platform.h" |
| 17 | #if SANITIZER_LINUX || SANITIZER_MAC |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 18 | |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 19 | #include "sanitizer_internal_defs.h" |
| 20 | #include "sanitizer_platform_limits_posix.h" |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 21 | |
Evgeniy Stepanov | 9530eb7 | 2013-04-23 14:05:15 +0000 | [diff] [blame] | 22 | #include <arpa/inet.h> |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 23 | #include <dirent.h> |
Evgeniy Stepanov | 103a63e | 2013-04-23 12:01:20 +0000 | [diff] [blame] | 24 | #include <grp.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 25 | #include <net/if.h> |
| 26 | #include <net/if_arp.h> |
| 27 | #include <net/route.h> |
| 28 | #include <netdb.h> |
Evgeniy Stepanov | 10fd322 | 2013-03-13 09:01:40 +0000 | [diff] [blame] | 29 | #include <pthread.h> |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 30 | #include <pwd.h> |
| 31 | #include <signal.h> |
Evgeniy Stepanov | 0228452 | 2013-05-17 13:30:48 +0000 | [diff] [blame] | 32 | #include <stddef.h> |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 33 | #include <sys/resource.h> |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 34 | #include <sys/socket.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 35 | #include <sys/stat.h> |
| 36 | #include <sys/time.h> |
| 37 | #include <sys/types.h> |
| 38 | #include <sys/utsname.h> |
| 39 | #include <termios.h> |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 40 | #include <time.h> |
| 41 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 42 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 43 | #include <sys/mount.h> |
Evgeniy Stepanov | 341b9e6 | 2013-06-28 11:02:43 +0000 | [diff] [blame] | 44 | #include <sys/ptrace.h> |
Evgeniy Stepanov | 359d7fc | 2013-06-24 14:25:33 +0000 | [diff] [blame] | 45 | #include <sys/sysinfo.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 46 | #include <sys/vt.h> |
| 47 | #include <linux/cdrom.h> |
| 48 | #include <linux/fd.h> |
Evgeniy Stepanov | 7965e95 | 2013-06-18 09:49:04 +0000 | [diff] [blame] | 49 | #include <linux/fs.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 50 | #include <linux/hdreg.h> |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 51 | #include <linux/input.h> |
| 52 | #include <linux/ioctl.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 53 | #include <linux/soundcard.h> |
| 54 | #endif |
| 55 | |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 56 | #if !SANITIZER_ANDROID |
| 57 | #include <sys/ucontext.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 58 | #endif |
| 59 | |
| 60 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | 22ec6d9 | 2013-06-19 10:36:31 +0000 | [diff] [blame] | 61 | #include <net/if_ppp.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 62 | #include <netax25/ax25.h> |
| 63 | #include <netipx/ipx.h> |
| 64 | #include <netrom/netrom.h> |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 65 | #include <scsi/scsi.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 66 | #include <sys/mtio.h> |
| 67 | #include <sys/kd.h> |
Evgeniy Stepanov | d50d29e | 2013-06-28 14:18:10 +0000 | [diff] [blame] | 68 | #include <sys/user.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 69 | #include <linux/cyclades.h> |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 70 | #include <linux/if_eql.h> |
| 71 | #include <linux/if_plip.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 72 | #include <linux/lp.h> |
| 73 | #include <linux/mroute.h> |
| 74 | #include <linux/mroute6.h> |
| 75 | #include <linux/scc.h> |
| 76 | #include <linux/serial.h> |
| 77 | #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
| 78 | |
| 79 | #if SANITIZER_ANDROID |
Evgeniy Stepanov | 4ce6f79 | 2013-06-07 14:56:54 +0000 | [diff] [blame] | 80 | #include <linux/kd.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 81 | #include <linux/mtio.h> |
Evgeniy Stepanov | 22ec6d9 | 2013-06-19 10:36:31 +0000 | [diff] [blame] | 82 | #include <linux/ppp_defs.h> |
| 83 | #include <linux/if_ppp.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 84 | #endif |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 85 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 86 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 1aad6b5 | 2013-05-17 12:51:13 +0000 | [diff] [blame] | 87 | #include <link.h> |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 88 | #include <sys/vfs.h> |
| 89 | #include <sys/epoll.h> |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 90 | #endif // SANITIZER_LINUX |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 91 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 92 | #if SANITIZER_MAC |
| 93 | #include <netinet/ip_mroute.h> |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 94 | #include <sys/filio.h> |
| 95 | #include <sys/sockio.h> |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 96 | #endif |
| 97 | |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 98 | namespace __sanitizer { |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 99 | unsigned struct_utsname_sz = sizeof(struct utsname); |
| 100 | unsigned struct_stat_sz = sizeof(struct stat); |
| 101 | unsigned struct_stat64_sz = sizeof(struct stat64); |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 102 | unsigned struct_rusage_sz = sizeof(struct rusage); |
| 103 | unsigned struct_tm_sz = sizeof(struct tm); |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 104 | unsigned struct_passwd_sz = sizeof(struct passwd); |
Evgeniy Stepanov | 103a63e | 2013-04-23 12:01:20 +0000 | [diff] [blame] | 105 | unsigned struct_group_sz = sizeof(struct group); |
Evgeniy Stepanov | 897a4ae | 2013-04-09 14:34:59 +0000 | [diff] [blame] | 106 | unsigned siginfo_t_sz = sizeof(siginfo_t); |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 107 | unsigned struct_sigaction_sz = sizeof(struct sigaction); |
| 108 | unsigned struct_itimerval_sz = sizeof(struct itimerval); |
| 109 | unsigned pthread_t_sz = sizeof(pthread_t); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 110 | unsigned pid_t_sz = sizeof(pid_t); |
| 111 | unsigned timeval_sz = sizeof(timeval); |
| 112 | unsigned uid_t_sz = sizeof(uid_t); |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 113 | |
| 114 | #if !SANITIZER_ANDROID |
Evgeniy Stepanov | 0727702 | 2013-04-04 09:03:56 +0000 | [diff] [blame] | 115 | unsigned ucontext_t_sz = sizeof(ucontext_t); |
Evgeniy Stepanov | 4fb04a8 | 2013-04-04 09:21:48 +0000 | [diff] [blame] | 116 | #endif // !SANITIZER_ANDROID |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 117 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 118 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 119 | unsigned struct_rlimit_sz = sizeof(struct rlimit); |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 120 | unsigned struct_statfs_sz = sizeof(struct statfs); |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 121 | unsigned struct_epoll_event_sz = sizeof(struct epoll_event); |
Evgeniy Stepanov | 359d7fc | 2013-06-24 14:25:33 +0000 | [diff] [blame] | 122 | unsigned struct_sysinfo_sz = sizeof(struct sysinfo); |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 123 | unsigned struct_timespec_sz = sizeof(struct timespec); |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 124 | #endif // SANITIZER_LINUX |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 125 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 126 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | b711ca6 | 2013-02-19 11:06:41 +0000 | [diff] [blame] | 127 | unsigned struct_rlimit64_sz = sizeof(struct rlimit64); |
| 128 | unsigned struct_statfs64_sz = sizeof(struct statfs64); |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 129 | #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | b711ca6 | 2013-02-19 11:06:41 +0000 | [diff] [blame] | 130 | |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 131 | uptr sig_ign = (uptr)SIG_IGN; |
| 132 | uptr sig_dfl = (uptr)SIG_DFL; |
| 133 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 134 | #if SANITIZER_LINUX |
| 135 | int e_tabsz = (int)E_TABSZ; |
| 136 | #endif |
| 137 | |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 138 | uptr __sanitizer_get_sigaction_sa_sigaction(void *act) { |
| 139 | struct sigaction *a = (struct sigaction *)act; |
| 140 | // Check that sa_sigaction and sa_handler are the same. |
| 141 | CHECK((void *)&(a->sa_sigaction) == (void *)&(a->sa_handler)); |
| 142 | return (uptr) a->sa_sigaction; |
| 143 | } |
| 144 | void __sanitizer_set_sigaction_sa_sigaction(void *act, uptr cb) { |
| 145 | struct sigaction *a = (struct sigaction *)act; |
| 146 | a->sa_sigaction = (void (*)(int, siginfo_t *, void *))cb; |
| 147 | } |
| 148 | bool __sanitizer_get_sigaction_sa_siginfo(void *act) { |
| 149 | struct sigaction *a = (struct sigaction *)act; |
| 150 | return a->sa_flags & SA_SIGINFO; |
| 151 | } |
Evgeniy Stepanov | 9530eb7 | 2013-04-23 14:05:15 +0000 | [diff] [blame] | 152 | |
Evgeniy Stepanov | 9d60087 | 2013-06-24 13:56:14 +0000 | [diff] [blame] | 153 | int af_inet = (int)AF_INET; |
| 154 | int af_inet6 = (int)AF_INET6; |
| 155 | |
Evgeniy Stepanov | 9530eb7 | 2013-04-23 14:05:15 +0000 | [diff] [blame] | 156 | uptr __sanitizer_in_addr_sz(int af) { |
| 157 | if (af == AF_INET) |
| 158 | return sizeof(struct in_addr); |
| 159 | else if (af == AF_INET6) |
| 160 | return sizeof(struct in6_addr); |
| 161 | else |
| 162 | return 0; |
| 163 | } |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 164 | |
Evgeniy Stepanov | d50d29e | 2013-06-28 14:18:10 +0000 | [diff] [blame] | 165 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Evgeniy Stepanov | 341b9e6 | 2013-06-28 11:02:43 +0000 | [diff] [blame] | 166 | unsigned struct_user_regs_struct_sz = sizeof(struct user_regs_struct); |
| 167 | unsigned struct_user_fpregs_struct_sz = sizeof(struct user_fpregs_struct); |
| 168 | #if __WORDSIZE == 64 |
| 169 | unsigned struct_user_fpxregs_struct_sz = 0; |
| 170 | #else |
| 171 | unsigned struct_user_fpxregs_struct_sz = sizeof(struct user_fpxregs_struct); |
| 172 | #endif |
| 173 | |
| 174 | int ptrace_getregs = PTRACE_GETREGS; |
| 175 | int ptrace_setregs = PTRACE_SETREGS; |
| 176 | int ptrace_getfpregs = PTRACE_GETFPREGS; |
| 177 | int ptrace_setfpregs = PTRACE_SETFPREGS; |
| 178 | int ptrace_getfpxregs = PTRACE_GETFPXREGS; |
| 179 | int ptrace_setfpxregs = PTRACE_SETFPXREGS; |
| 180 | int ptrace_getsiginfo = PTRACE_GETSIGINFO; |
| 181 | int ptrace_setsiginfo = PTRACE_SETSIGINFO; |
| 182 | int ptrace_getregset = PTRACE_GETREGSET; |
| 183 | int ptrace_setregset = PTRACE_SETREGSET; |
| 184 | #endif |
| 185 | |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 186 | // ioctl arguments |
| 187 | unsigned struct_arpreq_sz = sizeof(struct arpreq); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 188 | unsigned struct_ifreq_sz = sizeof(struct ifreq); |
| 189 | unsigned struct_termios_sz = sizeof(struct termios); |
| 190 | unsigned struct_winsize_sz = sizeof(struct winsize); |
| 191 | |
| 192 | #if SANITIZER_LINUX |
| 193 | unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf); |
| 194 | unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession); |
| 195 | unsigned struct_cdrom_read_audio_sz = sizeof(struct cdrom_read_audio); |
| 196 | unsigned struct_cdrom_subchnl_sz = sizeof(struct cdrom_subchnl); |
| 197 | unsigned struct_cdrom_ti_sz = sizeof(struct cdrom_ti); |
| 198 | unsigned struct_cdrom_tocentry_sz = sizeof(struct cdrom_tocentry); |
| 199 | unsigned struct_cdrom_tochdr_sz = sizeof(struct cdrom_tochdr); |
| 200 | unsigned struct_cdrom_volctrl_sz = sizeof(struct cdrom_volctrl); |
Evgeniy Stepanov | 4f116ad | 2013-06-26 08:16:38 +0000 | [diff] [blame] | 201 | #if SOUND_VERSION >= 0x040000 |
| 202 | unsigned struct_copr_buffer_sz = 0; |
| 203 | unsigned struct_copr_debug_buf_sz = 0; |
| 204 | unsigned struct_copr_msg_sz = 0; |
| 205 | #else |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 206 | unsigned struct_copr_buffer_sz = sizeof(struct copr_buffer); |
| 207 | unsigned struct_copr_debug_buf_sz = sizeof(struct copr_debug_buf); |
| 208 | unsigned struct_copr_msg_sz = sizeof(struct copr_msg); |
Evgeniy Stepanov | 4f116ad | 2013-06-26 08:16:38 +0000 | [diff] [blame] | 209 | #endif |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 210 | unsigned struct_ff_effect_sz = sizeof(struct ff_effect); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 211 | unsigned struct_floppy_drive_params_sz = sizeof(struct floppy_drive_params); |
| 212 | unsigned struct_floppy_drive_struct_sz = sizeof(struct floppy_drive_struct); |
| 213 | unsigned struct_floppy_fdc_state_sz = sizeof(struct floppy_fdc_state); |
| 214 | unsigned struct_floppy_max_errors_sz = sizeof(struct floppy_max_errors); |
| 215 | unsigned struct_floppy_raw_cmd_sz = sizeof(struct floppy_raw_cmd); |
| 216 | unsigned struct_floppy_struct_sz = sizeof(struct floppy_struct); |
| 217 | unsigned struct_floppy_write_errors_sz = sizeof(struct floppy_write_errors); |
| 218 | unsigned struct_format_descr_sz = sizeof(struct format_descr); |
| 219 | unsigned struct_hd_driveid_sz = sizeof(struct hd_driveid); |
| 220 | unsigned struct_hd_geometry_sz = sizeof(struct hd_geometry); |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 221 | unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo); |
| 222 | unsigned struct_input_id_sz = sizeof(struct input_id); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 223 | unsigned struct_midi_info_sz = sizeof(struct midi_info); |
| 224 | unsigned struct_mtget_sz = sizeof(struct mtget); |
| 225 | unsigned struct_mtop_sz = sizeof(struct mtop); |
| 226 | unsigned struct_mtpos_sz = sizeof(struct mtpos); |
| 227 | unsigned struct_rtentry_sz = sizeof(struct rtentry); |
| 228 | unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument); |
| 229 | unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec); |
| 230 | unsigned struct_synth_info_sz = sizeof(struct synth_info); |
| 231 | unsigned struct_termio_sz = sizeof(struct termio); |
| 232 | unsigned struct_vt_consize_sz = sizeof(struct vt_consize); |
| 233 | unsigned struct_vt_mode_sz = sizeof(struct vt_mode); |
| 234 | unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); |
| 235 | unsigned struct_vt_stat_sz = sizeof(struct vt_stat); |
| 236 | #endif |
| 237 | |
| 238 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 239 | unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info); |
| 240 | unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); |
| 241 | unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 242 | #if EV_VERSION > (0x010000) |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 243 | unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 244 | #else |
| 245 | unsigned struct_input_keymap_entry_sz = 0; |
| 246 | #endif |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 247 | unsigned struct_ipx_config_data_sz = sizeof(struct ipx_config_data); |
| 248 | unsigned struct_kbdiacrs_sz = sizeof(struct kbdiacrs); |
| 249 | unsigned struct_kbentry_sz = sizeof(struct kbentry); |
| 250 | unsigned struct_kbkeycode_sz = sizeof(struct kbkeycode); |
| 251 | unsigned struct_kbsentry_sz = sizeof(struct kbsentry); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 252 | unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo); |
| 253 | unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct); |
| 254 | unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats); |
| 255 | unsigned struct_scc_modem_sz = sizeof(struct scc_modem); |
| 256 | unsigned struct_scc_stat_sz = sizeof(struct scc_stat); |
Dmitry Vyukov | 4f0fd8e | 2013-06-10 10:00:54 +0000 | [diff] [blame] | 257 | unsigned struct_serial_multiport_struct_sz |
| 258 | = sizeof(struct serial_multiport_struct); |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 259 | unsigned struct_serial_struct_sz = sizeof(struct serial_struct); |
| 260 | unsigned struct_sockaddr_ax25_sz = sizeof(struct sockaddr_ax25); |
| 261 | unsigned struct_unimapdesc_sz = sizeof(struct unimapdesc); |
| 262 | unsigned struct_unimapinit_sz = sizeof(struct unimapinit); |
| 263 | #endif |
| 264 | |
Dmitry Vyukov | 4f0fd8e | 2013-06-10 10:00:54 +0000 | [diff] [blame] | 265 | #if !SANITIZER_ANDROID |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 266 | unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req); |
| 267 | unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req); |
| 268 | #endif |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 269 | |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 270 | unsigned IOCTL_NOT_PRESENT = 0; |
| 271 | |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 272 | unsigned IOCTL_FIOASYNC = FIOASYNC; |
| 273 | unsigned IOCTL_FIOCLEX = FIOCLEX; |
| 274 | unsigned IOCTL_FIOGETOWN = FIOGETOWN; |
| 275 | unsigned IOCTL_FIONBIO = FIONBIO; |
| 276 | unsigned IOCTL_FIONCLEX = FIONCLEX; |
| 277 | unsigned IOCTL_FIOSETOWN = FIOSETOWN; |
| 278 | unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI; |
| 279 | unsigned IOCTL_SIOCATMARK = SIOCATMARK; |
| 280 | unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI; |
| 281 | unsigned IOCTL_SIOCGIFADDR = SIOCGIFADDR; |
| 282 | unsigned IOCTL_SIOCGIFBRDADDR = SIOCGIFBRDADDR; |
| 283 | unsigned IOCTL_SIOCGIFCONF = SIOCGIFCONF; |
| 284 | unsigned IOCTL_SIOCGIFDSTADDR = SIOCGIFDSTADDR; |
| 285 | unsigned IOCTL_SIOCGIFFLAGS = SIOCGIFFLAGS; |
| 286 | unsigned IOCTL_SIOCGIFMETRIC = SIOCGIFMETRIC; |
| 287 | unsigned IOCTL_SIOCGIFMTU = SIOCGIFMTU; |
| 288 | unsigned IOCTL_SIOCGIFNETMASK = SIOCGIFNETMASK; |
| 289 | unsigned IOCTL_SIOCGPGRP = SIOCGPGRP; |
| 290 | unsigned IOCTL_SIOCSIFADDR = SIOCSIFADDR; |
| 291 | unsigned IOCTL_SIOCSIFBRDADDR = SIOCSIFBRDADDR; |
| 292 | unsigned IOCTL_SIOCSIFDSTADDR = SIOCSIFDSTADDR; |
| 293 | unsigned IOCTL_SIOCSIFFLAGS = SIOCSIFFLAGS; |
| 294 | unsigned IOCTL_SIOCSIFMETRIC = SIOCSIFMETRIC; |
| 295 | unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU; |
| 296 | unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK; |
| 297 | unsigned IOCTL_SIOCSPGRP = SIOCSPGRP; |
| 298 | unsigned IOCTL_TIOCCONS = TIOCCONS; |
| 299 | unsigned IOCTL_TIOCEXCL = TIOCEXCL; |
| 300 | unsigned IOCTL_TIOCGETD = TIOCGETD; |
| 301 | unsigned IOCTL_TIOCGPGRP = TIOCGPGRP; |
| 302 | unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ; |
| 303 | unsigned IOCTL_TIOCMBIC = TIOCMBIC; |
| 304 | unsigned IOCTL_TIOCMBIS = TIOCMBIS; |
| 305 | unsigned IOCTL_TIOCMGET = TIOCMGET; |
| 306 | unsigned IOCTL_TIOCMSET = TIOCMSET; |
| 307 | unsigned IOCTL_TIOCNOTTY = TIOCNOTTY; |
| 308 | unsigned IOCTL_TIOCNXCL = TIOCNXCL; |
| 309 | unsigned IOCTL_TIOCOUTQ = TIOCOUTQ; |
| 310 | unsigned IOCTL_TIOCPKT = TIOCPKT; |
| 311 | unsigned IOCTL_TIOCSCTTY = TIOCSCTTY; |
| 312 | unsigned IOCTL_TIOCSETD = TIOCSETD; |
| 313 | unsigned IOCTL_TIOCSPGRP = TIOCSPGRP; |
| 314 | unsigned IOCTL_TIOCSTI = TIOCSTI; |
| 315 | unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ; |
| 316 | #if (SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_MAC |
| 317 | unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT; |
| 318 | unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT; |
| 319 | #endif |
| 320 | #if SANITIZER_LINUX |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 321 | unsigned IOCTL_EVIOCGABS = EVIOCGABS(0); |
| 322 | unsigned IOCTL_EVIOCGBIT = EVIOCGBIT(0, 0); |
| 323 | unsigned IOCTL_EVIOCGEFFECTS = EVIOCGEFFECTS; |
| 324 | unsigned IOCTL_EVIOCGID = EVIOCGID; |
| 325 | unsigned IOCTL_EVIOCGKEY = EVIOCGKEY(0); |
| 326 | unsigned IOCTL_EVIOCGKEYCODE = EVIOCGKEYCODE; |
| 327 | unsigned IOCTL_EVIOCGLED = EVIOCGLED(0); |
| 328 | unsigned IOCTL_EVIOCGNAME = EVIOCGNAME(0); |
| 329 | unsigned IOCTL_EVIOCGPHYS = EVIOCGPHYS(0); |
| 330 | unsigned IOCTL_EVIOCGRAB = EVIOCGRAB; |
| 331 | unsigned IOCTL_EVIOCGREP = EVIOCGREP; |
| 332 | unsigned IOCTL_EVIOCGSND = EVIOCGSND(0); |
| 333 | unsigned IOCTL_EVIOCGSW = EVIOCGSW(0); |
| 334 | unsigned IOCTL_EVIOCGUNIQ = EVIOCGUNIQ(0); |
| 335 | unsigned IOCTL_EVIOCGVERSION = EVIOCGVERSION; |
| 336 | unsigned IOCTL_EVIOCRMFF = EVIOCRMFF; |
| 337 | unsigned IOCTL_EVIOCSABS = EVIOCSABS(0); |
| 338 | unsigned IOCTL_EVIOCSFF = EVIOCSFF; |
| 339 | unsigned IOCTL_EVIOCSKEYCODE = EVIOCSKEYCODE; |
| 340 | unsigned IOCTL_EVIOCSREP = EVIOCSREP; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 341 | unsigned IOCTL_BLKFLSBUF = BLKFLSBUF; |
| 342 | unsigned IOCTL_BLKGETSIZE = BLKGETSIZE; |
| 343 | unsigned IOCTL_BLKRAGET = BLKRAGET; |
| 344 | unsigned IOCTL_BLKRASET = BLKRASET; |
| 345 | unsigned IOCTL_BLKROGET = BLKROGET; |
| 346 | unsigned IOCTL_BLKROSET = BLKROSET; |
| 347 | unsigned IOCTL_BLKRRPART = BLKRRPART; |
| 348 | unsigned IOCTL_CDROMAUDIOBUFSIZ = CDROMAUDIOBUFSIZ; |
| 349 | unsigned IOCTL_CDROMEJECT = CDROMEJECT; |
| 350 | unsigned IOCTL_CDROMEJECT_SW = CDROMEJECT_SW; |
| 351 | unsigned IOCTL_CDROMMULTISESSION = CDROMMULTISESSION; |
| 352 | unsigned IOCTL_CDROMPAUSE = CDROMPAUSE; |
| 353 | unsigned IOCTL_CDROMPLAYMSF = CDROMPLAYMSF; |
| 354 | unsigned IOCTL_CDROMPLAYTRKIND = CDROMPLAYTRKIND; |
| 355 | unsigned IOCTL_CDROMREADAUDIO = CDROMREADAUDIO; |
| 356 | unsigned IOCTL_CDROMREADCOOKED = CDROMREADCOOKED; |
| 357 | unsigned IOCTL_CDROMREADMODE1 = CDROMREADMODE1; |
| 358 | unsigned IOCTL_CDROMREADMODE2 = CDROMREADMODE2; |
| 359 | unsigned IOCTL_CDROMREADRAW = CDROMREADRAW; |
| 360 | unsigned IOCTL_CDROMREADTOCENTRY = CDROMREADTOCENTRY; |
| 361 | unsigned IOCTL_CDROMREADTOCHDR = CDROMREADTOCHDR; |
| 362 | unsigned IOCTL_CDROMRESET = CDROMRESET; |
| 363 | unsigned IOCTL_CDROMRESUME = CDROMRESUME; |
| 364 | unsigned IOCTL_CDROMSEEK = CDROMSEEK; |
| 365 | unsigned IOCTL_CDROMSTART = CDROMSTART; |
| 366 | unsigned IOCTL_CDROMSTOP = CDROMSTOP; |
| 367 | unsigned IOCTL_CDROMSUBCHNL = CDROMSUBCHNL; |
| 368 | unsigned IOCTL_CDROMVOLCTRL = CDROMVOLCTRL; |
| 369 | unsigned IOCTL_CDROMVOLREAD = CDROMVOLREAD; |
| 370 | unsigned IOCTL_CDROM_GET_UPC = CDROM_GET_UPC; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 371 | unsigned IOCTL_FDCLRPRM = FDCLRPRM; |
| 372 | unsigned IOCTL_FDDEFPRM = FDDEFPRM; |
| 373 | unsigned IOCTL_FDFLUSH = FDFLUSH; |
| 374 | unsigned IOCTL_FDFMTBEG = FDFMTBEG; |
| 375 | unsigned IOCTL_FDFMTEND = FDFMTEND; |
| 376 | unsigned IOCTL_FDFMTTRK = FDFMTTRK; |
| 377 | unsigned IOCTL_FDGETDRVPRM = FDGETDRVPRM; |
| 378 | unsigned IOCTL_FDGETDRVSTAT = FDGETDRVSTAT; |
| 379 | unsigned IOCTL_FDGETDRVTYP = FDGETDRVTYP; |
| 380 | unsigned IOCTL_FDGETFDCSTAT = FDGETFDCSTAT; |
| 381 | unsigned IOCTL_FDGETMAXERRS = FDGETMAXERRS; |
| 382 | unsigned IOCTL_FDGETPRM = FDGETPRM; |
| 383 | unsigned IOCTL_FDMSGOFF = FDMSGOFF; |
| 384 | unsigned IOCTL_FDMSGON = FDMSGON; |
| 385 | unsigned IOCTL_FDPOLLDRVSTAT = FDPOLLDRVSTAT; |
| 386 | unsigned IOCTL_FDRAWCMD = FDRAWCMD; |
| 387 | unsigned IOCTL_FDRESET = FDRESET; |
| 388 | unsigned IOCTL_FDSETDRVPRM = FDSETDRVPRM; |
| 389 | unsigned IOCTL_FDSETEMSGTRESH = FDSETEMSGTRESH; |
| 390 | unsigned IOCTL_FDSETMAXERRS = FDSETMAXERRS; |
| 391 | unsigned IOCTL_FDSETPRM = FDSETPRM; |
| 392 | unsigned IOCTL_FDTWADDLE = FDTWADDLE; |
| 393 | unsigned IOCTL_FDWERRORCLR = FDWERRORCLR; |
| 394 | unsigned IOCTL_FDWERRORGET = FDWERRORGET; |
| 395 | unsigned IOCTL_HDIO_DRIVE_CMD = HDIO_DRIVE_CMD; |
| 396 | unsigned IOCTL_HDIO_GETGEO = HDIO_GETGEO; |
| 397 | unsigned IOCTL_HDIO_GET_32BIT = HDIO_GET_32BIT; |
| 398 | unsigned IOCTL_HDIO_GET_DMA = HDIO_GET_DMA; |
| 399 | unsigned IOCTL_HDIO_GET_IDENTITY = HDIO_GET_IDENTITY; |
| 400 | unsigned IOCTL_HDIO_GET_KEEPSETTINGS = HDIO_GET_KEEPSETTINGS; |
| 401 | unsigned IOCTL_HDIO_GET_MULTCOUNT = HDIO_GET_MULTCOUNT; |
| 402 | unsigned IOCTL_HDIO_GET_NOWERR = HDIO_GET_NOWERR; |
| 403 | unsigned IOCTL_HDIO_GET_UNMASKINTR = HDIO_GET_UNMASKINTR; |
| 404 | unsigned IOCTL_HDIO_SET_32BIT = HDIO_SET_32BIT; |
| 405 | unsigned IOCTL_HDIO_SET_DMA = HDIO_SET_DMA; |
| 406 | unsigned IOCTL_HDIO_SET_KEEPSETTINGS = HDIO_SET_KEEPSETTINGS; |
| 407 | unsigned IOCTL_HDIO_SET_MULTCOUNT = HDIO_SET_MULTCOUNT; |
| 408 | unsigned IOCTL_HDIO_SET_NOWERR = HDIO_SET_NOWERR; |
| 409 | unsigned IOCTL_HDIO_SET_UNMASKINTR = HDIO_SET_UNMASKINTR; |
| 410 | unsigned IOCTL_MTIOCGET = MTIOCGET; |
| 411 | unsigned IOCTL_MTIOCPOS = MTIOCPOS; |
| 412 | unsigned IOCTL_MTIOCTOP = MTIOCTOP; |
| 413 | unsigned IOCTL_PPPIOCGASYNCMAP = PPPIOCGASYNCMAP; |
| 414 | unsigned IOCTL_PPPIOCGDEBUG = PPPIOCGDEBUG; |
| 415 | unsigned IOCTL_PPPIOCGFLAGS = PPPIOCGFLAGS; |
| 416 | unsigned IOCTL_PPPIOCGUNIT = PPPIOCGUNIT; |
| 417 | unsigned IOCTL_PPPIOCGXASYNCMAP = PPPIOCGXASYNCMAP; |
| 418 | unsigned IOCTL_PPPIOCSASYNCMAP = PPPIOCSASYNCMAP; |
| 419 | unsigned IOCTL_PPPIOCSDEBUG = PPPIOCSDEBUG; |
| 420 | unsigned IOCTL_PPPIOCSFLAGS = PPPIOCSFLAGS; |
| 421 | unsigned IOCTL_PPPIOCSMAXCID = PPPIOCSMAXCID; |
| 422 | unsigned IOCTL_PPPIOCSMRU = PPPIOCSMRU; |
| 423 | unsigned IOCTL_PPPIOCSXASYNCMAP = PPPIOCSXASYNCMAP; |
| 424 | unsigned IOCTL_SIOCADDRT = SIOCADDRT; |
| 425 | unsigned IOCTL_SIOCDARP = SIOCDARP; |
| 426 | unsigned IOCTL_SIOCDELRT = SIOCDELRT; |
| 427 | unsigned IOCTL_SIOCDRARP = SIOCDRARP; |
| 428 | unsigned IOCTL_SIOCGARP = SIOCGARP; |
| 429 | unsigned IOCTL_SIOCGIFENCAP = SIOCGIFENCAP; |
| 430 | unsigned IOCTL_SIOCGIFHWADDR = SIOCGIFHWADDR; |
| 431 | unsigned IOCTL_SIOCGIFMAP = SIOCGIFMAP; |
| 432 | unsigned IOCTL_SIOCGIFMEM = SIOCGIFMEM; |
| 433 | unsigned IOCTL_SIOCGIFNAME = SIOCGIFNAME; |
| 434 | unsigned IOCTL_SIOCGIFSLAVE = SIOCGIFSLAVE; |
| 435 | unsigned IOCTL_SIOCGRARP = SIOCGRARP; |
| 436 | unsigned IOCTL_SIOCGSTAMP = SIOCGSTAMP; |
| 437 | unsigned IOCTL_SIOCSARP = SIOCSARP; |
| 438 | unsigned IOCTL_SIOCSIFENCAP = SIOCSIFENCAP; |
| 439 | unsigned IOCTL_SIOCSIFHWADDR = SIOCSIFHWADDR; |
| 440 | unsigned IOCTL_SIOCSIFLINK = SIOCSIFLINK; |
| 441 | unsigned IOCTL_SIOCSIFMAP = SIOCSIFMAP; |
| 442 | unsigned IOCTL_SIOCSIFMEM = SIOCSIFMEM; |
| 443 | unsigned IOCTL_SIOCSIFSLAVE = SIOCSIFSLAVE; |
| 444 | unsigned IOCTL_SIOCSRARP = SIOCSRARP; |
Evgeniy Stepanov | 4f116ad | 2013-06-26 08:16:38 +0000 | [diff] [blame] | 445 | #if SOUND_VERSION >= 0x040000 |
| 446 | unsigned IOCTL_SNDCTL_COPR_HALT = IOCTL_NOT_PRESENT; |
| 447 | unsigned IOCTL_SNDCTL_COPR_LOAD = IOCTL_NOT_PRESENT; |
| 448 | unsigned IOCTL_SNDCTL_COPR_RCODE = IOCTL_NOT_PRESENT; |
| 449 | unsigned IOCTL_SNDCTL_COPR_RCVMSG = IOCTL_NOT_PRESENT; |
| 450 | unsigned IOCTL_SNDCTL_COPR_RDATA = IOCTL_NOT_PRESENT; |
| 451 | unsigned IOCTL_SNDCTL_COPR_RESET = IOCTL_NOT_PRESENT; |
| 452 | unsigned IOCTL_SNDCTL_COPR_RUN = IOCTL_NOT_PRESENT; |
| 453 | unsigned IOCTL_SNDCTL_COPR_SENDMSG = IOCTL_NOT_PRESENT; |
| 454 | unsigned IOCTL_SNDCTL_COPR_WCODE = IOCTL_NOT_PRESENT; |
| 455 | unsigned IOCTL_SNDCTL_COPR_WDATA = IOCTL_NOT_PRESENT; |
| 456 | unsigned IOCTL_SOUND_PCM_READ_BITS = IOCTL_NOT_PRESENT; |
| 457 | unsigned IOCTL_SOUND_PCM_READ_CHANNELS = IOCTL_NOT_PRESENT; |
| 458 | unsigned IOCTL_SOUND_PCM_READ_FILTER = IOCTL_NOT_PRESENT; |
| 459 | unsigned IOCTL_SOUND_PCM_READ_RATE = IOCTL_NOT_PRESENT; |
| 460 | unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = IOCTL_NOT_PRESENT; |
| 461 | unsigned IOCTL_SOUND_PCM_WRITE_FILTER = IOCTL_NOT_PRESENT; |
| 462 | #else |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 463 | unsigned IOCTL_SNDCTL_COPR_HALT = SNDCTL_COPR_HALT; |
| 464 | unsigned IOCTL_SNDCTL_COPR_LOAD = SNDCTL_COPR_LOAD; |
| 465 | unsigned IOCTL_SNDCTL_COPR_RCODE = SNDCTL_COPR_RCODE; |
| 466 | unsigned IOCTL_SNDCTL_COPR_RCVMSG = SNDCTL_COPR_RCVMSG; |
| 467 | unsigned IOCTL_SNDCTL_COPR_RDATA = SNDCTL_COPR_RDATA; |
| 468 | unsigned IOCTL_SNDCTL_COPR_RESET = SNDCTL_COPR_RESET; |
| 469 | unsigned IOCTL_SNDCTL_COPR_RUN = SNDCTL_COPR_RUN; |
| 470 | unsigned IOCTL_SNDCTL_COPR_SENDMSG = SNDCTL_COPR_SENDMSG; |
| 471 | unsigned IOCTL_SNDCTL_COPR_WCODE = SNDCTL_COPR_WCODE; |
| 472 | unsigned IOCTL_SNDCTL_COPR_WDATA = SNDCTL_COPR_WDATA; |
Evgeniy Stepanov | 4f116ad | 2013-06-26 08:16:38 +0000 | [diff] [blame] | 473 | unsigned IOCTL_SOUND_PCM_READ_BITS = SOUND_PCM_READ_BITS; |
| 474 | unsigned IOCTL_SOUND_PCM_READ_CHANNELS = SOUND_PCM_READ_CHANNELS; |
| 475 | unsigned IOCTL_SOUND_PCM_READ_FILTER = SOUND_PCM_READ_FILTER; |
| 476 | unsigned IOCTL_SOUND_PCM_READ_RATE = SOUND_PCM_READ_RATE; |
| 477 | unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = SOUND_PCM_WRITE_CHANNELS; |
| 478 | unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER; |
| 479 | #endif |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 480 | unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE = SNDCTL_DSP_GETBLKSIZE; |
| 481 | unsigned IOCTL_SNDCTL_DSP_GETFMTS = SNDCTL_DSP_GETFMTS; |
| 482 | unsigned IOCTL_SNDCTL_DSP_NONBLOCK = SNDCTL_DSP_NONBLOCK; |
| 483 | unsigned IOCTL_SNDCTL_DSP_POST = SNDCTL_DSP_POST; |
| 484 | unsigned IOCTL_SNDCTL_DSP_RESET = SNDCTL_DSP_RESET; |
| 485 | unsigned IOCTL_SNDCTL_DSP_SETFMT = SNDCTL_DSP_SETFMT; |
| 486 | unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT = SNDCTL_DSP_SETFRAGMENT; |
| 487 | unsigned IOCTL_SNDCTL_DSP_SPEED = SNDCTL_DSP_SPEED; |
| 488 | unsigned IOCTL_SNDCTL_DSP_STEREO = SNDCTL_DSP_STEREO; |
| 489 | unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE = SNDCTL_DSP_SUBDIVIDE; |
| 490 | unsigned IOCTL_SNDCTL_DSP_SYNC = SNDCTL_DSP_SYNC; |
| 491 | unsigned IOCTL_SNDCTL_FM_4OP_ENABLE = SNDCTL_FM_4OP_ENABLE; |
| 492 | unsigned IOCTL_SNDCTL_FM_LOAD_INSTR = SNDCTL_FM_LOAD_INSTR; |
| 493 | unsigned IOCTL_SNDCTL_MIDI_INFO = SNDCTL_MIDI_INFO; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 494 | unsigned IOCTL_SNDCTL_MIDI_PRETIME = SNDCTL_MIDI_PRETIME; |
| 495 | unsigned IOCTL_SNDCTL_SEQ_CTRLRATE = SNDCTL_SEQ_CTRLRATE; |
| 496 | unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT = SNDCTL_SEQ_GETINCOUNT; |
| 497 | unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT = SNDCTL_SEQ_GETOUTCOUNT; |
| 498 | unsigned IOCTL_SNDCTL_SEQ_NRMIDIS = SNDCTL_SEQ_NRMIDIS; |
| 499 | unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS = SNDCTL_SEQ_NRSYNTHS; |
| 500 | unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND = SNDCTL_SEQ_OUTOFBAND; |
| 501 | unsigned IOCTL_SNDCTL_SEQ_PANIC = SNDCTL_SEQ_PANIC; |
| 502 | unsigned IOCTL_SNDCTL_SEQ_PERCMODE = SNDCTL_SEQ_PERCMODE; |
| 503 | unsigned IOCTL_SNDCTL_SEQ_RESET = SNDCTL_SEQ_RESET; |
| 504 | unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES = SNDCTL_SEQ_RESETSAMPLES; |
| 505 | unsigned IOCTL_SNDCTL_SEQ_SYNC = SNDCTL_SEQ_SYNC; |
| 506 | unsigned IOCTL_SNDCTL_SEQ_TESTMIDI = SNDCTL_SEQ_TESTMIDI; |
| 507 | unsigned IOCTL_SNDCTL_SEQ_THRESHOLD = SNDCTL_SEQ_THRESHOLD; |
| 508 | unsigned IOCTL_SNDCTL_SYNTH_INFO = SNDCTL_SYNTH_INFO; |
| 509 | unsigned IOCTL_SNDCTL_SYNTH_MEMAVL = SNDCTL_SYNTH_MEMAVL; |
| 510 | unsigned IOCTL_SNDCTL_TMR_CONTINUE = SNDCTL_TMR_CONTINUE; |
| 511 | unsigned IOCTL_SNDCTL_TMR_METRONOME = SNDCTL_TMR_METRONOME; |
| 512 | unsigned IOCTL_SNDCTL_TMR_SELECT = SNDCTL_TMR_SELECT; |
| 513 | unsigned IOCTL_SNDCTL_TMR_SOURCE = SNDCTL_TMR_SOURCE; |
| 514 | unsigned IOCTL_SNDCTL_TMR_START = SNDCTL_TMR_START; |
| 515 | unsigned IOCTL_SNDCTL_TMR_STOP = SNDCTL_TMR_STOP; |
| 516 | unsigned IOCTL_SNDCTL_TMR_TEMPO = SNDCTL_TMR_TEMPO; |
| 517 | unsigned IOCTL_SNDCTL_TMR_TIMEBASE = SNDCTL_TMR_TIMEBASE; |
| 518 | unsigned IOCTL_SOUND_MIXER_READ_ALTPCM = SOUND_MIXER_READ_ALTPCM; |
| 519 | unsigned IOCTL_SOUND_MIXER_READ_BASS = SOUND_MIXER_READ_BASS; |
| 520 | unsigned IOCTL_SOUND_MIXER_READ_CAPS = SOUND_MIXER_READ_CAPS; |
| 521 | unsigned IOCTL_SOUND_MIXER_READ_CD = SOUND_MIXER_READ_CD; |
| 522 | unsigned IOCTL_SOUND_MIXER_READ_DEVMASK = SOUND_MIXER_READ_DEVMASK; |
| 523 | unsigned IOCTL_SOUND_MIXER_READ_ENHANCE = SOUND_MIXER_READ_ENHANCE; |
| 524 | unsigned IOCTL_SOUND_MIXER_READ_IGAIN = SOUND_MIXER_READ_IGAIN; |
| 525 | unsigned IOCTL_SOUND_MIXER_READ_IMIX = SOUND_MIXER_READ_IMIX; |
| 526 | unsigned IOCTL_SOUND_MIXER_READ_LINE = SOUND_MIXER_READ_LINE; |
| 527 | unsigned IOCTL_SOUND_MIXER_READ_LINE1 = SOUND_MIXER_READ_LINE1; |
| 528 | unsigned IOCTL_SOUND_MIXER_READ_LINE2 = SOUND_MIXER_READ_LINE2; |
| 529 | unsigned IOCTL_SOUND_MIXER_READ_LINE3 = SOUND_MIXER_READ_LINE3; |
| 530 | unsigned IOCTL_SOUND_MIXER_READ_LOUD = SOUND_MIXER_READ_LOUD; |
| 531 | unsigned IOCTL_SOUND_MIXER_READ_MIC = SOUND_MIXER_READ_MIC; |
| 532 | unsigned IOCTL_SOUND_MIXER_READ_MUTE = SOUND_MIXER_READ_MUTE; |
| 533 | unsigned IOCTL_SOUND_MIXER_READ_OGAIN = SOUND_MIXER_READ_OGAIN; |
| 534 | unsigned IOCTL_SOUND_MIXER_READ_PCM = SOUND_MIXER_READ_PCM; |
| 535 | unsigned IOCTL_SOUND_MIXER_READ_RECLEV = SOUND_MIXER_READ_RECLEV; |
| 536 | unsigned IOCTL_SOUND_MIXER_READ_RECMASK = SOUND_MIXER_READ_RECMASK; |
| 537 | unsigned IOCTL_SOUND_MIXER_READ_RECSRC = SOUND_MIXER_READ_RECSRC; |
| 538 | unsigned IOCTL_SOUND_MIXER_READ_SPEAKER = SOUND_MIXER_READ_SPEAKER; |
| 539 | unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS = SOUND_MIXER_READ_STEREODEVS; |
| 540 | unsigned IOCTL_SOUND_MIXER_READ_SYNTH = SOUND_MIXER_READ_SYNTH; |
| 541 | unsigned IOCTL_SOUND_MIXER_READ_TREBLE = SOUND_MIXER_READ_TREBLE; |
| 542 | unsigned IOCTL_SOUND_MIXER_READ_VOLUME = SOUND_MIXER_READ_VOLUME; |
| 543 | unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM = SOUND_MIXER_WRITE_ALTPCM; |
| 544 | unsigned IOCTL_SOUND_MIXER_WRITE_BASS = SOUND_MIXER_WRITE_BASS; |
| 545 | unsigned IOCTL_SOUND_MIXER_WRITE_CD = SOUND_MIXER_WRITE_CD; |
| 546 | unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE = SOUND_MIXER_WRITE_ENHANCE; |
| 547 | unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN = SOUND_MIXER_WRITE_IGAIN; |
| 548 | unsigned IOCTL_SOUND_MIXER_WRITE_IMIX = SOUND_MIXER_WRITE_IMIX; |
| 549 | unsigned IOCTL_SOUND_MIXER_WRITE_LINE = SOUND_MIXER_WRITE_LINE; |
| 550 | unsigned IOCTL_SOUND_MIXER_WRITE_LINE1 = SOUND_MIXER_WRITE_LINE1; |
| 551 | unsigned IOCTL_SOUND_MIXER_WRITE_LINE2 = SOUND_MIXER_WRITE_LINE2; |
| 552 | unsigned IOCTL_SOUND_MIXER_WRITE_LINE3 = SOUND_MIXER_WRITE_LINE3; |
| 553 | unsigned IOCTL_SOUND_MIXER_WRITE_LOUD = SOUND_MIXER_WRITE_LOUD; |
| 554 | unsigned IOCTL_SOUND_MIXER_WRITE_MIC = SOUND_MIXER_WRITE_MIC; |
| 555 | unsigned IOCTL_SOUND_MIXER_WRITE_MUTE = SOUND_MIXER_WRITE_MUTE; |
| 556 | unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN = SOUND_MIXER_WRITE_OGAIN; |
| 557 | unsigned IOCTL_SOUND_MIXER_WRITE_PCM = SOUND_MIXER_WRITE_PCM; |
| 558 | unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV = SOUND_MIXER_WRITE_RECLEV; |
| 559 | unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC = SOUND_MIXER_WRITE_RECSRC; |
| 560 | unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER = SOUND_MIXER_WRITE_SPEAKER; |
| 561 | unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH = SOUND_MIXER_WRITE_SYNTH; |
| 562 | unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE = SOUND_MIXER_WRITE_TREBLE; |
| 563 | unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME = SOUND_MIXER_WRITE_VOLUME; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 564 | unsigned IOCTL_TCFLSH = TCFLSH; |
| 565 | unsigned IOCTL_TCGETA = TCGETA; |
| 566 | unsigned IOCTL_TCGETS = TCGETS; |
| 567 | unsigned IOCTL_TCSBRK = TCSBRK; |
| 568 | unsigned IOCTL_TCSBRKP = TCSBRKP; |
| 569 | unsigned IOCTL_TCSETA = TCSETA; |
| 570 | unsigned IOCTL_TCSETAF = TCSETAF; |
| 571 | unsigned IOCTL_TCSETAW = TCSETAW; |
| 572 | unsigned IOCTL_TCSETS = TCSETS; |
| 573 | unsigned IOCTL_TCSETSF = TCSETSF; |
| 574 | unsigned IOCTL_TCSETSW = TCSETSW; |
| 575 | unsigned IOCTL_TCXONC = TCXONC; |
| 576 | unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS; |
| 577 | unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR; |
| 578 | unsigned IOCTL_TIOCINQ = TIOCINQ; |
| 579 | unsigned IOCTL_TIOCLINUX = TIOCLINUX; |
| 580 | unsigned IOCTL_TIOCSERCONFIG = TIOCSERCONFIG; |
| 581 | unsigned IOCTL_TIOCSERGETLSR = TIOCSERGETLSR; |
| 582 | unsigned IOCTL_TIOCSERGWILD = TIOCSERGWILD; |
| 583 | unsigned IOCTL_TIOCSERSWILD = TIOCSERSWILD; |
| 584 | unsigned IOCTL_TIOCSLCKTRMIOS = TIOCSLCKTRMIOS; |
| 585 | unsigned IOCTL_TIOCSSOFTCAR = TIOCSSOFTCAR; |
| 586 | unsigned IOCTL_VT_ACTIVATE = VT_ACTIVATE; |
| 587 | unsigned IOCTL_VT_DISALLOCATE = VT_DISALLOCATE; |
| 588 | unsigned IOCTL_VT_GETMODE = VT_GETMODE; |
| 589 | unsigned IOCTL_VT_GETSTATE = VT_GETSTATE; |
| 590 | unsigned IOCTL_VT_OPENQRY = VT_OPENQRY; |
| 591 | unsigned IOCTL_VT_RELDISP = VT_RELDISP; |
| 592 | unsigned IOCTL_VT_RESIZE = VT_RESIZE; |
| 593 | unsigned IOCTL_VT_RESIZEX = VT_RESIZEX; |
| 594 | unsigned IOCTL_VT_SENDSIG = VT_SENDSIG; |
| 595 | unsigned IOCTL_VT_SETMODE = VT_SETMODE; |
| 596 | unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE; |
| 597 | #endif |
| 598 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 599 | unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; |
| 600 | unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; |
| 601 | unsigned IOCTL_CYGETMON = CYGETMON; |
| 602 | unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; |
| 603 | unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; |
| 604 | unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; |
| 605 | unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; |
| 606 | unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; |
| 607 | unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; |
| 608 | unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; |
| 609 | unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; |
| 610 | unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; |
| 611 | unsigned IOCTL_EQL_GETSLAVECFG = EQL_GETSLAVECFG; |
| 612 | unsigned IOCTL_EQL_SETMASTRCFG = EQL_SETMASTRCFG; |
| 613 | unsigned IOCTL_EQL_SETSLAVECFG = EQL_SETSLAVECFG; |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 614 | #if EV_VERSION > (0x010000) |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 615 | unsigned IOCTL_EVIOCGKEYCODE_V2 = EVIOCGKEYCODE_V2; |
| 616 | unsigned IOCTL_EVIOCGPROP = EVIOCGPROP(0); |
| 617 | unsigned IOCTL_EVIOCSKEYCODE_V2 = EVIOCSKEYCODE_V2; |
Evgeniy Stepanov | bb273d5 | 2013-06-21 10:54:57 +0000 | [diff] [blame] | 618 | #else |
| 619 | unsigned IOCTL_EVIOCGKEYCODE_V2 = IOCTL_NOT_PRESENT; |
| 620 | unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; |
| 621 | unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; |
| 622 | #endif |
Evgeniy Stepanov | 7028c1e | 2013-06-18 13:56:12 +0000 | [diff] [blame] | 623 | unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; |
| 624 | unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; |
| 625 | unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; |
| 626 | unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 627 | unsigned IOCTL_GIO_CMAP = GIO_CMAP; |
| 628 | unsigned IOCTL_GIO_FONT = GIO_FONT; |
| 629 | unsigned IOCTL_GIO_SCRNMAP = GIO_SCRNMAP; |
| 630 | unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; |
| 631 | unsigned IOCTL_GIO_UNISCRNMAP = GIO_UNISCRNMAP; |
| 632 | unsigned IOCTL_KDADDIO = KDADDIO; |
| 633 | unsigned IOCTL_KDDELIO = KDDELIO; |
| 634 | unsigned IOCTL_KDDISABIO = KDDISABIO; |
| 635 | unsigned IOCTL_KDENABIO = KDENABIO; |
| 636 | unsigned IOCTL_KDGETKEYCODE = KDGETKEYCODE; |
| 637 | unsigned IOCTL_KDGETLED = KDGETLED; |
| 638 | unsigned IOCTL_KDGETMODE = KDGETMODE; |
| 639 | unsigned IOCTL_KDGKBDIACR = KDGKBDIACR; |
| 640 | unsigned IOCTL_KDGKBENT = KDGKBENT; |
| 641 | unsigned IOCTL_KDGKBLED = KDGKBLED; |
| 642 | unsigned IOCTL_KDGKBMETA = KDGKBMETA; |
| 643 | unsigned IOCTL_KDGKBMODE = KDGKBMODE; |
| 644 | unsigned IOCTL_KDGKBSENT = KDGKBSENT; |
| 645 | unsigned IOCTL_KDGKBTYPE = KDGKBTYPE; |
| 646 | unsigned IOCTL_KDMAPDISP = KDMAPDISP; |
| 647 | unsigned IOCTL_KDMKTONE = KDMKTONE; |
| 648 | unsigned IOCTL_KDSETKEYCODE = KDSETKEYCODE; |
| 649 | unsigned IOCTL_KDSETLED = KDSETLED; |
| 650 | unsigned IOCTL_KDSETMODE = KDSETMODE; |
| 651 | unsigned IOCTL_KDSIGACCEPT = KDSIGACCEPT; |
| 652 | unsigned IOCTL_KDSKBDIACR = KDSKBDIACR; |
| 653 | unsigned IOCTL_KDSKBENT = KDSKBENT; |
| 654 | unsigned IOCTL_KDSKBLED = KDSKBLED; |
| 655 | unsigned IOCTL_KDSKBMETA = KDSKBMETA; |
| 656 | unsigned IOCTL_KDSKBMODE = KDSKBMODE; |
| 657 | unsigned IOCTL_KDSKBSENT = KDSKBSENT; |
| 658 | unsigned IOCTL_KDUNMAPDISP = KDUNMAPDISP; |
| 659 | unsigned IOCTL_KIOCSOUND = KIOCSOUND; |
| 660 | unsigned IOCTL_LPABORT = LPABORT; |
| 661 | unsigned IOCTL_LPABORTOPEN = LPABORTOPEN; |
| 662 | unsigned IOCTL_LPCAREFUL = LPCAREFUL; |
| 663 | unsigned IOCTL_LPCHAR = LPCHAR; |
| 664 | unsigned IOCTL_LPGETIRQ = LPGETIRQ; |
| 665 | unsigned IOCTL_LPGETSTATUS = LPGETSTATUS; |
| 666 | unsigned IOCTL_LPRESET = LPRESET; |
| 667 | unsigned IOCTL_LPSETIRQ = LPSETIRQ; |
| 668 | unsigned IOCTL_LPTIME = LPTIME; |
| 669 | unsigned IOCTL_LPWAIT = LPWAIT; |
| 670 | unsigned IOCTL_MTIOCGETCONFIG = MTIOCGETCONFIG; |
| 671 | unsigned IOCTL_MTIOCSETCONFIG = MTIOCSETCONFIG; |
| 672 | unsigned IOCTL_PIO_CMAP = PIO_CMAP; |
| 673 | unsigned IOCTL_PIO_FONT = PIO_FONT; |
| 674 | unsigned IOCTL_PIO_SCRNMAP = PIO_SCRNMAP; |
| 675 | unsigned IOCTL_PIO_UNIMAP = PIO_UNIMAP; |
| 676 | unsigned IOCTL_PIO_UNIMAPCLR = PIO_UNIMAPCLR; |
| 677 | unsigned IOCTL_PIO_UNISCRNMAP = PIO_UNISCRNMAP; |
| 678 | unsigned IOCTL_SCSI_IOCTL_GET_IDLUN = SCSI_IOCTL_GET_IDLUN; |
| 679 | unsigned IOCTL_SCSI_IOCTL_PROBE_HOST = SCSI_IOCTL_PROBE_HOST; |
| 680 | unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE = SCSI_IOCTL_TAGGED_DISABLE; |
| 681 | unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE = SCSI_IOCTL_TAGGED_ENABLE; |
| 682 | unsigned IOCTL_SIOCAIPXITFCRT = SIOCAIPXITFCRT; |
| 683 | unsigned IOCTL_SIOCAIPXPRISLT = SIOCAIPXPRISLT; |
| 684 | unsigned IOCTL_SIOCAX25ADDUID = SIOCAX25ADDUID; |
| 685 | unsigned IOCTL_SIOCAX25DELUID = SIOCAX25DELUID; |
| 686 | unsigned IOCTL_SIOCAX25GETPARMS = SIOCAX25GETPARMS; |
| 687 | unsigned IOCTL_SIOCAX25GETUID = SIOCAX25GETUID; |
| 688 | unsigned IOCTL_SIOCAX25NOUID = SIOCAX25NOUID; |
| 689 | unsigned IOCTL_SIOCAX25SETPARMS = SIOCAX25SETPARMS; |
| 690 | unsigned IOCTL_SIOCDEVPLIP = SIOCDEVPLIP; |
| 691 | unsigned IOCTL_SIOCIPXCFGDATA = SIOCIPXCFGDATA; |
| 692 | unsigned IOCTL_SIOCNRDECOBS = SIOCNRDECOBS; |
| 693 | unsigned IOCTL_SIOCNRGETPARMS = SIOCNRGETPARMS; |
| 694 | unsigned IOCTL_SIOCNRRTCTL = SIOCNRRTCTL; |
| 695 | unsigned IOCTL_SIOCNRSETPARMS = SIOCNRSETPARMS; |
| 696 | unsigned IOCTL_SNDCTL_DSP_GETISPACE = SNDCTL_DSP_GETISPACE; |
| 697 | unsigned IOCTL_SNDCTL_DSP_GETOSPACE = SNDCTL_DSP_GETOSPACE; |
Evgeniy Stepanov | 2557a1b | 2013-06-18 09:22:24 +0000 | [diff] [blame] | 698 | unsigned IOCTL_TIOCGSERIAL = TIOCGSERIAL; |
| 699 | unsigned IOCTL_TIOCSERGETMULTI = TIOCSERGETMULTI; |
| 700 | unsigned IOCTL_TIOCSERSETMULTI = TIOCSERSETMULTI; |
| 701 | unsigned IOCTL_TIOCSSERIAL = TIOCSSERIAL; |
| 702 | #endif |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 703 | } // namespace __sanitizer |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 704 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 705 | #define CHECK_TYPE_SIZE(TYPE) \ |
| 706 | COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE)) |
| 707 | |
| 708 | #define CHECK_SIZE_AND_OFFSET(CLASS, MEMBER) \ |
| 709 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \ |
| 710 | sizeof(((CLASS *) NULL)->MEMBER)); \ |
| 711 | COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \ |
| 712 | offsetof(CLASS, MEMBER)) |
| 713 | |
Evgeniy Stepanov | 10fd322 | 2013-03-13 09:01:40 +0000 | [diff] [blame] | 714 | COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t)); |
Evgeniy Stepanov | 06658ea | 2013-04-04 08:22:52 +0000 | [diff] [blame] | 715 | COMPILER_CHECK(sizeof(__sanitizer::struct_sigaction_max_sz) >= |
| 716 | sizeof(__sanitizer::struct_sigaction_sz)); |
Evgeniy Stepanov | 1aad6b5 | 2013-05-17 12:51:13 +0000 | [diff] [blame] | 717 | |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 718 | COMPILER_CHECK(sizeof(socklen_t) == sizeof(unsigned)); |
| 719 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 720 | #if SANITIZER_LINUX |
| 721 | // There are more undocumented fields in dl_phdr_info that we are not interested |
| 722 | // in. |
| 723 | COMPILER_CHECK(sizeof(__sanitizer_dl_phdr_info) <= sizeof(dl_phdr_info)); |
| 724 | CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_addr); |
| 725 | CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_name); |
| 726 | CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); |
| 727 | CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); |
Evgeniy Stepanov | 4612aba | 2013-06-20 09:19:28 +0000 | [diff] [blame] | 728 | |
| 729 | COMPILER_CHECK(IOC_SIZE(0x12345678) == _IOC_SIZE(0x12345678)); |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 730 | #endif |
Evgeniy Stepanov | 447ef19 | 2013-05-22 12:50:26 +0000 | [diff] [blame] | 731 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 732 | CHECK_TYPE_SIZE(addrinfo); |
| 733 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_flags); |
| 734 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_family); |
| 735 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_socktype); |
| 736 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); |
| 737 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); |
| 738 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen); |
| 739 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname); |
| 740 | CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr); |
Evgeniy Stepanov | 0a2cc37 | 2013-05-23 11:10:23 +0000 | [diff] [blame] | 741 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 742 | CHECK_TYPE_SIZE(hostent); |
| 743 | CHECK_SIZE_AND_OFFSET(hostent, h_name); |
| 744 | CHECK_SIZE_AND_OFFSET(hostent, h_aliases); |
| 745 | CHECK_SIZE_AND_OFFSET(hostent, h_addrtype); |
| 746 | CHECK_SIZE_AND_OFFSET(hostent, h_length); |
| 747 | CHECK_SIZE_AND_OFFSET(hostent, h_addr_list); |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 748 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 749 | CHECK_TYPE_SIZE(iovec); |
| 750 | CHECK_SIZE_AND_OFFSET(iovec, iov_base); |
| 751 | CHECK_SIZE_AND_OFFSET(iovec, iov_len); |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 752 | |
Evgeniy Stepanov | 00c35cf | 2013-05-31 10:46:51 +0000 | [diff] [blame] | 753 | CHECK_TYPE_SIZE(msghdr); |
| 754 | CHECK_SIZE_AND_OFFSET(msghdr, msg_name); |
| 755 | CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen); |
| 756 | CHECK_SIZE_AND_OFFSET(msghdr, msg_iov); |
| 757 | CHECK_SIZE_AND_OFFSET(msghdr, msg_iovlen); |
| 758 | CHECK_SIZE_AND_OFFSET(msghdr, msg_control); |
| 759 | CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen); |
| 760 | CHECK_SIZE_AND_OFFSET(msghdr, msg_flags); |
| 761 | |
| 762 | CHECK_TYPE_SIZE(cmsghdr); |
| 763 | CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len); |
| 764 | CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level); |
| 765 | CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); |
Evgeniy Stepanov | 9666d89 | 2013-05-29 11:30:00 +0000 | [diff] [blame] | 766 | |
Evgeniy Stepanov | a0379b5 | 2013-06-27 09:37:27 +0000 | [diff] [blame] | 767 | CHECK_SIZE_AND_OFFSET(dirent, d_ino); |
| 768 | #ifndef SANITIZER_MAC |
| 769 | CHECK_SIZE_AND_OFFSET(dirent, d_off); |
| 770 | #endif |
| 771 | CHECK_SIZE_AND_OFFSET(dirent, d_reclen); |
| 772 | |
Evgeniy Stepanov | 89d1eee | 2013-06-19 13:21:38 +0000 | [diff] [blame] | 773 | CHECK_TYPE_SIZE(ifconf); |
| 774 | CHECK_SIZE_AND_OFFSET(ifconf, ifc_len); |
| 775 | CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu); |
| 776 | |
Alexey Samsonov | 46f9395 | 2013-04-03 07:24:35 +0000 | [diff] [blame] | 777 | #endif // SANITIZER_LINUX || SANITIZER_MAC |
Evgeniy Stepanov | 89d1eee | 2013-06-19 13:21:38 +0000 | [diff] [blame] | 778 | |