]>
Commit | Line | Data |
---|---|---|
9e0c209e SL |
1 | pub type blkcnt_t = i64; |
2 | pub type blksize_t = i64; | |
3 | pub type c_char = i8; | |
4 | pub type c_long = i64; | |
5 | pub type c_ulong = u64; | |
9e0c209e SL |
6 | pub type ino_t = u64; |
7 | pub type nlink_t = u64; | |
8 | pub type off_t = i64; | |
9e0c209e SL |
9 | pub type suseconds_t = i64; |
10 | pub type time_t = i64; | |
11 | pub type wchar_t = i32; | |
041b39d2 | 12 | pub type clock_t = i64; |
3b2f2976 | 13 | pub type __u64 = ::c_ulong; |
9e0c209e SL |
14 | |
15 | s! { | |
476ff2be SL |
16 | pub struct aiocb { |
17 | pub aio_fildes: ::c_int, | |
18 | pub aio_lio_opcode: ::c_int, | |
19 | pub aio_reqprio: ::c_int, | |
20 | pub aio_buf: *mut ::c_void, | |
21 | pub aio_nbytes: ::size_t, | |
22 | pub aio_sigevent: ::sigevent, | |
23 | __next_prio: *mut aiocb, | |
24 | __abs_prio: ::c_int, | |
25 | __policy: ::c_int, | |
26 | __error_code: ::c_int, | |
27 | __return_value: ::ssize_t, | |
28 | pub aio_offset: off_t, | |
29 | __glibc_reserved: [::c_char; 32] | |
30 | } | |
31 | ||
9e0c209e SL |
32 | pub struct stat { |
33 | pub st_dev: ::c_ulong, | |
34 | st_pad1: [::c_long; 2], | |
35 | pub st_ino: ::ino_t, | |
36 | pub st_mode: ::mode_t, | |
37 | pub st_nlink: ::nlink_t, | |
38 | pub st_uid: ::uid_t, | |
39 | pub st_gid: ::gid_t, | |
40 | pub st_rdev: ::c_ulong, | |
41 | st_pad2: [::c_ulong; 1], | |
42 | pub st_size: ::off_t, | |
43 | st_pad3: ::c_long, | |
44 | pub st_atime: ::time_t, | |
45 | pub st_atime_nsec: ::c_long, | |
46 | pub st_mtime: ::time_t, | |
47 | pub st_mtime_nsec: ::c_long, | |
48 | pub st_ctime: ::time_t, | |
49 | pub st_ctime_nsec: ::c_long, | |
50 | pub st_blksize: ::blksize_t, | |
51 | st_pad4: ::c_long, | |
52 | pub st_blocks: ::blkcnt_t, | |
53 | st_pad5: [::c_long; 7], | |
54 | } | |
55 | ||
56 | pub struct stat64 { | |
57 | pub st_dev: ::c_ulong, | |
58 | st_pad1: [::c_long; 2], | |
59 | pub st_ino: ::ino64_t, | |
60 | pub st_mode: ::mode_t, | |
61 | pub st_nlink: ::nlink_t, | |
62 | pub st_uid: ::uid_t, | |
63 | pub st_gid: ::gid_t, | |
64 | pub st_rdev: ::c_ulong, | |
65 | st_pad2: [::c_long; 2], | |
66 | pub st_size: ::off64_t, | |
67 | pub st_atime: ::time_t, | |
68 | pub st_atime_nsec: ::c_long, | |
69 | pub st_mtime: ::time_t, | |
70 | pub st_mtime_nsec: ::c_long, | |
71 | pub st_ctime: ::time_t, | |
72 | pub st_ctime_nsec: ::c_long, | |
73 | pub st_blksize: ::blksize_t, | |
74 | st_pad3: ::c_long, | |
75 | pub st_blocks: ::blkcnt64_t, | |
76 | st_pad5: [::c_long; 7], | |
77 | } | |
78 | ||
3b2f2976 XL |
79 | pub struct statfs64 { |
80 | pub f_type: ::c_long, | |
81 | pub f_bsize: ::c_long, | |
82 | pub f_frsize: ::c_long, | |
83 | pub f_blocks: u64, | |
84 | pub f_bfree: u64, | |
85 | pub f_files: u64, | |
86 | pub f_ffree: u64, | |
87 | pub f_bavail: u64, | |
88 | pub f_fsid: ::fsid_t, | |
89 | pub f_namelen: ::c_long, | |
90 | pub f_flags: ::c_long, | |
91 | pub f_spare: [::c_long; 5], | |
92 | } | |
93 | ||
94 | pub struct statvfs64 { | |
95 | pub f_bsize: ::c_ulong, | |
96 | pub f_frsize: ::c_ulong, | |
97 | pub f_blocks: u64, | |
98 | pub f_bfree: u64, | |
99 | pub f_bavail: u64, | |
100 | pub f_files: u64, | |
101 | pub f_ffree: u64, | |
102 | pub f_favail: u64, | |
103 | pub f_fsid: ::c_ulong, | |
104 | pub f_flag: ::c_ulong, | |
105 | pub f_namemax: ::c_ulong, | |
106 | __f_spare: [::c_int; 6], | |
107 | } | |
108 | ||
9e0c209e SL |
109 | pub struct pthread_attr_t { |
110 | __size: [::c_ulong; 7] | |
111 | } | |
112 | ||
113 | pub struct sigaction { | |
114 | pub sa_flags: ::c_int, | |
115 | pub sa_sigaction: ::sighandler_t, | |
116 | pub sa_mask: sigset_t, | |
7cac9316 | 117 | pub sa_restorer: ::dox::Option<extern fn()>, |
9e0c209e SL |
118 | } |
119 | ||
120 | pub struct stack_t { | |
121 | pub ss_sp: *mut ::c_void, | |
122 | pub ss_size: ::size_t, | |
123 | pub ss_flags: ::c_int, | |
124 | } | |
125 | ||
126 | pub struct sigset_t { | |
127 | __size: [::c_ulong; 16], | |
128 | } | |
129 | ||
130 | pub struct siginfo_t { | |
131 | pub si_signo: ::c_int, | |
132 | pub si_code: ::c_int, | |
133 | pub si_errno: ::c_int, | |
134 | _pad: ::c_int, | |
135 | _pad2: [::c_long; 14], | |
136 | } | |
137 | ||
138 | pub struct ipc_perm { | |
139 | pub __key: ::key_t, | |
140 | pub uid: ::uid_t, | |
141 | pub gid: ::gid_t, | |
142 | pub cuid: ::uid_t, | |
143 | pub cgid: ::gid_t, | |
144 | pub mode: ::c_uint, | |
145 | pub __seq: ::c_ushort, | |
146 | __pad1: ::c_ushort, | |
147 | __unused1: ::c_ulong, | |
148 | __unused2: ::c_ulong | |
149 | } | |
150 | ||
151 | pub struct shmid_ds { | |
152 | pub shm_perm: ::ipc_perm, | |
153 | pub shm_segsz: ::size_t, | |
154 | pub shm_atime: ::time_t, | |
155 | pub shm_dtime: ::time_t, | |
156 | pub shm_ctime: ::time_t, | |
157 | pub shm_cpid: ::pid_t, | |
158 | pub shm_lpid: ::pid_t, | |
159 | pub shm_nattch: ::shmatt_t, | |
160 | __unused4: ::c_ulong, | |
161 | __unused5: ::c_ulong | |
162 | } | |
163 | ||
164 | pub struct msqid_ds { | |
165 | pub msg_perm: ::ipc_perm, | |
166 | pub msg_stime: ::time_t, | |
167 | pub msg_rtime: ::time_t, | |
168 | pub msg_ctime: ::time_t, | |
169 | __msg_cbytes: ::c_ulong, | |
170 | pub msg_qnum: ::msgqnum_t, | |
171 | pub msg_qbytes: ::msglen_t, | |
172 | pub msg_lspid: ::pid_t, | |
173 | pub msg_lrpid: ::pid_t, | |
174 | __glibc_reserved4: ::c_ulong, | |
175 | __glibc_reserved5: ::c_ulong, | |
176 | } | |
177 | ||
178 | pub struct statfs { | |
179 | pub f_type: ::c_long, | |
180 | pub f_bsize: ::c_long, | |
181 | pub f_frsize: ::c_long, | |
182 | pub f_blocks: ::fsblkcnt_t, | |
183 | pub f_bfree: ::fsblkcnt_t, | |
184 | pub f_files: ::fsblkcnt_t, | |
185 | pub f_ffree: ::fsblkcnt_t, | |
186 | pub f_bavail: ::fsblkcnt_t, | |
187 | pub f_fsid: ::fsid_t, | |
188 | ||
189 | pub f_namelen: ::c_long, | |
190 | f_spare: [::c_long; 6], | |
191 | } | |
192 | ||
193 | pub struct msghdr { | |
194 | pub msg_name: *mut ::c_void, | |
195 | pub msg_namelen: ::socklen_t, | |
196 | pub msg_iov: *mut ::iovec, | |
197 | pub msg_iovlen: ::size_t, | |
198 | pub msg_control: *mut ::c_void, | |
199 | pub msg_controllen: ::size_t, | |
200 | pub msg_flags: ::c_int, | |
201 | } | |
202 | ||
32a655c1 SL |
203 | pub struct cmsghdr { |
204 | pub cmsg_len: ::size_t, | |
205 | pub cmsg_level: ::c_int, | |
206 | pub cmsg_type: ::c_int, | |
207 | } | |
208 | ||
9e0c209e SL |
209 | pub struct termios { |
210 | pub c_iflag: ::tcflag_t, | |
211 | pub c_oflag: ::tcflag_t, | |
212 | pub c_cflag: ::tcflag_t, | |
213 | pub c_lflag: ::tcflag_t, | |
214 | pub c_line: ::cc_t, | |
215 | pub c_cc: [::cc_t; ::NCCS], | |
216 | } | |
217 | ||
041b39d2 XL |
218 | pub struct flock { |
219 | pub l_type: ::c_short, | |
220 | pub l_whence: ::c_short, | |
221 | pub l_start: ::off_t, | |
222 | pub l_len: ::off_t, | |
223 | pub l_pid: ::pid_t, | |
224 | } | |
225 | ||
9e0c209e SL |
226 | pub struct sysinfo { |
227 | pub uptime: ::c_long, | |
228 | pub loads: [::c_ulong; 3], | |
229 | pub totalram: ::c_ulong, | |
230 | pub freeram: ::c_ulong, | |
231 | pub sharedram: ::c_ulong, | |
232 | pub bufferram: ::c_ulong, | |
233 | pub totalswap: ::c_ulong, | |
234 | pub freeswap: ::c_ulong, | |
235 | pub procs: ::c_ushort, | |
236 | pub pad: ::c_ushort, | |
237 | pub totalhigh: ::c_ulong, | |
238 | pub freehigh: ::c_ulong, | |
239 | pub mem_unit: ::c_uint, | |
240 | pub _f: [::c_char; 0], | |
241 | } | |
9e0c209e SL |
242 | } |
243 | ||
244 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; | |
245 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; | |
246 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; | |
247 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; | |
3b2f2976 XL |
248 | pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; |
249 | ||
250 | pub const O_LARGEFILE: ::c_int = 0; | |
9e0c209e | 251 | |
476ff2be SL |
252 | pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff; |
253 | ||
3b2f2976 XL |
254 | // Valid for n64 |
255 | pub const SYS_pivot_root: ::c_long = 5151; | |
256 | pub const SYS_gettid: ::c_long = 5178; | |
257 | pub const SYS_memfd_create: ::c_long = 5314; |