]>
Commit | Line | Data |
---|---|---|
476ff2be SL |
1 | pub type c_char = i8; |
2 | pub type wchar_t = i32; | |
3 | pub type greg_t = i32; | |
4 | ||
5 | s! { | |
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 | ||
23 | pub struct mcontext_t { | |
24 | pub gregs: [greg_t; 19], | |
25 | pub fpregs: *mut _libc_fpstate, | |
26 | pub oldmask: ::c_ulong, | |
27 | pub cr2: ::c_ulong, | |
28 | } | |
29 | ||
30 | pub struct ucontext_t { | |
31 | pub uc_flags: ::c_ulong, | |
32 | pub uc_link: *mut ucontext_t, | |
33 | pub uc_stack: ::stack_t, | |
34 | pub uc_mcontext: mcontext_t, | |
35 | pub uc_sigmask: ::sigset_t, | |
36 | __private: [u8; 112], | |
37 | } | |
38 | ||
39 | pub struct ipc_perm { | |
40 | pub __key: ::key_t, | |
41 | pub uid: ::uid_t, | |
42 | pub gid: ::gid_t, | |
43 | pub cuid: ::uid_t, | |
44 | pub cgid: ::gid_t, | |
45 | pub mode: ::c_ushort, | |
46 | __pad1: ::c_ushort, | |
47 | pub __seq: ::c_ushort, | |
48 | __pad2: ::c_ushort, | |
49 | __unused1: ::c_ulong, | |
50 | __unused2: ::c_ulong | |
51 | } | |
52 | ||
53 | pub struct stat64 { | |
54 | pub st_dev: ::dev_t, | |
55 | __pad1: ::c_uint, | |
56 | __st_ino: ::ino_t, | |
57 | pub st_mode: ::mode_t, | |
58 | pub st_nlink: ::nlink_t, | |
59 | pub st_uid: ::uid_t, | |
60 | pub st_gid: ::gid_t, | |
61 | pub st_rdev: ::dev_t, | |
62 | __pad2: ::c_uint, | |
63 | pub st_size: ::off64_t, | |
64 | pub st_blksize: ::blksize_t, | |
65 | pub st_blocks: ::blkcnt64_t, | |
66 | pub st_atime: ::time_t, | |
67 | pub st_atime_nsec: ::c_long, | |
68 | pub st_mtime: ::time_t, | |
69 | pub st_mtime_nsec: ::c_long, | |
70 | pub st_ctime: ::time_t, | |
71 | pub st_ctime_nsec: ::c_long, | |
72 | pub st_ino: ::ino64_t, | |
73 | } | |
74 | ||
75 | pub struct shmid_ds { | |
76 | pub shm_perm: ::ipc_perm, | |
77 | pub shm_segsz: ::size_t, | |
78 | pub shm_atime: ::time_t, | |
79 | __unused1: ::c_ulong, | |
80 | pub shm_dtime: ::time_t, | |
81 | __unused2: ::c_ulong, | |
82 | pub shm_ctime: ::time_t, | |
83 | __unused3: ::c_ulong, | |
84 | pub shm_cpid: ::pid_t, | |
85 | pub shm_lpid: ::pid_t, | |
86 | pub shm_nattch: ::shmatt_t, | |
87 | __unused4: ::c_ulong, | |
88 | __unused5: ::c_ulong | |
89 | } | |
90 | ||
91 | pub struct msqid_ds { | |
92 | pub msg_perm: ::ipc_perm, | |
93 | pub msg_stime: ::time_t, | |
94 | __glibc_reserved1: ::c_ulong, | |
95 | pub msg_rtime: ::time_t, | |
96 | __glibc_reserved2: ::c_ulong, | |
97 | pub msg_ctime: ::time_t, | |
98 | __glibc_reserved3: ::c_ulong, | |
99 | __msg_cbytes: ::c_ulong, | |
100 | pub msg_qnum: ::msgqnum_t, | |
101 | pub msg_qbytes: ::msglen_t, | |
102 | pub msg_lspid: ::pid_t, | |
103 | pub msg_lrpid: ::pid_t, | |
104 | __glibc_reserved4: ::c_ulong, | |
105 | __glibc_reserved5: ::c_ulong, | |
106 | } | |
107 | } | |
108 | ||
109 | pub const O_DIRECT: ::c_int = 0x4000; | |
110 | pub const O_DIRECTORY: ::c_int = 0x10000; | |
111 | pub const O_NOFOLLOW: ::c_int = 0x20000; | |
112 | ||
113 | pub const MAP_LOCKED: ::c_int = 0x02000; | |
114 | pub const MAP_NORESERVE: ::c_int = 0x04000; | |
115 | pub const MAP_32BIT: ::c_int = 0x0040; | |
116 | ||
117 | pub const EDEADLOCK: ::c_int = 35; | |
118 | ||
119 | pub const SO_PEERCRED: ::c_int = 17; | |
120 | pub const SO_RCVLOWAT: ::c_int = 18; | |
121 | pub const SO_SNDLOWAT: ::c_int = 19; | |
122 | pub const SO_RCVTIMEO: ::c_int = 20; | |
123 | pub const SO_SNDTIMEO: ::c_int = 21; | |
124 | ||
125 | pub const FIOCLEX: ::c_ulong = 0x5451; | |
126 | pub const FIONBIO: ::c_ulong = 0x5421; | |
127 | ||
128 | pub const SYS_gettid: ::c_long = 224; | |
129 | pub const SYS_perf_event_open: ::c_long = 336; | |
130 | ||
131 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
132 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
133 | ||
134 | pub const MCL_CURRENT: ::c_int = 0x0001; | |
135 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
136 | ||
137 | pub const SIGSTKSZ: ::size_t = 8192; | |
138 | pub const CBAUD: ::tcflag_t = 0o0010017; | |
139 | pub const TAB1: ::c_int = 0x00000800; | |
140 | pub const TAB2: ::c_int = 0x00001000; | |
141 | pub const TAB3: ::c_int = 0x00001800; | |
142 | pub const CR1: ::c_int = 0x00000200; | |
143 | pub const CR2: ::c_int = 0x00000400; | |
144 | pub const CR3: ::c_int = 0x00000600; | |
145 | pub const FF1: ::c_int = 0x00008000; | |
146 | pub const BS1: ::c_int = 0x00002000; | |
147 | pub const VT1: ::c_int = 0x00004000; | |
148 | pub const VWERASE: usize = 14; | |
149 | pub const VREPRINT: usize = 12; | |
150 | pub const VSUSP: usize = 10; | |
151 | pub const VSTART: usize = 8; | |
152 | pub const VSTOP: usize = 9; | |
153 | pub const VDISCARD: usize = 13; | |
154 | pub const VTIME: usize = 5; | |
155 | pub const IXON: ::tcflag_t = 0x00000400; | |
156 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
157 | pub const ONLCR: ::tcflag_t = 0x4; | |
158 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
159 | pub const CS6: ::tcflag_t = 0x00000010; | |
160 | pub const CS7: ::tcflag_t = 0x00000020; | |
161 | pub const CS8: ::tcflag_t = 0x00000030; | |
162 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
163 | pub const CREAD: ::tcflag_t = 0x00000080; | |
164 | pub const PARENB: ::tcflag_t = 0x00000100; | |
165 | pub const PARODD: ::tcflag_t = 0x00000200; | |
166 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
167 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
168 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
169 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
170 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
171 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
172 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
173 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
174 | pub const ISIG: ::tcflag_t = 0x00000001; | |
175 | pub const ICANON: ::tcflag_t = 0x00000002; | |
176 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
177 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
178 | ||
179 | pub const VEOL: usize = 11; | |
180 | pub const VEOL2: usize = 16; | |
181 | pub const VMIN: usize = 6; | |
182 | pub const IEXTEN: ::tcflag_t = 0x00008000; | |
183 | pub const TOSTOP: ::tcflag_t = 0x00000100; | |
184 | pub const FLUSHO: ::tcflag_t = 0x00001000; | |
185 | pub const EXTPROC: ::tcflag_t = 0x00010000; | |
186 | pub const TCGETS: ::c_ulong = 0x5401; | |
187 | pub const TCSETS: ::c_ulong = 0x5402; | |
188 | pub const TCSETSW: ::c_ulong = 0x5403; | |
189 | pub const TCSETSF: ::c_ulong = 0x5404; | |
190 | pub const TCGETA: ::c_ulong = 0x5405; | |
191 | pub const TCSETA: ::c_ulong = 0x5406; | |
192 | pub const TCSETAW: ::c_ulong = 0x5407; | |
193 | pub const TCSETAF: ::c_ulong = 0x5408; | |
194 | pub const TCSBRK: ::c_ulong = 0x5409; | |
195 | pub const TCXONC: ::c_ulong = 0x540A; | |
196 | pub const TCFLSH: ::c_ulong = 0x540B; | |
197 | pub const TIOCINQ: ::c_ulong = 0x541B; | |
198 | pub const TIOCGPGRP: ::c_ulong = 0x540F; | |
199 | pub const TIOCSPGRP: ::c_ulong = 0x5410; | |
200 | pub const TIOCOUTQ: ::c_ulong = 0x5411; | |
201 | pub const TIOCGWINSZ: ::c_ulong = 0x5413; | |
202 | pub const TIOCSWINSZ: ::c_ulong = 0x5414; | |
203 | pub const FIONREAD: ::c_ulong = 0x541B; | |
204 | ||
205 | extern { | |
206 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; | |
207 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; | |
208 | pub fn makecontext(ucp: *mut ucontext_t, | |
209 | func: extern fn (), | |
210 | argc: ::c_int, ...); | |
211 | pub fn swapcontext(uocp: *mut ucontext_t, | |
212 | ucp: *const ucontext_t) -> ::c_int; | |
213 | } |