1//===-- Definition of macros from unistd.h --------------------------------===//
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_MACROS_LINUX_UNISTD_MACROS_H
10#define LLVM_LIBC_MACROS_LINUX_UNISTD_MACROS_H
11
12// Values for mode argument to the access(...) function.
13#define F_OK 0
14#define X_OK 1
15#define W_OK 2
16#define R_OK 4
17
18#define _SC_PAGESIZE 1
19#define _SC_PAGE_SIZE _SC_PAGESIZE
20
21// Macro to set up the call to the __llvm_libc_syscall function
22// This is to prevent the call from having fewer than 6 arguments, since six
23// arguments are always passed to the syscall. Unnecessary arguments are
24// ignored.
25#define __syscall_helper(sysno, arg1, arg2, arg3, arg4, arg5, arg6, ...) \
26 __llvm_libc_syscall((long)(sysno), (long)(arg1), (long)(arg2), (long)(arg3), \
27 (long)(arg4), (long)(arg5), (long)(arg6))
28#define syscall(...) __syscall_helper(__VA_ARGS__, 0, 1, 2, 3, 4, 5, 6)
29
30#endif // LLVM_LIBC_MACROS_LINUX_UNISTD_MACROS_H
31

source code of libc/include/llvm-libc-macros/linux/unistd-macros.h