summaryrefslogtreecommitdiffstats
path: root/kernel/tests/include/lapi/fcntl.h
blob: 576a18daf1dcc1d285ed1dd34c4532a94109cb68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
 */

#ifndef __LAPI_FCNTL_H__
#define __LAPI_FCNTL_H__

#include <fcntl.h>
#include <sys/socket.h>

#ifndef O_DIRECT
# define O_DIRECT 040000
#endif

#ifndef O_CLOEXEC
# define O_CLOEXEC 02000000
#endif

#ifndef SOCK_CLOEXEC
# define SOCK_CLOEXEC O_CLOEXEC
#endif

#ifndef SOCK_NONBLOCK
# define SOCK_NONBLOCK O_NONBLOCK
#endif

#ifndef O_TMPFILE
# define O_TMPFILE (020000000 | O_DIRECTORY)
#endif

#ifndef F_DUPFD_CLOEXEC
# define F_DUPFD_CLOEXEC 1030
#endif

#ifndef F_SETPIPE_SZ
# define F_SETPIPE_SZ 1031
#endif

#ifndef F_GETPIPE_SZ
# define F_GETPIPE_SZ 1032
#endif

/*
 * Set/Get seals
 */
#ifndef F_ADD_SEALS
# define F_ADD_SEALS     (1033)
#endif

#ifndef F_GET_SEALS
# define F_GET_SEALS     (1034)
#endif

#ifndef F_SEAL_SEAL
# define F_SEAL_SEAL     0x0001  /* prevent further seals from being set */
#endif

#ifndef F_SEAL_SHRINK
# define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
#endif
#ifndef F_SEAL_GROW
# define F_SEAL_GROW     0x0004  /* prevent file from growing */
#endif
#ifndef F_SEAL_WRITE
# define F_SEAL_WRITE    0x0008  /* prevent writes */
#endif

#ifndef F_OWNER_PGRP
# define F_OWNER_PGRP 2
#endif

#ifndef F_OFD_GETLK
# define F_OFD_GETLK	36
#endif

#ifndef F_OFD_SETLK
# define F_OFD_SETLK	37
#endif

#ifndef F_OFD_SETLKW
# define F_OFD_SETLKW	38
#endif

#ifndef AT_FDCWD
# define AT_FDCWD -100
#endif

#ifndef AT_SYMLINK_FOLLOW
# define AT_SYMLINK_FOLLOW 0x400
#endif

#ifndef AT_SYMLINK_NOFOLLOW
# define AT_SYMLINK_NOFOLLOW 0x100
#endif

#ifndef AT_EMPTY_PATH
# define AT_EMPTY_PATH 0x1000
#endif

#ifndef AT_REMOVEDIR
# define AT_REMOVEDIR 0x200
#endif

#ifndef O_NOATIME
# define O_NOATIME 01000000
#endif

#ifndef O_PATH
# ifdef __sparc__
#  define O_PATH 0x1000000
# else
#  define O_PATH 010000000
# endif
#endif

#ifndef FALLOC_FL_KEEP_SIZE
# define FALLOC_FL_KEEP_SIZE 1
#endif

#ifndef RENAME_NOREPLACE
# define RENAME_NOREPLACE	(1 << 0)
#endif

#ifndef RENAME_EXCHANGE
# define RENAME_EXCHANGE		(1 << 1)
#endif

#ifndef RENAME_WHITEOUT
# define RENAME_WHITEOUT		(1 << 2)
#endif

/* splice, vmsplice, tee */

#ifndef SPLICE_F_NONBLOCK
# define SPLICE_F_NONBLOCK 2
#endif

#endif /* __LAPI_FCNTL_H__ */