1 //===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Generic implementations of internal_syscall* and internal_iserror.
11 //===----------------------------------------------------------------------===//
13 // NetBSD uses libc calls directly
16 #if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_OPENBSD || SANITIZER_SOLARIS
17 # define SYSCALL(name) SYS_ ## name
19 # define SYSCALL(name) __NR_ ## name
22 #if defined(__x86_64__) && (SANITIZER_FREEBSD || SANITIZER_MAC)
23 # define internal_syscall __syscall
25 # define internal_syscall syscall
30 bool internal_iserror(uptr retval, int *rverrno) {
31 if (retval == (uptr)-1) {