llvm/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc

//===-- sanitizer_common_syscalls.inc ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Common syscalls handlers for tools like AddressSanitizer,
// ThreadSanitizer, MemorySanitizer, etc.
//
// This file should be included into the tool's interceptor file,
// which has to define it's own macros:
//   COMMON_SYSCALL_PRE_READ_RANGE
//          Called in prehook for regions that will be read by the kernel and
//          must be initialized.
//   COMMON_SYSCALL_PRE_WRITE_RANGE
//          Called in prehook for regions that will be written to by the kernel
//          and must be addressable. The actual write range may be smaller than
//          reported in the prehook. See POST_WRITE_RANGE.
//   COMMON_SYSCALL_POST_READ_RANGE
//          Called in posthook for regions that were read by the kernel. Does
//          not make much sense.
//   COMMON_SYSCALL_POST_WRITE_RANGE
//          Called in posthook for regions that were written to by the kernel
//          and are now initialized.
//   COMMON_SYSCALL_ACQUIRE(addr)
//          Acquire memory visibility from addr.
//   COMMON_SYSCALL_RELEASE(addr)
//          Release memory visibility to addr.
//   COMMON_SYSCALL_FD_CLOSE(fd)
//          Called before closing file descriptor fd.
//   COMMON_SYSCALL_FD_ACQUIRE(fd)
//          Acquire memory visibility from fd.
//   COMMON_SYSCALL_FD_RELEASE(fd)
//          Release memory visibility to fd.
//   COMMON_SYSCALL_PRE_FORK()
//          Called before fork syscall.
//   COMMON_SYSCALL_POST_FORK(long res)
//          Called after fork syscall.
//   COMMON_SYSCALL_BLOCKING_START()
//         Called before blocking syscall.
//   COMMON_SYSCALL_BLOCKING_END()
//         Called after blocking syscall.
//===----------------------------------------------------------------------===//

#include "sanitizer_platform.h"
#if SANITIZER_LINUX

#  include "sanitizer_libc.h"
#  include "sanitizer_platform_limits_posix.h"

#define PRE_SYSCALL
#define PRE_READ
#define PRE_WRITE

#define POST_SYSCALL
#define POST_READ
#define POST_WRITE

#  ifndef COMMON_SYSCALL_ACQUIRE
#define COMMON_SYSCALL_ACQUIRE(addr)
#  endif

#  ifndef COMMON_SYSCALL_RELEASE
#define COMMON_SYSCALL_RELEASE(addr)
#  endif

#  ifndef COMMON_SYSCALL_FD_CLOSE
#define COMMON_SYSCALL_FD_CLOSE(fd)
#  endif

#  ifndef COMMON_SYSCALL_FD_ACQUIRE
#define COMMON_SYSCALL_FD_ACQUIRE(fd)
#  endif

#  ifndef COMMON_SYSCALL_FD_RELEASE
#define COMMON_SYSCALL_FD_RELEASE(fd)
#  endif

#  ifndef COMMON_SYSCALL_PRE_FORK
#define COMMON_SYSCALL_PRE_FORK()
#  endif

#  ifndef COMMON_SYSCALL_POST_FORK
#define COMMON_SYSCALL_POST_FORK(res)
#  endif

#  ifndef COMMON_SYSCALL_BLOCKING_START
#define COMMON_SYSCALL_BLOCKING_START()
#  endif

#  ifndef COMMON_SYSCALL_BLOCKING_END
#define COMMON_SYSCALL_BLOCKING_END()
#  endif

// FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such).

extern "C" {
struct sanitizer_kernel_iovec {};

struct sanitizer_kernel_msghdr {};

struct sanitizer_kernel_mmsghdr {};

struct sanitizer_kernel_timespec {};

struct sanitizer_kernel_timeval {};

struct sanitizer_kernel_rusage {};

struct sanitizer_kernel_sockaddr {};

// Real sigset size is always passed as a syscall argument.
// Declare it "void" to catch sizeof(kernel_sigset_t).
kernel_sigset_t;

static void kernel_write_iovec(const __sanitizer_iovec *iovec, SIZE_T iovlen,
                               SIZE_T maxlen) {}

// This functions uses POST_READ, because it needs to run after syscall to know
// the real read range.
static void kernel_read_iovec(const __sanitizer_iovec *iovec, SIZE_T iovlen,
                              SIZE_T maxlen) {}

PRE_SYSCALL(recvmsg)(long sockfd, sanitizer_kernel_msghdr *msg, long flags) {}

POST_SYSCALL(recvmsg)
(long res, long sockfd, sanitizer_kernel_msghdr *msg, long flags) {}

PRE_SYSCALL(recvmmsg)
(long fd, sanitizer_kernel_mmsghdr *msg, long vlen, long flags, void *timeout) {}

POST_SYSCALL(recvmmsg)
(long res, long fd, sanitizer_kernel_mmsghdr *msg, long vlen, long flags,
 void *timeout) {}

PRE_SYSCALL(read)(long fd, void *buf, uptr count) {}

POST_SYSCALL(read)(long res, long fd, void *buf, uptr count) {}

PRE_SYSCALL(time)(void *tloc) {}

POST_SYSCALL(time)(long res, void *tloc) {}

PRE_SYSCALL(stime)(void *tptr) {}

POST_SYSCALL(stime)(long res, void *tptr) {}

PRE_SYSCALL(gettimeofday)(void *tv, void *tz) {}

POST_SYSCALL(gettimeofday)(long res, void *tv, void *tz) {}

PRE_SYSCALL(settimeofday)(void *tv, void *tz) {}

POST_SYSCALL(settimeofday)(long res, void *tv, void *tz) {}

#  if !SANITIZER_ANDROID
PRE_SYSCALL(adjtimex)(void *txc_p) {}

POST_SYSCALL(adjtimex)(long res, void *txc_p) {}
#  endif

PRE_SYSCALL(times)(void *tbuf) {}

POST_SYSCALL(times)(long res, void *tbuf) {}

PRE_SYSCALL(gettid)() {}

POST_SYSCALL(gettid)(long res) {}

PRE_SYSCALL(nanosleep)(void *rqtp, void *rmtp) {}

POST_SYSCALL(nanosleep)(long res, void *rqtp, void *rmtp) {}

PRE_SYSCALL(alarm)(long seconds) {}

POST_SYSCALL(alarm)(long res, long seconds) {}

PRE_SYSCALL(getpid)() {}

POST_SYSCALL(getpid)(long res) {}

PRE_SYSCALL(getppid)() {}

POST_SYSCALL(getppid)(long res) {}

PRE_SYSCALL(getuid)() {}

POST_SYSCALL(getuid)(long res) {}

PRE_SYSCALL(geteuid)() {}

POST_SYSCALL(geteuid)(long res) {}

PRE_SYSCALL(getgid)() {}

POST_SYSCALL(getgid)(long res) {}

PRE_SYSCALL(getegid)() {}

POST_SYSCALL(getegid)(long res) {}

PRE_SYSCALL(getresuid)(void *ruid, void *euid, void *suid) {}

POST_SYSCALL(getresuid)(long res, void *ruid, void *euid, void *suid) {}

PRE_SYSCALL(getresgid)(void *rgid, void *egid, void *sgid) {}

POST_SYSCALL(getresgid)(long res, void *rgid, void *egid, void *sgid) {}

PRE_SYSCALL(getpgid)(long pid) {}

POST_SYSCALL(getpgid)(long res, long pid) {}

PRE_SYSCALL(getpgrp)() {}

POST_SYSCALL(getpgrp)(long res) {}

PRE_SYSCALL(getsid)(long pid) {}

POST_SYSCALL(getsid)(long res, long pid) {}

PRE_SYSCALL(getgroups)(long gidsetsize, void *grouplist) {}

POST_SYSCALL(getgroups)
(long res, long gidsetsize, __sanitizer___kernel_gid_t *grouplist) {}

PRE_SYSCALL(setregid)(long rgid, long egid) {}

POST_SYSCALL(setregid)(long res, long rgid, long egid) {}

PRE_SYSCALL(setgid)(long gid) {}

POST_SYSCALL(setgid)(long res, long gid) {}

PRE_SYSCALL(setreuid)(long ruid, long euid) {}

POST_SYSCALL(setreuid)(long res, long ruid, long euid) {}

PRE_SYSCALL(setuid)(long uid) {}

POST_SYSCALL(setuid)(long res, long uid) {}

PRE_SYSCALL(setresuid)(long ruid, long euid, long suid) {}

POST_SYSCALL(setresuid)(long res, long ruid, long euid, long suid) {}

PRE_SYSCALL(setresgid)(long rgid, long egid, long sgid) {}

POST_SYSCALL(setresgid)(long res, long rgid, long egid, long sgid) {}

PRE_SYSCALL(setfsuid)(long uid) {}

POST_SYSCALL(setfsuid)(long res, long uid) {}

PRE_SYSCALL(setfsgid)(long gid) {}

POST_SYSCALL(setfsgid)(long res, long gid) {}

PRE_SYSCALL(setpgid)(long pid, long pgid) {}

POST_SYSCALL(setpgid)(long res, long pid, long pgid) {}

PRE_SYSCALL(setsid)() {}

POST_SYSCALL(setsid)(long res) {}

PRE_SYSCALL(setgroups)(long gidsetsize, __sanitizer___kernel_gid_t *grouplist) {}

POST_SYSCALL(setgroups)
(long res, long gidsetsize, __sanitizer___kernel_gid_t *grouplist) {}

PRE_SYSCALL(acct)(const void *name) {}

POST_SYSCALL(acct)(long res, const void *name) {}

PRE_SYSCALL(capget)(void *header, void *dataptr) {}

POST_SYSCALL(capget)(long res, void *header, void *dataptr) {}

PRE_SYSCALL(capset)(void *header, const void *data) {}

POST_SYSCALL(capset)(long res, void *header, const void *data) {}

PRE_SYSCALL(personality)(long personality) {}

POST_SYSCALL(personality)(long res, long personality) {}

PRE_SYSCALL(sigpending)(void *set) {}

POST_SYSCALL(sigpending)(long res, void *set) {}

PRE_SYSCALL(sigprocmask)(long how, void *set, void *oset) {}

POST_SYSCALL(sigprocmask)(long res, long how, void *set, void *oset) {}

PRE_SYSCALL(getitimer)(long which, void *value) {}

POST_SYSCALL(getitimer)(long res, long which, void *value) {}

PRE_SYSCALL(setitimer)(long which, void *value, void *ovalue) {}

POST_SYSCALL(setitimer)(long res, long which, void *value, void *ovalue) {}

PRE_SYSCALL(timer_create)
(long which_clock, void *timer_event_spec, void *created_timer_id) {}

POST_SYSCALL(timer_create)
(long res, long which_clock, void *timer_event_spec, void *created_timer_id) {}

PRE_SYSCALL(timer_gettime)(long timer_id, void *setting) {}

POST_SYSCALL(timer_gettime)(long res, long timer_id, void *setting) {}

PRE_SYSCALL(timer_getoverrun)(long timer_id) {}

POST_SYSCALL(timer_getoverrun)(long res, long timer_id) {}

PRE_SYSCALL(timer_settime)
(long timer_id, long flags, const void *new_setting, void *old_setting) {}

POST_SYSCALL(timer_settime)
(long res, long timer_id, long flags, const void *new_setting,
 void *old_setting) {}

PRE_SYSCALL(timer_delete)(long timer_id) {}

POST_SYSCALL(timer_delete)(long res, long timer_id) {}

PRE_SYSCALL(clock_settime)(long which_clock, const void *tp) {}

POST_SYSCALL(clock_settime)(long res, long which_clock, const void *tp) {}

PRE_SYSCALL(clock_gettime)(long which_clock, void *tp) {}

POST_SYSCALL(clock_gettime)(long res, long which_clock, void *tp) {}

#  if !SANITIZER_ANDROID
PRE_SYSCALL(clock_adjtime)(long which_clock, void *tx) {}

POST_SYSCALL(clock_adjtime)(long res, long which_clock, void *tx) {}
#  endif

PRE_SYSCALL(clock_getres)(long which_clock, void *tp) {}

POST_SYSCALL(clock_getres)(long res, long which_clock, void *tp) {}

PRE_SYSCALL(clock_nanosleep)
(long which_clock, long flags, const void *rqtp, void *rmtp) {}

POST_SYSCALL(clock_nanosleep)
(long res, long which_clock, long flags, const void *rqtp, void *rmtp) {}

PRE_SYSCALL(nice)(long increment) {}

POST_SYSCALL(nice)(long res, long increment) {}

PRE_SYSCALL(sched_setscheduler)(long pid, long policy, void *param) {}

POST_SYSCALL(sched_setscheduler)(long res, long pid, long policy, void *param) {}

PRE_SYSCALL(sched_setparam)(long pid, void *param) {}

POST_SYSCALL(sched_setparam)(long res, long pid, void *param) {}

PRE_SYSCALL(sched_getscheduler)(long pid) {}

POST_SYSCALL(sched_getscheduler)(long res, long pid) {}

PRE_SYSCALL(sched_getparam)(long pid, void *param) {}

POST_SYSCALL(sched_getparam)(long res, long pid, void *param) {}

PRE_SYSCALL(sched_setaffinity)(long pid, long len, void *user_mask_ptr) {}

POST_SYSCALL(sched_setaffinity)
(long res, long pid, long len, void *user_mask_ptr) {}

PRE_SYSCALL(sched_getaffinity)(long pid, long len, void *user_mask_ptr) {}

POST_SYSCALL(sched_getaffinity)
(long res, long pid, long len, void *user_mask_ptr) {}

PRE_SYSCALL(sched_yield)() {}

POST_SYSCALL(sched_yield)(long res) {}

PRE_SYSCALL(sched_get_priority_max)(long policy) {}

POST_SYSCALL(sched_get_priority_max)(long res, long policy) {}

PRE_SYSCALL(sched_get_priority_min)(long policy) {}

POST_SYSCALL(sched_get_priority_min)(long res, long policy) {}

PRE_SYSCALL(sched_rr_get_interval)(long pid, void *interval) {}

POST_SYSCALL(sched_rr_get_interval)(long res, long pid, void *interval) {}

PRE_SYSCALL(setpriority)(long which, long who, long niceval) {}

POST_SYSCALL(setpriority)(long res, long which, long who, long niceval) {}

PRE_SYSCALL(getpriority)(long which, long who) {}

POST_SYSCALL(getpriority)(long res, long which, long who) {}

PRE_SYSCALL(shutdown)(long arg0, long arg1) {}

POST_SYSCALL(shutdown)(long res, long arg0, long arg1) {}

PRE_SYSCALL(reboot)(long magic1, long magic2, long cmd, void *arg) {}

POST_SYSCALL(reboot)(long res, long magic1, long magic2, long cmd, void *arg) {}

PRE_SYSCALL(restart_syscall)() {}

POST_SYSCALL(restart_syscall)(long res) {}

PRE_SYSCALL(kexec_load)
(long entry, long nr_segments, void *segments, long flags) {}

POST_SYSCALL(kexec_load)
(long res, long entry, long nr_segments, void *segments, long flags) {}

PRE_SYSCALL(exit)(long error_code) {}

POST_SYSCALL(exit)(long res, long error_code) {}

PRE_SYSCALL(exit_group)(long error_code) {}

POST_SYSCALL(exit_group)(long res, long error_code) {}

PRE_SYSCALL(wait4)(long pid, void *stat_addr, long options, void *ru) {}

POST_SYSCALL(wait4)
(long res, long pid, void *stat_addr, long options, void *ru) {}

PRE_SYSCALL(waitid)
(long which, long pid, void *infop, long options, void *ru) {}

POST_SYSCALL(waitid)
(long res, long which, long pid, void *infop, long options, void *ru) {}

PRE_SYSCALL(waitpid)(long pid, void *stat_addr, long options) {}

POST_SYSCALL(waitpid)(long res, long pid, void *stat_addr, long options) {}

PRE_SYSCALL(set_tid_address)(void *tidptr) {}

POST_SYSCALL(set_tid_address)(long res, void *tidptr) {}

PRE_SYSCALL(init_module)(void *umod, long len, const void *uargs) {}

POST_SYSCALL(init_module)(long res, void *umod, long len, const void *uargs) {}

PRE_SYSCALL(delete_module)(const void *name_user, long flags) {}

POST_SYSCALL(delete_module)(long res, const void *name_user, long flags) {}

PRE_SYSCALL(rt_sigprocmask)(long how, void *set, void *oset, long sigsetsize) {}

POST_SYSCALL(rt_sigprocmask)
(long res, long how, kernel_sigset_t *set, kernel_sigset_t *oset,
 long sigsetsize) {}

PRE_SYSCALL(rt_sigpending)(void *set, long sigsetsize) {}

POST_SYSCALL(rt_sigpending)(long res, kernel_sigset_t *set, long sigsetsize) {}

PRE_SYSCALL(rt_sigtimedwait)
(const kernel_sigset_t *uthese, void *uinfo, const void *uts, long sigsetsize) {}

POST_SYSCALL(rt_sigtimedwait)
(long res, const void *uthese, void *uinfo, const void *uts, long sigsetsize) {}

PRE_SYSCALL(rt_tgsigqueueinfo)(long tgid, long pid, long sig, void *uinfo) {}

POST_SYSCALL(rt_tgsigqueueinfo)
(long res, long tgid, long pid, long sig, void *uinfo) {}

PRE_SYSCALL(kill)(long pid, long sig) {}

POST_SYSCALL(kill)(long res, long pid, long sig) {}

PRE_SYSCALL(tgkill)(long tgid, long pid, long sig) {}

POST_SYSCALL(tgkill)(long res, long tgid, long pid, long sig) {}

PRE_SYSCALL(tkill)(long pid, long sig) {}

POST_SYSCALL(tkill)(long res, long pid, long sig) {}

PRE_SYSCALL(rt_sigqueueinfo)(long pid, long sig, void *uinfo) {}

POST_SYSCALL(rt_sigqueueinfo)(long res, long pid, long sig, void *uinfo) {}

PRE_SYSCALL(sgetmask)() {}

POST_SYSCALL(sgetmask)(long res) {}

PRE_SYSCALL(ssetmask)(long newmask) {}

POST_SYSCALL(ssetmask)(long res, long newmask) {}

PRE_SYSCALL(signal)(long sig, long handler) {}

POST_SYSCALL(signal)(long res, long sig, long handler) {}

PRE_SYSCALL(pause)() {}

POST_SYSCALL(pause)(long res) {}

PRE_SYSCALL(sync)() {}

POST_SYSCALL(sync)(long res) {}

PRE_SYSCALL(fsync)(long fd) {}

POST_SYSCALL(fsync)(long res, long fd) {}

PRE_SYSCALL(fdatasync)(long fd) {}

POST_SYSCALL(fdatasync)(long res, long fd) {}

PRE_SYSCALL(bdflush)(long func, long data) {}

POST_SYSCALL(bdflush)(long res, long func, long data) {}

PRE_SYSCALL(mount)
(void *dev_name, void *dir_name, void *type, long flags, void *data) {}

POST_SYSCALL(mount)
(long res, void *dev_name, void *dir_name, void *type, long flags, void *data) {}

PRE_SYSCALL(umount)(void *name, long flags) {}

POST_SYSCALL(umount)(long res, void *name, long flags) {}

PRE_SYSCALL(oldumount)(void *name) {}

POST_SYSCALL(oldumount)(long res, void *name) {}

PRE_SYSCALL(truncate)(const void *path, long length) {}

POST_SYSCALL(truncate)(long res, const void *path, long length) {}

PRE_SYSCALL(ftruncate)(long fd, long length) {}

POST_SYSCALL(ftruncate)(long res, long fd, long length) {}

PRE_SYSCALL(stat)(const void *filename, void *statbuf) {}

POST_SYSCALL(stat)(long res, const void *filename, void *statbuf) {}

#  if !SANITIZER_ANDROID
PRE_SYSCALL(statfs)(const void *path, void *buf) {}

POST_SYSCALL(statfs)(long res, const void *path, void *buf) {}

PRE_SYSCALL(fstatfs)(long fd, void *buf) {}

POST_SYSCALL(fstatfs)(long res, long fd, void *buf) {}
#  endif  // !SANITIZER_ANDROID

#  if SANITIZER_GLIBC
PRE_SYSCALL(statfs64)(const void *path, long sz, void *buf) {}

POST_SYSCALL(statfs64)(long res, const void *path, long sz, void *buf) {}

PRE_SYSCALL(fstatfs64)(long fd, long sz, void *buf) {}

POST_SYSCALL(fstatfs64)(long res, long fd, long sz, void *buf) {}
#  endif  // SANITIZER_GLIBC

PRE_SYSCALL(lstat)(const void *filename, void *statbuf) {}

POST_SYSCALL(lstat)(long res, const void *filename, void *statbuf) {}

PRE_SYSCALL(fstat)(long fd, void *statbuf) {}

POST_SYSCALL(fstat)(long res, long fd, void *statbuf) {}

PRE_SYSCALL(newstat)(const void *filename, void *statbuf) {}

POST_SYSCALL(newstat)(long res, const void *filename, void *statbuf) {}

PRE_SYSCALL(newlstat)(const void *filename, void *statbuf) {}

POST_SYSCALL(newlstat)(long res, const void *filename, void *statbuf) {}

PRE_SYSCALL(newfstat)(long fd, void *statbuf) {}

POST_SYSCALL(newfstat)(long res, long fd, void *statbuf) {}

#  if SANITIZER_GLIBC
PRE_SYSCALL(ustat)(long dev, void *ubuf) {}

POST_SYSCALL(ustat)(long res, long dev, void *ubuf) {}
#  endif  // SANITIZER_GLIBC

PRE_SYSCALL(stat64)(const void *filename, void *statbuf) {}

POST_SYSCALL(stat64)(long res, const void *filename, void *statbuf) {}

PRE_SYSCALL(fstat64)(long fd, void *statbuf) {}

POST_SYSCALL(fstat64)(long res, long fd, void *statbuf) {}

PRE_SYSCALL(lstat64)(const void *filename, void *statbuf) {}

POST_SYSCALL(lstat64)(long res, const void *filename, void *statbuf) {}

PRE_SYSCALL(setxattr)
(const void *path, const void *name, const void *value, long size, long flags) {}

POST_SYSCALL(setxattr)
(long res, const void *path, const void *name, const void *value, long size,
 long flags) {}

PRE_SYSCALL(lsetxattr)
(const void *path, const void *name, const void *value, long size, long flags) {}

POST_SYSCALL(lsetxattr)
(long res, const void *path, const void *name, const void *value, long size,
 long flags) {}

PRE_SYSCALL(fsetxattr)
(long fd, const void *name, const void *value, long size, long flags) {}

POST_SYSCALL(fsetxattr)
(long res, long fd, const void *name, const void *value, long size,
 long flags) {}

PRE_SYSCALL(getxattr)
(const void *path, const void *name, void *value, long size) {}

POST_SYSCALL(getxattr)
(long res, const void *path, const void *name, void *value, long size) {}

PRE_SYSCALL(lgetxattr)
(const void *path, const void *name, void *value, long size) {}

POST_SYSCALL(lgetxattr)
(long res, const void *path, const void *name, void *value, long size) {}

PRE_SYSCALL(fgetxattr)(long fd, const void *name, void *value, long size) {}

POST_SYSCALL(fgetxattr)
(long res, long fd, const void *name, void *value, long size) {}

PRE_SYSCALL(listxattr)(const void *path, void *list, long size) {}

POST_SYSCALL(listxattr)(long res, const void *path, void *list, long size) {}

PRE_SYSCALL(llistxattr)(const void *path, void *list, long size) {}

POST_SYSCALL(llistxattr)(long res, const void *path, void *list, long size) {}

PRE_SYSCALL(flistxattr)(long fd, void *list, long size) {}

POST_SYSCALL(flistxattr)(long res, long fd, void *list, long size) {}

PRE_SYSCALL(removexattr)(const void *path, const void *name) {}

POST_SYSCALL(removexattr)(long res, const void *path, const void *name) {}

PRE_SYSCALL(lremovexattr)(const void *path, const void *name) {}

POST_SYSCALL(lremovexattr)(long res, const void *path, const void *name) {}

PRE_SYSCALL(fremovexattr)(long fd, const void *name) {}

POST_SYSCALL(fremovexattr)(long res, long fd, const void *name) {}

PRE_SYSCALL(brk)(long brk) {}

POST_SYSCALL(brk)(long res, long brk) {}

PRE_SYSCALL(mprotect)(long start, long len, long prot) {}

POST_SYSCALL(mprotect)(long res, long start, long len, long prot) {}

PRE_SYSCALL(mremap)
(long addr, long old_len, long new_len, long flags, long new_addr) {}

POST_SYSCALL(mremap)
(long res, long addr, long old_len, long new_len, long flags, long new_addr) {}

PRE_SYSCALL(remap_file_pages)
(long start, long size, long prot, long pgoff, long flags) {}

POST_SYSCALL(remap_file_pages)
(long res, long start, long size, long prot, long pgoff, long flags) {}

PRE_SYSCALL(msync)(long start, long len, long flags) {}

POST_SYSCALL(msync)(long res, long start, long len, long flags) {}

PRE_SYSCALL(munmap)(long addr, long len) {}

POST_SYSCALL(munmap)(long res, long addr, long len) {}

PRE_SYSCALL(mlock)(long start, long len) {}

POST_SYSCALL(mlock)(long res, long start, long len) {}

PRE_SYSCALL(munlock)(long start, long len) {}

POST_SYSCALL(munlock)(long res, long start, long len) {}

PRE_SYSCALL(mlockall)(long flags) {}

POST_SYSCALL(mlockall)(long res, long flags) {}

PRE_SYSCALL(munlockall)() {}

POST_SYSCALL(munlockall)(long res) {}

PRE_SYSCALL(madvise)(long start, long len, long behavior) {}

POST_SYSCALL(madvise)(long res, long start, long len, long behavior) {}

PRE_SYSCALL(mincore)(long start, long len, void *vec) {}

POST_SYSCALL(mincore)(long res, long start, long len, void *vec) {}

PRE_SYSCALL(pivot_root)(const void *new_root, const void *put_old) {}

POST_SYSCALL(pivot_root)(long res, const void *new_root, const void *put_old) {}

PRE_SYSCALL(chroot)(const void *filename) {}

POST_SYSCALL(chroot)(long res, const void *filename) {}

PRE_SYSCALL(mknod)(const void *filename, long mode, long dev) {}

POST_SYSCALL(mknod)(long res, const void *filename, long mode, long dev) {}

PRE_SYSCALL(link)(const void *oldname, const void *newname) {}

POST_SYSCALL(link)(long res, const void *oldname, const void *newname) {}

PRE_SYSCALL(symlink)(const void *old, const void *new_) {}

POST_SYSCALL(symlink)(long res, const void *old, const void *new_) {}

PRE_SYSCALL(unlink)(const void *pathname) {}

POST_SYSCALL(unlink)(long res, const void *pathname) {}

PRE_SYSCALL(rename)(const void *oldname, const void *newname) {}

POST_SYSCALL(rename)(long res, const void *oldname, const void *newname) {}

PRE_SYSCALL(chmod)(const void *filename, long mode) {}

POST_SYSCALL(chmod)(long res, const void *filename, long mode) {}

PRE_SYSCALL(fchmod)(long fd, long mode) {}

POST_SYSCALL(fchmod)(long res, long fd, long mode) {}

PRE_SYSCALL(fcntl)(long fd, long cmd, long arg) {}

POST_SYSCALL(fcntl)(long res, long fd, long cmd, long arg) {}

PRE_SYSCALL(fcntl64)(long fd, long cmd, long arg) {}

POST_SYSCALL(fcntl64)(long res, long fd, long cmd, long arg) {}

PRE_SYSCALL(pipe)(void *fildes) {}

POST_SYSCALL(pipe)(long res, void *fildes) {}

PRE_SYSCALL(pipe2)(void *fildes, long flags) {}

POST_SYSCALL(pipe2)(long res, void *fildes, long flags) {}

PRE_SYSCALL(dup)(long fildes) {}

POST_SYSCALL(dup)(long res, long fildes) {}

PRE_SYSCALL(dup2)(long oldfd, long newfd) {}

POST_SYSCALL(dup2)(long res, long oldfd, long newfd) {}

PRE_SYSCALL(dup3)(long oldfd, long newfd, long flags) {}

POST_SYSCALL(dup3)(long res, long oldfd, long newfd, long flags) {}

PRE_SYSCALL(ioperm)(long from, long num, long on) {}

POST_SYSCALL(ioperm)(long res, long from, long num, long on) {}

PRE_SYSCALL(ioctl)(long fd, long cmd, long arg) {}

POST_SYSCALL(ioctl)(long res, long fd, long cmd, long arg) {}

PRE_SYSCALL(flock)(long fd, long cmd) {}

POST_SYSCALL(flock)(long res, long fd, long cmd) {}

PRE_SYSCALL(io_setup)(long nr_reqs, void **ctx) {}

POST_SYSCALL(io_setup)(long res, long nr_reqs, void **ctx) {}

PRE_SYSCALL(io_destroy)(long ctx) {}

POST_SYSCALL(io_destroy)(long res, long ctx) {}

PRE_SYSCALL(io_getevents)
(long ctx_id, long min_nr, long nr, __sanitizer_io_event *ioevpp,
 void *timeout) {}

POST_SYSCALL(io_getevents)
(long res, long ctx_id, long min_nr, long nr, __sanitizer_io_event *ioevpp,
 void *timeout) {}

PRE_SYSCALL(io_submit)(long ctx_id, long nr, __sanitizer_iocb **iocbpp) {}

POST_SYSCALL(io_submit)
(long res, long ctx_id, long nr, __sanitizer_iocb **iocbpp) {}

PRE_SYSCALL(io_cancel)
(long ctx_id, __sanitizer_iocb *iocb, __sanitizer_io_event *result) {}

POST_SYSCALL(io_cancel)
(long res, long ctx_id, __sanitizer_iocb *iocb, __sanitizer_io_event *result) {}

PRE_SYSCALL(sendfile)(long out_fd, long in_fd, void *offset, long count) {}

POST_SYSCALL(sendfile)
(long res, long out_fd, long in_fd, __sanitizer___kernel_off_t *offset,
 long count) {}

PRE_SYSCALL(sendfile64)(long out_fd, long in_fd, void *offset, long count) {}

POST_SYSCALL(sendfile64)
(long res, long out_fd, long in_fd, __sanitizer___kernel_loff_t *offset,
 long count) {}

PRE_SYSCALL(readlink)(const void *path, void *buf, long bufsiz) {}

POST_SYSCALL(readlink)(long res, const void *path, void *buf, long bufsiz) {}

PRE_SYSCALL(creat)(const void *pathname, long mode) {}

POST_SYSCALL(creat)(long res, const void *pathname, long mode) {}

PRE_SYSCALL(open)(const void *filename, long flags, long mode) {}

POST_SYSCALL(open)(long res, const void *filename, long flags, long mode) {}

PRE_SYSCALL(close)(long fd) {}

POST_SYSCALL(close)(long res, long fd) {}

PRE_SYSCALL(access)(const void *filename, long mode) {}

POST_SYSCALL(access)(long res, const void *filename, long mode) {}

PRE_SYSCALL(vhangup)() {}

POST_SYSCALL(vhangup)(long res) {}

PRE_SYSCALL(chown)(const void *filename, long user, long group) {}

POST_SYSCALL(chown)(long res, const void *filename, long user, long group) {}

PRE_SYSCALL(lchown)(const void *filename, long user, long group) {}

POST_SYSCALL(lchown)(long res, const void *filename, long user, long group) {}

PRE_SYSCALL(fchown)(long fd, long user, long group) {}

POST_SYSCALL(fchown)(long res, long fd, long user, long group) {}

#  if SANITIZER_USES_UID16_SYSCALLS
PRE_SYSCALL(chown16)(const void *filename, long user, long group) {
  if (filename)
    PRE_READ(filename,
             __sanitizer::internal_strlen((const char *)filename) + 1);
}

POST_SYSCALL(chown16)(long res, const void *filename, long user, long group) {}

PRE_SYSCALL(lchown16)(const void *filename, long user, long group) {
  if (filename)
    PRE_READ(filename,
             __sanitizer::internal_strlen((const char *)filename) + 1);
}

POST_SYSCALL(lchown16)(long res, const void *filename, long user, long group) {}

PRE_SYSCALL(fchown16)(long fd, long user, long group) {}

POST_SYSCALL(fchown16)(long res, long fd, long user, long group) {}

PRE_SYSCALL(setregid16)(long rgid, long egid) {}

POST_SYSCALL(setregid16)(long res, long rgid, long egid) {}

PRE_SYSCALL(setgid16)(long gid) {}

POST_SYSCALL(setgid16)(long res, long gid) {}

PRE_SYSCALL(setreuid16)(long ruid, long euid) {}

POST_SYSCALL(setreuid16)(long res, long ruid, long euid) {}

PRE_SYSCALL(setuid16)(long uid) {}

POST_SYSCALL(setuid16)(long res, long uid) {}

PRE_SYSCALL(setresuid16)(long ruid, long euid, long suid) {}

POST_SYSCALL(setresuid16)(long res, long ruid, long euid, long suid) {}

PRE_SYSCALL(getresuid16)(void *ruid, void *euid, void *suid) {}

POST_SYSCALL(getresuid16)
(long res, __sanitizer___kernel_old_uid_t *ruid,
 __sanitizer___kernel_old_uid_t *euid, __sanitizer___kernel_old_uid_t *suid) {
  if (res >= 0) {
    if (ruid)
      POST_WRITE(ruid, sizeof(*ruid));
    if (euid)
      POST_WRITE(euid, sizeof(*euid));
    if (suid)
      POST_WRITE(suid, sizeof(*suid));
  }
}

PRE_SYSCALL(setresgid16)(long rgid, long egid, long sgid) {}

POST_SYSCALL(setresgid16)(long res, long rgid, long egid, long sgid) {}

PRE_SYSCALL(getresgid16)(void *rgid, void *egid, void *sgid) {}

POST_SYSCALL(getresgid16)
(long res, __sanitizer___kernel_old_gid_t *rgid,
 __sanitizer___kernel_old_gid_t *egid, __sanitizer___kernel_old_gid_t *sgid) {
  if (res >= 0) {
    if (rgid)
      POST_WRITE(rgid, sizeof(*rgid));
    if (egid)
      POST_WRITE(egid, sizeof(*egid));
    if (sgid)
      POST_WRITE(sgid, sizeof(*sgid));
  }
}

PRE_SYSCALL(setfsuid16)(long uid) {}

POST_SYSCALL(setfsuid16)(long res, long uid) {}

PRE_SYSCALL(setfsgid16)(long gid) {}

POST_SYSCALL(setfsgid16)(long res, long gid) {}

PRE_SYSCALL(getgroups16)
(long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {}

POST_SYSCALL(getgroups16)
(long res, long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {
  if (res >= 0) {
    if (grouplist)
      POST_WRITE(grouplist, res * sizeof(*grouplist));
  }
}

PRE_SYSCALL(setgroups16)
(long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {
  if (grouplist)
    POST_WRITE(grouplist, gidsetsize * sizeof(*grouplist));
}

POST_SYSCALL(setgroups16)
(long res, long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {}

PRE_SYSCALL(getuid16)() {}

POST_SYSCALL(getuid16)(long res) {}

PRE_SYSCALL(geteuid16)() {}

POST_SYSCALL(geteuid16)(long res) {}

PRE_SYSCALL(getgid16)() {}

POST_SYSCALL(getgid16)(long res) {}

PRE_SYSCALL(getegid16)() {}

POST_SYSCALL(getegid16)(long res) {}
#  endif  // SANITIZER_USES_UID16_SYSCALLS

PRE_SYSCALL(utime)(void *filename, void *times) {}

POST_SYSCALL(utime)(long res, void *filename, void *times) {}

PRE_SYSCALL(utimes)(void *filename, void *utimes) {}

POST_SYSCALL(utimes)(long res, void *filename, void *utimes) {}

PRE_SYSCALL(lseek)(long fd, long offset, long origin) {}

POST_SYSCALL(lseek)(long res, long fd, long offset, long origin) {}

PRE_SYSCALL(llseek)
(long fd, long offset_high, long offset_low, void *result, long origin) {}

POST_SYSCALL(llseek)
(long res, long fd, long offset_high, long offset_low, void *result,
 long origin) {}

PRE_SYSCALL(readv)(long fd, const __sanitizer_iovec *vec, long vlen) {}

POST_SYSCALL(readv)
(long res, long fd, const __sanitizer_iovec *vec, long vlen) {}

PRE_SYSCALL(write)(long fd, const void *buf, long count) {}

POST_SYSCALL(write)(long res, long fd, const void *buf, long count) {}

PRE_SYSCALL(writev)(long fd, const __sanitizer_iovec *vec, long vlen) {}

POST_SYSCALL(writev)
(long res, long fd, const __sanitizer_iovec *vec, long vlen) {}

#  ifdef _LP64
PRE_SYSCALL(pread64)(long fd, void *buf, long count, long pos) {}

POST_SYSCALL(pread64)(long res, long fd, void *buf, long count, long pos) {}

PRE_SYSCALL(pwrite64)(long fd, const void *buf, long count, long pos) {}

POST_SYSCALL(pwrite64)
(long res, long fd, const void *buf, long count, long pos) {}
#  else
PRE_SYSCALL(pread64)(long fd, void *buf, long count, long pos0, long pos1) {}

POST_SYSCALL(pread64)
(long res, long fd, void *buf, long count, long pos0, long pos1) {
  if (res >= 0) {
    if (buf)
      POST_WRITE(buf, res);
  }
}

PRE_SYSCALL(pwrite64)
(long fd, const void *buf, long count, long pos0, long pos1) {
  if (buf)
    PRE_READ(buf, count);
}

POST_SYSCALL(pwrite64)
(long res, long fd, const void *buf, long count, long pos0, long pos1) {}
#  endif

PRE_SYSCALL(preadv)
(long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) {}

POST_SYSCALL(preadv)
(long res, long fd, const __sanitizer_iovec *vec, long vlen, long pos_l,
 long pos_h) {}

PRE_SYSCALL(pwritev)
(long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) {}

POST_SYSCALL(pwritev)
(long res, long fd, const __sanitizer_iovec *vec, long vlen, long pos_l,
 long pos_h) {}

PRE_SYSCALL(getcwd)(void *buf, long size) {}

POST_SYSCALL(getcwd)(long res, void *buf, long size) {}

PRE_SYSCALL(mkdir)(const void *pathname, long mode) {}

POST_SYSCALL(mkdir)(long res, const void *pathname, long mode) {}

PRE_SYSCALL(chdir)(const void *filename) {}

POST_SYSCALL(chdir)(long res, const void *filename) {}

PRE_SYSCALL(fchdir)(long fd) {}

POST_SYSCALL(fchdir)(long res, long fd) {}

PRE_SYSCALL(rmdir)(const void *pathname) {}

POST_SYSCALL(rmdir)(long res, const void *pathname) {}

PRE_SYSCALL(lookup_dcookie)(u64 cookie64, void *buf, long len) {}

POST_SYSCALL(lookup_dcookie)(long res, u64 cookie64, void *buf, long len) {}

PRE_SYSCALL(quotactl)(long cmd, const void *special, long id, void *addr) {}

POST_SYSCALL(quotactl)
(long res, long cmd, const void *special, long id, void *addr) {}

PRE_SYSCALL(getdents)(long fd, void *dirent, long count) {}

POST_SYSCALL(getdents)(long res, long fd, void *dirent, long count) {}

PRE_SYSCALL(getdents64)(long fd, void *dirent, long count) {}

POST_SYSCALL(getdents64)(long res, long fd, void *dirent, long count) {}

PRE_SYSCALL(setsockopt)
(long fd, long level, long optname, void *optval, long optlen) {}

POST_SYSCALL(setsockopt)
(long res, long fd, long level, long optname, void *optval, long optlen) {}

PRE_SYSCALL(getsockopt)
(long fd, long level, long optname, void *optval, void *optlen) {}

POST_SYSCALL(getsockopt)
(long res, long fd, long level, long optname, void *optval, void *optlen) {}

PRE_SYSCALL(bind)(long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {}

POST_SYSCALL(bind)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {}

PRE_SYSCALL(connect)(long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {}

POST_SYSCALL(connect)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {}

PRE_SYSCALL(accept)(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

POST_SYSCALL(accept)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

PRE_SYSCALL(accept4)
(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2, long arg3) {}

POST_SYSCALL(accept4)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2, long arg3) {}

PRE_SYSCALL(getsockname)
(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

POST_SYSCALL(getsockname)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

PRE_SYSCALL(getpeername)
(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

POST_SYSCALL(getpeername)
(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {}

PRE_SYSCALL(send)(long arg0, void *arg1, long arg2, long arg3) {}

POST_SYSCALL(send)(long res, long arg0, void *arg1, long arg2, long arg3) {}

PRE_SYSCALL(sendto)
(long arg0, void *arg1, long arg2, long arg3, sanitizer_kernel_sockaddr *arg4,
 long arg5) {}

POST_SYSCALL(sendto)
(long res, long arg0, void *arg1, long arg2, long arg3,
 sanitizer_kernel_sockaddr *arg4, long arg5) {}

PRE_SYSCALL(sendmsg)(long fd, void *msg, long flags) {}

POST_SYSCALL(sendmsg)(long res, long fd, void *msg, long flags) {}

PRE_SYSCALL(sendmmsg)(long fd, void *msg, long vlen, long flags) {}

POST_SYSCALL(sendmmsg)(long res, long fd, void *msg, long vlen, long flags) {}

PRE_SYSCALL(recv)(long arg0, void *buf, long len, long flags) {}

POST_SYSCALL(recv)(long res, void *buf, long len, long flags) {}

PRE_SYSCALL(recvfrom)
(long arg0, void *buf, long len, long flags, sanitizer_kernel_sockaddr *arg4,
 void *arg5) {}

POST_SYSCALL(recvfrom)
(long res, long arg0, void *buf, long len, long flags,
 sanitizer_kernel_sockaddr *arg4, void *arg5) {}

PRE_SYSCALL(socket)(long arg0, long arg1, long arg2) {}

POST_SYSCALL(socket)(long res, long arg0, long arg1, long arg2) {}

PRE_SYSCALL(socketpair)(long arg0, long arg1, long arg2, int *sv) {}

POST_SYSCALL(socketpair)(long res, long arg0, long arg1, long arg2, int *sv) {}

PRE_SYSCALL(socketcall)(long call, void *args) {}

POST_SYSCALL(socketcall)(long res, long call, void *args) {}

PRE_SYSCALL(listen)(long arg0, long arg1) {}

POST_SYSCALL(listen)(long res, long arg0, long arg1) {}

PRE_SYSCALL(poll)(void *ufds, long nfds, long timeout) {}

POST_SYSCALL(poll)
(long res, __sanitizer_pollfd *ufds, long nfds, long timeout) {}

PRE_SYSCALL(select)
(long n, __sanitizer___kernel_fd_set *inp, __sanitizer___kernel_fd_set *outp,
 __sanitizer___kernel_fd_set *exp, void *tvp) {}

POST_SYSCALL(select)
(long res, long n, __sanitizer___kernel_fd_set *inp,
 __sanitizer___kernel_fd_set *outp, __sanitizer___kernel_fd_set *exp,
 void *tvp) {}

PRE_SYSCALL(old_select)(void *arg) {}

POST_SYSCALL(old_select)(long res, void *arg) {}

PRE_SYSCALL(epoll_create)(long size) {}

POST_SYSCALL(epoll_create)(long res, long size) {}

PRE_SYSCALL(epoll_create1)(long flags) {}

POST_SYSCALL(epoll_create1)(long res, long flags) {}

PRE_SYSCALL(epoll_ctl)(long epfd, long op, long fd, void *event) {}

POST_SYSCALL(epoll_ctl)(long res, long epfd, long op, long fd, void *event) {}

PRE_SYSCALL(epoll_wait)
(long epfd, void *events, long maxevents, long timeout) {}

POST_SYSCALL(epoll_wait)
(long res, long epfd, void *events, long maxevents, long timeout) {}

PRE_SYSCALL(epoll_pwait)
(long epfd, void *events, long maxevents, long timeout,
 const kernel_sigset_t *sigmask, long sigsetsize) {}

POST_SYSCALL(epoll_pwait)
(long res, long epfd, void *events, long maxevents, long timeout,
 const void *sigmask, long sigsetsize) {}

PRE_SYSCALL(epoll_pwait2)
(long epfd, void *events, long maxevents,
 const sanitizer_kernel_timespec *timeout, const kernel_sigset_t *sigmask,
 long sigsetsize) {}

POST_SYSCALL(epoll_pwait2)
(long res, long epfd, void *events, long maxevents,
 const sanitizer_kernel_timespec *timeout, const void *sigmask,
 long sigsetsize) {}

PRE_SYSCALL(gethostname)(void *name, long len) {}

POST_SYSCALL(gethostname)(long res, void *name, long len) {}

PRE_SYSCALL(sethostname)(void *name, long len) {}

POST_SYSCALL(sethostname)(long res, void *name, long len) {}

PRE_SYSCALL(setdomainname)(void *name, long len) {}

POST_SYSCALL(setdomainname)(long res, void *name, long len) {}

PRE_SYSCALL(newuname)(void *name) {}

POST_SYSCALL(newuname)(long res, void *name) {}

PRE_SYSCALL(uname)(void *arg0) {}

POST_SYSCALL(uname)(long res, void *arg0) {}

PRE_SYSCALL(olduname)(void *arg0) {}

POST_SYSCALL(olduname)(long res, void *arg0) {}

PRE_SYSCALL(getrlimit)(long resource, void *rlim) {}

POST_SYSCALL(getrlimit)(long res, long resource, void *rlim) {}

PRE_SYSCALL(old_getrlimit)(long resource, void *rlim) {}

POST_SYSCALL(old_getrlimit)(long res, long resource, void *rlim) {}

PRE_SYSCALL(setrlimit)(long resource, void *rlim) {}

POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {}

#  if SANITIZER_GLIBC
PRE_SYSCALL(prlimit64)
(long pid, long resource, const void *new_rlim, void *old_rlim) {}

POST_SYSCALL(prlimit64)
(long res, long pid, long resource, const void *new_rlim, void *old_rlim) {}
#  endif

PRE_SYSCALL(getrusage)(long who, void *ru) {}

POST_SYSCALL(getrusage)(long res, long who, void *ru) {}

PRE_SYSCALL(umask)(long mask) {}

POST_SYSCALL(umask)(long res, long mask) {}

PRE_SYSCALL(msgget)(long key, long msgflg) {}

POST_SYSCALL(msgget)(long res, long key, long msgflg) {}

PRE_SYSCALL(msgsnd)(long msqid, void *msgp, long msgsz, long msgflg) {}

POST_SYSCALL(msgsnd)
(long res, long msqid, void *msgp, long msgsz, long msgflg) {}

PRE_SYSCALL(msgrcv)
(long msqid, void *msgp, long msgsz, long msgtyp, long msgflg) {}

POST_SYSCALL(msgrcv)
(long res, long msqid, void *msgp, long msgsz, long msgtyp, long msgflg) {}

#  if !SANITIZER_ANDROID
PRE_SYSCALL(msgctl)(long msqid, long cmd, void *buf) {}

POST_SYSCALL(msgctl)(long res, long msqid, long cmd, void *buf) {}
#  endif

PRE_SYSCALL(semget)(long key, long nsems, long semflg) {}

POST_SYSCALL(semget)(long res, long key, long nsems, long semflg) {}

PRE_SYSCALL(semop)(long semid, void *sops, long nsops) {}

POST_SYSCALL(semop)(long res, long semid, void *sops, long nsops) {}

PRE_SYSCALL(semctl)(long semid, long semnum, long cmd, void *arg) {}

POST_SYSCALL(semctl)(long res, long semid, long semnum, long cmd, void *arg) {}

PRE_SYSCALL(semtimedop)
(long semid, void *sops, long nsops, const void *timeout) {}

POST_SYSCALL(semtimedop)
(long res, long semid, void *sops, long nsops, const void *timeout) {}

PRE_SYSCALL(shmat)(long shmid, void *shmaddr, long shmflg) {}

POST_SYSCALL(shmat)(long res, long shmid, void *shmaddr, long shmflg) {}

PRE_SYSCALL(shmget)(long key, long size, long flag) {}

POST_SYSCALL(shmget)(long res, long key, long size, long flag) {}

PRE_SYSCALL(shmdt)(void *shmaddr) {}

POST_SYSCALL(shmdt)(long res, void *shmaddr) {}

PRE_SYSCALL(ipc)
(long call, long first, long second, long third, void *ptr, long fifth) {}

POST_SYSCALL(ipc)
(long res, long call, long first, long second, long third, void *ptr,
 long fifth) {}

#  if !SANITIZER_ANDROID
PRE_SYSCALL(shmctl)(long shmid, long cmd, void *buf) {}

POST_SYSCALL(shmctl)(long res, long shmid, long cmd, void *buf) {}

PRE_SYSCALL(mq_open)(const void *name, long oflag, long mode, void *attr) {}

POST_SYSCALL(mq_open)
(long res, const void *name, long oflag, long mode, void *attr) {}

PRE_SYSCALL(mq_unlink)(const void *name) {}

POST_SYSCALL(mq_unlink)(long res, const void *name) {}

PRE_SYSCALL(mq_timedsend)
(long mqdes, const void *msg_ptr, long msg_len, long msg_prio,
 const void *abs_timeout) {}

POST_SYSCALL(mq_timedsend)
(long res, long mqdes, const void *msg_ptr, long msg_len, long msg_prio,
 const void *abs_timeout) {}

PRE_SYSCALL(mq_timedreceive)
(long mqdes, void *msg_ptr, long msg_len, void *msg_prio,
 const void *abs_timeout) {}

POST_SYSCALL(mq_timedreceive)
(long res, long mqdes, void *msg_ptr, long msg_len, int *msg_prio,
 const void *abs_timeout) {}

PRE_SYSCALL(mq_notify)(long mqdes, const void *notification) {}

POST_SYSCALL(mq_notify)(long res, long mqdes, const void *notification) {}

PRE_SYSCALL(mq_getsetattr)(long mqdes, const void *mqstat, void *omqstat) {}

POST_SYSCALL(mq_getsetattr)
(long res, long mqdes, const void *mqstat, void *omqstat) {}
#  endif  // SANITIZER_ANDROID

PRE_SYSCALL(pciconfig_iobase)(long which, long bus, long devfn) {}

POST_SYSCALL(pciconfig_iobase)(long res, long which, long bus, long devfn) {}

PRE_SYSCALL(pciconfig_read)
(long bus, long dfn, long off, long len, void *buf) {}

POST_SYSCALL(pciconfig_read)
(long res, long bus, long dfn, long off, long len, void *buf) {}

PRE_SYSCALL(pciconfig_write)
(long bus, long dfn, long off, long len, void *buf) {}

POST_SYSCALL(pciconfig_write)
(long res, long bus, long dfn, long off, long len, void *buf) {}

PRE_SYSCALL(swapon)(const void *specialfile, long swap_flags) {}

POST_SYSCALL(swapon)(long res, const void *specialfile, long swap_flags) {}

PRE_SYSCALL(swapoff)(const void *specialfile) {}

POST_SYSCALL(swapoff)(long res, const void *specialfile) {}

PRE_SYSCALL(sysctl)(__sanitizer___sysctl_args *args) {}

POST_SYSCALL(sysctl)(long res, __sanitizer___sysctl_args *args) {}

PRE_SYSCALL(sysinfo)(void *info) {}

POST_SYSCALL(sysinfo)(long res, void *info) {}

PRE_SYSCALL(sysfs)(long option, long arg1, long arg2) {}

POST_SYSCALL(sysfs)(long res, long option, long arg1, long arg2) {}

PRE_SYSCALL(syslog)(long type, void *buf, long len) {}

POST_SYSCALL(syslog)(long res, long type, void *buf, long len) {}

PRE_SYSCALL(uselib)(const void *library) {}

POST_SYSCALL(uselib)(long res, const void *library) {}

PRE_SYSCALL(ni_syscall)() {}

POST_SYSCALL(ni_syscall)(long res) {}

PRE_SYSCALL(ptrace)(long request, long pid, long addr, long data) {}

POST_SYSCALL(ptrace)(long res, long request, long pid, long addr, long data) {}

PRE_SYSCALL(add_key)
(const void *_type, const void *_description, const void *_payload, long plen,
 long destringid) {}

POST_SYSCALL(add_key)
(long res, const void *_type, const void *_description, const void *_payload,
 long plen, long destringid) {}

PRE_SYSCALL(request_key)
(const void *_type, const void *_description, const void *_callout_info,
 long destringid) {}

POST_SYSCALL(request_key)
(long res, const void *_type, const void *_description,
 const void *_callout_info, long destringid) {}

PRE_SYSCALL(keyctl)(long cmd, long arg2, long arg3, long arg4, long arg5) {}

POST_SYSCALL(keyctl)
(long res, long cmd, long arg2, long arg3, long arg4, long arg5) {}

PRE_SYSCALL(ioprio_set)(long which, long who, long ioprio) {}

POST_SYSCALL(ioprio_set)(long res, long which, long who, long ioprio) {}

PRE_SYSCALL(ioprio_get)(long which, long who) {}

POST_SYSCALL(ioprio_get)(long res, long which, long who) {}

PRE_SYSCALL(set_mempolicy)(long mode, void *nmask, long maxnode) {}

POST_SYSCALL(set_mempolicy)(long res, long mode, void *nmask, long maxnode) {}

PRE_SYSCALL(migrate_pages)
(long pid, long maxnode, const void *from, const void *to) {}

POST_SYSCALL(migrate_pages)
(long res, long pid, long maxnode, const void *from, const void *to) {}

PRE_SYSCALL(move_pages)
(long pid, long nr_pages, const void **pages, const int *nodes, int *status,
 long flags) {}

POST_SYSCALL(move_pages)
(long res, long pid, long nr_pages, const void **pages, const int *nodes,
 int *status, long flags) {}

PRE_SYSCALL(mbind)
(long start, long len, long mode, void *nmask, long maxnode, long flags) {}

POST_SYSCALL(mbind)
(long res, long start, long len, long mode, void *nmask, long maxnode,
 long flags) {}

PRE_SYSCALL(get_mempolicy)
(void *policy, void *nmask, long maxnode, long addr, long flags) {}

POST_SYSCALL(get_mempolicy)
(long res, void *policy, void *nmask, long maxnode, long addr, long flags) {}

PRE_SYSCALL(inotify_init)() {}

POST_SYSCALL(inotify_init)(long res) {}

PRE_SYSCALL(inotify_init1)(long flags) {}

POST_SYSCALL(inotify_init1)(long res, long flags) {}

PRE_SYSCALL(inotify_add_watch)(long fd, const void *path, long mask) {}

POST_SYSCALL(inotify_add_watch)
(long res, long fd, const void *path, long mask) {}

PRE_SYSCALL(inotify_rm_watch)(long fd, long wd) {}

POST_SYSCALL(inotify_rm_watch)(long res, long fd, long wd) {}

PRE_SYSCALL(spu_run)(long fd, void *unpc, void *ustatus) {}

POST_SYSCALL(spu_run)(long res, long fd, unsigned *unpc, unsigned *ustatus) {}

PRE_SYSCALL(spu_create)(const void *name, long flags, long mode, long fd) {}

POST_SYSCALL(spu_create)
(long res, const void *name, long flags, long mode, long fd) {}

PRE_SYSCALL(mknodat)(long dfd, const void *filename, long mode, long dev) {}

POST_SYSCALL(mknodat)
(long res, long dfd, const void *filename, long mode, long dev) {}

PRE_SYSCALL(mkdirat)(long dfd, const void *pathname, long mode) {}

POST_SYSCALL(mkdirat)(long res, long dfd, const void *pathname, long mode) {}

PRE_SYSCALL(unlinkat)(long dfd, const void *pathname, long flag) {}

POST_SYSCALL(unlinkat)(long res, long dfd, const void *pathname, long flag) {}

PRE_SYSCALL(symlinkat)(const void *oldname, long newdfd, const void *newname) {}

POST_SYSCALL(symlinkat)
(long res, const void *oldname, long newdfd, const void *newname) {}

PRE_SYSCALL(linkat)
(long olddfd, const void *oldname, long newdfd, const void *newname,
 long flags) {}

POST_SYSCALL(linkat)
(long res, long olddfd, const void *oldname, long newdfd, const void *newname,
 long flags) {}

PRE_SYSCALL(renameat)
(long olddfd, const void *oldname, long newdfd, const void *newname) {}

POST_SYSCALL(renameat)
(long res, long olddfd, const void *oldname, long newdfd, const void *newname) {}

PRE_SYSCALL(futimesat)(long dfd, const void *filename, void *utimes) {}

POST_SYSCALL(futimesat)
(long res, long dfd, const void *filename, void *utimes) {}

PRE_SYSCALL(faccessat)(long dfd, const void *filename, long mode) {}

POST_SYSCALL(faccessat)(long res, long dfd, const void *filename, long mode) {}

PRE_SYSCALL(fchmodat)(long dfd, const void *filename, long mode) {}

POST_SYSCALL(fchmodat)(long res, long dfd, const void *filename, long mode) {}

PRE_SYSCALL(fchownat)
(long dfd, const void *filename, long user, long group, long flag) {}

POST_SYSCALL(fchownat)
(long res, long dfd, const void *filename, long user, long group, long flag) {}

PRE_SYSCALL(fchmodat2)(long dfd, const void *filename, long mode, long flag) {}

POST_SYSCALL(fchmodat2)
(long res, long dfd, const void *filename, long mode, long flag) {}

PRE_SYSCALL(openat)(long dfd, const void *filename, long flags, long mode) {}

POST_SYSCALL(openat)
(long res, long dfd, const void *filename, long flags, long mode) {}

PRE_SYSCALL(newfstatat)
(long dfd, const void *filename, void *statbuf, long flag) {}

POST_SYSCALL(newfstatat)
(long res, long dfd, const void *filename, void *statbuf, long flag) {}

PRE_SYSCALL(fstatat64)
(long dfd, const void *filename, void *statbuf, long flag) {}

POST_SYSCALL(fstatat64)
(long res, long dfd, const void *filename, void *statbuf, long flag) {}

PRE_SYSCALL(readlinkat)(long dfd, const void *path, void *buf, long bufsiz) {}

POST_SYSCALL(readlinkat)
(long res, long dfd, const void *path, void *buf, long bufsiz) {}

PRE_SYSCALL(utimensat)
(long dfd, const void *filename, void *utimes, long flags) {}

POST_SYSCALL(utimensat)
(long res, long dfd, const void *filename, void *utimes, long flags) {}

PRE_SYSCALL(unshare)(long unshare_flags) {}

POST_SYSCALL(unshare)(long res, long unshare_flags) {}

PRE_SYSCALL(splice)
(long fd_in, void *off_in, long fd_out, void *off_out, long len, long flags) {}

POST_SYSCALL(splice)
(long res, long fd_in, void *off_in, long fd_out, void *off_out, long len,
 long flags) {}

PRE_SYSCALL(vmsplice)
(long fd, const __sanitizer_iovec *iov, long nr_segs, long flags) {}

POST_SYSCALL(vmsplice)
(long res, long fd, const __sanitizer_iovec *iov, long nr_segs, long flags) {}

PRE_SYSCALL(tee)(long fdin, long fdout, long len, long flags) {}

POST_SYSCALL(tee)(long res, long fdin, long fdout, long len, long flags) {}

PRE_SYSCALL(get_robust_list)(long pid, void *head_ptr, void *len_ptr) {}

POST_SYSCALL(get_robust_list)
(long res, long pid, void *head_ptr, void *len_ptr) {}

PRE_SYSCALL(set_robust_list)(void *head, long len) {}

POST_SYSCALL(set_robust_list)(long res, void *head, long len) {}

PRE_SYSCALL(getcpu)(void *cpu, void *node, void *cache) {}

POST_SYSCALL(getcpu)(long res, void *cpu, void *node, void *cache) {}

PRE_SYSCALL(signalfd)(long ufd, void *user_mask, long sizemask) {}

POST_SYSCALL(signalfd)
(long res, long ufd, kernel_sigset_t *user_mask, long sizemask) {}

PRE_SYSCALL(signalfd4)(long ufd, void *user_mask, long sizemask, long flags) {}

POST_SYSCALL(signalfd4)
(long res, long ufd, kernel_sigset_t *user_mask, long sizemask, long flags) {}

PRE_SYSCALL(timerfd_create)(long clockid, long flags) {}

POST_SYSCALL(timerfd_create)(long res, long clockid, long flags) {}

PRE_SYSCALL(timerfd_settime)
(long ufd, long flags, const void *utmr, void *otmr) {}

POST_SYSCALL(timerfd_settime)
(long res, long ufd, long flags, const void *utmr, void *otmr) {}

PRE_SYSCALL(timerfd_gettime)(long ufd, void *otmr) {}

POST_SYSCALL(timerfd_gettime)(long res, long ufd, void *otmr) {}

PRE_SYSCALL(eventfd)(long count) {}

POST_SYSCALL(eventfd)(long res, long count) {}

PRE_SYSCALL(eventfd2)(long count, long flags) {}

POST_SYSCALL(eventfd2)(long res, long count, long flags) {}

PRE_SYSCALL(old_readdir)(long arg0, void *arg1, long arg2) {}

POST_SYSCALL(old_readdir)(long res, long arg0, void *arg1, long arg2) {}

PRE_SYSCALL(pselect6)
(long arg0, __sanitizer___kernel_fd_set *arg1,
 __sanitizer___kernel_fd_set *arg2, __sanitizer___kernel_fd_set *arg3,
 void *arg4, void *arg5) {}

POST_SYSCALL(pselect6)
(long res, long arg0, __sanitizer___kernel_fd_set *arg1,
 __sanitizer___kernel_fd_set *arg2, __sanitizer___kernel_fd_set *arg3,
 void *arg4, void *arg5) {}

PRE_SYSCALL(ppoll)
(__sanitizer_pollfd *arg0, long arg1, void *arg2, const kernel_sigset_t *arg3,
 long arg4) {}

POST_SYSCALL(ppoll)
(long res, __sanitizer_pollfd *arg0, long arg1, void *arg2, const void *arg3,
 long arg4) {}

PRE_SYSCALL(syncfs)(long fd) {}

POST_SYSCALL(syncfs)(long res, long fd) {}

PRE_SYSCALL(perf_event_open)
(__sanitizer_perf_event_attr *attr_uptr, long pid, long cpu, long group_fd,
 long flags) {}

POST_SYSCALL(perf_event_open)
(long res, __sanitizer_perf_event_attr *attr_uptr, long pid, long cpu,
 long group_fd, long flags) {}

PRE_SYSCALL(mmap_pgoff)
(long addr, long len, long prot, long flags, long fd, long pgoff) {}

POST_SYSCALL(mmap_pgoff)
(long res, long addr, long len, long prot, long flags, long fd, long pgoff) {}

PRE_SYSCALL(old_mmap)(void *arg) {}

POST_SYSCALL(old_mmap)(long res, void *arg) {}

PRE_SYSCALL(name_to_handle_at)
(long dfd, const void *name, void *handle, void *mnt_id, long flag) {}

POST_SYSCALL(name_to_handle_at)
(long res, long dfd, const void *name, void *handle, void *mnt_id, long flag) {}

PRE_SYSCALL(open_by_handle_at)(long mountdirfd, void *handle, long flags) {}

POST_SYSCALL(open_by_handle_at)
(long res, long mountdirfd, void *handle, long flags) {}

PRE_SYSCALL(setns)(long fd, long nstype) {}

POST_SYSCALL(setns)(long res, long fd, long nstype) {}

PRE_SYSCALL(process_vm_readv)
(long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec,
 long riovcnt, long flags) {}

POST_SYSCALL(process_vm_readv)
(long res, long pid, const __sanitizer_iovec *lvec, long liovcnt,
 const void *rvec, long riovcnt, long flags) {}

PRE_SYSCALL(process_vm_writev)
(long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec,
 long riovcnt, long flags) {}

POST_SYSCALL(process_vm_writev)
(long res, long pid, const __sanitizer_iovec *lvec, long liovcnt,
 const void *rvec, long riovcnt, long flags) {}

PRE_SYSCALL(fork)() {}

POST_SYSCALL(fork)(long res) {}

PRE_SYSCALL(vfork)() {}

POST_SYSCALL(vfork)(long res) {}

PRE_SYSCALL(sigaction)
(long signum, const __sanitizer_kernel_sigaction_t *act,
 __sanitizer_kernel_sigaction_t *oldact) {}

POST_SYSCALL(sigaction)
(long res, long signum, const __sanitizer_kernel_sigaction_t *act,
 __sanitizer_kernel_sigaction_t *oldact) {}

PRE_SYSCALL(rt_sigaction)
(long signum, const __sanitizer_kernel_sigaction_t *act,
 __sanitizer_kernel_sigaction_t *oldact, SIZE_T sz) {}

POST_SYSCALL(rt_sigaction)
(long res, long signum, const __sanitizer_kernel_sigaction_t *act,
 __sanitizer_kernel_sigaction_t *oldact, SIZE_T sz) {}

PRE_SYSCALL(getrandom)(void *buf, uptr count, long flags) {}

POST_SYSCALL(getrandom)(long res, void *buf, uptr count, long flags) {}

PRE_SYSCALL(sigaltstack)(const void *ss, void *oss) {}

POST_SYSCALL(sigaltstack)(long res, void *ss, void *oss) {}

PRE_SYSCALL(futex)
(void *uaddr, long futex_op, long val, void *timeout, void *uaddr2, long val3) {}

POST_SYSCALL(futex)
(long res, void *uaddr, long futex_op, long val, void *timeout, void *uaddr2,
 long val3) {}

}  // extern "C"

#  undef PRE_SYSCALL
#  undef PRE_READ
#  undef PRE_WRITE
#  undef POST_SYSCALL
#  undef POST_READ
#  undef POST_WRITE

#endif  // SANITIZER_LINUX