13
13
#include <linux/fcntl.h>
14
14
#include <linux/fs.h>
15
15
#include <linux/futex.h>
16
- #include <linux/in.h>
17
16
#include <linux/inotify.h>
18
- #include <linux/ip.h>
19
- #include <linux/in6.h>
20
- #include <linux/ipv6.h>
21
17
#include <linux/limits.h>
22
18
#include <linux/magic.h>
23
19
#include <linux/mman.h>
24
- #include <linux/net.h>
25
20
#include <linux/poll.h>
26
- #include <linux/prctl.h>
27
21
#include <linux/random.h>
28
22
#include <linux/resource.h>
29
23
#include <linux/sched.h>
30
24
#include <linux/signal.h>
31
- #include <linux/socket.h>
32
25
#include <linux/stat.h>
33
- #include <linux/sysinfo.h>
34
- #include <linux/tcp.h>
35
26
#include <linux/termios.h>
36
27
#include <linux/time.h>
37
28
#include <linux/types.h>
38
29
#include <linux/uio.h>
39
- #include <linux/un.h>
40
30
#include <linux/unistd.h>
41
- #include <linux/utsname.h>
42
31
#include <linux/wait.h>
43
32
#include <linux/xattr.h>
44
33
62
51
#include <linux/userfaultfd.h>
63
52
#endif
64
53
65
- #if LINUX_VERSION_CODE >= KERNEL_VERSION (5 ,1 ,0 )
66
- #include <linux/io_uring.h>
67
- #endif
68
-
69
- // Miscellaneous definitions which don't appear to be defined in Linux's public
70
- // headers, but which are nonetheless part of the ABI, and necessary for
71
- // interoperability.
72
- //
73
- // When adding definitions here, please only include content needed for
74
- // interoperability with Linux's public ABI, and please only include types
75
- // and constants.
76
- //
77
- // In particular, please don't copy comments from other sources. And please
78
- // don't include any functions or function-style macros, as bindgen isn't
79
- // able to generate bindings for them.
80
- //
81
- // Also, please be aware that libc implementations (and thus the Rust libc
82
- // crate as well) sometimes define types and constants with similar names but
83
- // which are ABI-incompatible with the Linux kernel ABI. This file should
84
- // only describe the kernel ABI.
85
-
86
- struct sockaddr {
87
- struct __kernel_sockaddr_storage __storage ;
88
- };
89
- #if LINUX_VERSION_CODE == KERNEL_VERSION (2 ,6 ,32 )
90
- typedef uint16_t __kernel_sa_family_t ;
91
- #endif
92
-
93
- struct linger {
94
- int l_onoff ;
95
- int l_linger ;
96
- };
97
-
98
- #if LINUX_VERSION_CODE <= KERNEL_VERSION (4 ,4 ,0 )
99
- typedef long long __kernel_time64_t ;
100
- struct __kernel_timespec {
101
- __kernel_time64_t tv_sec ;
102
- long long tv_nsec ;
103
- };
104
- #endif
105
-
106
54
#define DT_UNKNOWN 0
107
55
#define DT_FIFO 1
108
56
#define DT_CHR 2
@@ -112,13 +60,6 @@ struct __kernel_timespec {
112
60
#define DT_LNK 10
113
61
#define DT_SOCK 12
114
62
115
- #define WEXITSTATUS (status ) (((status) & 0xff00) >> 8)
116
- #define WIFEXITED (status ) (((status) & 0x7f) == 0)
117
-
118
- #define SHUT_RD 0
119
- #define SHUT_WR 1
120
- #define SHUT_RDWR 2
121
-
122
63
struct linux_dirent64 {
123
64
__UINT64_TYPE__ d_ino ;
124
65
__INT64_TYPE__ d_off ;
@@ -127,8 +68,6 @@ struct linux_dirent64 {
127
68
char d_name [];
128
69
};
129
70
130
- typedef __UINT32_TYPE__ socklen_t ;
131
-
132
71
// Obtain the definitions of structs stat/stat64 and statfs/statfs64.
133
72
#include <asm/stat.h>
134
73
#include <asm/statfs.h>
@@ -143,17 +82,6 @@ typedef long __fsword_t;
143
82
typedef __statfs_word __fsword_t ;
144
83
#endif
145
84
146
- #if defined(__mips__ ) || defined(__mips64__ )
147
- #define SOCK_STREAM 2
148
- #define SOCK_DGRAM 1
149
- #else
150
- #define SOCK_STREAM 1
151
- #define SOCK_DGRAM 2
152
- #endif
153
- #define SOCK_RAW 3
154
- #define SOCK_RDM 4
155
- #define SOCK_SEQPACKET 5
156
-
157
85
#define F_OK 0
158
86
#define R_OK 4
159
87
#define W_OK 2
@@ -162,62 +90,37 @@ typedef __statfs_word __fsword_t;
162
90
#define UTIME_NOW 0x3fffffff
163
91
#define UTIME_OMIT 0x3ffffffe
164
92
165
- #define MSG_DONTWAIT 0x40
166
-
167
- #define AF_UNSPEC 0
168
- #define AF_UNIX 1
169
- #define AF_INET 2
170
- #define AF_AX25 3
171
- #define AF_IPX 4
172
- #define AF_APPLETALK 5
173
- #define AF_NETROM 6
174
- #define AF_BRIDGE 7
175
- #define AF_ATMPVC 8
176
- #define AF_X25 9
177
- #define AF_INET6 10
178
- #define AF_ROSE 11
179
- #define AF_DECnet 12
180
- #define AF_NETBEUI 13
181
- #define AF_SECURITY 14
182
- #define AF_KEY 15
183
- #define AF_NETLINK 16
184
- #define AF_PACKET 17
185
- #define AF_ASH 18
186
- #define AF_ECONET 19
187
- #define AF_ATMSVC 20
188
- #define AF_RDS 21
189
- #define AF_SNA 22
190
- #define AF_IRDA 23
191
- #define AF_PPPOX 24
192
- #define AF_WANPIPE 25
193
- #define AF_LLC 26
194
- #define AF_CAN 29
195
- #define AF_TIPC 30
196
- #define AF_BLUETOOTH 31
197
- #define AF_IUCV 32
198
- #define AF_RXRPC 33
199
- #define AF_ISDN 34
200
- #define AF_PHONET 35
201
- #define AF_IEEE802154 36
202
- #define AF_MAX 37
203
-
204
- #define MSG_OOB 0x1
205
- #define MSG_PEEK 0x2
206
- #define MSG_DONTROUTE 0x4
207
- #define MSG_CTRUNC 0x8
208
- #define MSG_PROBE 0x10
209
- #define MSG_TRUNC 0x20
210
- #define MSG_DONTWAIT 0x40
211
- #define MSG_EOR 0x80
212
- #define MSG_WAITALL 0x100
213
- #define MSG_FIN 0x200
214
- #define MSG_SYN 0x400
215
- #define MSG_CONFIRM 0x800
216
- #define MSG_RST 0x1000
217
- #define MSG_ERRQUEUE 0x2000
218
- #define MSG_NOSIGNAL 0x4000
219
- #define MSG_MORE 0x8000
220
- #define MSG_CMSG_CLOEXEC 0x40000000
93
+ #define MNT_FORCE 0x1
94
+ #define MNT_DETACH 0x2
95
+ #define MNT_EXPIRE 0x4
96
+ #define UMOUNT_NOFOLLOW 0x8
97
+ #define UMOUNT_UNUSED 0x80000000// Miscellaneous definitions which don't appear to be defined in Linux's public
98
+ // headers, but which are nonetheless part of the ABI, and necessary for
99
+ // interoperability.
100
+ //
101
+ // When adding definitions here, please only include content needed for
102
+ // interoperability with Linux's public ABI, and please only include types
103
+ // and constants.
104
+ //
105
+ // In particular, please don't copy comments from other sources. And please
106
+ // don't include any functions or function-style macros, as bindgen isn't
107
+ // able to generate bindings for them.
108
+ //
109
+ // Also, please be aware that libc implementations (and thus the Rust libc
110
+ // crate as well) sometimes define types and constants with similar names but
111
+ // which are ABI-incompatible with the Linux kernel ABI. This file should
112
+ // only describe the kernel ABI.
113
+
114
+ #if LINUX_VERSION_CODE <= KERNEL_VERSION (4 ,4 ,0 )
115
+ typedef long long __kernel_time64_t ;
116
+ struct __kernel_timespec {
117
+ __kernel_time64_t tv_sec ;
118
+ long long tv_nsec ;
119
+ };
120
+ #endif
121
+
122
+ #define WEXITSTATUS (status ) (((status) & 0xff00) >> 8)
123
+ #define WIFEXITED (status ) (((status) & 0x7f) == 0)
221
124
222
125
#define STDIN_FILENO 0
223
126
#define STDOUT_FILENO 1
@@ -293,38 +196,6 @@ struct user_desc {
293
196
#define ARCH_SET_FS 0x1002
294
197
#endif
295
198
296
- struct msghdr {
297
- void * msg_name ;
298
- int msg_namelen ;
299
- struct iovec * msg_iov ;
300
- size_t msg_iovlen ;
301
- void * msg_control ;
302
- size_t msg_controllen ;
303
- unsigned int msg_flags ;
304
- };
305
-
306
- struct cmsghdr {
307
- size_t cmsg_len ;
308
- int cmsg_level ;
309
- int cmsg_type ;
310
- };
311
-
312
-
313
- #define SCM_RIGHTS 0x01
314
- #define SCM_CREDENTIALS 0x02
315
- #define SCM_SECURITY 0x03
316
-
317
- struct ucred {
318
- __u32 pid ;
319
- __u32 uid ;
320
- __u32 gid ;
321
- };
322
-
323
- struct mmsghdr {
324
- struct msghdr msg_hdr ;
325
- unsigned int msg_len ;
326
- };
327
-
328
199
#define UFFD_API 0xAA
329
200
330
201
#define UFFDIO_REGISTER_MODE_MISSING 0x1
@@ -352,12 +223,6 @@ struct mmsghdr {
352
223
#define SPLICE_F_MORE 4
353
224
#define SPLICE_F_GIFT 8
354
225
355
- #define MNT_FORCE 0x1
356
- #define MNT_DETACH 0x2
357
- #define MNT_EXPIRE 0x4
358
- #define UMOUNT_NOFOLLOW 0x8
359
- #define UMOUNT_UNUSED 0x80000000
360
-
361
226
// Linux's public headers provide public `NSIG`, `sigset_t` and `sigaction`
362
227
// definitions which "cater to libcs that poke about in kernel headers", but
363
228
// they're not usable in libcs because, for example, `SYS_rt_sigaction` insists
0 commit comments