//===-- sanitizer_syscalls_netbsd.inc ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // 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 long res) // Called after fork syscall. // // DO NOT EDIT! THIS FILE HAS BEEN GENERATED! // // Generated with: generate_netbsd_syscalls.awk // Generated date: 2018-02-15 // Generated from: syscalls.master,v 1.291 2018/01/06 16:41:23 kamil Exp // //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_NETBSD #include "sanitizer_libc.h" #define PRE_SYSCALL(name) \ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_pre_impl_##name #define PRE_READ(p, s) COMMON_SYSCALL_PRE_READ_RANGE(p, s) #define PRE_WRITE(p, s) COMMON_SYSCALL_PRE_WRITE_RANGE(p, s) #define POST_SYSCALL(name) \ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_post_impl_##name #define POST_READ(p, s) COMMON_SYSCALL_POST_READ_RANGE(p, s) #define POST_WRITE(p, s) COMMON_SYSCALL_POST_WRITE_RANGE(p, s) #ifndef COMMON_SYSCALL_ACQUIRE #define COMMON_SYSCALL_ACQUIRE(addr) ((void)(addr)) #endif #ifndef COMMON_SYSCALL_RELEASE #define COMMON_SYSCALL_RELEASE(addr) ((void)(addr)) #endif #ifndef COMMON_SYSCALL_FD_CLOSE #define COMMON_SYSCALL_FD_CLOSE(fd) ((void)(fd)) #endif #ifndef COMMON_SYSCALL_FD_ACQUIRE #define COMMON_SYSCALL_FD_ACQUIRE(fd) ((void)(fd)) #endif #ifndef COMMON_SYSCALL_FD_RELEASE #define COMMON_SYSCALL_FD_RELEASE(fd) ((void)(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 // FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such). extern "C" {} // extern "C" #undef PRE_SYSCALL #undef PRE_READ #undef PRE_WRITE #undef POST_SYSCALL #undef POST_READ #undef POST_WRITE #endif // SANITIZER_NETBSD