]>
Commit | Line | Data |
---|---|---|
92a42be0 SL |
1 | pub type c_char = i8; |
2 | pub type wchar_t = i32; | |
a7813a04 | 3 | pub type greg_t = i32; |
9cc50fc6 | 4 | |
54a0048b | 5 | s! { |
a7813a04 XL |
6 | pub struct _libc_fpreg { |
7 | pub significand: [u16; 4], | |
8 | pub exponent: u16, | |
9 | } | |
10 | ||
11 | pub struct _libc_fpstate { | |
12 | pub cw: ::c_ulong, | |
13 | pub sw: ::c_ulong, | |
14 | pub tag: ::c_ulong, | |
15 | pub ipoff: ::c_ulong, | |
16 | pub cssel: ::c_ulong, | |
17 | pub dataoff: ::c_ulong, | |
18 | pub datasel: ::c_ulong, | |
19 | pub _st: [_libc_fpreg; 8], | |
20 | pub status: ::c_ulong, | |
21 | } | |
22 | ||
041b39d2 XL |
23 | pub struct user_fpregs_struct { |
24 | pub cwd: ::c_long, | |
25 | pub swd: ::c_long, | |
26 | pub twd: ::c_long, | |
27 | pub fip: ::c_long, | |
28 | pub fcs: ::c_long, | |
29 | pub foo: ::c_long, | |
30 | pub fos: ::c_long, | |
31 | pub st_space: [::c_long; 20], | |
32 | } | |
33 | ||
34 | pub struct user_fpxregs_struct { | |
35 | pub cwd: ::c_ushort, | |
36 | pub swd: ::c_ushort, | |
37 | pub twd: ::c_ushort, | |
38 | pub fop: ::c_ushort, | |
39 | pub fip: ::c_long, | |
40 | pub fcs: ::c_long, | |
41 | pub foo: ::c_long, | |
42 | pub fos: ::c_long, | |
43 | pub mxcsr: ::c_long, | |
44 | __reserved: ::c_long, | |
45 | pub st_space: [::c_long; 32], | |
46 | pub xmm_space: [::c_long; 32], | |
47 | padding: [::c_long; 56], | |
48 | } | |
49 | ||
50 | pub struct user_regs_struct { | |
51 | pub ebx: ::c_long, | |
52 | pub ecx: ::c_long, | |
53 | pub edx: ::c_long, | |
54 | pub esi: ::c_long, | |
55 | pub edi: ::c_long, | |
56 | pub ebp: ::c_long, | |
57 | pub eax: ::c_long, | |
58 | pub xds: ::c_long, | |
59 | pub xes: ::c_long, | |
60 | pub xfs: ::c_long, | |
61 | pub xgs: ::c_long, | |
62 | pub orig_eax: ::c_long, | |
63 | pub eip: ::c_long, | |
64 | pub xcs: ::c_long, | |
65 | pub eflags: ::c_long, | |
66 | pub esp: ::c_long, | |
67 | pub xss: ::c_long, | |
68 | } | |
69 | ||
70 | pub struct user { | |
71 | pub regs: user_regs_struct, | |
72 | pub u_fpvalid: ::c_int, | |
73 | pub i387: user_fpregs_struct, | |
74 | pub u_tsize: ::c_ulong, | |
75 | pub u_dsize: ::c_ulong, | |
76 | pub u_ssize: ::c_ulong, | |
77 | pub start_code: ::c_ulong, | |
78 | pub start_stack: ::c_ulong, | |
79 | pub signal: ::c_long, | |
80 | __reserved: ::c_int, | |
81 | pub u_ar0: *mut user_regs_struct, | |
82 | pub u_fpstate: *mut user_fpregs_struct, | |
83 | pub magic: ::c_ulong, | |
84 | pub u_comm: [c_char; 32], | |
85 | pub u_debugreg: [::c_int; 8], | |
86 | } | |
87 | ||
54a0048b | 88 | pub struct mcontext_t { |
a7813a04 XL |
89 | pub gregs: [greg_t; 19], |
90 | pub fpregs: *mut _libc_fpstate, | |
91 | pub oldmask: ::c_ulong, | |
92 | pub cr2: ::c_ulong, | |
54a0048b SL |
93 | } |
94 | ||
95 | pub struct ucontext_t { | |
96 | pub uc_flags: ::c_ulong, | |
97 | pub uc_link: *mut ucontext_t, | |
98 | pub uc_stack: ::stack_t, | |
99 | pub uc_mcontext: mcontext_t, | |
100 | pub uc_sigmask: ::sigset_t, | |
101 | __private: [u8; 112], | |
102 | } | |
9e0c209e SL |
103 | |
104 | pub struct ipc_perm { | |
105 | pub __key: ::key_t, | |
106 | pub uid: ::uid_t, | |
107 | pub gid: ::gid_t, | |
108 | pub cuid: ::uid_t, | |
109 | pub cgid: ::gid_t, | |
110 | pub mode: ::c_ushort, | |
111 | __pad1: ::c_ushort, | |
112 | pub __seq: ::c_ushort, | |
113 | __pad2: ::c_ushort, | |
114 | __unused1: ::c_ulong, | |
115 | __unused2: ::c_ulong | |
116 | } | |
117 | ||
118 | pub struct stat64 { | |
119 | pub st_dev: ::dev_t, | |
120 | __pad1: ::c_uint, | |
121 | __st_ino: ::ino_t, | |
122 | pub st_mode: ::mode_t, | |
123 | pub st_nlink: ::nlink_t, | |
124 | pub st_uid: ::uid_t, | |
125 | pub st_gid: ::gid_t, | |
126 | pub st_rdev: ::dev_t, | |
127 | __pad2: ::c_uint, | |
128 | pub st_size: ::off64_t, | |
129 | pub st_blksize: ::blksize_t, | |
130 | pub st_blocks: ::blkcnt64_t, | |
131 | pub st_atime: ::time_t, | |
132 | pub st_atime_nsec: ::c_long, | |
133 | pub st_mtime: ::time_t, | |
134 | pub st_mtime_nsec: ::c_long, | |
135 | pub st_ctime: ::time_t, | |
136 | pub st_ctime_nsec: ::c_long, | |
137 | pub st_ino: ::ino64_t, | |
138 | } | |
139 | ||
140 | pub struct shmid_ds { | |
141 | pub shm_perm: ::ipc_perm, | |
142 | pub shm_segsz: ::size_t, | |
143 | pub shm_atime: ::time_t, | |
144 | __unused1: ::c_ulong, | |
145 | pub shm_dtime: ::time_t, | |
146 | __unused2: ::c_ulong, | |
147 | pub shm_ctime: ::time_t, | |
148 | __unused3: ::c_ulong, | |
149 | pub shm_cpid: ::pid_t, | |
150 | pub shm_lpid: ::pid_t, | |
151 | pub shm_nattch: ::shmatt_t, | |
152 | __unused4: ::c_ulong, | |
153 | __unused5: ::c_ulong | |
154 | } | |
155 | ||
156 | pub struct msqid_ds { | |
157 | pub msg_perm: ::ipc_perm, | |
158 | pub msg_stime: ::time_t, | |
159 | __glibc_reserved1: ::c_ulong, | |
160 | pub msg_rtime: ::time_t, | |
161 | __glibc_reserved2: ::c_ulong, | |
162 | pub msg_ctime: ::time_t, | |
163 | __glibc_reserved3: ::c_ulong, | |
164 | __msg_cbytes: ::c_ulong, | |
165 | pub msg_qnum: ::msgqnum_t, | |
166 | pub msg_qbytes: ::msglen_t, | |
167 | pub msg_lspid: ::pid_t, | |
168 | pub msg_lrpid: ::pid_t, | |
169 | __glibc_reserved4: ::c_ulong, | |
170 | __glibc_reserved5: ::c_ulong, | |
171 | } | |
54a0048b SL |
172 | } |
173 | ||
9cc50fc6 SL |
174 | pub const O_DIRECT: ::c_int = 0x4000; |
175 | pub const O_DIRECTORY: ::c_int = 0x10000; | |
176 | pub const O_NOFOLLOW: ::c_int = 0x20000; | |
177 | ||
178 | pub const MAP_LOCKED: ::c_int = 0x02000; | |
179 | pub const MAP_NORESERVE: ::c_int = 0x04000; | |
54a0048b | 180 | pub const MAP_32BIT: ::c_int = 0x0040; |
9cc50fc6 SL |
181 | |
182 | pub const EDEADLOCK: ::c_int = 35; | |
183 | ||
cc61c64b XL |
184 | pub const SO_SNDBUFFORCE: ::c_int = 32; |
185 | pub const SO_RCVBUFFORCE: ::c_int = 33; | |
186 | pub const SO_NO_CHECK: ::c_int = 11; | |
187 | pub const SO_PRIORITY: ::c_int = 12; | |
188 | pub const SO_BSDCOMPAT: ::c_int = 14; | |
189 | pub const SO_PASSCRED: ::c_int = 16; | |
9cc50fc6 SL |
190 | pub const SO_PEERCRED: ::c_int = 17; |
191 | pub const SO_RCVLOWAT: ::c_int = 18; | |
192 | pub const SO_SNDLOWAT: ::c_int = 19; | |
193 | pub const SO_RCVTIMEO: ::c_int = 20; | |
194 | pub const SO_SNDTIMEO: ::c_int = 21; | |
195 | ||
196 | pub const FIOCLEX: ::c_ulong = 0x5451; | |
197 | pub const FIONBIO: ::c_ulong = 0x5421; | |
54a0048b SL |
198 | |
199 | pub const SYS_gettid: ::c_long = 224; | |
200 | pub const SYS_perf_event_open: ::c_long = 336; | |
201 | ||
9e0c209e SL |
202 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; |
203 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
204 | ||
205 | pub const MCL_CURRENT: ::c_int = 0x0001; | |
206 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
207 | ||
208 | pub const SIGSTKSZ: ::size_t = 8192; | |
7cac9316 | 209 | pub const MINSIGSTKSZ: ::size_t = 2048; |
9e0c209e SL |
210 | pub const CBAUD: ::tcflag_t = 0o0010017; |
211 | pub const TAB1: ::c_int = 0x00000800; | |
212 | pub const TAB2: ::c_int = 0x00001000; | |
213 | pub const TAB3: ::c_int = 0x00001800; | |
214 | pub const CR1: ::c_int = 0x00000200; | |
215 | pub const CR2: ::c_int = 0x00000400; | |
216 | pub const CR3: ::c_int = 0x00000600; | |
217 | pub const FF1: ::c_int = 0x00008000; | |
218 | pub const BS1: ::c_int = 0x00002000; | |
219 | pub const VT1: ::c_int = 0x00004000; | |
220 | pub const VWERASE: usize = 14; | |
221 | pub const VREPRINT: usize = 12; | |
222 | pub const VSUSP: usize = 10; | |
223 | pub const VSTART: usize = 8; | |
224 | pub const VSTOP: usize = 9; | |
225 | pub const VDISCARD: usize = 13; | |
226 | pub const VTIME: usize = 5; | |
227 | pub const IXON: ::tcflag_t = 0x00000400; | |
228 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
229 | pub const ONLCR: ::tcflag_t = 0x4; | |
230 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
231 | pub const CS6: ::tcflag_t = 0x00000010; | |
232 | pub const CS7: ::tcflag_t = 0x00000020; | |
233 | pub const CS8: ::tcflag_t = 0x00000030; | |
234 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
235 | pub const CREAD: ::tcflag_t = 0x00000080; | |
236 | pub const PARENB: ::tcflag_t = 0x00000100; | |
237 | pub const PARODD: ::tcflag_t = 0x00000200; | |
238 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
239 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
240 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
241 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
242 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
243 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
244 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
245 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
246 | pub const ISIG: ::tcflag_t = 0x00000001; | |
247 | pub const ICANON: ::tcflag_t = 0x00000002; | |
248 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
249 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
250 | ||
cc61c64b XL |
251 | pub const B0: ::speed_t = 0o000000; |
252 | pub const B50: ::speed_t = 0o000001; | |
253 | pub const B75: ::speed_t = 0o000002; | |
254 | pub const B110: ::speed_t = 0o000003; | |
255 | pub const B134: ::speed_t = 0o000004; | |
256 | pub const B150: ::speed_t = 0o000005; | |
257 | pub const B200: ::speed_t = 0o000006; | |
258 | pub const B300: ::speed_t = 0o000007; | |
259 | pub const B600: ::speed_t = 0o000010; | |
260 | pub const B1200: ::speed_t = 0o000011; | |
261 | pub const B1800: ::speed_t = 0o000012; | |
262 | pub const B2400: ::speed_t = 0o000013; | |
263 | pub const B4800: ::speed_t = 0o000014; | |
264 | pub const B9600: ::speed_t = 0o000015; | |
265 | pub const B19200: ::speed_t = 0o000016; | |
266 | pub const B38400: ::speed_t = 0o000017; | |
267 | pub const EXTA: ::speed_t = B19200; | |
268 | pub const EXTB: ::speed_t = B38400; | |
269 | pub const B57600: ::speed_t = 0o010001; | |
270 | pub const B115200: ::speed_t = 0o010002; | |
271 | pub const B230400: ::speed_t = 0o010003; | |
272 | pub const B460800: ::speed_t = 0o010004; | |
273 | pub const B500000: ::speed_t = 0o010005; | |
274 | pub const B576000: ::speed_t = 0o010006; | |
275 | pub const B921600: ::speed_t = 0o010007; | |
276 | pub const B1000000: ::speed_t = 0o010010; | |
277 | pub const B1152000: ::speed_t = 0o010011; | |
278 | pub const B1500000: ::speed_t = 0o010012; | |
279 | pub const B2000000: ::speed_t = 0o010013; | |
280 | pub const B2500000: ::speed_t = 0o010014; | |
281 | pub const B3000000: ::speed_t = 0o010015; | |
282 | pub const B3500000: ::speed_t = 0o010016; | |
283 | pub const B4000000: ::speed_t = 0o010017; | |
284 | ||
9e0c209e SL |
285 | pub const VEOL: usize = 11; |
286 | pub const VEOL2: usize = 16; | |
287 | pub const VMIN: usize = 6; | |
288 | pub const IEXTEN: ::tcflag_t = 0x00008000; | |
289 | pub const TOSTOP: ::tcflag_t = 0x00000100; | |
290 | pub const FLUSHO: ::tcflag_t = 0x00001000; | |
291 | pub const EXTPROC: ::tcflag_t = 0x00010000; | |
292 | pub const TCGETS: ::c_ulong = 0x5401; | |
293 | pub const TCSETS: ::c_ulong = 0x5402; | |
294 | pub const TCSETSW: ::c_ulong = 0x5403; | |
295 | pub const TCSETSF: ::c_ulong = 0x5404; | |
296 | pub const TCGETA: ::c_ulong = 0x5405; | |
297 | pub const TCSETA: ::c_ulong = 0x5406; | |
298 | pub const TCSETAW: ::c_ulong = 0x5407; | |
299 | pub const TCSETAF: ::c_ulong = 0x5408; | |
300 | pub const TCSBRK: ::c_ulong = 0x5409; | |
301 | pub const TCXONC: ::c_ulong = 0x540A; | |
302 | pub const TCFLSH: ::c_ulong = 0x540B; | |
303 | pub const TIOCINQ: ::c_ulong = 0x541B; | |
304 | pub const TIOCGPGRP: ::c_ulong = 0x540F; | |
305 | pub const TIOCSPGRP: ::c_ulong = 0x5410; | |
306 | pub const TIOCOUTQ: ::c_ulong = 0x5411; | |
307 | pub const TIOCGWINSZ: ::c_ulong = 0x5413; | |
308 | pub const TIOCSWINSZ: ::c_ulong = 0x5414; | |
309 | pub const FIONREAD: ::c_ulong = 0x541B; | |
310 | ||
54a0048b SL |
311 | extern { |
312 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; | |
313 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; | |
314 | pub fn makecontext(ucp: *mut ucontext_t, | |
315 | func: extern fn (), | |
316 | argc: ::c_int, ...); | |
317 | pub fn swapcontext(uocp: *mut ucontext_t, | |
318 | ucp: *const ucontext_t) -> ::c_int; | |
319 | } |