1 //===----------------------- Linux syscalls ---------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_SYSCALL_H
10 #define LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_SYSCALL_H
11 
12 #include "src/__support/architectures.h"
13 
14 #ifdef LLVM_LIBC_ARCH_X86_64
15 #include "x86_64/syscall.h"
16 #elif defined(LLVM_LIBC_ARCH_AARCH64)
17 #include "aarch64/syscall.h"
18 #endif
19 
20 namespace __llvm_libc {
21 
22 template <typename... Ts>
syscall(long __number,Ts...ts)23 __attribute__((always_inline)) inline long syscall(long __number, Ts... ts) {
24   static_assert(sizeof...(Ts) <= 6, "Too many arguments for syscall");
25   return syscall(__number, (long)ts...);
26 }
27 
28 } // namespace __llvm_libc
29 
30 #endif // LLVM_LIBC_SRC_SUPPORT_OSUTIL_LINUX_SYSCALL_H
31