1 s! {
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 
14 // arch/sparc/include/uapi/asm/socket.h
15 pub const SOL_SOCKET: ::c_int = 0xffff;
16 
17 // Defined in unix/linux_like/mod.rs
18 // pub const SO_DEBUG: ::c_int = 0x0001;
19 pub const SO_PASSCRED: ::c_int = 0x0002;
20 pub const SO_REUSEADDR: ::c_int = 0x0004;
21 pub const SO_KEEPALIVE: ::c_int = 0x0008;
22 pub const SO_DONTROUTE: ::c_int = 0x0010;
23 pub const SO_BROADCAST: ::c_int = 0x0020;
24 pub const SO_PEERCRED: ::c_int = 0x0040;
25 pub const SO_LINGER: ::c_int = 0x0080;
26 pub const SO_OOBINLINE: ::c_int = 0x0100;
27 pub const SO_REUSEPORT: ::c_int = 0x0200;
28 pub const SO_BSDCOMPAT: ::c_int = 0x0400;
29 pub const SO_RCVLOWAT: ::c_int = 0x0800;
30 pub const SO_SNDLOWAT: ::c_int = 0x1000;
31 pub const SO_RCVTIMEO: ::c_int = 0x2000;
32 pub const SO_SNDTIMEO: ::c_int = 0x4000;
33 // pub const SO_RCVTIMEO_OLD: ::c_int = 0x2000;
34 // pub const SO_SNDTIMEO_OLD: ::c_int = 0x4000;
35 pub const SO_ACCEPTCONN: ::c_int = 0x8000;
36 pub const SO_SNDBUF: ::c_int = 0x1001;
37 pub const SO_RCVBUF: ::c_int = 0x1002;
38 pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
39 pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
40 pub const SO_ERROR: ::c_int = 0x1007;
41 pub const SO_TYPE: ::c_int = 0x1008;
42 pub const SO_PROTOCOL: ::c_int = 0x1028;
43 pub const SO_DOMAIN: ::c_int = 0x1029;
44 pub const SO_NO_CHECK: ::c_int = 0x000b;
45 pub const SO_PRIORITY: ::c_int = 0x000c;
46 pub const SO_BINDTODEVICE: ::c_int = 0x000d;
47 pub const SO_ATTACH_FILTER: ::c_int = 0x001a;
48 pub const SO_DETACH_FILTER: ::c_int = 0x001b;
49 pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
50 pub const SO_PEERNAME: ::c_int = 0x001c;
51 pub const SO_PEERSEC: ::c_int = 0x001e;
52 pub const SO_PASSSEC: ::c_int = 0x001f;
53 pub const SO_MARK: ::c_int = 0x0022;
54 pub const SO_RXQ_OVFL: ::c_int = 0x0024;
55 pub const SO_WIFI_STATUS: ::c_int = 0x0025;
56 pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
57 pub const SO_PEEK_OFF: ::c_int = 0x0026;
58 pub const SO_NOFCS: ::c_int = 0x0027;
59 pub const SO_LOCK_FILTER: ::c_int = 0x0028;
60 pub const SO_SELECT_ERR_QUEUE: ::c_int = 0x0029;
61 pub const SO_BUSY_POLL: ::c_int = 0x0030;
62 pub const SO_MAX_PACING_RATE: ::c_int = 0x0031;
63 pub const SO_BPF_EXTENSIONS: ::c_int = 0x0032;
64 pub const SO_INCOMING_CPU: ::c_int = 0x0033;
65 pub const SO_ATTACH_BPF: ::c_int = 0x0034;
66 pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
67 pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 0x0035;
68 pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 0x0036;
69 pub const SO_CNX_ADVICE: ::c_int = 0x0037;
70 pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 0x0038;
71 pub const SO_MEMINFO: ::c_int = 0x0039;
72 pub const SO_INCOMING_NAPI_ID: ::c_int = 0x003a;
73 pub const SO_COOKIE: ::c_int = 0x003b;
74 pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 0x003c;
75 pub const SO_PEERGROUPS: ::c_int = 0x003d;
76 pub const SO_ZEROCOPY: ::c_int = 0x003e;
77 pub const SO_TXTIME: ::c_int = 0x003f;
78 pub const SCM_TXTIME: ::c_int = SO_TXTIME;
79 pub const SO_BINDTOIFINDEX: ::c_int = 0x0041;
80 pub const SO_SECURITY_AUTHENTICATION: ::c_int = 0x5001;
81 pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 0x5002;
82 pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 0x5004;
83 pub const SO_TIMESTAMP: ::c_int = 0x001d;
84 pub const SO_TIMESTAMPNS: ::c_int = 0x0021;
85 pub const SO_TIMESTAMPING: ::c_int = 0x0023;
86 // pub const SO_TIMESTAMP_OLD: ::c_int = 0x001d;
87 // pub const SO_TIMESTAMPNS_OLD: ::c_int = 0x0021;
88 // pub const SO_TIMESTAMPING_OLD: ::c_int = 0x0023;
89 // pub const SO_TIMESTAMP_NEW: ::c_int = 0x0046;
90 // pub const SO_TIMESTAMPNS_NEW: ::c_int = 0x0042;
91 // pub const SO_TIMESTAMPING_NEW: ::c_int = 0x0043;
92 // pub const SO_RCVTIMEO_NEW: ::c_int = 0x0044;
93 // pub const SO_SNDTIMEO_NEW: ::c_int = 0x0045;
94 // pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 0x0047;
95 // pub const SO_PREFER_BUSY_POLL: ::c_int = 0x0048;
96 // pub const SO_BUSY_POLL_BUDGET: ::c_int = 0x0049;
97 
98 // Defined in unix/linux_like/mod.rs
99 // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
100 pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
101 pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
102 
103 // Ioctl Constants
104 
105 pub const TCGETS: ::Ioctl = 0x40245408;
106 pub const TCSETS: ::Ioctl = 0x80245409;
107 pub const TCSETSW: ::Ioctl = 0x8024540a;
108 pub const TCSETSF: ::Ioctl = 0x8024540b;
109 pub const TCGETA: ::Ioctl = 0x40125401;
110 pub const TCSETA: ::Ioctl = 0x80125402;
111 pub const TCSETAW: ::Ioctl = 0x80125403;
112 pub const TCSETAF: ::Ioctl = 0x80125404;
113 pub const TCSBRK: ::Ioctl = 0x20005405;
114 pub const TCXONC: ::Ioctl = 0x20005406;
115 pub const TCFLSH: ::Ioctl = 0x20005407;
116 pub const TIOCEXCL: ::Ioctl = 0x2000740d;
117 pub const TIOCNXCL: ::Ioctl = 0x2000740e;
118 pub const TIOCSCTTY: ::Ioctl = 0x20007484;
119 pub const TIOCGPGRP: ::Ioctl = 0x40047483;
120 pub const TIOCSPGRP: ::Ioctl = 0x80047482;
121 pub const TIOCOUTQ: ::Ioctl = 0x40047473;
122 pub const TIOCSTI: ::Ioctl = 0x80017472;
123 pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
124 pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
125 pub const TIOCMGET: ::Ioctl = 0x4004746a;
126 pub const TIOCMBIS: ::Ioctl = 0x8004746c;
127 pub const TIOCMBIC: ::Ioctl = 0x8004746b;
128 pub const TIOCMSET: ::Ioctl = 0x8004746d;
129 pub const TIOCGSOFTCAR: ::Ioctl = 0x40047464;
130 pub const TIOCSSOFTCAR: ::Ioctl = 0x80047465;
131 pub const FIONREAD: ::Ioctl = 0x4004667f;
132 pub const TIOCINQ: ::Ioctl = FIONREAD;
133 pub const TIOCLINUX: ::Ioctl = 0x541C;
134 pub const TIOCCONS: ::Ioctl = 0x20007424;
135 pub const TIOCGSERIAL: ::Ioctl = 0x541E;
136 pub const TIOCSSERIAL: ::Ioctl = 0x541F;
137 pub const TIOCPKT: ::Ioctl = 0x80047470;
138 pub const FIONBIO: ::Ioctl = 0x8004667e;
139 pub const TIOCNOTTY: ::Ioctl = 0x20007471;
140 pub const TIOCSETD: ::Ioctl = 0x80047401;
141 pub const TIOCGETD: ::Ioctl = 0x40047400;
142 pub const TCSBRKP: ::Ioctl = 0x5425;
143 pub const TIOCSBRK: ::Ioctl = 0x2000747b;
144 pub const TIOCCBRK: ::Ioctl = 0x2000747a;
145 pub const TIOCGSID: ::Ioctl = 0x40047485;
146 pub const TCGETS2: ::Ioctl = 0x402c540c;
147 pub const TCSETS2: ::Ioctl = 0x802c540d;
148 pub const TCSETSW2: ::Ioctl = 0x802c540e;
149 pub const TCSETSF2: ::Ioctl = 0x802c540f;
150 pub const TIOCGPTN: ::Ioctl = 0x40047486;
151 pub const TIOCSPTLCK: ::Ioctl = 0x80047487;
152 pub const TIOCGDEV: ::Ioctl = 0x40045432;
153 pub const TIOCSIG: ::Ioctl = 0x80047488;
154 pub const TIOCVHANGUP: ::Ioctl = 0x20005437;
155 pub const TIOCGPKT: ::Ioctl = 0x40045438;
156 pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
157 pub const TIOCGEXCL: ::Ioctl = 0x40045440;
158 pub const TIOCGPTPEER: ::Ioctl = 0x20007489;
159 pub const FIONCLEX: ::Ioctl = 0x20006602;
160 pub const FIOCLEX: ::Ioctl = 0x20006601;
161 pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
162 pub const TIOCSERGWILD: ::Ioctl = 0x5454;
163 pub const TIOCSERSWILD: ::Ioctl = 0x5455;
164 pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
165 pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
166 pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
167 pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
168 pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
169 pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
170 pub const TIOCMIWAIT: ::Ioctl = 0x545C;
171 pub const TIOCGICOUNT: ::Ioctl = 0x545D;
172 pub const TIOCSTART: ::Ioctl = 0x2000746e;
173 pub const TIOCSTOP: ::Ioctl = 0x2000746f;
174 pub const BLKIOMIN: ::Ioctl = 0x20001278;
175 pub const BLKIOOPT: ::Ioctl = 0x20001279;
176 pub const BLKSSZGET: ::Ioctl = 0x20001268;
177 pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
178 
179 //pub const FIOASYNC: ::Ioctl = 0x4004667d;
180 //pub const FIOQSIZE: ::Ioctl = ;
181 //pub const TIOCGISO7816: ::Ioctl = 0x40285443;
182 //pub const TIOCSISO7816: ::Ioctl = 0xc0285444;
183 //pub const TIOCGRS485: ::Ioctl = 0x40205441;
184 //pub const TIOCSRS485: ::Ioctl = 0xc0205442;
185 
186 pub const TIOCM_LE: ::c_int = 0x001;
187 pub const TIOCM_DTR: ::c_int = 0x002;
188 pub const TIOCM_RTS: ::c_int = 0x004;
189 pub const TIOCM_ST: ::c_int = 0x008;
190 pub const TIOCM_SR: ::c_int = 0x010;
191 pub const TIOCM_CTS: ::c_int = 0x020;
192 pub const TIOCM_CAR: ::c_int = 0x040;
193 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
194 pub const TIOCM_RNG: ::c_int = 0x080;
195 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
196 pub const TIOCM_DSR: ::c_int = 0x100;
197 
198 pub const BOTHER: ::speed_t = 0x1000;
199 pub const IBSHIFT: ::tcflag_t = 16;
200 
201 // RLIMIT Constants
202 
203 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
204 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
205 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
206 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
207 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
208 pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
209 pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
210 pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
211 pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
212 pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
213 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
214 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
215 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
216 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
217 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
218 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
219 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
220 pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
221 #[allow(deprecated)]
222 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
223 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
224 
225 cfg_if! {
226     if #[cfg(target_arch = "sparc64")] {
227         pub const RLIM_INFINITY: ::rlim_t = !0;
228     } else if #[cfg(target_arch = "sparc")] {
229         pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
230     }
231 }
232 
233 cfg_if! {
234     // Those type are constructed using the _IOC macro
235     // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
236     // where D stands for direction (either None (00), Read (01) or Write (11))
237     // where S stands for size (int, long, struct...)
238     // where T stands for type ('f','v','X'...)
239     // where N stands for NR (NumbeR)
240     if #[cfg(target_arch = "sparc")] {
241         pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
242         pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
243         pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
244         pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
245         pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
246         pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
247         pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
248         pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
249     } else if #[cfg(target_arch = "sparc64")] {
250         pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
251         pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
252         pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
253         pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
254         pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
255         pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
256         pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
257         pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
258     }
259 }
260