1 //===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // Generic implementations of internal_syscall* and internal_iserror.
10 //===----------------------------------------------------------------------===//
12 // NetBSD uses libc calls directly
15 #if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_OPENBSD || SANITIZER_SOLARIS
16 # define SYSCALL(name) SYS_ ## name
18 # define SYSCALL(name) __NR_ ## name
21 #if defined(__x86_64__) && (SANITIZER_FREEBSD || SANITIZER_MAC)
22 # define internal_syscall __syscall
24 # define internal_syscall syscall
29 bool internal_iserror(uptr retval, int *rverrno) {
30 if (retval == (uptr)-1) {