• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it would be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write the Free Software Foundation,
16  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 
19 #ifndef __LAPI_FCNTL_H__
20 #define __LAPI_FCNTL_H__
21 
22 #include <fcntl.h>
23 #include <sys/socket.h>
24 
25 #ifndef O_CLOEXEC
26 # define O_CLOEXEC 02000000
27 #endif
28 
29 #ifndef SOCK_CLOEXEC
30 # define SOCK_CLOEXEC O_CLOEXEC
31 #endif
32 
33 #ifndef SOCK_NONBLOCK
34 # define SOCK_NONBLOCK O_NONBLOCK
35 #endif
36 
37 #ifndef O_TMPFILE
38 # define O_TMPFILE (020000000 | O_DIRECTORY)
39 #endif
40 
41 #ifndef F_DUPFD_CLOEXEC
42 # define F_DUPFD_CLOEXEC 1030
43 #endif
44 
45 #ifndef F_SETPIPE_SZ
46 # define F_SETPIPE_SZ 1031
47 #endif
48 
49 #ifndef F_GETPIPE_SZ
50 # define F_GETPIPE_SZ 1032
51 #endif
52 
53 /*
54  * Set/Get seals
55  */
56 #ifndef F_ADD_SEALS
57 # define F_ADD_SEALS     (1033)
58 #endif
59 
60 #ifndef F_GET_SEALS
61 # define F_GET_SEALS     (1034)
62 #endif
63 
64 #ifndef F_SEAL_SEAL
65 # define F_SEAL_SEAL     0x0001  /* prevent further seals from being set */
66 #endif
67 
68 #ifndef F_SEAL_SHRINK
69 # define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
70 #endif
71 #ifndef F_SEAL_GROW
72 # define F_SEAL_GROW     0x0004  /* prevent file from growing */
73 #endif
74 #ifndef F_SEAL_WRITE
75 # define F_SEAL_WRITE    0x0008  /* prevent writes */
76 #endif
77 
78 #ifndef F_OWNER_PGRP
79 # define F_OWNER_PGRP 2
80 #endif
81 
82 #ifndef F_OFD_GETLK
83 # define F_OFD_GETLK	36
84 #endif
85 
86 #ifndef F_OFD_SETLK
87 # define F_OFD_SETLK	37
88 #endif
89 
90 #ifndef F_OFD_SETLKW
91 # define F_OFD_SETLKW	38
92 #endif
93 
94 #ifndef AT_FDCWD
95 # define AT_FDCWD -100
96 #endif
97 
98 #ifndef AT_SYMLINK_FOLLOW
99 # define AT_SYMLINK_FOLLOW 0x400
100 #endif
101 
102 #ifndef AT_SYMLINK_NOFOLLOW
103 # define AT_SYMLINK_NOFOLLOW 0x100
104 #endif
105 
106 #ifndef AT_EMPTY_PATH
107 # define AT_EMPTY_PATH 0x1000
108 #endif
109 
110 #ifndef AT_REMOVEDIR
111 # define AT_REMOVEDIR 0x200
112 #endif
113 
114 #ifndef O_NOATIME
115 # define O_NOATIME 01000000
116 #endif
117 
118 #ifndef O_PATH
119 # ifdef __sparc__
120 #  define O_PATH 0x1000000
121 # else
122 #  define O_PATH 010000000
123 # endif
124 #endif
125 
126 #ifndef FALLOC_FL_KEEP_SIZE
127 # define FALLOC_FL_KEEP_SIZE 1
128 #endif
129 
130 #ifndef RENAME_NOREPLACE
131 # define RENAME_NOREPLACE	(1 << 0)
132 #endif
133 
134 #ifndef RENAME_EXCHANGE
135 # define RENAME_EXCHANGE		(1 << 1)
136 #endif
137 
138 #ifndef RENAME_WHITEOUT
139 # define RENAME_WHITEOUT		(1 << 2)
140 #endif
141 
142 /* splice, vmsplice, tee */
143 
144 #ifndef SPLICE_F_NONBLOCK
145 # define SPLICE_F_NONBLOCK 2
146 #endif
147 
148 #endif /* __LAPI_FCNTL_H__ */
149