diff --git a/libc/config/linux/x86_64/syscall.h.inc b/libc/config/linux/x86_64/syscall.h.inc --- a/libc/config/linux/x86_64/syscall.h.inc +++ b/libc/config/linux/x86_64/syscall.h.inc @@ -94,6 +94,13 @@ return retcode; } +template +__attribute__((always_inline)) inline long syscall(long __number, Ts... ts) { + static_assert(sizeof...(Ts) <= 6, "Too many arguments for syscall"); + return syscall(__number, (long)ts...); +} + + #undef SYSCALL_CLOBBER_LIST } // namespace __llvm_libc diff --git a/libc/test/config/linux/x86_64/syscall_test.cpp b/libc/test/config/linux/x86_64/syscall_test.cpp --- a/libc/test/config/linux/x86_64/syscall_test.cpp +++ b/libc/test/config/linux/x86_64/syscall_test.cpp @@ -36,4 +36,9 @@ [](long n, long a1, long a2, long a3, long a4, long a5, long a6) { return __llvm_libc::syscall(n, a1, a2, a3, a4, a5, a6); }); + + std::function notLongType( + [](long n, void *a1) { + return __llvm_libc::syscall(n, a1); + }); }