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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
use super::types::*;
pub const O_ACCMODE: i32 = 0o0000003;
pub const O_RDONLY: i32 = 0o0000000;
pub const O_WRONLY: i32 = 0o0000001;
pub const O_RDWR: i32 = 0o0000002;
pub const O_CREAT: i32 = 0o0000100;
pub const O_EXCL: i32 = 0o0000200;
pub const O_NOCTTY: i32 = 0o0000400;
pub const O_TRUNC: i32 = 0o0001000;
pub const O_APPEND: i32 = 0o0002000;
pub const O_NONBLOCK: i32 = 0o0004000;
pub const O_DSYNC: i32 = 0o0010000;
pub const FASYNC: i32 = 0o0020000;
pub const O_DIRECT: i32 = 0o0040000;
pub const O_LARGEFILE: i32 = 0o0100000;
pub const O_DIRECTORY: i32 = 0o0200000;
pub const O_NOFOLLOW: i32 = 0o0400000;
pub const O_NOATIME: i32 = 0o1000000;
pub const O_CLOEXEC: i32 = 0o2000000;
pub const __O_SYNC: i32 = 0o4000000;
pub const O_SYNC: i32 = (__O_SYNC | O_DSYNC);
pub const O_PATH: i32 = 0o10000000;
pub const __O_TMPFILE: i32 = 0o20000000;
pub const O_TMPFILE: i32 = (__O_TMPFILE | O_DIRECTORY);
pub const O_TMPFILE_MASK: i32 = (__O_TMPFILE | O_DIRECTORY | O_CREAT);
pub const O_NDELAY: i32 = O_NONBLOCK;
pub const F_DUPFD: i32 = 0;
pub const F_GETFD: i32 = 1;
pub const F_SETFD: i32 = 2;
pub const F_GETFL: i32 = 3;
pub const F_SETFL: i32 = 4;
pub const F_GETLK: i32 = 5;
pub const F_SETLK: i32 = 6;
pub const F_SETLKW: i32 = 7;
pub const F_SETOWN: i32 = 8;
pub const F_GETOWN: i32 = 9;
pub const F_SETSIG: i32 = 10;
pub const F_GETSIG: i32 = 11;
pub const F_GETLK64: i32 = 12;
pub const F_SETLK64: i32 = 13;
pub const F_SETLKW64: i32 = 14;
pub const F_SETOWN_EX: i32 = 15;
pub const F_GETOWN_EX: i32 = 16;
pub const F_GETOWNER_UIDS: i32 = 17;
pub const F_OFD_GETLK: i32 = 36;
pub const F_OFD_SETLK: i32 = 37;
pub const F_OFD_SETLKW: i32 = 38;
pub const F_OWNER_TID: i32 = 0;
pub const F_OWNER_PID: i32 = 1;
pub const F_OWNER_PGRP: i32 = 2;
#[repr(C)]
pub struct f_owner_ex_t {
pub type_: i32,
pub pid: pid_t,
}
pub const FD_CLOEXEC: i32 = 1;
pub const F_RDLCK: i32 = 0;
pub const F_WRLCK: i32 = 1;
pub const F_UNLCK: i32 = 2;
pub const F_EXLCK: i32 = 4;
pub const F_SHLCK: i32 = 8;
pub const LOCK_SH: i32 = 1;
pub const LOCK_EX: i32 = 2;
pub const LOCK_NB: i32 = 4;
pub const LOCK_UN: i32 = 8;
pub const LOCK_MAND: i32 = 32;
pub const LOCK_READ: i32 = 64;
pub const LOCK_WRITE: i32 = 128;
pub const LOCK_RW: i32 = 192;
pub const F_LINUX_SPECIFIC_BASE: i32 = 1024;
#[repr(C)]
pub struct flock_t {
pub l_type: i16,
pub l_whence: i16,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: pid_t,
}
#[repr(C)]
pub struct flock64_t {
pub l_type: i16,
pub l_whence: i16,
pub l_start: loff_t,
pub l_len: loff_t,
pub l_pid: pid_t,
}