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
|
|
|
|
2017-08-29 05:03:23 +08:00
|
|
|
#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC
|
|
|
|
|
2013-10-11 22:19:14 +08:00
|
|
|
#include "sanitizer_internal_defs.h"
|
2013-03-19 22:33:38 +08:00
|
|
|
#include "sanitizer_platform.h"
|
|
|
|
|
2015-01-30 20:43:52 +08:00
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
// FreeBSD's dlopen() returns a pointer to an Obj_Entry structure that
|
2016-09-22 01:16:38 +08:00
|
|
|
// incorporates the map structure.
|
2015-01-30 20:43:52 +08:00
|
|
|
# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
|
|
|
|
((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 544)))
|
Adjust sanitizers for FreeBSD 64-bit inode update
Summary:
Very recently, FreeBSD 12 has been updated to use 64-bit inode numbers:
<https://svnweb.freebsd.org/changeset/base/318737>. This entails many
user-visible changes, but for the sanitizers the modifications are
limited in scope:
* The `stat` and `lstat` syscalls were removed, and should be replaced
with calls to `fstatat`.
* The `getdents` syscall was removed, and should be replaced with calls
to `getdirentries`.
* The layout of `struct dirent` was changed to accomodate 64-bit inode
numbers, and a new `d_off` field was added.
* The system header <sys/_types.h> now contains a macro `__INO64` to
determine whether the system uses 64-bit inode numbers.
I tested these changes on both FreeBSD 12.0-CURRENT (after r318959,
which adds the `__INO64` macro), and FreeBSD 11.0-STABLE (which still
uses 32-bit inode numbers).
Reviewers: emaste, kcc, vitalybuka, kubamracek
Reviewed By: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33600
llvm-svn: 304658
2017-06-03 19:11:36 +08:00
|
|
|
// Get sys/_types.h, because that tells us whether 64-bit inodes are
|
|
|
|
// used in struct dirent below.
|
|
|
|
#include <sys/_types.h>
|
2015-01-30 20:43:52 +08:00
|
|
|
#else
|
|
|
|
# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
|
|
|
|
#endif // !SANITIZER_FREEBSD
|
|
|
|
|
2016-12-02 16:07:35 +08:00
|
|
|
#ifndef __GLIBC_PREREQ
|
|
|
|
#define __GLIBC_PREREQ(x, y) 0
|
|
|
|
#endif
|
|
|
|
|
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;
|
2014-02-27 17:02:08 +08:00
|
|
|
#if !SANITIZER_FREEBSD && !SANITIZER_IOS
|
2012-12-11 20:27:27 +08:00
|
|
|
extern unsigned struct_stat64_sz;
|
2013-11-01 01:38:18 +08:00
|
|
|
#endif
|
2013-02-19 17:19:16 +08:00
|
|
|
extern unsigned struct_rusage_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;
|
2017-11-21 17:36:07 +08:00
|
|
|
extern unsigned pthread_mutex_t_sz;
|
2013-10-16 16:20:31 +08:00
|
|
|
extern unsigned pthread_cond_t_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned pid_t_sz;
|
|
|
|
extern unsigned timeval_sz;
|
|
|
|
extern unsigned uid_t_sz;
|
2014-02-06 23:12:56 +08:00
|
|
|
extern unsigned gid_t_sz;
|
2013-07-10 22:17:46 +08:00
|
|
|
extern unsigned mbstate_t_sz;
|
2013-09-06 22:20:01 +08:00
|
|
|
extern unsigned struct_timezone_sz;
|
|
|
|
extern unsigned struct_tms_sz;
|
|
|
|
extern unsigned struct_itimerspec_sz;
|
|
|
|
extern unsigned struct_sigevent_sz;
|
|
|
|
extern unsigned struct_sched_param_sz;
|
2013-10-30 08:58:17 +08:00
|
|
|
extern unsigned struct_statfs64_sz;
|
2013-04-04 17:21:48 +08:00
|
|
|
|
|
|
|
#if !SANITIZER_ANDROID
|
2014-07-03 22:20:56 +08:00
|
|
|
extern unsigned struct_statfs_sz;
|
|
|
|
extern unsigned struct_sockaddr_sz;
|
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
|
2013-11-22 17:01:50 +08:00
|
|
|
|
|
|
|
#if defined(__x86_64__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 144;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 0;
|
|
|
|
#elif defined(__i386__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 64;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 96;
|
2013-11-22 18:09:34 +08:00
|
|
|
#elif defined(__arm__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 64;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
2014-02-13 15:50:20 +08:00
|
|
|
#elif defined(__aarch64__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 128;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
2013-11-22 19:01:43 +08:00
|
|
|
#elif defined(__powerpc__) && !defined(__powerpc64__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 72;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
|
|
|
#elif defined(__powerpc64__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 144;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
2014-06-24 20:08:18 +08:00
|
|
|
#elif defined(__mips__)
|
2016-03-16 16:23:10 +08:00
|
|
|
const unsigned struct_kernel_stat_sz =
|
|
|
|
SANITIZER_ANDROID ? FIRST_32_SECOND_64(104, 128) :
|
2017-04-25 21:25:40 +08:00
|
|
|
FIRST_32_SECOND_64(160, 216);
|
2014-06-24 20:08:18 +08:00
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
2016-04-15 05:17:19 +08:00
|
|
|
#elif defined(__s390__) && !defined(__s390x__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 64;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
|
|
|
#elif defined(__s390x__)
|
|
|
|
const unsigned struct_kernel_stat_sz = 144;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 0;
|
2016-12-02 16:07:35 +08:00
|
|
|
#elif defined(__sparc__) && defined(__arch64__)
|
|
|
|
const unsigned struct___old_kernel_stat_sz = 0;
|
|
|
|
const unsigned struct_kernel_stat_sz = 104;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 144;
|
|
|
|
#elif defined(__sparc__) && !defined(__arch64__)
|
|
|
|
const unsigned struct___old_kernel_stat_sz = 0;
|
|
|
|
const unsigned struct_kernel_stat_sz = 64;
|
|
|
|
const unsigned struct_kernel_stat64_sz = 104;
|
2013-11-22 17:01:50 +08:00
|
|
|
#endif
|
2013-11-22 17:32:39 +08:00
|
|
|
struct __sanitizer_perf_event_attr {
|
|
|
|
unsigned type;
|
|
|
|
unsigned size;
|
|
|
|
// More fields that vary with the kernel version.
|
|
|
|
};
|
2013-11-22 17:01:50 +08:00
|
|
|
|
2012-12-11 20:27:27 +08:00
|
|
|
extern unsigned struct_epoll_event_sz;
|
2013-06-24 22:25:33 +08:00
|
|
|
extern unsigned struct_sysinfo_sz;
|
2013-09-06 22:20:01 +08:00
|
|
|
extern unsigned __user_cap_header_struct_sz;
|
|
|
|
extern unsigned __user_cap_data_struct_sz;
|
2014-02-10 16:00:24 +08:00
|
|
|
extern unsigned struct_new_utsname_sz;
|
|
|
|
extern unsigned struct_old_utsname_sz;
|
|
|
|
extern unsigned struct_oldold_utsname_sz;
|
|
|
|
|
2013-09-06 22:20:01 +08:00
|
|
|
const unsigned struct_kexec_segment_sz = 4 * sizeof(unsigned long);
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
|
|
|
|
2016-04-15 05:17:19 +08:00
|
|
|
#if defined(__powerpc64__) || defined(__s390__)
|
2014-02-27 17:02:08 +08:00
|
|
|
const unsigned struct___old_kernel_stat_sz = 0;
|
2016-12-02 16:07:35 +08:00
|
|
|
#elif !defined(__sparc__)
|
2014-02-27 17:02:08 +08:00
|
|
|
const unsigned struct___old_kernel_stat_sz = 32;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern unsigned struct_rlimit_sz;
|
|
|
|
extern unsigned struct_utimbuf_sz;
|
|
|
|
extern unsigned struct_timespec_sz;
|
2013-09-06 22:20:01 +08:00
|
|
|
|
2013-11-01 09:20:39 +08:00
|
|
|
struct __sanitizer_iocb {
|
|
|
|
u64 aio_data;
|
|
|
|
u32 aio_key_or_aio_reserved1; // Simply crazy.
|
|
|
|
u32 aio_reserved1_or_aio_key; // Luckily, we don't need these.
|
|
|
|
u16 aio_lio_opcode;
|
|
|
|
s16 aio_reqprio;
|
|
|
|
u32 aio_fildes;
|
|
|
|
u64 aio_buf;
|
|
|
|
u64 aio_nbytes;
|
|
|
|
s64 aio_offset;
|
|
|
|
u64 aio_reserved2;
|
2013-11-02 01:48:35 +08:00
|
|
|
u64 aio_reserved3;
|
2013-11-01 09:20:39 +08:00
|
|
|
};
|
|
|
|
|
2013-11-27 17:10:47 +08:00
|
|
|
struct __sanitizer_io_event {
|
|
|
|
u64 data;
|
|
|
|
u64 obj;
|
|
|
|
u64 res;
|
|
|
|
u64 res2;
|
|
|
|
};
|
|
|
|
|
2013-11-22 17:01:50 +08:00
|
|
|
const unsigned iocb_cmd_pread = 0;
|
|
|
|
const unsigned iocb_cmd_pwrite = 1;
|
2013-11-27 17:10:47 +08:00
|
|
|
const unsigned iocb_cmd_preadv = 7;
|
|
|
|
const unsigned iocb_cmd_pwritev = 8;
|
2013-11-01 09:20:39 +08:00
|
|
|
|
2013-09-06 22:20:01 +08:00
|
|
|
struct __sanitizer___sysctl_args {
|
|
|
|
int *name;
|
|
|
|
int nlen;
|
|
|
|
void *oldval;
|
|
|
|
uptr *oldlenp;
|
|
|
|
void *newval;
|
|
|
|
uptr newlen;
|
2013-09-06 22:58:49 +08:00
|
|
|
unsigned long ___unused[4];
|
2013-09-06 22:20:01 +08:00
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
|
|
|
|
const unsigned old_sigset_t_sz = sizeof(unsigned long);
|
2015-10-13 05:32:30 +08:00
|
|
|
|
|
|
|
struct __sanitizer_sem_t {
|
|
|
|
#if SANITIZER_ANDROID && defined(_LP64)
|
|
|
|
int data[4];
|
|
|
|
#elif SANITIZER_ANDROID && !defined(_LP64)
|
|
|
|
int data;
|
|
|
|
#elif SANITIZER_LINUX
|
|
|
|
uptr data[4];
|
|
|
|
#elif SANITIZER_FREEBSD
|
|
|
|
u32 data[4];
|
|
|
|
#endif
|
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
2012-12-11 20:27:27 +08:00
|
|
|
|
2014-03-27 21:29:29 +08:00
|
|
|
#if SANITIZER_ANDROID
|
|
|
|
struct __sanitizer_mallinfo {
|
2014-03-27 22:06:15 +08:00
|
|
|
uptr v[10];
|
2014-03-27 21:29:29 +08:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
2014-03-27 21:29:29 +08:00
|
|
|
struct __sanitizer_mallinfo {
|
|
|
|
int v[10];
|
|
|
|
};
|
|
|
|
|
2014-02-10 16:00:24 +08:00
|
|
|
extern unsigned struct_ustat_sz;
|
2013-02-19 19:06:41 +08:00
|
|
|
extern unsigned struct_rlimit64_sz;
|
2013-10-18 19:26:02 +08:00
|
|
|
extern unsigned struct_statvfs64_sz;
|
2013-10-29 10:48:49 +08:00
|
|
|
|
|
|
|
struct __sanitizer_ipc_perm {
|
|
|
|
int __key;
|
|
|
|
int uid;
|
|
|
|
int gid;
|
|
|
|
int cuid;
|
|
|
|
int cgid;
|
2014-01-13 18:19:12 +08:00
|
|
|
#ifdef __powerpc__
|
2013-11-22 19:01:43 +08:00
|
|
|
unsigned mode;
|
|
|
|
unsigned __seq;
|
2014-01-13 18:19:12 +08:00
|
|
|
u64 __unused1;
|
|
|
|
u64 __unused2;
|
2016-12-02 16:07:35 +08:00
|
|
|
#elif defined(__sparc__)
|
|
|
|
#if defined(__arch64__)
|
|
|
|
unsigned mode;
|
|
|
|
unsigned short __pad1;
|
|
|
|
#else
|
|
|
|
unsigned short __pad1;
|
|
|
|
unsigned short mode;
|
|
|
|
unsigned short __pad2;
|
|
|
|
#endif
|
|
|
|
unsigned short __seq;
|
|
|
|
unsigned long long __unused1;
|
|
|
|
unsigned long long __unused2;
|
2016-04-15 05:17:19 +08:00
|
|
|
#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
|
2014-06-24 20:08:18 +08:00
|
|
|
unsigned int mode;
|
|
|
|
unsigned short __seq;
|
|
|
|
unsigned short __pad1;
|
|
|
|
unsigned long __unused1;
|
|
|
|
unsigned long __unused2;
|
2013-11-22 19:01:43 +08:00
|
|
|
#else
|
2013-10-29 10:48:49 +08:00
|
|
|
unsigned short mode;
|
|
|
|
unsigned short __pad1;
|
|
|
|
unsigned short __seq;
|
|
|
|
unsigned short __pad2;
|
2014-01-13 18:19:12 +08:00
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
u64 __unused1;
|
|
|
|
u64 __unused2;
|
|
|
|
#else
|
|
|
|
unsigned long __unused1;
|
|
|
|
unsigned long __unused2;
|
|
|
|
#endif
|
2013-11-22 19:01:43 +08:00
|
|
|
#endif
|
2013-10-29 10:48:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct __sanitizer_shmid_ds {
|
|
|
|
__sanitizer_ipc_perm shm_perm;
|
2016-12-02 16:07:35 +08:00
|
|
|
#if defined(__sparc__)
|
|
|
|
#if !defined(__arch64__)
|
|
|
|
u32 __pad1;
|
|
|
|
#endif
|
|
|
|
long shm_atime;
|
|
|
|
#if !defined(__arch64__)
|
|
|
|
u32 __pad2;
|
|
|
|
#endif
|
|
|
|
long shm_dtime;
|
|
|
|
#if !defined(__arch64__)
|
|
|
|
u32 __pad3;
|
|
|
|
#endif
|
|
|
|
long shm_ctime;
|
|
|
|
uptr shm_segsz;
|
|
|
|
int shm_cpid;
|
|
|
|
int shm_lpid;
|
|
|
|
unsigned long shm_nattch;
|
|
|
|
unsigned long __glibc_reserved1;
|
|
|
|
unsigned long __glibc_reserved2;
|
|
|
|
#else
|
2013-11-22 19:01:43 +08:00
|
|
|
#ifndef __powerpc__
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr shm_segsz;
|
2014-01-13 18:19:12 +08:00
|
|
|
#elif !defined(__powerpc64__)
|
|
|
|
uptr __unused0;
|
2013-11-22 19:01:43 +08:00
|
|
|
#endif
|
2014-01-14 15:38:53 +08:00
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
u64 shm_atime;
|
|
|
|
u64 shm_dtime;
|
|
|
|
u64 shm_ctime;
|
|
|
|
#else
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr shm_atime;
|
2014-06-24 20:08:18 +08:00
|
|
|
#if !defined(_LP64) && !defined(__mips__)
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr __unused1;
|
|
|
|
#endif
|
|
|
|
uptr shm_dtime;
|
2014-06-24 20:08:18 +08:00
|
|
|
#if !defined(_LP64) && !defined(__mips__)
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr __unused2;
|
|
|
|
#endif
|
|
|
|
uptr shm_ctime;
|
2014-06-24 20:08:18 +08:00
|
|
|
#if !defined(_LP64) && !defined(__mips__)
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr __unused3;
|
2013-11-22 19:01:43 +08:00
|
|
|
#endif
|
2014-01-14 15:38:53 +08:00
|
|
|
#endif
|
2013-11-22 19:01:43 +08:00
|
|
|
#ifdef __powerpc__
|
|
|
|
uptr shm_segsz;
|
2013-10-29 10:48:49 +08:00
|
|
|
#endif
|
|
|
|
int shm_cpid;
|
|
|
|
int shm_lpid;
|
2014-01-14 15:38:53 +08:00
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
u64 shm_nattch;
|
|
|
|
u64 __unused4;
|
|
|
|
u64 __unused5;
|
|
|
|
#else
|
2013-10-29 10:48:49 +08:00
|
|
|
uptr shm_nattch;
|
|
|
|
uptr __unused4;
|
|
|
|
uptr __unused5;
|
2014-01-14 15:38:53 +08:00
|
|
|
#endif
|
2016-12-02 16:07:35 +08:00
|
|
|
#endif
|
2013-10-29 10:48:49 +08:00
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#elif SANITIZER_FREEBSD
|
|
|
|
struct __sanitizer_ipc_perm {
|
|
|
|
unsigned int cuid;
|
|
|
|
unsigned int cgid;
|
|
|
|
unsigned int uid;
|
|
|
|
unsigned int gid;
|
|
|
|
unsigned short mode;
|
|
|
|
unsigned short seq;
|
|
|
|
long key;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __sanitizer_shmid_ds {
|
|
|
|
__sanitizer_ipc_perm shm_perm;
|
|
|
|
unsigned long shm_segsz;
|
|
|
|
unsigned int shm_lpid;
|
|
|
|
unsigned int shm_cpid;
|
|
|
|
int shm_nattch;
|
|
|
|
unsigned long shm_atime;
|
|
|
|
unsigned long shm_dtime;
|
|
|
|
unsigned long shm_ctime;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_msqid_ds_sz;
|
|
|
|
extern unsigned struct_mq_attr_sz;
|
|
|
|
extern unsigned struct_timex_sz;
|
|
|
|
extern unsigned struct_statvfs_sz;
|
|
|
|
#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
2013-02-19 19:06:41 +08:00
|
|
|
|
2013-05-29 19:30:00 +08:00
|
|
|
struct __sanitizer_iovec {
|
2014-02-07 02:48:23 +08:00
|
|
|
void *iov_base;
|
2013-05-29 19:30:00 +08:00
|
|
|
uptr iov_len;
|
|
|
|
};
|
|
|
|
|
2014-02-07 02:48:23 +08:00
|
|
|
#if !SANITIZER_ANDROID
|
|
|
|
struct __sanitizer_ifaddrs {
|
|
|
|
struct __sanitizer_ifaddrs *ifa_next;
|
|
|
|
char *ifa_name;
|
|
|
|
unsigned int ifa_flags;
|
|
|
|
void *ifa_addr; // (struct sockaddr *)
|
|
|
|
void *ifa_netmask; // (struct sockaddr *)
|
2014-02-07 03:36:10 +08:00
|
|
|
// This is a union on Linux.
|
2014-02-27 17:02:08 +08:00
|
|
|
# ifdef ifa_dstaddr
|
|
|
|
# undef ifa_dstaddr
|
|
|
|
# endif
|
2014-02-07 03:36:10 +08:00
|
|
|
void *ifa_dstaddr; // (struct sockaddr *)
|
2014-02-07 02:48:23 +08:00
|
|
|
void *ifa_data;
|
|
|
|
};
|
|
|
|
#endif // !SANITIZER_ANDROID
|
|
|
|
|
2013-07-05 23:04:56 +08:00
|
|
|
#if SANITIZER_MAC
|
|
|
|
typedef unsigned long __sanitizer_pthread_key_t;
|
|
|
|
#else
|
2013-07-05 20:31:07 +08:00
|
|
|
typedef unsigned __sanitizer_pthread_key_t;
|
2013-07-05 23:04:56 +08:00
|
|
|
#endif
|
2013-07-05 20:31:07 +08:00
|
|
|
|
2014-04-04 22:51:23 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
2014-05-13 16:01:59 +08:00
|
|
|
|
2014-04-04 22:51:23 +08:00
|
|
|
struct __sanitizer_XDR {
|
|
|
|
int x_op;
|
2014-05-15 15:18:34 +08:00
|
|
|
void *x_ops;
|
2014-04-04 22:51:23 +08:00
|
|
|
uptr x_public;
|
|
|
|
uptr x_private;
|
|
|
|
uptr x_base;
|
|
|
|
unsigned x_handy;
|
|
|
|
};
|
|
|
|
|
|
|
|
const int __sanitizer_XDR_ENCODE = 0;
|
|
|
|
const int __sanitizer_XDR_DECODE = 1;
|
|
|
|
const int __sanitizer_XDR_FREE = 2;
|
|
|
|
#endif
|
|
|
|
|
2014-03-28 21:03:55 +08:00
|
|
|
struct __sanitizer_passwd {
|
|
|
|
char *pw_name;
|
|
|
|
char *pw_passwd;
|
|
|
|
int pw_uid;
|
|
|
|
int pw_gid;
|
2014-04-01 18:29:42 +08:00
|
|
|
#if SANITIZER_MAC || SANITIZER_FREEBSD
|
2014-03-28 21:03:55 +08:00
|
|
|
long pw_change;
|
|
|
|
char *pw_class;
|
2014-03-28 22:01:40 +08:00
|
|
|
#endif
|
2015-04-28 07:49:39 +08:00
|
|
|
#if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32))
|
2014-03-28 22:01:40 +08:00
|
|
|
char *pw_gecos;
|
2014-03-28 21:03:55 +08:00
|
|
|
#endif
|
|
|
|
char *pw_dir;
|
|
|
|
char *pw_shell;
|
2014-04-01 18:29:42 +08:00
|
|
|
#if SANITIZER_MAC || SANITIZER_FREEBSD
|
2014-03-28 21:03:55 +08:00
|
|
|
long pw_expire;
|
2014-04-01 18:29:42 +08:00
|
|
|
#endif
|
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
int pw_fields;
|
2014-03-28 21:03:55 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __sanitizer_group {
|
|
|
|
char *gr_name;
|
|
|
|
char *gr_passwd;
|
|
|
|
int gr_gid;
|
|
|
|
char **gr_mem;
|
|
|
|
};
|
|
|
|
|
2014-05-13 15:49:39 +08:00
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
typedef long long __sanitizer_time_t;
|
|
|
|
#else
|
|
|
|
typedef long __sanitizer_time_t;
|
|
|
|
#endif
|
|
|
|
|
2014-03-28 16:33:32 +08:00
|
|
|
struct __sanitizer_timeb {
|
2014-05-13 15:49:39 +08:00
|
|
|
__sanitizer_time_t time;
|
2014-03-28 16:33:32 +08:00
|
|
|
unsigned short millitm;
|
|
|
|
short timezone;
|
|
|
|
short dstflag;
|
|
|
|
};
|
|
|
|
|
2013-10-23 21:57:47 +08:00
|
|
|
struct __sanitizer_ether_addr {
|
|
|
|
u8 octet[6];
|
|
|
|
};
|
|
|
|
|
2013-10-02 22:30:03 +08:00
|
|
|
struct __sanitizer_tm {
|
|
|
|
int tm_sec;
|
|
|
|
int tm_min;
|
|
|
|
int tm_hour;
|
|
|
|
int tm_mday;
|
|
|
|
int tm_mon;
|
|
|
|
int tm_year;
|
|
|
|
int tm_wday;
|
|
|
|
int tm_yday;
|
|
|
|
int tm_isdst;
|
|
|
|
long int tm_gmtoff;
|
|
|
|
const char *tm_zone;
|
|
|
|
};
|
|
|
|
|
2013-10-18 17:41:43 +08:00
|
|
|
#if SANITIZER_LINUX
|
|
|
|
struct __sanitizer_mntent {
|
|
|
|
char *mnt_fsname;
|
|
|
|
char *mnt_dir;
|
|
|
|
char *mnt_type;
|
|
|
|
char *mnt_opts;
|
|
|
|
int mnt_freq;
|
|
|
|
int mnt_passno;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2015-04-28 07:49:39 +08:00
|
|
|
#if SANITIZER_MAC || SANITIZER_FREEBSD
|
2013-05-29 19:55:27 +08:00
|
|
|
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
|
|
|
|
2013-06-27 17:37:27 +08:00
|
|
|
#if SANITIZER_MAC
|
|
|
|
struct __sanitizer_dirent {
|
2013-07-16 19:54:40 +08:00
|
|
|
unsigned long long d_ino;
|
|
|
|
unsigned long long d_seekoff;
|
2013-06-27 17:37:27 +08:00
|
|
|
unsigned short d_reclen;
|
|
|
|
// more fields that we don't care about
|
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#elif SANITIZER_FREEBSD
|
|
|
|
struct __sanitizer_dirent {
|
Adjust sanitizers for FreeBSD 64-bit inode update
Summary:
Very recently, FreeBSD 12 has been updated to use 64-bit inode numbers:
<https://svnweb.freebsd.org/changeset/base/318737>. This entails many
user-visible changes, but for the sanitizers the modifications are
limited in scope:
* The `stat` and `lstat` syscalls were removed, and should be replaced
with calls to `fstatat`.
* The `getdents` syscall was removed, and should be replaced with calls
to `getdirentries`.
* The layout of `struct dirent` was changed to accomodate 64-bit inode
numbers, and a new `d_off` field was added.
* The system header <sys/_types.h> now contains a macro `__INO64` to
determine whether the system uses 64-bit inode numbers.
I tested these changes on both FreeBSD 12.0-CURRENT (after r318959,
which adds the `__INO64` macro), and FreeBSD 11.0-STABLE (which still
uses 32-bit inode numbers).
Reviewers: emaste, kcc, vitalybuka, kubamracek
Reviewed By: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33600
llvm-svn: 304658
2017-06-03 19:11:36 +08:00
|
|
|
#if defined(__INO64)
|
|
|
|
unsigned long long d_fileno;
|
|
|
|
unsigned long long d_off;
|
|
|
|
#else
|
2014-02-27 17:02:08 +08:00
|
|
|
unsigned int d_fileno;
|
Adjust sanitizers for FreeBSD 64-bit inode update
Summary:
Very recently, FreeBSD 12 has been updated to use 64-bit inode numbers:
<https://svnweb.freebsd.org/changeset/base/318737>. This entails many
user-visible changes, but for the sanitizers the modifications are
limited in scope:
* The `stat` and `lstat` syscalls were removed, and should be replaced
with calls to `fstatat`.
* The `getdents` syscall was removed, and should be replaced with calls
to `getdirentries`.
* The layout of `struct dirent` was changed to accomodate 64-bit inode
numbers, and a new `d_off` field was added.
* The system header <sys/_types.h> now contains a macro `__INO64` to
determine whether the system uses 64-bit inode numbers.
I tested these changes on both FreeBSD 12.0-CURRENT (after r318959,
which adds the `__INO64` macro), and FreeBSD 11.0-STABLE (which still
uses 32-bit inode numbers).
Reviewers: emaste, kcc, vitalybuka, kubamracek
Reviewed By: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33600
llvm-svn: 304658
2017-06-03 19:11:36 +08:00
|
|
|
#endif
|
2014-02-27 17:02:08 +08:00
|
|
|
unsigned short d_reclen;
|
|
|
|
// more fields that we don't care about
|
|
|
|
};
|
2013-11-07 01:47:39 +08:00
|
|
|
#elif SANITIZER_ANDROID || defined(__x86_64__)
|
2013-06-27 17:37:27 +08:00
|
|
|
struct __sanitizer_dirent {
|
|
|
|
unsigned long long d_ino;
|
|
|
|
unsigned long long d_off;
|
|
|
|
unsigned short d_reclen;
|
|
|
|
// more fields that we don't care about
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
struct __sanitizer_dirent {
|
|
|
|
uptr d_ino;
|
|
|
|
uptr d_off;
|
|
|
|
unsigned short d_reclen;
|
|
|
|
// more fields that we don't care about
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
struct __sanitizer_dirent64 {
|
Fix a veritable conucopia of bugs in the readdir_r interceptors.
First, the reason I came here: I forgot to look at readdir64_r which had
the exact same bug as readdir_r. However, upon applying the same
quick-fix and testing it I discovered that it still didn't work at all.
As a consequence, I spent some time studying the code and thinking about
it and fixed several other problems.
Second, the code was checking for a null entry and result pointer, but
there is no indication that null pointers are viable here. Certainly,
the spec makes it extremely clear that there is no non-error case where
the implementation of readdir_r fails to dereference the 'result'
pointer and store NULL to it. Thus, our checking for a non-null 'result'
pointer before reflecting that write in the instrumentation was
trivially dead. Remove it.
Third, the interceptor was marking the write to the actual dirent struct
by looking at the entry pointer, but nothing in the spec requires that
the dirent struct written is actually written into the entry structure
provided. A threadlocal buffer would be just as conforming, and the spec
goes out of its way to say the pointer to the *actual* result dirent
struct is stored into *result, so *that* is where the interceptor should
reflect a write occuring. This also obviates the need to even consider
whether the 'entry' parameter is null.
Fourth, I got to the bottom of why nothing at all worked in readdir64_r
-- the interceptor structure for dirent64 was completely wrong in that
it was the same as dirent. I fixed this struct to be correct (64-bit
inode and 64-bit offset! just a 64-bit offset isn't enough!) and added
several missing tests for the size and layout of this struct.
llvm-svn: 186109
2013-07-12 02:51:40 +08:00
|
|
|
unsigned long long d_ino;
|
|
|
|
unsigned long long d_off;
|
2013-06-27 17:37:27 +08:00
|
|
|
unsigned short d_reclen;
|
|
|
|
// more fields that we don't care about
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
// 'clock_t' is 32 bits wide on x64 FreeBSD
|
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
typedef int __sanitizer_clock_t;
|
|
|
|
#elif defined(__x86_64__) && !defined(_LP64)
|
2014-01-14 15:38:53 +08:00
|
|
|
typedef long long __sanitizer_clock_t;
|
|
|
|
#else
|
2013-11-28 22:41:22 +08:00
|
|
|
typedef long __sanitizer_clock_t;
|
2014-01-14 15:38:53 +08:00
|
|
|
#endif
|
2013-11-28 22:41:22 +08:00
|
|
|
|
2017-12-17 07:01:14 +08:00
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
2014-06-19 18:19:57 +08:00
|
|
|
typedef int __sanitizer_clockid_t;
|
|
|
|
#endif
|
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
2014-06-24 20:08:18 +08:00
|
|
|
#if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__)\
|
|
|
|
|| defined(__mips__)
|
2013-09-06 23:34:17 +08:00
|
|
|
typedef unsigned __sanitizer___kernel_uid_t;
|
|
|
|
typedef unsigned __sanitizer___kernel_gid_t;
|
|
|
|
#else
|
2013-09-09 14:18:07 +08:00
|
|
|
typedef unsigned short __sanitizer___kernel_uid_t;
|
2013-09-06 23:34:17 +08:00
|
|
|
typedef unsigned short __sanitizer___kernel_gid_t;
|
2014-01-13 18:19:12 +08:00
|
|
|
#endif
|
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
typedef long long __sanitizer___kernel_off_t;
|
|
|
|
#else
|
2013-11-07 01:47:39 +08:00
|
|
|
typedef long __sanitizer___kernel_off_t;
|
2013-09-06 23:34:17 +08:00
|
|
|
#endif
|
2013-11-22 19:01:43 +08:00
|
|
|
|
2014-09-29 21:18:55 +08:00
|
|
|
#if defined(__powerpc__) || defined(__mips__)
|
2013-11-22 19:01:43 +08:00
|
|
|
typedef unsigned int __sanitizer___kernel_old_uid_t;
|
|
|
|
typedef unsigned int __sanitizer___kernel_old_gid_t;
|
|
|
|
#else
|
2013-09-06 23:34:17 +08:00
|
|
|
typedef unsigned short __sanitizer___kernel_old_uid_t;
|
|
|
|
typedef unsigned short __sanitizer___kernel_old_gid_t;
|
2013-11-22 19:01:43 +08:00
|
|
|
#endif
|
|
|
|
|
2013-09-06 23:34:17 +08:00
|
|
|
typedef long long __sanitizer___kernel_loff_t;
|
|
|
|
typedef struct {
|
|
|
|
unsigned long fds_bits[1024 / (8 * sizeof(long))];
|
|
|
|
} __sanitizer___kernel_fd_set;
|
|
|
|
#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
|
|
|
|
2013-08-27 19:10:04 +08:00
|
|
|
#if SANITIZER_ANDROID
|
2016-03-16 16:23:10 +08:00
|
|
|
# if SANITIZER_MIPS
|
|
|
|
typedef unsigned long __sanitizer_sigset_t[16/sizeof(unsigned long)];
|
|
|
|
# else
|
2013-08-27 19:10:04 +08:00
|
|
|
typedef unsigned long __sanitizer_sigset_t;
|
2016-03-16 16:23:10 +08:00
|
|
|
# endif
|
2013-08-27 19:10:04 +08:00
|
|
|
#elif SANITIZER_MAC
|
|
|
|
typedef unsigned __sanitizer_sigset_t;
|
|
|
|
#elif SANITIZER_LINUX
|
|
|
|
struct __sanitizer_sigset_t {
|
|
|
|
// The size is determined by looking at sizeof of real sigset_t on linux.
|
|
|
|
uptr val[128 / sizeof(uptr)];
|
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#elif SANITIZER_FREEBSD
|
|
|
|
struct __sanitizer_sigset_t {
|
|
|
|
// uint32_t * 4
|
|
|
|
unsigned int __bits[4];
|
|
|
|
};
|
2013-08-27 19:10:04 +08:00
|
|
|
#endif
|
2013-04-04 16:22:52 +08:00
|
|
|
|
2017-11-10 12:27:47 +08:00
|
|
|
struct __sanitizer_siginfo {
|
|
|
|
// The size is determined by looking at sizeof of real siginfo_t on linux.
|
|
|
|
u64 opaque[128 / sizeof(u64)];
|
|
|
|
};
|
|
|
|
|
2017-11-11 06:41:52 +08:00
|
|
|
using __sanitizer_sighandler_ptr = void (*)(int sig);
|
|
|
|
using __sanitizer_sigactionhandler_ptr =
|
|
|
|
void (*)(int sig, __sanitizer_siginfo *siginfo, void *uctx);
|
|
|
|
|
2014-01-31 19:29:51 +08:00
|
|
|
// Linux system headers define the 'sa_handler' and 'sa_sigaction' macros.
|
2015-04-28 07:49:39 +08:00
|
|
|
#if SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64)
|
|
|
|
struct __sanitizer_sigaction {
|
|
|
|
unsigned sa_flags;
|
|
|
|
union {
|
2017-11-11 06:41:52 +08:00
|
|
|
__sanitizer_sigactionhandler_ptr sigaction;
|
|
|
|
__sanitizer_sighandler_ptr handler;
|
2015-04-28 07:49:39 +08:00
|
|
|
};
|
|
|
|
__sanitizer_sigset_t sa_mask;
|
|
|
|
void (*sa_restorer)();
|
|
|
|
};
|
2016-03-16 16:23:10 +08:00
|
|
|
#elif SANITIZER_ANDROID && SANITIZER_MIPS32 // check this before WORDSIZE == 32
|
|
|
|
struct __sanitizer_sigaction {
|
|
|
|
unsigned sa_flags;
|
|
|
|
union {
|
2017-11-11 06:41:52 +08:00
|
|
|
__sanitizer_sigactionhandler_ptr sigaction;
|
|
|
|
__sanitizer_sighandler_ptr handler;
|
2016-03-16 16:23:10 +08:00
|
|
|
};
|
|
|
|
__sanitizer_sigset_t sa_mask;
|
|
|
|
};
|
2015-04-28 07:49:39 +08:00
|
|
|
#elif SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32)
|
|
|
|
struct __sanitizer_sigaction {
|
|
|
|
union {
|
2017-11-11 06:41:52 +08:00
|
|
|
__sanitizer_sigactionhandler_ptr sigaction;
|
|
|
|
__sanitizer_sighandler_ptr handler;
|
2015-04-28 07:49:39 +08:00
|
|
|
};
|
|
|
|
__sanitizer_sigset_t sa_mask;
|
|
|
|
uptr sa_flags;
|
|
|
|
void (*sa_restorer)();
|
|
|
|
};
|
|
|
|
#else // !SANITIZER_ANDROID
|
2013-08-27 19:10:04 +08:00
|
|
|
struct __sanitizer_sigaction {
|
2014-06-24 20:08:18 +08:00
|
|
|
#if defined(__mips__) && !SANITIZER_FREEBSD
|
|
|
|
unsigned int sa_flags;
|
|
|
|
#endif
|
2013-08-27 19:10:04 +08:00
|
|
|
union {
|
2017-11-11 06:41:52 +08:00
|
|
|
__sanitizer_sigactionhandler_ptr sigaction;
|
|
|
|
__sanitizer_sighandler_ptr handler;
|
2013-08-27 19:10:04 +08:00
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
int sa_flags;
|
|
|
|
__sanitizer_sigset_t sa_mask;
|
2016-04-15 05:17:19 +08:00
|
|
|
#else
|
|
|
|
#if defined(__s390x__)
|
|
|
|
int sa_resv;
|
2014-02-27 17:02:08 +08:00
|
|
|
#else
|
2013-08-27 19:10:04 +08:00
|
|
|
__sanitizer_sigset_t sa_mask;
|
2016-04-15 05:17:19 +08:00
|
|
|
#endif
|
2014-06-24 20:08:18 +08:00
|
|
|
#ifndef __mips__
|
2016-12-02 16:07:35 +08:00
|
|
|
#if defined(__sparc__)
|
|
|
|
#if __GLIBC_PREREQ (2, 20)
|
2017-01-10 20:41:18 +08:00
|
|
|
// On sparc glibc 2.19 and earlier sa_flags was unsigned long.
|
|
|
|
#if defined(__arch64__)
|
|
|
|
// To maintain ABI compatibility on sparc64 when switching to an int,
|
|
|
|
// __glibc_reserved0 was added.
|
2016-12-02 16:07:35 +08:00
|
|
|
int __glibc_reserved0;
|
2017-01-10 20:41:18 +08:00
|
|
|
#endif
|
2016-12-02 16:07:35 +08:00
|
|
|
int sa_flags;
|
|
|
|
#else
|
|
|
|
unsigned long sa_flags;
|
|
|
|
#endif
|
|
|
|
#else
|
2013-08-27 19:10:04 +08:00
|
|
|
int sa_flags;
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif
|
2014-06-24 20:08:18 +08:00
|
|
|
#endif
|
2016-12-02 16:07:35 +08:00
|
|
|
#endif
|
2013-08-27 19:10:04 +08:00
|
|
|
#if SANITIZER_LINUX
|
|
|
|
void (*sa_restorer)();
|
2014-06-24 20:08:18 +08:00
|
|
|
#endif
|
|
|
|
#if defined(__mips__) && (SANITIZER_WORDSIZE == 32)
|
|
|
|
int sa_resv[1];
|
2016-04-15 05:17:19 +08:00
|
|
|
#endif
|
|
|
|
#if defined(__s390x__)
|
|
|
|
__sanitizer_sigset_t sa_mask;
|
2013-08-27 19:10:04 +08:00
|
|
|
#endif
|
2013-04-04 16:22:52 +08:00
|
|
|
};
|
2015-04-28 07:49:39 +08:00
|
|
|
#endif // !SANITIZER_ANDROID
|
2013-04-04 16:22:52 +08:00
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
typedef __sanitizer_sigset_t __sanitizer_kernel_sigset_t;
|
2015-02-19 15:30:39 +08:00
|
|
|
#elif defined(__mips__)
|
|
|
|
struct __sanitizer_kernel_sigset_t {
|
2016-10-06 18:21:42 +08:00
|
|
|
uptr sig[2];
|
2015-02-19 15:30:39 +08:00
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#else
|
2013-10-15 20:57:59 +08:00
|
|
|
struct __sanitizer_kernel_sigset_t {
|
|
|
|
u8 sig[8];
|
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif
|
2013-10-15 20:57:59 +08:00
|
|
|
|
2014-01-31 19:29:51 +08:00
|
|
|
// Linux system headers define the 'sa_handler' and 'sa_sigaction' macros.
|
2016-10-06 17:58:11 +08:00
|
|
|
#if SANITIZER_MIPS
|
|
|
|
struct __sanitizer_kernel_sigaction_t {
|
|
|
|
unsigned int sa_flags;
|
|
|
|
union {
|
|
|
|
void (*handler)(int signo);
|
2017-11-10 12:27:47 +08:00
|
|
|
void (*sigaction)(int signo, __sanitizer_siginfo *info, void *ctx);
|
2016-10-06 17:58:11 +08:00
|
|
|
};
|
|
|
|
__sanitizer_kernel_sigset_t sa_mask;
|
|
|
|
void (*sa_restorer)(void);
|
|
|
|
};
|
|
|
|
#else
|
2013-10-15 20:57:59 +08:00
|
|
|
struct __sanitizer_kernel_sigaction_t {
|
|
|
|
union {
|
|
|
|
void (*handler)(int signo);
|
2017-11-10 12:27:47 +08:00
|
|
|
void (*sigaction)(int signo, __sanitizer_siginfo *info, void *ctx);
|
2013-10-15 20:57:59 +08:00
|
|
|
};
|
|
|
|
unsigned long sa_flags;
|
|
|
|
void (*sa_restorer)(void);
|
|
|
|
__sanitizer_kernel_sigset_t sa_mask;
|
|
|
|
};
|
2016-10-06 17:58:11 +08:00
|
|
|
#endif
|
2013-10-15 20:57:59 +08:00
|
|
|
|
2017-11-11 06:41:52 +08:00
|
|
|
extern const uptr sig_ign;
|
|
|
|
extern const uptr sig_dfl;
|
|
|
|
extern const uptr sig_err;
|
|
|
|
extern const uptr sa_siginfo;
|
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-06-24 21:56:14 +08:00
|
|
|
extern int af_inet;
|
|
|
|
extern int af_inet6;
|
2013-04-23 22:05:15 +08:00
|
|
|
uptr __sanitizer_in_addr_sz(int af);
|
2013-05-17 20:51:13 +08:00
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
2013-05-17 20:51:13 +08:00
|
|
|
struct __sanitizer_dl_phdr_info {
|
|
|
|
uptr dlpi_addr;
|
|
|
|
const char *dlpi_name;
|
|
|
|
const void *dlpi_phdr;
|
|
|
|
short dlpi_phnum;
|
|
|
|
};
|
2015-09-09 07:14:44 +08:00
|
|
|
|
|
|
|
extern unsigned struct_ElfW_Phdr_sz;
|
2013-05-17 20:51:13 +08:00
|
|
|
#endif
|
2013-05-22 20:50:26 +08:00
|
|
|
|
|
|
|
struct __sanitizer_addrinfo {
|
|
|
|
int ai_flags;
|
|
|
|
int ai_family;
|
|
|
|
int ai_socktype;
|
|
|
|
int ai_protocol;
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD
|
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-08-12 21:19:53 +08:00
|
|
|
struct __sanitizer_pollfd {
|
|
|
|
int fd;
|
|
|
|
short events;
|
|
|
|
short revents;
|
|
|
|
};
|
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD
|
2013-08-12 21:19:53 +08:00
|
|
|
typedef unsigned __sanitizer_nfds_t;
|
|
|
|
#else
|
|
|
|
typedef unsigned long __sanitizer_nfds_t;
|
|
|
|
#endif
|
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if !SANITIZER_ANDROID
|
|
|
|
# if SANITIZER_LINUX
|
2013-07-02 22:08:52 +08:00
|
|
|
struct __sanitizer_glob_t {
|
|
|
|
uptr gl_pathc;
|
|
|
|
char **gl_pathv;
|
2013-07-09 20:07:59 +08:00
|
|
|
uptr gl_offs;
|
|
|
|
int gl_flags;
|
2013-07-16 00:11:39 +08:00
|
|
|
|
|
|
|
void (*gl_closedir)(void *dirp);
|
|
|
|
void *(*gl_readdir)(void *dirp);
|
2013-07-09 20:07:59 +08:00
|
|
|
void *(*gl_opendir)(const char *);
|
|
|
|
int (*gl_lstat)(const char *, void *);
|
|
|
|
int (*gl_stat)(const char *, void *);
|
2013-07-02 22:08:52 +08:00
|
|
|
};
|
2014-02-27 17:02:08 +08:00
|
|
|
# elif SANITIZER_FREEBSD
|
|
|
|
struct __sanitizer_glob_t {
|
|
|
|
uptr gl_pathc;
|
|
|
|
uptr gl_matchc;
|
|
|
|
uptr gl_offs;
|
|
|
|
int gl_flags;
|
|
|
|
char **gl_pathv;
|
|
|
|
int (*gl_errfunc)(const char*, int);
|
|
|
|
void (*gl_closedir)(void *dirp);
|
|
|
|
struct dirent *(*gl_readdir)(void *dirp);
|
|
|
|
void *(*gl_opendir)(const char*);
|
2014-03-04 16:55:41 +08:00
|
|
|
int (*gl_lstat)(const char*, void* /* struct stat* */);
|
|
|
|
int (*gl_stat)(const char*, void* /* struct stat* */);
|
2014-02-27 17:02:08 +08:00
|
|
|
};
|
|
|
|
# endif // SANITIZER_FREEBSD
|
2013-07-02 22:08:52 +08:00
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
# if SANITIZER_LINUX || SANITIZER_FREEBSD
|
2013-07-02 22:08:52 +08:00
|
|
|
extern int glob_nomatch;
|
2013-07-09 20:07:59 +08:00
|
|
|
extern int glob_altdirfunc;
|
2014-02-27 17:02:08 +08:00
|
|
|
# endif
|
|
|
|
#endif // !SANITIZER_ANDROID
|
2013-07-02 22:08:52 +08:00
|
|
|
|
2013-07-09 17:53:37 +08:00
|
|
|
extern unsigned path_max;
|
|
|
|
|
2013-09-24 22:38:22 +08:00
|
|
|
struct __sanitizer_wordexp_t {
|
|
|
|
uptr we_wordc;
|
|
|
|
char **we_wordv;
|
|
|
|
uptr we_offs;
|
2014-02-27 17:02:08 +08:00
|
|
|
#if SANITIZER_FREEBSD
|
|
|
|
char *we_strings;
|
|
|
|
uptr we_nbytes;
|
|
|
|
#endif
|
2013-09-24 22:38:22 +08:00
|
|
|
};
|
|
|
|
|
2014-04-25 21:26:21 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
struct __sanitizer_FILE {
|
|
|
|
int _flags;
|
|
|
|
char *_IO_read_ptr;
|
|
|
|
char *_IO_read_end;
|
|
|
|
char *_IO_read_base;
|
|
|
|
char *_IO_write_base;
|
|
|
|
char *_IO_write_ptr;
|
|
|
|
char *_IO_write_end;
|
|
|
|
char *_IO_buf_base;
|
|
|
|
char *_IO_buf_end;
|
|
|
|
char *_IO_save_base;
|
|
|
|
char *_IO_backup_base;
|
|
|
|
char *_IO_save_end;
|
|
|
|
void *_markers;
|
|
|
|
__sanitizer_FILE *_chain;
|
|
|
|
int _fileno;
|
|
|
|
};
|
2014-05-13 16:36:31 +08:00
|
|
|
# define SANITIZER_HAS_STRUCT_FILE 1
|
|
|
|
#else
|
|
|
|
typedef void __sanitizer_FILE;
|
|
|
|
# define SANITIZER_HAS_STRUCT_FILE 0
|
2014-04-25 21:26:21 +08:00
|
|
|
#endif
|
|
|
|
|
2013-07-05 16:57:47 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID && \
|
2015-06-26 04:50:18 +08:00
|
|
|
(defined(__i386) || defined(__x86_64) || defined(__mips64) || \
|
2016-04-26 18:41:30 +08:00
|
|
|
defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \
|
|
|
|
defined(__s390__))
|
2013-06-28 19:02:43 +08:00
|
|
|
extern unsigned struct_user_regs_struct_sz;
|
|
|
|
extern unsigned struct_user_fpregs_struct_sz;
|
|
|
|
extern unsigned struct_user_fpxregs_struct_sz;
|
2015-10-27 02:15:14 +08:00
|
|
|
extern unsigned struct_user_vfpregs_struct_sz;
|
2013-06-28 19:02:43 +08:00
|
|
|
|
2013-10-30 01:59:45 +08:00
|
|
|
extern int ptrace_peektext;
|
|
|
|
extern int ptrace_peekdata;
|
|
|
|
extern int ptrace_peekuser;
|
2013-06-28 19:02:43 +08:00
|
|
|
extern int ptrace_getregs;
|
|
|
|
extern int ptrace_setregs;
|
|
|
|
extern int ptrace_getfpregs;
|
|
|
|
extern int ptrace_setfpregs;
|
|
|
|
extern int ptrace_getfpxregs;
|
|
|
|
extern int ptrace_setfpxregs;
|
2015-10-27 02:15:14 +08:00
|
|
|
extern int ptrace_getvfpregs;
|
|
|
|
extern int ptrace_setvfpregs;
|
2013-06-28 19:02:43 +08:00
|
|
|
extern int ptrace_getsiginfo;
|
|
|
|
extern int ptrace_setsiginfo;
|
|
|
|
extern int ptrace_getregset;
|
|
|
|
extern int ptrace_setregset;
|
2014-06-16 21:49:13 +08:00
|
|
|
extern int ptrace_geteventmsg;
|
2013-06-28 19:02:43 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-27 17:02:08 +08:00
|
|
|
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
2013-10-24 22:47:34 +08:00
|
|
|
extern unsigned struct_shminfo_sz;
|
|
|
|
extern unsigned struct_shm_info_sz;
|
|
|
|
extern int shmctl_ipc_stat;
|
|
|
|
extern int shmctl_ipc_info;
|
|
|
|
extern int shmctl_shm_info;
|
|
|
|
extern int shmctl_shm_stat;
|
|
|
|
#endif
|
|
|
|
|
2016-12-20 15:58:49 +08:00
|
|
|
#if !SANITIZER_MAC && !SANITIZER_FREEBSD
|
2016-12-16 06:00:14 +08:00
|
|
|
extern unsigned struct_utmp_sz;
|
2016-12-20 15:58:49 +08:00
|
|
|
#endif
|
2016-12-16 06:00:14 +08:00
|
|
|
#if !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_utmpx_sz;
|
|
|
|
#endif
|
|
|
|
|
2014-01-27 17:12:22 +08:00
|
|
|
extern int map_fixed;
|
|
|
|
|
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-19 21:21:38 +08:00
|
|
|
#if SANITIZER_MAC
|
|
|
|
} __attribute__((packed));
|
|
|
|
#else
|
2013-06-07 23:49:38 +08:00
|
|
|
};
|
2013-06-19 21:21:38 +08:00
|
|
|
#endif
|
2013-06-07 23:49:38 +08:00
|
|
|
|
2014-05-07 19:50:56 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
struct __sanitizer__obstack_chunk {
|
|
|
|
char *limit;
|
|
|
|
struct __sanitizer__obstack_chunk *prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __sanitizer_obstack {
|
|
|
|
long chunk_size;
|
|
|
|
struct __sanitizer__obstack_chunk *chunk;
|
|
|
|
char *object_base;
|
|
|
|
char *next_free;
|
|
|
|
uptr more_fields[7];
|
|
|
|
};
|
2015-06-19 09:28:41 +08:00
|
|
|
|
|
|
|
typedef uptr (*__sanitizer_cookie_io_read)(void *cookie, char *buf, uptr size);
|
|
|
|
typedef uptr (*__sanitizer_cookie_io_write)(void *cookie, const char *buf,
|
|
|
|
uptr size);
|
|
|
|
typedef int (*__sanitizer_cookie_io_seek)(void *cookie, u64 *offset,
|
|
|
|
int whence);
|
|
|
|
typedef int (*__sanitizer_cookie_io_close)(void *cookie);
|
|
|
|
|
|
|
|
struct __sanitizer_cookie_io_functions_t {
|
|
|
|
__sanitizer_cookie_io_read read;
|
|
|
|
__sanitizer_cookie_io_write write;
|
|
|
|
__sanitizer_cookie_io_seek seek;
|
|
|
|
__sanitizer_cookie_io_close close;
|
|
|
|
};
|
2014-05-07 19:50:56 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-06 03:35:24 +08:00
|
|
|
#define IOC_NRBITS 8
|
|
|
|
#define IOC_TYPEBITS 8
|
2016-12-02 16:07:35 +08:00
|
|
|
#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || \
|
|
|
|
defined(__sparc__)
|
2014-02-06 03:35:24 +08:00
|
|
|
#define IOC_SIZEBITS 13
|
|
|
|
#define IOC_DIRBITS 3
|
|
|
|
#define IOC_NONE 1U
|
|
|
|
#define IOC_WRITE 4U
|
|
|
|
#define IOC_READ 2U
|
|
|
|
#else
|
|
|
|
#define IOC_SIZEBITS 14
|
|
|
|
#define IOC_DIRBITS 2
|
|
|
|
#define IOC_NONE 0U
|
|
|
|
#define IOC_WRITE 1U
|
|
|
|
#define IOC_READ 2U
|
|
|
|
#endif
|
|
|
|
#define IOC_NRMASK ((1 << IOC_NRBITS) - 1)
|
|
|
|
#define IOC_TYPEMASK ((1 << IOC_TYPEBITS) - 1)
|
|
|
|
#define IOC_SIZEMASK ((1 << IOC_SIZEBITS) - 1)
|
2014-02-28 00:46:06 +08:00
|
|
|
#if defined(IOC_DIRMASK)
|
|
|
|
#undef IOC_DIRMASK
|
|
|
|
#endif
|
2014-02-06 03:35:24 +08:00
|
|
|
#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)
|
2016-12-02 16:07:35 +08:00
|
|
|
|
|
|
|
#if defined(__sparc__)
|
|
|
|
// In sparc the 14 bits SIZE field overlaps with the
|
|
|
|
// least significant bit of DIR, so either IOC_READ or
|
|
|
|
// IOC_WRITE shall be 1 in order to get a non-zero SIZE.
|
|
|
|
#define IOC_SIZE(nr) \
|
|
|
|
((((((nr) >> 29) & 0x7) & (4U | 2U)) == 0) ? 0 : (((nr) >> 16) & 0x3fff))
|
|
|
|
#else
|
2014-02-06 03:35:24 +08:00
|
|
|
#define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
|
2016-12-02 16:07:35 +08:00
|
|
|
#endif
|
2013-06-20 17:19:28 +08:00
|
|
|
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned struct_ifreq_sz;
|
|
|
|
extern unsigned struct_termios_sz;
|
|
|
|
extern unsigned struct_winsize_sz;
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX
|
2015-06-24 05:39:52 +08:00
|
|
|
extern unsigned struct_arpreq_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
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;
|
2013-06-20 17:19:28 +08:00
|
|
|
extern unsigned struct_ff_effect_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
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;
|
2013-06-20 17:19:28 +08:00
|
|
|
extern unsigned struct_input_absinfo_sz;
|
|
|
|
extern unsigned struct_input_id_sz;
|
2014-02-27 17:02:08 +08:00
|
|
|
extern unsigned struct_mtpos_sz;
|
|
|
|
extern unsigned struct_termio_sz;
|
|
|
|
extern unsigned struct_vt_consize_sz;
|
|
|
|
extern unsigned struct_vt_sizes_sz;
|
|
|
|
extern unsigned struct_vt_stat_sz;
|
|
|
|
#endif // SANITIZER_LINUX
|
|
|
|
|
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
|
|
|
extern unsigned struct_copr_buffer_sz;
|
|
|
|
extern unsigned struct_copr_debug_buf_sz;
|
|
|
|
extern unsigned struct_copr_msg_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned struct_midi_info_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;
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
2013-06-07 21:00:47 +08:00
|
|
|
|
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_ax25_parms_struct_sz;
|
|
|
|
extern unsigned struct_cyclades_monitor_sz;
|
2013-06-20 17:19:28 +08:00
|
|
|
extern unsigned struct_input_keymap_entry_sz;
|
2013-06-07 21:00:47 +08:00
|
|
|
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 struct_mtconfiginfo_sz;
|
|
|
|
extern unsigned struct_nr_parms_struct_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;
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
|
|
|
|
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
|
|
|
extern unsigned struct_audio_buf_info_sz;
|
|
|
|
extern unsigned struct_ppp_stats_sz;
|
|
|
|
#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
2013-06-10 18:00:54 +08:00
|
|
|
|
2013-11-16 03:13:08 +08:00
|
|
|
#if !SANITIZER_ANDROID && !SANITIZER_MAC
|
2013-06-07 21:00:47 +08:00
|
|
|
extern unsigned struct_sioc_sg_req_sz;
|
|
|
|
extern unsigned struct_sioc_vif_req_sz;
|
|
|
|
#endif
|
2013-06-18 17:22:24 +08:00
|
|
|
|
|
|
|
// ioctl request identifiers
|
2013-06-21 18:54:57 +08:00
|
|
|
|
|
|
|
// 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.
|
2014-09-17 04:49:55 +08:00
|
|
|
extern const unsigned IOCTL_NOT_PRESENT;
|
2013-06-21 18:54:57 +08:00
|
|
|
|
2013-06-18 17:22:24 +08:00
|
|
|
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;
|
2014-02-27 17:02:08 +08:00
|
|
|
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_SIOCGETSGCNT;
|
|
|
|
extern unsigned IOCTL_SIOCGETVIFCNT;
|
|
|
|
#endif
|
|
|
|
#if SANITIZER_LINUX
|
2013-06-20 17:19:28 +08:00
|
|
|
extern unsigned IOCTL_EVIOCGABS;
|
|
|
|
extern unsigned IOCTL_EVIOCGBIT;
|
|
|
|
extern unsigned IOCTL_EVIOCGEFFECTS;
|
|
|
|
extern unsigned IOCTL_EVIOCGID;
|
|
|
|
extern unsigned IOCTL_EVIOCGKEY;
|
|
|
|
extern unsigned IOCTL_EVIOCGKEYCODE;
|
|
|
|
extern unsigned IOCTL_EVIOCGLED;
|
|
|
|
extern unsigned IOCTL_EVIOCGNAME;
|
|
|
|
extern unsigned IOCTL_EVIOCGPHYS;
|
|
|
|
extern unsigned IOCTL_EVIOCGRAB;
|
|
|
|
extern unsigned IOCTL_EVIOCGREP;
|
|
|
|
extern unsigned IOCTL_EVIOCGSND;
|
|
|
|
extern unsigned IOCTL_EVIOCGSW;
|
|
|
|
extern unsigned IOCTL_EVIOCGUNIQ;
|
|
|
|
extern unsigned IOCTL_EVIOCGVERSION;
|
|
|
|
extern unsigned IOCTL_EVIOCRMFF;
|
|
|
|
extern unsigned IOCTL_EVIOCSABS;
|
|
|
|
extern unsigned IOCTL_EVIOCSFF;
|
|
|
|
extern unsigned IOCTL_EVIOCSKEYCODE;
|
|
|
|
extern unsigned IOCTL_EVIOCSREP;
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_BLKFLSBUF;
|
|
|
|
extern unsigned IOCTL_BLKGETSIZE;
|
|
|
|
extern unsigned IOCTL_BLKRAGET;
|
|
|
|
extern unsigned IOCTL_BLKRASET;
|
|
|
|
extern unsigned IOCTL_BLKROGET;
|
|
|
|
extern unsigned IOCTL_BLKROSET;
|
|
|
|
extern unsigned IOCTL_BLKRRPART;
|
|
|
|
extern unsigned IOCTL_CDROMAUDIOBUFSIZ;
|
|
|
|
extern unsigned IOCTL_CDROMEJECT;
|
|
|
|
extern unsigned IOCTL_CDROMEJECT_SW;
|
|
|
|
extern unsigned IOCTL_CDROMMULTISESSION;
|
|
|
|
extern unsigned IOCTL_CDROMPAUSE;
|
|
|
|
extern unsigned IOCTL_CDROMPLAYMSF;
|
|
|
|
extern unsigned IOCTL_CDROMPLAYTRKIND;
|
|
|
|
extern unsigned IOCTL_CDROMREADAUDIO;
|
|
|
|
extern unsigned IOCTL_CDROMREADCOOKED;
|
|
|
|
extern unsigned IOCTL_CDROMREADMODE1;
|
|
|
|
extern unsigned IOCTL_CDROMREADMODE2;
|
|
|
|
extern unsigned IOCTL_CDROMREADRAW;
|
|
|
|
extern unsigned IOCTL_CDROMREADTOCENTRY;
|
|
|
|
extern unsigned IOCTL_CDROMREADTOCHDR;
|
|
|
|
extern unsigned IOCTL_CDROMRESET;
|
|
|
|
extern unsigned IOCTL_CDROMRESUME;
|
|
|
|
extern unsigned IOCTL_CDROMSEEK;
|
|
|
|
extern unsigned IOCTL_CDROMSTART;
|
|
|
|
extern unsigned IOCTL_CDROMSTOP;
|
|
|
|
extern unsigned IOCTL_CDROMSUBCHNL;
|
|
|
|
extern unsigned IOCTL_CDROMVOLCTRL;
|
|
|
|
extern unsigned IOCTL_CDROMVOLREAD;
|
|
|
|
extern unsigned IOCTL_CDROM_GET_UPC;
|
|
|
|
extern unsigned IOCTL_FDCLRPRM;
|
|
|
|
extern unsigned IOCTL_FDDEFPRM;
|
|
|
|
extern unsigned IOCTL_FDFLUSH;
|
|
|
|
extern unsigned IOCTL_FDFMTBEG;
|
|
|
|
extern unsigned IOCTL_FDFMTEND;
|
|
|
|
extern unsigned IOCTL_FDFMTTRK;
|
|
|
|
extern unsigned IOCTL_FDGETDRVPRM;
|
|
|
|
extern unsigned IOCTL_FDGETDRVSTAT;
|
|
|
|
extern unsigned IOCTL_FDGETDRVTYP;
|
|
|
|
extern unsigned IOCTL_FDGETFDCSTAT;
|
|
|
|
extern unsigned IOCTL_FDGETMAXERRS;
|
|
|
|
extern unsigned IOCTL_FDGETPRM;
|
|
|
|
extern unsigned IOCTL_FDMSGOFF;
|
|
|
|
extern unsigned IOCTL_FDMSGON;
|
|
|
|
extern unsigned IOCTL_FDPOLLDRVSTAT;
|
|
|
|
extern unsigned IOCTL_FDRAWCMD;
|
|
|
|
extern unsigned IOCTL_FDRESET;
|
|
|
|
extern unsigned IOCTL_FDSETDRVPRM;
|
|
|
|
extern unsigned IOCTL_FDSETEMSGTRESH;
|
|
|
|
extern unsigned IOCTL_FDSETMAXERRS;
|
|
|
|
extern unsigned IOCTL_FDSETPRM;
|
|
|
|
extern unsigned IOCTL_FDTWADDLE;
|
|
|
|
extern unsigned IOCTL_FDWERRORCLR;
|
|
|
|
extern unsigned IOCTL_FDWERRORGET;
|
|
|
|
extern unsigned IOCTL_HDIO_DRIVE_CMD;
|
|
|
|
extern unsigned IOCTL_HDIO_GETGEO;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_32BIT;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_DMA;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_IDENTITY;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_KEEPSETTINGS;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_MULTCOUNT;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_NOWERR;
|
|
|
|
extern unsigned IOCTL_HDIO_GET_UNMASKINTR;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_32BIT;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_DMA;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_KEEPSETTINGS;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_MULTCOUNT;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_NOWERR;
|
|
|
|
extern unsigned IOCTL_HDIO_SET_UNMASKINTR;
|
|
|
|
extern unsigned IOCTL_MTIOCPOS;
|
|
|
|
extern unsigned IOCTL_PPPIOCGASYNCMAP;
|
|
|
|
extern unsigned IOCTL_PPPIOCGDEBUG;
|
|
|
|
extern unsigned IOCTL_PPPIOCGFLAGS;
|
|
|
|
extern unsigned IOCTL_PPPIOCGUNIT;
|
|
|
|
extern unsigned IOCTL_PPPIOCGXASYNCMAP;
|
|
|
|
extern unsigned IOCTL_PPPIOCSASYNCMAP;
|
|
|
|
extern unsigned IOCTL_PPPIOCSDEBUG;
|
|
|
|
extern unsigned IOCTL_PPPIOCSFLAGS;
|
|
|
|
extern unsigned IOCTL_PPPIOCSMAXCID;
|
|
|
|
extern unsigned IOCTL_PPPIOCSMRU;
|
|
|
|
extern unsigned IOCTL_PPPIOCSXASYNCMAP;
|
|
|
|
extern unsigned IOCTL_SIOCDARP;
|
|
|
|
extern unsigned IOCTL_SIOCDRARP;
|
|
|
|
extern unsigned IOCTL_SIOCGARP;
|
|
|
|
extern unsigned IOCTL_SIOCGIFENCAP;
|
|
|
|
extern unsigned IOCTL_SIOCGIFHWADDR;
|
|
|
|
extern unsigned IOCTL_SIOCGIFMAP;
|
|
|
|
extern unsigned IOCTL_SIOCGIFMEM;
|
|
|
|
extern unsigned IOCTL_SIOCGIFNAME;
|
|
|
|
extern unsigned IOCTL_SIOCGIFSLAVE;
|
|
|
|
extern unsigned IOCTL_SIOCGRARP;
|
|
|
|
extern unsigned IOCTL_SIOCGSTAMP;
|
|
|
|
extern unsigned IOCTL_SIOCSARP;
|
|
|
|
extern unsigned IOCTL_SIOCSIFENCAP;
|
|
|
|
extern unsigned IOCTL_SIOCSIFHWADDR;
|
|
|
|
extern unsigned IOCTL_SIOCSIFLINK;
|
|
|
|
extern unsigned IOCTL_SIOCSIFMAP;
|
|
|
|
extern unsigned IOCTL_SIOCSIFMEM;
|
|
|
|
extern unsigned IOCTL_SIOCSIFSLAVE;
|
|
|
|
extern unsigned IOCTL_SIOCSRARP;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_HALT;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_LOAD;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_RCODE;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_RCVMSG;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_RDATA;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_RESET;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_RUN;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_SENDMSG;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_WCODE;
|
|
|
|
extern unsigned IOCTL_SNDCTL_COPR_WDATA;
|
2014-02-27 17:02:08 +08:00
|
|
|
extern unsigned IOCTL_TCFLSH;
|
|
|
|
extern unsigned IOCTL_TCGETA;
|
|
|
|
extern unsigned IOCTL_TCGETS;
|
|
|
|
extern unsigned IOCTL_TCSBRK;
|
|
|
|
extern unsigned IOCTL_TCSBRKP;
|
|
|
|
extern unsigned IOCTL_TCSETA;
|
|
|
|
extern unsigned IOCTL_TCSETAF;
|
|
|
|
extern unsigned IOCTL_TCSETAW;
|
|
|
|
extern unsigned IOCTL_TCSETS;
|
|
|
|
extern unsigned IOCTL_TCSETSF;
|
|
|
|
extern unsigned IOCTL_TCSETSW;
|
|
|
|
extern unsigned IOCTL_TCXONC;
|
|
|
|
extern unsigned IOCTL_TIOCGLCKTRMIOS;
|
|
|
|
extern unsigned IOCTL_TIOCGSOFTCAR;
|
|
|
|
extern unsigned IOCTL_TIOCINQ;
|
|
|
|
extern unsigned IOCTL_TIOCLINUX;
|
|
|
|
extern unsigned IOCTL_TIOCSERCONFIG;
|
|
|
|
extern unsigned IOCTL_TIOCSERGETLSR;
|
|
|
|
extern unsigned IOCTL_TIOCSERGWILD;
|
|
|
|
extern unsigned IOCTL_TIOCSERSWILD;
|
|
|
|
extern unsigned IOCTL_TIOCSLCKTRMIOS;
|
|
|
|
extern unsigned IOCTL_TIOCSSOFTCAR;
|
|
|
|
extern unsigned IOCTL_VT_DISALLOCATE;
|
|
|
|
extern unsigned IOCTL_VT_GETSTATE;
|
|
|
|
extern unsigned IOCTL_VT_RESIZE;
|
|
|
|
extern unsigned IOCTL_VT_RESIZEX;
|
|
|
|
extern unsigned IOCTL_VT_SENDSIG;
|
|
|
|
#endif // SANITIZER_LINUX
|
|
|
|
#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
|
|
|
extern unsigned IOCTL_MTIOCGET;
|
|
|
|
extern unsigned IOCTL_MTIOCTOP;
|
|
|
|
extern unsigned IOCTL_SIOCADDRT;
|
|
|
|
extern unsigned IOCTL_SIOCDELRT;
|
2013-06-18 17:22:24 +08:00
|
|
|
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;
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
|
|
|
|
2013-06-18 17:22:24 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
extern unsigned IOCTL_CYGETDEFTHRESH;
|
|
|
|
extern unsigned IOCTL_CYGETDEFTIMEOUT;
|
|
|
|
extern unsigned IOCTL_CYGETMON;
|
|
|
|
extern unsigned IOCTL_CYGETTHRESH;
|
|
|
|
extern unsigned IOCTL_CYGETTIMEOUT;
|
|
|
|
extern unsigned IOCTL_CYSETDEFTHRESH;
|
|
|
|
extern unsigned IOCTL_CYSETDEFTIMEOUT;
|
|
|
|
extern unsigned IOCTL_CYSETTHRESH;
|
|
|
|
extern unsigned IOCTL_CYSETTIMEOUT;
|
|
|
|
extern unsigned IOCTL_EQL_EMANCIPATE;
|
|
|
|
extern unsigned IOCTL_EQL_ENSLAVE;
|
|
|
|
extern unsigned IOCTL_EQL_GETMASTRCFG;
|
|
|
|
extern unsigned IOCTL_EQL_GETSLAVECFG;
|
|
|
|
extern unsigned IOCTL_EQL_SETMASTRCFG;
|
|
|
|
extern unsigned IOCTL_EQL_SETSLAVECFG;
|
2013-06-20 17:19:28 +08:00
|
|
|
extern unsigned IOCTL_EVIOCGKEYCODE_V2;
|
|
|
|
extern unsigned IOCTL_EVIOCGPROP;
|
|
|
|
extern unsigned IOCTL_EVIOCSKEYCODE_V2;
|
2013-06-18 21:56:12 +08:00
|
|
|
extern unsigned IOCTL_FS_IOC_GETFLAGS;
|
|
|
|
extern unsigned IOCTL_FS_IOC_GETVERSION;
|
|
|
|
extern unsigned IOCTL_FS_IOC_SETFLAGS;
|
|
|
|
extern unsigned IOCTL_FS_IOC_SETVERSION;
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_GIO_CMAP;
|
|
|
|
extern unsigned IOCTL_GIO_FONT;
|
|
|
|
extern unsigned IOCTL_GIO_UNIMAP;
|
|
|
|
extern unsigned IOCTL_GIO_UNISCRNMAP;
|
|
|
|
extern unsigned IOCTL_KDADDIO;
|
|
|
|
extern unsigned IOCTL_KDDELIO;
|
|
|
|
extern unsigned IOCTL_KDGETKEYCODE;
|
|
|
|
extern unsigned IOCTL_KDGKBDIACR;
|
|
|
|
extern unsigned IOCTL_KDGKBENT;
|
|
|
|
extern unsigned IOCTL_KDGKBLED;
|
|
|
|
extern unsigned IOCTL_KDGKBMETA;
|
|
|
|
extern unsigned IOCTL_KDGKBSENT;
|
|
|
|
extern unsigned IOCTL_KDMAPDISP;
|
|
|
|
extern unsigned IOCTL_KDSETKEYCODE;
|
|
|
|
extern unsigned IOCTL_KDSIGACCEPT;
|
|
|
|
extern unsigned IOCTL_KDSKBDIACR;
|
|
|
|
extern unsigned IOCTL_KDSKBENT;
|
|
|
|
extern unsigned IOCTL_KDSKBLED;
|
|
|
|
extern unsigned IOCTL_KDSKBMETA;
|
|
|
|
extern unsigned IOCTL_KDSKBSENT;
|
|
|
|
extern unsigned IOCTL_KDUNMAPDISP;
|
|
|
|
extern unsigned IOCTL_LPABORT;
|
|
|
|
extern unsigned IOCTL_LPABORTOPEN;
|
|
|
|
extern unsigned IOCTL_LPCAREFUL;
|
|
|
|
extern unsigned IOCTL_LPCHAR;
|
|
|
|
extern unsigned IOCTL_LPGETIRQ;
|
|
|
|
extern unsigned IOCTL_LPGETSTATUS;
|
|
|
|
extern unsigned IOCTL_LPRESET;
|
|
|
|
extern unsigned IOCTL_LPSETIRQ;
|
|
|
|
extern unsigned IOCTL_LPTIME;
|
|
|
|
extern unsigned IOCTL_LPWAIT;
|
2013-08-18 16:47:06 +08:00
|
|
|
extern unsigned IOCTL_MTIOCGETCONFIG;
|
|
|
|
extern unsigned IOCTL_MTIOCSETCONFIG;
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_PIO_CMAP;
|
|
|
|
extern unsigned IOCTL_PIO_FONT;
|
|
|
|
extern unsigned IOCTL_PIO_UNIMAP;
|
|
|
|
extern unsigned IOCTL_PIO_UNIMAPCLR;
|
|
|
|
extern unsigned IOCTL_PIO_UNISCRNMAP;
|
|
|
|
extern unsigned IOCTL_SCSI_IOCTL_GET_IDLUN;
|
|
|
|
extern unsigned IOCTL_SCSI_IOCTL_PROBE_HOST;
|
|
|
|
extern unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE;
|
|
|
|
extern unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE;
|
|
|
|
extern unsigned IOCTL_SIOCAIPXITFCRT;
|
|
|
|
extern unsigned IOCTL_SIOCAIPXPRISLT;
|
2013-08-18 16:47:06 +08:00
|
|
|
extern unsigned IOCTL_SIOCAX25ADDUID;
|
|
|
|
extern unsigned IOCTL_SIOCAX25DELUID;
|
|
|
|
extern unsigned IOCTL_SIOCAX25GETPARMS;
|
|
|
|
extern unsigned IOCTL_SIOCAX25GETUID;
|
|
|
|
extern unsigned IOCTL_SIOCAX25NOUID;
|
|
|
|
extern unsigned IOCTL_SIOCAX25SETPARMS;
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_SIOCDEVPLIP;
|
|
|
|
extern unsigned IOCTL_SIOCIPXCFGDATA;
|
2013-08-18 16:47:06 +08:00
|
|
|
extern unsigned IOCTL_SIOCNRDECOBS;
|
|
|
|
extern unsigned IOCTL_SIOCNRGETPARMS;
|
|
|
|
extern unsigned IOCTL_SIOCNRRTCTL;
|
|
|
|
extern unsigned IOCTL_SIOCNRSETPARMS;
|
2013-06-18 17:22:24 +08:00
|
|
|
extern unsigned IOCTL_SNDCTL_DSP_GETISPACE;
|
|
|
|
extern unsigned IOCTL_SNDCTL_DSP_GETOSPACE;
|
|
|
|
extern unsigned IOCTL_TIOCGSERIAL;
|
|
|
|
extern unsigned IOCTL_TIOCSERGETMULTI;
|
|
|
|
extern unsigned IOCTL_TIOCSERSETMULTI;
|
|
|
|
extern unsigned IOCTL_TIOCSSERIAL;
|
2014-02-27 17:02:08 +08:00
|
|
|
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
|
|
|
|
|
|
|
|
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
|
|
|
extern unsigned IOCTL_GIO_SCRNMAP;
|
|
|
|
extern unsigned IOCTL_KDDISABIO;
|
|
|
|
extern unsigned IOCTL_KDENABIO;
|
|
|
|
extern unsigned IOCTL_KDGETLED;
|
|
|
|
extern unsigned IOCTL_KDGETMODE;
|
|
|
|
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 unsigned IOCTL_KIOCSOUND;
|
|
|
|
extern unsigned IOCTL_PIO_SCRNMAP;
|
2014-01-31 22:02:21 +08:00
|
|
|
#endif
|
2013-10-11 22:19:14 +08:00
|
|
|
|
2014-02-19 21:40:41 +08:00
|
|
|
extern const int si_SEGV_MAPERR;
|
|
|
|
extern const int si_SEGV_ACCERR;
|
2013-02-19 17:19:16 +08:00
|
|
|
} // namespace __sanitizer
|
2012-12-11 20:27:27 +08:00
|
|
|
|
2013-11-01 09:20:39 +08:00
|
|
|
#define CHECK_TYPE_SIZE(TYPE) \
|
|
|
|
COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
|
|
|
|
|
|
|
|
#define CHECK_SIZE_AND_OFFSET(CLASS, MEMBER) \
|
|
|
|
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
|
|
|
|
sizeof(((CLASS *) NULL)->MEMBER)); \
|
|
|
|
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
|
|
|
|
offsetof(CLASS, MEMBER))
|
|
|
|
|
|
|
|
// For sigaction, which is a function and struct at the same time,
|
|
|
|
// and thus requires explicit "struct" in sizeof() expression.
|
|
|
|
#define CHECK_STRUCT_SIZE_AND_OFFSET(CLASS, MEMBER) \
|
|
|
|
COMPILER_CHECK(sizeof(((struct __sanitizer_##CLASS *) NULL)->MEMBER) == \
|
|
|
|
sizeof(((struct CLASS *) NULL)->MEMBER)); \
|
|
|
|
COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) == \
|
|
|
|
offsetof(struct CLASS, MEMBER))
|
|
|
|
|
2017-12-07 05:32:57 +08:00
|
|
|
#define SIGACTION_SYMNAME sigaction
|
|
|
|
|
2017-08-29 05:03:23 +08:00
|
|
|
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC
|
|
|
|
|
2012-12-11 20:27:27 +08:00
|
|
|
#endif
|