1 //===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Generic implementations of internal_syscall* and internal_iserror.
12 //===----------------------------------------------------------------------===//
14 // NetBSD uses libc calls directly
17 #if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_OPENBSD || SANITIZER_SOLARIS
18 # define SYSCALL(name) SYS_ ## name
20 # define SYSCALL(name) __NR_ ## name
23 #if defined(__x86_64__) && (SANITIZER_FREEBSD || SANITIZER_MAC)
24 # define internal_syscall __syscall
26 # define internal_syscall syscall
31 bool internal_iserror(uptr retval, int *rverrno) {
32 if (retval == (uptr)-1) {