Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/llvm-project/libc/include/llvm-libc-macros/linux/unistd-macros.h
213799 views
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
#define _PC_FILESIZEBITS 0
22
#define _PC_LINK_MAX 1
23
#define _PC_MAX_CANON 2
24
#define _PC_MAX_INPUT 3
25
#define _PC_NAME_MAX 4
26
#define _PC_PATH_MAX 5
27
#define _PC_PIPE_BUF 6
28
#define _PC_2_SYMLINKS 7
29
#define _PC_ALLOC_SIZE_MIN 8
30
#define _PC_REC_INCR_XFER_SIZE 9
31
#define _PC_REC_MAX_XFER_SIZE 10
32
#define _PC_REC_MIN_XFER_SIZE 11
33
#define _PC_REC_XFER_ALIGN 12
34
#define _PC_SYMLINK_MAX 13
35
#define _PC_CHOWN_RESTRICTED 14
36
#define _PC_NO_TRUNC 15
37
#define _PC_VDISABLE 16
38
#define _PC_ASYNC_IO 17
39
#define _PC_PRIO_IO 18
40
#define _PC_SYNC_IO 19
41
42
// TODO: Move these limit macros to a separate file
43
#define _POSIX_CHOWN_RESTRICTED 1
44
#define _POSIX_PIPE_BUF 512
45
#define _POSIX_NO_TRUNC 1
46
#define _POSIX_VDISABLE '\0'
47
48
// Macro to set up the call to the __llvm_libc_syscall function
49
// This is to prevent the call from having fewer than 6 arguments, since six
50
// arguments are always passed to the syscall. Unnecessary arguments are
51
// ignored.
52
#define __syscall_helper(sysno, arg1, arg2, arg3, arg4, arg5, arg6, ...) \
53
__llvm_libc_syscall((long)(sysno), (long)(arg1), (long)(arg2), (long)(arg3), \
54
(long)(arg4), (long)(arg5), (long)(arg6))
55
#define syscall(...) __syscall_helper(__VA_ARGS__, 0, 1, 2, 3, 4, 5, 6)
56
57
#endif // LLVM_LIBC_MACROS_LINUX_UNISTD_MACROS_H
58
59