2013-02-19 17:19:16 +08:00
|
|
|
//===-- sanitizer_platform_limits_posix.h ---------------------------------===//
|
2012-12-11 20:27:27 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2013-02-19 17:19:16 +08:00
|
|
|
// This file is a part of Sanitizer common code.
|
2012-12-11 20:27:27 +08:00
|
|
|
//
|
2013-02-19 17:19:16 +08:00
|
|
|
// Sizes and layouts of platform-specific POSIX data structures.
|
2012-12-11 20:27:27 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-02-19 17:19:16 +08:00
|
|
|
#ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
|
|
|
|
#define SANITIZER_PLATFORM_LIMITS_POSIX_H
|
2012-12-11 20:27:27 +08:00
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#include "sanitizer_platform.h"
|
|
|
|
|
2013-02-19 17:19:16 +08:00
|
|
|
namespace __sanitizer {
|
2012-12-11 20:27:27 +08:00
|
|
|
extern unsigned struct_utsname_sz;
|
|
|
|
extern unsigned struct_stat_sz;
|
|
|
|
extern unsigned struct_stat64_sz;
|
2013-02-19 17:19:16 +08:00
|
|
|
extern unsigned struct_rusage_sz;
|
|
|
|
extern unsigned struct_tm_sz;
|
2013-04-01 22:47:21 +08:00
|
|
|
extern unsigned struct_passwd_sz;
|
2013-04-23 20:01:20 +08:00
|
|
|
extern unsigned struct_group_sz;
|
2013-04-01 22:47:21 +08:00
|
|
|
extern unsigned struct_sigaction_sz;
|
2013-04-09 22:34:59 +08:00
|
|
|
extern unsigned siginfo_t_sz;
|
2013-04-01 22:47:21 +08:00
|
|
|
extern unsigned struct_itimerval_sz;
|
|
|
|
extern unsigned pthread_t_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned pid_t_sz;
|
|
|
|
extern unsigned timeval_sz;
|
|
|
|
extern unsigned uid_t_sz;
|
2013-04-04 17:21:48 +08:00
|
|
|
|
|
|
|
#if !SANITIZER_ANDROID
|
2013-04-04 17:03:56 +08:00
|
|
|
extern unsigned ucontext_t_sz;
|
2013-04-04 17:21:48 +08:00
|
|
|
#endif // !SANITIZER_ANDROID
|
2013-02-19 17:19:16 +08:00
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX
|
2012-12-11 20:27:27 +08:00
|
|
|
extern unsigned struct_rlimit_sz;
|
|
|
|
extern unsigned struct_dirent_sz;
|
|
|
|
extern unsigned struct_statfs_sz;
|
|
|
|
extern unsigned struct_epoll_event_sz;
|
2013-04-01 22:47:21 +08:00
|
|
|
extern unsigned struct_timespec_sz;
|
2013-04-03 15:24:35 +08:00
|
|
|
#endif // SANITIZER_LINUX
|
2012-12-11 20:27:27 +08:00
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
2013-03-14 21:24:03 +08:00
|
|
|
extern unsigned struct_dirent64_sz;
|
2013-02-19 19:06:41 +08:00
|
|
|
extern unsigned struct_rlimit64_sz;
|
|
|
|
extern unsigned struct_statfs64_sz;
|
2013-04-03 15:24:35 +08:00
|
|
|
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
|
2013-02-19 19:06:41 +08:00
|
|
|
|
2013-05-29 19:30:00 +08:00
|
|
|
struct __sanitizer_iovec {
|
|
|
|
void *iov_base;
|
|
|
|
uptr iov_len;
|
|
|
|
};
|
|
|
|
|
2013-05-29 19:55:27 +08:00
|
|
|
#if SANITIZER_ANDROID || SANITIZER_MAC
|
|
|
|
struct __sanitizer_msghdr {
|
|
|
|
void *msg_name;
|
|
|
|
unsigned msg_namelen;
|
|
|
|
struct __sanitizer_iovec *msg_iov;
|
|
|
|
unsigned msg_iovlen;
|
|
|
|
void *msg_control;
|
|
|
|
unsigned msg_controllen;
|
|
|
|
int msg_flags;
|
|
|
|
};
|
|
|
|
struct __sanitizer_cmsghdr {
|
|
|
|
unsigned cmsg_len;
|
|
|
|
int cmsg_level;
|
|
|
|
int cmsg_type;
|
|
|
|
};
|
|
|
|
#else
|
2013-05-29 19:30:00 +08:00
|
|
|
struct __sanitizer_msghdr {
|
|
|
|
void *msg_name;
|
|
|
|
unsigned msg_namelen;
|
|
|
|
struct __sanitizer_iovec *msg_iov;
|
|
|
|
uptr msg_iovlen;
|
|
|
|
void *msg_control;
|
|
|
|
uptr msg_controllen;
|
|
|
|
int msg_flags;
|
|
|
|
};
|
|
|
|
struct __sanitizer_cmsghdr {
|
|
|
|
uptr cmsg_len;
|
|
|
|
int cmsg_level;
|
|
|
|
int cmsg_type;
|
|
|
|
};
|
2013-05-29 19:55:27 +08:00
|
|
|
#endif
|
2013-03-13 17:01:40 +08:00
|
|
|
|
|
|
|
// This thing depends on the platform. We are only interested in the upper
|
|
|
|
// limit. Verified with a compiler assert in .cc.
|
|
|
|
const int pthread_attr_t_max_sz = 128;
|
|
|
|
union __sanitizer_pthread_attr_t {
|
2013-03-13 18:20:35 +08:00
|
|
|
char size[pthread_attr_t_max_sz]; // NOLINT
|
2013-03-13 17:01:40 +08:00
|
|
|
void *align;
|
|
|
|
};
|
2013-04-04 16:22:52 +08:00
|
|
|
|
|
|
|
uptr __sanitizer_get_sigaction_sa_sigaction(void *act);
|
|
|
|
void __sanitizer_set_sigaction_sa_sigaction(void *act, uptr cb);
|
|
|
|
bool __sanitizer_get_sigaction_sa_siginfo(void *act);
|
|
|
|
|
|
|
|
const unsigned struct_sigaction_max_sz = 256;
|
|
|
|
union __sanitizer_sigaction {
|
|
|
|
char size[struct_sigaction_max_sz]; // NOLINT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern uptr sig_ign;
|
|
|
|
extern uptr sig_dfl;
|
2013-04-23 22:05:15 +08:00
|
|
|
|
2013-06-07 21:00:47 +08:00
|
|
|
#if SANITIZER_LINUX
|
|
|
|
extern int e_tabsz;
|
|
|
|
#endif
|
|
|
|
|
2013-04-23 22:05:15 +08:00
|
|
|
uptr __sanitizer_in_addr_sz(int af);
|
2013-05-17 20:51:13 +08:00
|
|
|
|
|
|
|
#if SANITIZER_LINUX
|
|
|
|
struct __sanitizer_dl_phdr_info {
|
|
|
|
uptr dlpi_addr;
|
|
|
|
const char *dlpi_name;
|
|
|
|
const void *dlpi_phdr;
|
|
|
|
short dlpi_phnum;
|
|
|
|
};
|
|
|
|
#endif
|
2013-05-22 20:50:26 +08:00
|
|
|
|
|
|
|
struct __sanitizer_addrinfo {
|
|
|
|
int ai_flags;
|
|
|
|
int ai_family;
|
|
|
|
int ai_socktype;
|
|
|
|
int ai_protocol;
|
2013-05-22 23:21:04 +08:00
|
|
|
#if SANITIZER_ANDROID || SANITIZER_MAC
|
2013-05-22 22:26:52 +08:00
|
|
|
unsigned ai_addrlen;
|
|
|
|
char *ai_canonname;
|
|
|
|
void *ai_addr;
|
|
|
|
#else // LINUX
|
2013-05-31 18:46:51 +08:00
|
|
|
unsigned ai_addrlen;
|
2013-05-22 22:26:52 +08:00
|
|
|
void *ai_addr;
|
|
|
|
char *ai_canonname;
|
|
|
|
#endif
|
2013-05-22 20:50:26 +08:00
|
|
|
struct __sanitizer_addrinfo *ai_next;
|
|
|
|
};
|
2013-05-23 19:10:23 +08:00
|
|
|
|
|
|
|
struct __sanitizer_hostent {
|
|
|
|
char *h_name;
|
|
|
|
char **h_aliases;
|
|
|
|
int h_addrtype;
|
|
|
|
int h_length;
|
|
|
|
char **h_addr_list;
|
|
|
|
};
|
|
|
|
|
2013-06-07 21:00:47 +08:00
|
|
|
// ioctl arguments
|
2013-06-07 23:49:38 +08:00
|
|
|
struct __sanitizer_ifconf {
|
|
|
|
int ifc_len;
|
|
|
|
union {
|
|
|
|
void *ifcu_req;
|
|
|
|
} ifc_ifcu;
|
|
|
|
};
|
|
|
|
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned struct_arpreq_sz;
|
|
|
|
extern unsigned struct_ifreq_sz;
|
|
|
|
extern unsigned struct_termios_sz;
|
|
|
|
extern unsigned struct_winsize_sz;
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX
|
|
|
|
extern unsigned struct_cdrom_msf_sz;
|
|
|
|
extern unsigned struct_cdrom_multisession_sz;
|
|
|
|
extern unsigned struct_cdrom_read_audio_sz;
|
|
|
|
extern unsigned struct_cdrom_subchnl_sz;
|
|
|
|
extern unsigned struct_cdrom_ti_sz;
|
|
|
|
extern unsigned struct_cdrom_tocentry_sz;
|
|
|
|
extern unsigned struct_cdrom_tochdr_sz;
|
|
|
|
extern unsigned struct_cdrom_volctrl_sz;
|
|
|
|
extern unsigned struct_copr_buffer_sz;
|
|
|
|
extern unsigned struct_copr_debug_buf_sz;
|
|
|
|
extern unsigned struct_copr_msg_sz;
|
|
|
|
extern unsigned struct_floppy_drive_params_sz;
|
|
|
|
extern unsigned struct_floppy_drive_struct_sz;
|
|
|
|
extern unsigned struct_floppy_fdc_state_sz;
|
|
|
|
extern unsigned struct_floppy_max_errors_sz;
|
|
|
|
extern unsigned struct_floppy_raw_cmd_sz;
|
|
|
|
extern unsigned struct_floppy_struct_sz;
|
|
|
|
extern unsigned struct_floppy_write_errors_sz;
|
|
|
|
extern unsigned struct_format_descr_sz;
|
|
|
|
extern unsigned struct_hd_driveid_sz;
|
|
|
|
extern unsigned struct_hd_geometry_sz;
|
|
|
|
extern unsigned struct_midi_info_sz;
|
|
|
|
extern unsigned struct_mtget_sz;
|
|
|
|
extern unsigned struct_mtop_sz;
|
|
|
|
extern unsigned struct_mtpos_sz;
|
|
|
|
extern unsigned struct_rtentry_sz;
|
|
|
|
extern unsigned struct_sbi_instrument_sz;
|
|
|
|
extern unsigned struct_seq_event_rec_sz;
|
|
|
|
extern unsigned struct_synth_info_sz;
|
|
|
|
extern unsigned struct_termio_sz;
|
|
|
|
extern unsigned struct_vt_consize_sz;
|
|
|
|
extern unsigned struct_vt_mode_sz;
|
|
|
|
extern unsigned struct_vt_sizes_sz;
|
|
|
|
extern unsigned struct_vt_stat_sz;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_audio_buf_info_sz;
|
|
|
|
extern unsigned struct_ax25_parms_struct_sz;
|
|
|
|
extern unsigned struct_cyclades_monitor_sz;
|
|
|
|
extern unsigned struct_ipx_config_data_sz;
|
|
|
|
extern unsigned struct_kbdiacrs_sz;
|
|
|
|
extern unsigned struct_kbentry_sz;
|
|
|
|
extern unsigned struct_kbkeycode_sz;
|
|
|
|
extern unsigned struct_kbsentry_sz;
|
|
|
|
extern unsigned mpu_command_rec_sz;
|
|
|
|
extern unsigned struct_mtconfiginfo_sz;
|
|
|
|
extern unsigned struct_nr_parms_struct_sz;
|
|
|
|
extern unsigned struct_ppp_stats_sz;
|
|
|
|
extern unsigned struct_scc_modem_sz;
|
|
|
|
extern unsigned struct_scc_stat_sz;
|
|
|
|
extern unsigned struct_serial_multiport_struct_sz;
|
|
|
|
extern unsigned struct_serial_struct_sz;
|
|
|
|
extern unsigned struct_sockaddr_ax25_sz;
|
|
|
|
extern unsigned struct_unimapdesc_sz;
|
|
|
|
extern unsigned struct_unimapinit_sz;
|
|
|
|
#endif
|
2013-06-10 18:00:54 +08:00
|
|
|
|
2013-06-07 21:00:47 +08:00
|
|
|
#if !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_sioc_sg_req_sz;
|
|
|
|
extern unsigned struct_sioc_vif_req_sz;
|
|
|
|
#endif
|
2013-02-19 17:19:16 +08:00
|
|
|
} // namespace __sanitizer
|
2012-12-11 20:27:27 +08:00
|
|
|
|
|
|
|
#endif
|
2013-06-07 21:00:47 +08:00
|
|
|
|