]> git.proxmox.com Git - rustc.git/blame - vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / vendor / libc / src / unix / linux_like / linux / arch / generic / mod.rs
CommitLineData
3c0e092e
XL
1s! {
2 pub struct termios2 {
3 pub c_iflag: ::tcflag_t,
4 pub c_oflag: ::tcflag_t,
5 pub c_cflag: ::tcflag_t,
6 pub c_lflag: ::tcflag_t,
7 pub c_line: ::cc_t,
8 pub c_cc: [::cc_t; 19],
9 pub c_ispeed: ::speed_t,
10 pub c_ospeed: ::speed_t,
11 }
12}
13
cdc7bbd5
XL
14// include/uapi/asm-generic/socket.h
15// arch/alpha/include/uapi/asm/socket.h
16// tools/include/uapi/asm-generic/socket.h
17// arch/mips/include/uapi/asm/socket.h
18pub const SOL_SOCKET: ::c_int = 1;
19
20// Defined in unix/linux_like/mod.rs
21// pub const SO_DEBUG: ::c_int = 1;
22pub const SO_REUSEADDR: ::c_int = 2;
23pub const SO_TYPE: ::c_int = 3;
24pub const SO_ERROR: ::c_int = 4;
25pub const SO_DONTROUTE: ::c_int = 5;
26pub const SO_BROADCAST: ::c_int = 6;
27pub const SO_SNDBUF: ::c_int = 7;
28pub const SO_RCVBUF: ::c_int = 8;
29pub const SO_KEEPALIVE: ::c_int = 9;
30pub const SO_OOBINLINE: ::c_int = 10;
31pub const SO_NO_CHECK: ::c_int = 11;
32pub const SO_PRIORITY: ::c_int = 12;
33pub const SO_LINGER: ::c_int = 13;
34pub const SO_BSDCOMPAT: ::c_int = 14;
35pub const SO_REUSEPORT: ::c_int = 15;
36pub const SO_PASSCRED: ::c_int = 16;
37pub const SO_PEERCRED: ::c_int = 17;
38pub const SO_RCVLOWAT: ::c_int = 18;
39pub const SO_SNDLOWAT: ::c_int = 19;
40pub const SO_RCVTIMEO: ::c_int = 20;
41pub const SO_SNDTIMEO: ::c_int = 21;
42// pub const SO_RCVTIMEO_OLD: ::c_int = 20;
43// pub const SO_SNDTIMEO_OLD: ::c_int = 21;
44pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
45pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
46pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
47pub const SO_BINDTODEVICE: ::c_int = 25;
48pub const SO_ATTACH_FILTER: ::c_int = 26;
49pub const SO_DETACH_FILTER: ::c_int = 27;
50pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
51pub const SO_PEERNAME: ::c_int = 28;
52pub const SO_TIMESTAMP: ::c_int = 29;
53// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
54pub const SO_ACCEPTCONN: ::c_int = 30;
55pub const SO_PEERSEC: ::c_int = 31;
56pub const SO_SNDBUFFORCE: ::c_int = 32;
57pub const SO_RCVBUFFORCE: ::c_int = 33;
58pub const SO_PASSSEC: ::c_int = 34;
59pub const SO_TIMESTAMPNS: ::c_int = 35;
60// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
61pub const SO_MARK: ::c_int = 36;
62pub const SO_TIMESTAMPING: ::c_int = 37;
63// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
64pub const SO_PROTOCOL: ::c_int = 38;
65pub const SO_DOMAIN: ::c_int = 39;
66pub const SO_RXQ_OVFL: ::c_int = 40;
67pub const SO_WIFI_STATUS: ::c_int = 41;
68pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
69pub const SO_PEEK_OFF: ::c_int = 42;
70pub const SO_NOFCS: ::c_int = 43;
71pub const SO_LOCK_FILTER: ::c_int = 44;
72pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
73pub const SO_BUSY_POLL: ::c_int = 46;
74pub const SO_MAX_PACING_RATE: ::c_int = 47;
75pub const SO_BPF_EXTENSIONS: ::c_int = 48;
76pub const SO_INCOMING_CPU: ::c_int = 49;
77pub const SO_ATTACH_BPF: ::c_int = 50;
78pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
79pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
80pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
81pub const SO_CNX_ADVICE: ::c_int = 53;
82pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
83pub const SO_MEMINFO: ::c_int = 55;
84pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
85pub const SO_COOKIE: ::c_int = 57;
86pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
87pub const SO_PEERGROUPS: ::c_int = 59;
88pub const SO_ZEROCOPY: ::c_int = 60;
89pub const SO_TXTIME: ::c_int = 61;
90pub const SCM_TXTIME: ::c_int = SO_TXTIME;
91pub const SO_BINDTOIFINDEX: ::c_int = 62;
92cfg_if! {
93 // Some of these platforms in CI already have these constants.
94 // But they may still not have those _OLD ones.
95 if #[cfg(all(any(target_arch = "x86",
96 target_arch = "x86_64",
97 target_arch = "aarch64"),
98 not(target_env = "musl")))] {
99 pub const SO_TIMESTAMP_NEW: ::c_int = 63;
100 pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
101 pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
102 pub const SO_RCVTIMEO_NEW: ::c_int = 66;
103 pub const SO_SNDTIMEO_NEW: ::c_int = 67;
104 pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
105 }
106}
2b03887a
FG
107
108cfg_if! {
487cf647
FG
109 if #[cfg(any(target_arch = "x86",
110 target_arch = "x86_64",
111 target_arch = "aarch64"))] {
2b03887a
FG
112 pub const FICLONE: ::c_ulong = 0x40049409;
113 pub const FICLONERANGE: ::c_ulong = 0x4020940D;
114 }
115}
cdc7bbd5
XL
116// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
117// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
118
119// Defined in unix/linux_like/mod.rs
120// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
121pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
122pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
3c0e092e 123
5099ac24
FG
124// Ioctl Constants
125
5e7ed085
FG
126pub const TCGETS: ::Ioctl = 0x5401;
127pub const TCSETS: ::Ioctl = 0x5402;
128pub const TCSETSW: ::Ioctl = 0x5403;
129pub const TCSETSF: ::Ioctl = 0x5404;
130pub const TCGETA: ::Ioctl = 0x5405;
131pub const TCSETA: ::Ioctl = 0x5406;
132pub const TCSETAW: ::Ioctl = 0x5407;
133pub const TCSETAF: ::Ioctl = 0x5408;
134pub const TCSBRK: ::Ioctl = 0x5409;
135pub const TCXONC: ::Ioctl = 0x540A;
136pub const TCFLSH: ::Ioctl = 0x540B;
137pub const TIOCEXCL: ::Ioctl = 0x540C;
138pub const TIOCNXCL: ::Ioctl = 0x540D;
139pub const TIOCSCTTY: ::Ioctl = 0x540E;
140pub const TIOCGPGRP: ::Ioctl = 0x540F;
141pub const TIOCSPGRP: ::Ioctl = 0x5410;
142pub const TIOCOUTQ: ::Ioctl = 0x5411;
143pub const TIOCSTI: ::Ioctl = 0x5412;
144pub const TIOCGWINSZ: ::Ioctl = 0x5413;
145pub const TIOCSWINSZ: ::Ioctl = 0x5414;
146pub const TIOCMGET: ::Ioctl = 0x5415;
147pub const TIOCMBIS: ::Ioctl = 0x5416;
148pub const TIOCMBIC: ::Ioctl = 0x5417;
149pub const TIOCMSET: ::Ioctl = 0x5418;
150pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
151pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
152pub const FIONREAD: ::Ioctl = 0x541B;
153pub const TIOCINQ: ::Ioctl = FIONREAD;
154pub const TIOCLINUX: ::Ioctl = 0x541C;
155pub const TIOCCONS: ::Ioctl = 0x541D;
156pub const TIOCGSERIAL: ::Ioctl = 0x541E;
157pub const TIOCSSERIAL: ::Ioctl = 0x541F;
158pub const TIOCPKT: ::Ioctl = 0x5420;
159pub const FIONBIO: ::Ioctl = 0x5421;
160pub const TIOCNOTTY: ::Ioctl = 0x5422;
161pub const TIOCSETD: ::Ioctl = 0x5423;
162pub const TIOCGETD: ::Ioctl = 0x5424;
163pub const TCSBRKP: ::Ioctl = 0x5425;
164pub const TIOCSBRK: ::Ioctl = 0x5427;
165pub const TIOCCBRK: ::Ioctl = 0x5428;
166pub const TIOCGSID: ::Ioctl = 0x5429;
167pub const TCGETS2: ::Ioctl = 0x802c542a;
168pub const TCSETS2: ::Ioctl = 0x402c542b;
169pub const TCSETSW2: ::Ioctl = 0x402c542c;
170pub const TCSETSF2: ::Ioctl = 0x402c542d;
171pub const TIOCGRS485: ::Ioctl = 0x542E;
172pub const TIOCSRS485: ::Ioctl = 0x542F;
173pub const TIOCGPTN: ::Ioctl = 0x80045430;
174pub const TIOCSPTLCK: ::Ioctl = 0x40045431;
175pub const TIOCGDEV: ::Ioctl = 0x80045432;
176pub const TCGETX: ::Ioctl = 0x5432;
177pub const TCSETX: ::Ioctl = 0x5433;
178pub const TCSETXF: ::Ioctl = 0x5434;
179pub const TCSETXW: ::Ioctl = 0x5435;
180pub const TIOCSIG: ::Ioctl = 0x40045436;
181pub const TIOCVHANGUP: ::Ioctl = 0x5437;
182pub const TIOCGPKT: ::Ioctl = 0x80045438;
183pub const TIOCGPTLCK: ::Ioctl = 0x80045439;
184pub const TIOCGEXCL: ::Ioctl = 0x80045440;
185pub const TIOCGPTPEER: ::Ioctl = 0x5441;
186// pub const TIOCGISO7816: ::Ioctl = 0x80285442;
187// pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
188pub const FIONCLEX: ::Ioctl = 0x5450;
189pub const FIOCLEX: ::Ioctl = 0x5451;
190pub const FIOASYNC: ::Ioctl = 0x5452;
191pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
192pub const TIOCSERGWILD: ::Ioctl = 0x5454;
193pub const TIOCSERSWILD: ::Ioctl = 0x5455;
194pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
195pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
196pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
197pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
198pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
199pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
200pub const TIOCMIWAIT: ::Ioctl = 0x545C;
201pub const TIOCGICOUNT: ::Ioctl = 0x545D;
202pub const BLKIOMIN: ::Ioctl = 0x1278;
203pub const BLKIOOPT: ::Ioctl = 0x1279;
204pub const BLKSSZGET: ::Ioctl = 0x1268;
205pub const BLKPBSZGET: ::Ioctl = 0x127B;
5099ac24
FG
206
207cfg_if! {
208 if #[cfg(any(target_arch = "arm",
209 target_arch = "s390x"))] {
210 pub const FIOQSIZE: ::Ioctl = 0x545E;
5e7ed085 211 } else {
5099ac24
FG
212 pub const FIOQSIZE: ::Ioctl = 0x5460;
213 }
214}
a2a8927a
XL
215
216pub const TIOCM_LE: ::c_int = 0x001;
217pub const TIOCM_DTR: ::c_int = 0x002;
218pub const TIOCM_RTS: ::c_int = 0x004;
219pub const TIOCM_ST: ::c_int = 0x008;
220pub const TIOCM_SR: ::c_int = 0x010;
221pub const TIOCM_CTS: ::c_int = 0x020;
222pub const TIOCM_CAR: ::c_int = 0x040;
223pub const TIOCM_CD: ::c_int = TIOCM_CAR;
224pub const TIOCM_RNG: ::c_int = 0x080;
225pub const TIOCM_RI: ::c_int = TIOCM_RNG;
226pub const TIOCM_DSR: ::c_int = 0x100;
227
228pub const BOTHER: ::speed_t = 0o010000;
229pub const IBSHIFT: ::tcflag_t = 16;
230
5e7ed085
FG
231// RLIMIT Constants
232
233cfg_if! {
234 if #[cfg(any(target_env = "gnu",
235 target_env = "uclibc"))] {
236
237 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
238 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
239 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
240 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
241 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
242 pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
243 pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
244 pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
245 pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
246 pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
247 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
248 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
249 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
250 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
251 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
252 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
253 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
254
255 } else if #[cfg(target_env = "musl")] {
256
257 pub const RLIMIT_CPU: ::c_int = 0;
258 pub const RLIMIT_FSIZE: ::c_int = 1;
259 pub const RLIMIT_DATA: ::c_int = 2;
260 pub const RLIMIT_STACK: ::c_int = 3;
261 pub const RLIMIT_CORE: ::c_int = 4;
262 pub const RLIMIT_RSS: ::c_int = 5;
263 pub const RLIMIT_NPROC: ::c_int = 6;
264 pub const RLIMIT_NOFILE: ::c_int = 7;
265 pub const RLIMIT_MEMLOCK: ::c_int = 8;
266 pub const RLIMIT_AS: ::c_int = 9;
267 pub const RLIMIT_LOCKS: ::c_int = 10;
268 pub const RLIMIT_SIGPENDING: ::c_int = 11;
269 pub const RLIMIT_MSGQUEUE: ::c_int = 12;
270 pub const RLIMIT_NICE: ::c_int = 13;
271 pub const RLIMIT_RTPRIO: ::c_int = 14;
272 pub const RLIMIT_RTTIME: ::c_int = 15;
273 pub const RLIM_NLIMITS: ::c_int = 15;
274 pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
275 }
276}
277
278cfg_if! {
279 if #[cfg(target_env = "gnu")] {
280 pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
281 }
282 else if #[cfg(target_env = "uclibc")] {
283 pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
284 }
285}
286
287pub const RLIM_INFINITY: ::rlim_t = !0;