Index: lib/sanitizer_common/sanitizer_common_interceptors.inc =================================================================== --- lib/sanitizer_common/sanitizer_common_interceptors.inc +++ lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -4405,27 +4405,36 @@ #endif #if SANITIZER_INTERCEPT_PTHREAD_ATTR_GET -INTERCEPTOR_PTHREAD_ATTR_GET(detachstate, sizeof(int)) -INTERCEPTOR_PTHREAD_ATTR_GET(guardsize, sizeof(SIZE_T)) +#define COMMON_INTERCEPTOR_PTHREAD_ATTR_GET \ +INTERCEPTOR_PTHREAD_ATTR_GET(detachstate, sizeof(int)) \ +INTERCEPTOR_PTHREAD_ATTR_GET(guardsize, sizeof(SIZE_T)) \ +INTERCEPTOR_PTHREAD_ATTR_GET(scope, sizeof(int)) \ +INTERCEPTOR_PTHREAD_ATTR_GET(stacksize, sizeof(SIZE_T)) \ +INTERCEPTOR(int, pthread_attr_getstack, void *attr, void **addr, SIZE_T *size) { \ + void *ctx; \ + COMMON_INTERCEPTOR_ENTER(ctx, pthread_attr_getstack, attr, addr, size); \ + // FIXME: under ASan the call below may write to freed memory and corrupt \ + // its metadata. See \ + // https://github.com/google/sanitizers/issues/321. \ + int res = REAL(pthread_attr_getstack)(attr, addr, size); \ + if (!res) { \ + if (addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr)); \ + if (size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, size, sizeof(*size)); \ + } \ + return res; \ +} + #if !SANITIZER_OPENBSD -INTERCEPTOR_PTHREAD_ATTR_GET(schedparam, struct_sched_param_sz) -INTERCEPTOR_PTHREAD_ATTR_GET(schedpolicy, sizeof(int)) +#define SANITIZER_INTERCEPTOR_PTHREAD_ATTR_GET \ +COMMON_INTERCEPTOR_PTHREAD_ATTR_GET \ +INTERCEPTOR_PTHREAD_ATTR_GET(schedparam, struct_sched_param_sz) \ +INTERCEPTOR_PTHREAD_ATTR_GET(schedpolicy, sizeof(int)) +#else +#define SANITIZER_INTERCEPTOR_PTHREAD_ATTR_GET \ +COMMON_INTERCEPTOR_PTHREAD_ATTR_GET #endif -INTERCEPTOR_PTHREAD_ATTR_GET(scope, sizeof(int)) -INTERCEPTOR_PTHREAD_ATTR_GET(stacksize, sizeof(SIZE_T)) -INTERCEPTOR(int, pthread_attr_getstack, void *attr, void **addr, SIZE_T *size) { - void *ctx; - COMMON_INTERCEPTOR_ENTER(ctx, pthread_attr_getstack, attr, addr, size); - // FIXME: under ASan the call below may write to freed memory and corrupt - // its metadata. See - // https://github.com/google/sanitizers/issues/321. - int res = REAL(pthread_attr_getstack)(attr, addr, size); - if (!res) { - if (addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr)); - if (size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, size, sizeof(*size)); - } - return res; -} + +SANITIZER_INTERCEPTOR_PTHREAD_ATTR_GET // We may need to call the real pthread_attr_getstack from the run-time // in sanitizer_common, but we don't want to include the interception headers @@ -4438,22 +4447,20 @@ } // extern "C" } // namespace __sanitizer -#if !SANITIZER_OPENBSD -#define INIT_PTHREAD_ATTR_GET \ +#define COMMON_INIT_PTHREAD_ATTR_GET \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getdetachstate); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getguardsize); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedparam); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedpolicy); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getscope); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getstacksize); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getstack); -#else + +#if !SANITIZER_OPENBSD #define INIT_PTHREAD_ATTR_GET \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getdetachstate); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getguardsize); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getscope); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getstacksize); \ - COMMON_INTERCEPT_FUNCTION(pthread_attr_getstack); + COMMON_INIT_PTHREAD_ATTR_GET \ + COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedparam); \ + COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedpolicy); \ +#else +#define INIT_PTHREAD_ATTR_GET COMMON_INIT_PTHREAD_ATTR_GET #endif #else #define INIT_PTHREAD_ATTR_GET Index: lib/sanitizer_common/sanitizer_interface_internal.h =================================================================== --- lib/sanitizer_common/sanitizer_interface_internal.h +++ lib/sanitizer_common/sanitizer_interface_internal.h @@ -69,7 +69,6 @@ __sanitizer::uptr pc, char *module_path, __sanitizer::uptr module_path_len, __sanitizer::uptr *pc_offset); -#if !SANITIZER_OPENBSD SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp(); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE @@ -107,7 +106,6 @@ void __sanitizer_cov_8bit_counters_init(); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_pcs_init(); -#endif } // extern "C" #endif // SANITIZER_INTERFACE_INTERNAL_H Index: lib/sanitizer_common/sanitizer_linux.cc =================================================================== --- lib/sanitizer_common/sanitizer_linux.cc +++ lib/sanitizer_common/sanitizer_linux.cc @@ -88,6 +88,7 @@ // FreeBSD 9.2 and 10.0. #include } +#include extern char **environ; // provided by crt1 #endif // SANITIZER_FREEBSD @@ -313,7 +314,8 @@ return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); #elif SANITIZER_OPENBSD - return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); + return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, + (uptr)buf, 0); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); @@ -397,26 +399,34 @@ } uptr internal_readlink(const char *path, char *buf, uptr bufsize) { -#if SANITIZER_OPENBSD || SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf, bufsize); +#elif SANITIZER_OPENBSD + return internal_syscall_ptr(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, + (uptr)buf, bufsize); #else return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize); #endif } uptr internal_unlink(const char *path) { -#if SANITIZER_OPENBSD || SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0); +#elif SANITIZER_OPENBSD + return internal_syscall_ptr(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0); #else return internal_syscall_ptr(SYSCALL(unlink), (uptr)path); #endif } uptr internal_rename(const char *oldpath, const char *newpath) { -#if SANITIZER_OPENBSD || SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD, (uptr)newpath); +#elif SANITIZER_OPENBSD + return internal_syscall_ptr(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, + AT_FDCWD, (uptr)newpath); #else return internal_syscall_ptr(SYSCALL(rename), (uptr)oldpath, (uptr)newpath); #endif @@ -463,12 +473,12 @@ } tid_t GetTid() { -#if SANITIZER_FREEBSD || SANITIZER_OPENBSD - return (uptr)pthread_self(); +#if SANITIZER_FREEBSD || SANITIZER_SOLARIS + return (uptr)thr_self(); +#elif SANITIZER_OPENBSD + return (uptr)internal_syscall(SYSCALL(getthrid)); #elif SANITIZER_NETBSD return _lwp_self(); -#elif SANITIZER_SOLARIS - return (uptr)thr_self(); #else return internal_syscall(SYSCALL(gettid)); #endif @@ -483,7 +493,7 @@ #endif internal_memset(&tv, 0, sizeof(tv)); internal_syscall_ptr(SYSCALL(gettimeofday), &tv, 0); - return (u64)tv.tv_sec * 1000 * 1000 * 1000 + tv.tv_usec * 1000; + return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000; } uptr internal_clock_gettime(__sanitizer_clockid_t clk_id, void *tp) { @@ -520,7 +530,8 @@ const char *p = environ; while (*p != '\0') { // will happen at the \0\0 that terminates the buffer // proc file has the format NAME=value\0NAME=value\0NAME=value\0... - const char *endp = (char *)internal_memchr(p, '\0', len - (p - environ)); + const char *endp = + (char *)internal_memchr(p, '\0', len - (p - environ)); if (!endp) // this entry isn't NUL terminated return nullptr; else if (!internal_memcmp(p, name, namelen) && p[namelen] == '=') // Match. @@ -553,10 +564,10 @@ } (*arr)[0] = buff; int count, i; - for (count = 1, i = 1;; i++) { + for (count = 1, i = 1; ; i++) { if (buff[i] == 0) { - if (buff[i + 1] == 0) break; - (*arr)[count] = &buff[i + 1]; + if (buff[i+1] == 0) break; + (*arr)[count] = &buff[i+1]; CHECK_LE(count, arr_size - 1); // FIXME: make this more flexible. count++; } @@ -1728,9 +1739,6 @@ #endif SignalContext::WriteFlag SignalContext::GetWriteFlag() const { -#if SANITIZER_OPENBSD - return UNKNOWN; -#endif #if !SANITIZER_OPENBSD ucontext_t *ucontext = (ucontext_t *)context; #if defined(__x86_64__) || defined(__i386__) @@ -1765,6 +1773,8 @@ (void)ucontext; return UNKNOWN; // FIXME: Implement. #endif +#else + return UNKNOWN; #endif } @@ -1777,8 +1787,7 @@ *pc = 0; *bp = 0; *sp = 0; -#else -#if SANITIZER_NETBSD +#elif SANITIZER_NETBSD // This covers all NetBSD architectures ucontext_t *ucontext = (ucontext_t *)context; *pc = _UC_MACHINE_PC(ucontext); @@ -1884,7 +1893,6 @@ #else # error "Unsupported arch" #endif -#endif } void SignalContext::InitPcSpBp() { GetPcSpBp(context, &pc, &sp, &bp); } Index: lib/sanitizer_common/sanitizer_platform_limits_openbsd.h =================================================================== --- lib/sanitizer_common/sanitizer_platform_limits_openbsd.h +++ lib/sanitizer_common/sanitizer_platform_limits_openbsd.h @@ -9,7 +9,7 @@ // // This file is a part of Sanitizer common code. // -// Sizes and layouts of platform-specific NetBSD data structures. +// Sizes and layouts of platform-specific OpenBSD data structures. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PLATFORM_LIMITS_OPENBSD_H @@ -49,10 +49,8 @@ extern unsigned struct_tms_sz; extern unsigned struct_itimerspec_sz; extern unsigned struct_sigevent_sz; -extern unsigned struct_sched_param_sz; extern unsigned struct_statfs_sz; extern unsigned struct_sockaddr_sz; -extern unsigned ucontext_t_sz; extern unsigned struct_rlimit_sz; extern unsigned struct_utimbuf_sz; @@ -329,14 +327,6 @@ extern unsigned path_max; -struct __sanitizer_wordexp_t { - uptr we_wordc; - char **we_wordv; - uptr we_offs; - char *we_strings; - uptr we_nbytes; -}; - typedef char __sanitizer_FILE; #define SANITIZER_HAS_STRUCT_FILE 0 @@ -362,210 +352,6 @@ } ifc_ifcu; }; -#define IOC_NRBITS 8 -#define IOC_TYPEBITS 8 -#define IOC_SIZEBITS 14 -#define IOC_DIRBITS 2 -#define IOC_NONE 0U -#define IOC_WRITE 1U -#define IOC_READ 2U -#define IOC_NRMASK ((1 << IOC_NRBITS) - 1) -#define IOC_TYPEMASK ((1 << IOC_TYPEBITS) - 1) -#define IOC_SIZEMASK ((1 << IOC_SIZEBITS) - 1) -#undef IOC_DIRMASK -#define IOC_DIRMASK ((1 << IOC_DIRBITS) - 1) -#define IOC_NRSHIFT 0 -#define IOC_TYPESHIFT (IOC_NRSHIFT + IOC_NRBITS) -#define IOC_SIZESHIFT (IOC_TYPESHIFT + IOC_TYPEBITS) -#define IOC_DIRSHIFT (IOC_SIZESHIFT + IOC_SIZEBITS) -#define EVIOC_EV_MAX 0x1f -#define EVIOC_ABS_MAX 0x3f - -#define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK) -#define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK) -#define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK) -#define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK) - -extern unsigned struct_ifreq_sz; -extern unsigned struct_termios_sz; -extern unsigned struct_winsize_sz; - -extern unsigned struct_arpreq_sz; - -extern unsigned struct_mtget_sz; -extern unsigned struct_mtop_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_vt_mode_sz; -extern unsigned struct_audio_buf_info_sz; -extern unsigned struct_ppp_stats_sz; -extern unsigned struct_sioc_sg_req_sz; -extern unsigned struct_sioc_vif_req_sz; - -// ioctl request identifiers - -// A special value to mark ioctls that are not present on the target platform, -// when it can not be determined without including any system headers. -extern const unsigned IOCTL_NOT_PRESENT; - -extern unsigned IOCTL_FIOASYNC; -extern unsigned IOCTL_FIOCLEX; -extern unsigned IOCTL_FIOGETOWN; -extern unsigned IOCTL_FIONBIO; -extern unsigned IOCTL_FIONCLEX; -extern unsigned IOCTL_FIOSETOWN; -extern unsigned IOCTL_SIOCADDMULTI; -extern unsigned IOCTL_SIOCATMARK; -extern unsigned IOCTL_SIOCDELMULTI; -extern unsigned IOCTL_SIOCGIFADDR; -extern unsigned IOCTL_SIOCGIFBRDADDR; -extern unsigned IOCTL_SIOCGIFCONF; -extern unsigned IOCTL_SIOCGIFDSTADDR; -extern unsigned IOCTL_SIOCGIFFLAGS; -extern unsigned IOCTL_SIOCGIFMETRIC; -extern unsigned IOCTL_SIOCGIFMTU; -extern unsigned IOCTL_SIOCGIFNETMASK; -extern unsigned IOCTL_SIOCGPGRP; -extern unsigned IOCTL_SIOCSIFADDR; -extern unsigned IOCTL_SIOCSIFBRDADDR; -extern unsigned IOCTL_SIOCSIFDSTADDR; -extern unsigned IOCTL_SIOCSIFFLAGS; -extern unsigned IOCTL_SIOCSIFMETRIC; -extern unsigned IOCTL_SIOCSIFMTU; -extern unsigned IOCTL_SIOCSIFNETMASK; -extern unsigned IOCTL_SIOCSPGRP; -extern unsigned IOCTL_TIOCCONS; -extern unsigned IOCTL_TIOCEXCL; -extern unsigned IOCTL_TIOCGETD; -extern unsigned IOCTL_TIOCGPGRP; -extern unsigned IOCTL_TIOCGWINSZ; -extern unsigned IOCTL_TIOCMBIC; -extern unsigned IOCTL_TIOCMBIS; -extern unsigned IOCTL_TIOCMGET; -extern unsigned IOCTL_TIOCMSET; -extern unsigned IOCTL_TIOCNOTTY; -extern unsigned IOCTL_TIOCNXCL; -extern unsigned IOCTL_TIOCOUTQ; -extern unsigned IOCTL_TIOCPKT; -extern unsigned IOCTL_TIOCSCTTY; -extern unsigned IOCTL_TIOCSETD; -extern unsigned IOCTL_TIOCSPGRP; -extern unsigned IOCTL_TIOCSTI; -extern unsigned IOCTL_TIOCSWINSZ; -extern unsigned IOCTL_SIOCGETSGCNT; -extern unsigned IOCTL_SIOCGETVIFCNT; -extern unsigned IOCTL_MTIOCGET; -extern unsigned IOCTL_MTIOCTOP; -extern unsigned IOCTL_SIOCADDRT; -extern unsigned IOCTL_SIOCDELRT; -extern unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE; -extern unsigned IOCTL_SNDCTL_DSP_GETFMTS; -extern unsigned IOCTL_SNDCTL_DSP_NONBLOCK; -extern unsigned IOCTL_SNDCTL_DSP_POST; -extern unsigned IOCTL_SNDCTL_DSP_RESET; -extern unsigned IOCTL_SNDCTL_DSP_SETFMT; -extern unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT; -extern unsigned IOCTL_SNDCTL_DSP_SPEED; -extern unsigned IOCTL_SNDCTL_DSP_STEREO; -extern unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE; -extern unsigned IOCTL_SNDCTL_DSP_SYNC; -extern unsigned IOCTL_SNDCTL_FM_4OP_ENABLE; -extern unsigned IOCTL_SNDCTL_FM_LOAD_INSTR; -extern unsigned IOCTL_SNDCTL_MIDI_INFO; -extern unsigned IOCTL_SNDCTL_MIDI_PRETIME; -extern unsigned IOCTL_SNDCTL_SEQ_CTRLRATE; -extern unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT; -extern unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT; -extern unsigned IOCTL_SNDCTL_SEQ_NRMIDIS; -extern unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS; -extern unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND; -extern unsigned IOCTL_SNDCTL_SEQ_PANIC; -extern unsigned IOCTL_SNDCTL_SEQ_PERCMODE; -extern unsigned IOCTL_SNDCTL_SEQ_RESET; -extern unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES; -extern unsigned IOCTL_SNDCTL_SEQ_SYNC; -extern unsigned IOCTL_SNDCTL_SEQ_TESTMIDI; -extern unsigned IOCTL_SNDCTL_SEQ_THRESHOLD; -extern unsigned IOCTL_SNDCTL_SYNTH_INFO; -extern unsigned IOCTL_SNDCTL_SYNTH_MEMAVL; -extern unsigned IOCTL_SNDCTL_TMR_CONTINUE; -extern unsigned IOCTL_SNDCTL_TMR_METRONOME; -extern unsigned IOCTL_SNDCTL_TMR_SELECT; -extern unsigned IOCTL_SNDCTL_TMR_SOURCE; -extern unsigned IOCTL_SNDCTL_TMR_START; -extern unsigned IOCTL_SNDCTL_TMR_STOP; -extern unsigned IOCTL_SNDCTL_TMR_TEMPO; -extern unsigned IOCTL_SNDCTL_TMR_TIMEBASE; -extern unsigned IOCTL_SOUND_MIXER_READ_ALTPCM; -extern unsigned IOCTL_SOUND_MIXER_READ_BASS; -extern unsigned IOCTL_SOUND_MIXER_READ_CAPS; -extern unsigned IOCTL_SOUND_MIXER_READ_CD; -extern unsigned IOCTL_SOUND_MIXER_READ_DEVMASK; -extern unsigned IOCTL_SOUND_MIXER_READ_ENHANCE; -extern unsigned IOCTL_SOUND_MIXER_READ_IGAIN; -extern unsigned IOCTL_SOUND_MIXER_READ_IMIX; -extern unsigned IOCTL_SOUND_MIXER_READ_LINE1; -extern unsigned IOCTL_SOUND_MIXER_READ_LINE2; -extern unsigned IOCTL_SOUND_MIXER_READ_LINE3; -extern unsigned IOCTL_SOUND_MIXER_READ_LINE; -extern unsigned IOCTL_SOUND_MIXER_READ_LOUD; -extern unsigned IOCTL_SOUND_MIXER_READ_MIC; -extern unsigned IOCTL_SOUND_MIXER_READ_MUTE; -extern unsigned IOCTL_SOUND_MIXER_READ_OGAIN; -extern unsigned IOCTL_SOUND_MIXER_READ_PCM; -extern unsigned IOCTL_SOUND_MIXER_READ_RECLEV; -extern unsigned IOCTL_SOUND_MIXER_READ_RECMASK; -extern unsigned IOCTL_SOUND_MIXER_READ_RECSRC; -extern unsigned IOCTL_SOUND_MIXER_READ_SPEAKER; -extern unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS; -extern unsigned IOCTL_SOUND_MIXER_READ_SYNTH; -extern unsigned IOCTL_SOUND_MIXER_READ_TREBLE; -extern unsigned IOCTL_SOUND_MIXER_READ_VOLUME; -extern unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM; -extern unsigned IOCTL_SOUND_MIXER_WRITE_BASS; -extern unsigned IOCTL_SOUND_MIXER_WRITE_CD; -extern unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE; -extern unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN; -extern unsigned IOCTL_SOUND_MIXER_WRITE_IMIX; -extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE1; -extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE2; -extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE3; -extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE; -extern unsigned IOCTL_SOUND_MIXER_WRITE_LOUD; -extern unsigned IOCTL_SOUND_MIXER_WRITE_MIC; -extern unsigned IOCTL_SOUND_MIXER_WRITE_MUTE; -extern unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN; -extern unsigned IOCTL_SOUND_MIXER_WRITE_PCM; -extern unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV; -extern unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC; -extern unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER; -extern unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH; -extern unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE; -extern unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME; -extern unsigned IOCTL_SOUND_PCM_READ_BITS; -extern unsigned IOCTL_SOUND_PCM_READ_CHANNELS; -extern unsigned IOCTL_SOUND_PCM_READ_FILTER; -extern unsigned IOCTL_SOUND_PCM_READ_RATE; -extern unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS; -extern unsigned IOCTL_SOUND_PCM_WRITE_FILTER; -extern unsigned IOCTL_VT_ACTIVATE; -extern unsigned IOCTL_VT_GETMODE; -extern unsigned IOCTL_VT_OPENQRY; -extern unsigned IOCTL_VT_RELDISP; -extern unsigned IOCTL_VT_SETMODE; -extern unsigned IOCTL_VT_WAITACTIVE; -extern unsigned IOCTL_KDDISABIO; -extern unsigned IOCTL_KDENABIO; -extern unsigned IOCTL_KDGETLED; -extern unsigned IOCTL_KDGKBMODE; -extern unsigned IOCTL_KDGKBTYPE; -extern unsigned IOCTL_KDMKTONE; -extern unsigned IOCTL_KDSETLED; -extern unsigned IOCTL_KDSETMODE; -extern unsigned IOCTL_KDSKBMODE; - extern const int si_SEGV_MAPERR; extern const int si_SEGV_ACCERR; } // namespace __sanitizer Index: lib/sanitizer_common/sanitizer_platform_limits_openbsd.cc =================================================================== --- lib/sanitizer_common/sanitizer_platform_limits_openbsd.cc +++ lib/sanitizer_common/sanitizer_platform_limits_openbsd.cc @@ -124,66 +124,6 @@ unsigned path_max = PATH_MAX; -// ioctl arguments -unsigned struct_ifreq_sz = sizeof(struct ifreq); -unsigned struct_termios_sz = sizeof(struct termios); -unsigned struct_winsize_sz = sizeof(struct winsize); -unsigned struct_mtget_sz = sizeof(struct mtget); -unsigned struct_mtop_sz = sizeof(struct mtop); -unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info); -unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats); -unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req); -unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req); - -const unsigned IOCTL_NOT_PRESENT = 0; - -unsigned IOCTL_FIOASYNC = FIOASYNC; -unsigned IOCTL_FIOCLEX = FIOCLEX; -unsigned IOCTL_FIOGETOWN = FIOGETOWN; -unsigned IOCTL_FIONBIO = FIONBIO; -unsigned IOCTL_FIONCLEX = FIONCLEX; -unsigned IOCTL_FIOSETOWN = FIOSETOWN; -unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI; -unsigned IOCTL_SIOCATMARK = SIOCATMARK; -unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI; -unsigned IOCTL_SIOCGIFADDR = SIOCGIFADDR; -unsigned IOCTL_SIOCGIFBRDADDR = SIOCGIFBRDADDR; -unsigned IOCTL_SIOCGIFCONF = SIOCGIFCONF; -unsigned IOCTL_SIOCGIFDSTADDR = SIOCGIFDSTADDR; -unsigned IOCTL_SIOCGIFFLAGS = SIOCGIFFLAGS; -unsigned IOCTL_SIOCGIFMETRIC = SIOCGIFMETRIC; -unsigned IOCTL_SIOCGIFMTU = SIOCGIFMTU; -unsigned IOCTL_SIOCGIFNETMASK = SIOCGIFNETMASK; -unsigned IOCTL_SIOCGPGRP = SIOCGPGRP; -unsigned IOCTL_SIOCSIFADDR = SIOCSIFADDR; -unsigned IOCTL_SIOCSIFBRDADDR = SIOCSIFBRDADDR; -unsigned IOCTL_SIOCSIFDSTADDR = SIOCSIFDSTADDR; -unsigned IOCTL_SIOCSIFFLAGS = SIOCSIFFLAGS; -unsigned IOCTL_SIOCSIFMETRIC = SIOCSIFMETRIC; -unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU; -unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK; -unsigned IOCTL_SIOCSPGRP = SIOCSPGRP; -unsigned IOCTL_TIOCCONS = TIOCCONS; -unsigned IOCTL_TIOCEXCL = TIOCEXCL; -unsigned IOCTL_TIOCGETD = TIOCGETD; -unsigned IOCTL_TIOCGPGRP = TIOCGPGRP; -unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ; -unsigned IOCTL_TIOCMBIC = TIOCMBIC; -unsigned IOCTL_TIOCMBIS = TIOCMBIS; -unsigned IOCTL_TIOCMGET = TIOCMGET; -unsigned IOCTL_TIOCMSET = TIOCMSET; -unsigned IOCTL_TIOCNOTTY = TIOCNOTTY; -unsigned IOCTL_TIOCNXCL = TIOCNXCL; -unsigned IOCTL_TIOCOUTQ = TIOCOUTQ; -unsigned IOCTL_TIOCPKT = TIOCPKT; -unsigned IOCTL_TIOCSCTTY = TIOCSCTTY; -unsigned IOCTL_TIOCSETD = TIOCSETD; -unsigned IOCTL_TIOCSPGRP = TIOCSPGRP; -unsigned IOCTL_TIOCSTI = TIOCSTI; -unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ; -unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT; -unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT; - const int si_SEGV_MAPERR = SEGV_MAPERR; const int si_SEGV_ACCERR = SEGV_ACCERR; } // namespace __sanitizer