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