]>
Commit | Line | Data |
---|---|---|
9cc50fc6 SL |
1 | pub type clock_t = i64; |
2 | pub type suseconds_t = i64; | |
3 | pub type dev_t = i32; | |
4 | pub type sigset_t = ::c_uint; | |
5 | pub type blksize_t = ::int32_t; | |
6 | pub type fsblkcnt_t = ::uint64_t; | |
7 | pub type fsfilcnt_t = ::uint64_t; | |
8 | pub type pthread_attr_t = *mut ::c_void; | |
9 | pub type pthread_mutex_t = *mut ::c_void; | |
10 | pub type pthread_mutexattr_t = *mut ::c_void; | |
11 | pub type pthread_cond_t = *mut ::c_void; | |
12 | pub type pthread_rwlock_t = *mut ::c_void; | |
13 | ||
92a42be0 | 14 | s! { |
9cc50fc6 SL |
15 | pub struct dirent { |
16 | pub d_fileno: ::ino_t, | |
17 | pub d_off: ::off_t, | |
18 | pub d_reclen: u16, | |
19 | pub d_type: u8, | |
20 | pub d_namlen: u8, | |
21 | __d_padding: [u8; 4], | |
22 | pub d_name: [::c_char; 256], | |
23 | } | |
24 | ||
92a42be0 SL |
25 | pub struct glob_t { |
26 | pub gl_pathc: ::c_int, | |
27 | __unused1: ::c_int, | |
28 | pub gl_offs: ::c_int, | |
29 | __unused2: ::c_int, | |
30 | pub gl_pathv: *mut *mut ::c_char, | |
31 | ||
32 | __unused3: *mut ::c_void, | |
33 | ||
34 | __unused4: *mut ::c_void, | |
35 | __unused5: *mut ::c_void, | |
36 | __unused6: *mut ::c_void, | |
37 | __unused7: *mut ::c_void, | |
38 | __unused8: *mut ::c_void, | |
39 | __unused9: *mut ::c_void, | |
40 | } | |
9cc50fc6 SL |
41 | |
42 | pub struct stat { | |
43 | pub st_mode: ::mode_t, | |
44 | pub st_dev: ::dev_t, | |
45 | pub st_ino: ::ino_t, | |
46 | pub st_nlink: ::nlink_t, | |
47 | pub st_uid: ::uid_t, | |
48 | pub st_gid: ::gid_t, | |
49 | pub st_rdev: ::dev_t, | |
50 | pub st_atime: ::time_t, | |
51 | pub st_atime_nsec: ::c_long, | |
52 | pub st_mtime: ::time_t, | |
53 | pub st_mtime_nsec: ::c_long, | |
54 | pub st_ctime: ::time_t, | |
55 | pub st_ctime_nsec: ::c_long, | |
56 | pub st_size: ::off_t, | |
57 | pub st_blocks: ::blkcnt_t, | |
58 | pub st_blksize: ::blksize_t, | |
59 | pub st_flags: ::uint32_t, | |
60 | pub st_gen: ::uint32_t, | |
61 | pub st_birthtime: ::time_t, | |
62 | pub st_birthtime_nsec: ::c_long, | |
63 | } | |
64 | ||
65 | pub struct statvfs { | |
66 | pub f_bsize: ::c_ulong, | |
67 | pub f_frsize: ::c_ulong, | |
68 | pub f_blocks: ::fsblkcnt_t, | |
69 | pub f_bfree: ::fsblkcnt_t, | |
70 | pub f_bavail: ::fsblkcnt_t, | |
71 | pub f_files: ::fsfilcnt_t, | |
72 | pub f_ffree: ::fsfilcnt_t, | |
73 | pub f_favail: ::fsfilcnt_t, | |
74 | pub f_fsid: ::c_ulong, | |
75 | pub f_flag: ::c_ulong, | |
76 | pub f_namemax: ::c_ulong, | |
77 | } | |
78 | ||
79 | pub struct addrinfo { | |
80 | pub ai_flags: ::c_int, | |
81 | pub ai_family: ::c_int, | |
82 | pub ai_socktype: ::c_int, | |
83 | pub ai_protocol: ::c_int, | |
84 | pub ai_addrlen: ::socklen_t, | |
85 | pub ai_addr: *mut ::sockaddr, | |
86 | pub ai_canonname: *mut ::c_char, | |
87 | pub ai_next: *mut ::addrinfo, | |
88 | } | |
89 | ||
90 | pub struct sockaddr_storage { | |
91 | pub ss_len: u8, | |
92 | pub ss_family: ::sa_family_t, | |
93 | __ss_pad1: [u8; 6], | |
94 | __ss_pad2: i64, | |
95 | __ss_pad3: [u8; 240], | |
96 | } | |
97 | ||
98 | pub struct siginfo_t { | |
99 | pub si_signo: ::c_int, | |
100 | pub si_code: ::c_int, | |
101 | pub si_errno: ::c_int, | |
102 | pub si_addr: *mut ::c_char, | |
103 | __pad: [u8; 108], | |
104 | } | |
105 | ||
106 | pub struct Dl_info { | |
107 | pub dli_fname: *const ::c_char, | |
108 | pub dli_fbase: *mut ::c_void, | |
109 | pub dli_sname: *const ::c_char, | |
110 | pub dli_saddr: *mut ::c_void, | |
111 | } | |
54a0048b SL |
112 | |
113 | pub struct lconv { | |
114 | pub decimal_point: *mut ::c_char, | |
115 | pub thousands_sep: *mut ::c_char, | |
116 | pub grouping: *mut ::c_char, | |
117 | pub int_curr_symbol: *mut ::c_char, | |
118 | pub currency_symbol: *mut ::c_char, | |
119 | pub mon_decimal_point: *mut ::c_char, | |
120 | pub mon_thousands_sep: *mut ::c_char, | |
121 | pub mon_grouping: *mut ::c_char, | |
122 | pub positive_sign: *mut ::c_char, | |
123 | pub negative_sign: *mut ::c_char, | |
124 | pub int_frac_digits: ::c_char, | |
125 | pub frac_digits: ::c_char, | |
126 | pub p_cs_precedes: ::c_char, | |
127 | pub p_sep_by_space: ::c_char, | |
128 | pub n_cs_precedes: ::c_char, | |
129 | pub n_sep_by_space: ::c_char, | |
130 | pub p_sign_posn: ::c_char, | |
131 | pub n_sign_posn: ::c_char, | |
132 | pub int_p_cs_precedes: ::c_char, | |
133 | pub int_p_sep_by_space: ::c_char, | |
134 | pub int_n_cs_precedes: ::c_char, | |
135 | pub int_n_sep_by_space: ::c_char, | |
136 | pub int_p_sign_posn: ::c_char, | |
137 | pub int_n_sign_posn: ::c_char, | |
138 | } | |
92a42be0 SL |
139 | } |
140 | ||
9cc50fc6 SL |
141 | pub const O_CLOEXEC: ::c_int = 0x10000; |
142 | ||
143 | pub const MS_SYNC : ::c_int = 0x0002; | |
144 | pub const MS_INVALIDATE : ::c_int = 0x0004; | |
145 | ||
146 | pub const PTHREAD_STACK_MIN : ::size_t = 2048; | |
147 | ||
148 | pub const ENOATTR : ::c_int = 83; | |
149 | pub const EILSEQ : ::c_int = 84; | |
150 | pub const EOVERFLOW : ::c_int = 87; | |
151 | pub const ECANCELED : ::c_int = 88; | |
152 | pub const EIDRM : ::c_int = 89; | |
153 | pub const ENOMSG : ::c_int = 90; | |
154 | pub const ENOTSUP : ::c_int = 91; | |
155 | pub const ELAST : ::c_int = 91; | |
156 | ||
157 | pub const F_DUPFD_CLOEXEC : ::c_int = 10; | |
158 | ||
159 | pub const RLIM_NLIMITS: ::c_int = 9; | |
160 | ||
161 | pub const SO_SNDTIMEO: ::c_int = 0x1005; | |
162 | pub const SO_RCVTIMEO: ::c_int = 0x1006; | |
163 | ||
7453a54e SL |
164 | pub const IPV6_JOIN_GROUP: ::c_int = 12; |
165 | pub const IPV6_LEAVE_GROUP: ::c_int = 13; | |
166 | ||
9cc50fc6 SL |
167 | pub const KERN_PROC : ::c_int = 66; |
168 | pub const O_DSYNC : ::c_int = 128; | |
169 | ||
170 | pub const MAP_RENAME : ::c_int = 0x0000; | |
171 | pub const MAP_NORESERVE : ::c_int = 0x0000; | |
172 | pub const MAP_HASSEMAPHORE : ::c_int = 0x0000; | |
173 | ||
174 | pub const EIPSEC : ::c_int = 82; | |
175 | pub const ENOMEDIUM : ::c_int = 85; | |
176 | pub const EMEDIUMTYPE : ::c_int = 86; | |
177 | ||
178 | pub const RUSAGE_THREAD: ::c_int = 1; | |
179 | ||
180 | pub const MAP_COPY : ::c_int = 0x0002; | |
181 | pub const MAP_NOEXTEND : ::c_int = 0x0000; | |
182 | ||
183 | pub const _SC_CLK_TCK : ::c_int = 3; | |
184 | pub const _SC_IOV_MAX : ::c_int = 51; | |
185 | pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100; | |
186 | pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101; | |
187 | pub const _SC_LOGIN_NAME_MAX : ::c_int = 102; | |
188 | pub const _SC_MQ_PRIO_MAX : ::c_int = 59; | |
7453a54e | 189 | pub const _SC_NPROCESSORS_ONLN : ::c_int = 503; |
9cc50fc6 SL |
190 | pub const _SC_THREADS : ::c_int = 91; |
191 | pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77; | |
192 | pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78; | |
193 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80; | |
194 | pub const _SC_THREAD_KEYS_MAX : ::c_int = 81; | |
195 | pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82; | |
196 | pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83; | |
197 | pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84; | |
198 | pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85; | |
199 | pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103; | |
200 | pub const _SC_THREAD_STACK_MIN : ::c_int = 89; | |
201 | pub const _SC_THREAD_THREADS_MAX : ::c_int = 90; | |
202 | pub const _SC_TTY_NAME_MAX : ::c_int = 107; | |
203 | pub const _SC_ATEXIT_MAX : ::c_int = 46; | |
204 | pub const _SC_AIO_LISTIO_MAX : ::c_int = 42; | |
205 | pub const _SC_AIO_MAX : ::c_int = 43; | |
206 | pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45; | |
207 | pub const _SC_MAPPED_FILES : ::c_int = 53; | |
208 | pub const _SC_MEMLOCK : ::c_int = 54; | |
209 | pub const _SC_MEMLOCK_RANGE : ::c_int = 55; | |
210 | pub const _SC_MEMORY_PROTECTION : ::c_int = 56; | |
211 | pub const _SC_MESSAGE_PASSING : ::c_int = 57; | |
212 | pub const _SC_MQ_OPEN_MAX : ::c_int = 58; | |
213 | pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61; | |
214 | pub const _SC_SEMAPHORES : ::c_int = 67; | |
215 | pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68; | |
216 | pub const _SC_SYNCHRONIZED_IO : ::c_int = 75; | |
217 | pub const _SC_TIMERS : ::c_int = 94; | |
218 | pub const _SC_XOPEN_CRYPT : ::c_int = 117; | |
219 | pub const _SC_XOPEN_ENH_I18N : ::c_int = 118; | |
220 | pub const _SC_XOPEN_LEGACY : ::c_int = 119; | |
221 | pub const _SC_XOPEN_REALTIME : ::c_int = 120; | |
222 | pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121; | |
223 | pub const _SC_XOPEN_UNIX : ::c_int = 123; | |
224 | pub const _SC_XOPEN_VERSION : ::c_int = 125; | |
225 | pub const _SC_SEM_NSEMS_MAX : ::c_int = 31; | |
226 | pub const _SC_SEM_VALUE_MAX : ::c_int = 32; | |
227 | pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44; | |
228 | pub const _SC_DELAYTIMER_MAX : ::c_int = 50; | |
229 | pub const _SC_PRIORITIZED_IO : ::c_int = 60; | |
230 | pub const _SC_REALTIME_SIGNALS : ::c_int = 64; | |
231 | pub const _SC_RTSIG_MAX : ::c_int = 66; | |
232 | pub const _SC_SIGQUEUE_MAX : ::c_int = 70; | |
233 | pub const _SC_TIMER_MAX : ::c_int = 93; | |
234 | ||
9cc50fc6 SL |
235 | pub const FD_SETSIZE: usize = 1024; |
236 | ||
237 | pub const ST_NOSUID: ::c_ulong = 2; | |
238 | ||
239 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; | |
240 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; | |
241 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; | |
242 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; | |
243 | ||
244 | pub const KERN_PROC_ARGS: ::c_int = 55; | |
245 | ||
246 | pub const TMP_MAX : ::c_uint = 0x7fffffff; | |
247 | ||
248 | pub const NI_MAXHOST: ::size_t = 256; | |
249 | ||
7453a54e SL |
250 | pub const RTLD_LOCAL: ::c_int = 0; |
251 | ||
92a42be0 | 252 | extern { |
9cc50fc6 SL |
253 | pub fn getnameinfo(sa: *const ::sockaddr, |
254 | salen: ::socklen_t, | |
255 | host: *mut ::c_char, | |
256 | hostlen: ::size_t, | |
257 | serv: *mut ::c_char, | |
258 | servlen: ::size_t, | |
259 | flags: ::c_int) -> ::c_int; | |
260 | pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) | |
261 | -> ::c_int; | |
54a0048b SL |
262 | pub fn pthread_main_np() -> ::c_int; |
263 | pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); | |
264 | pub fn pthread_stackseg_np(thread: ::pthread_t, | |
265 | sinfo: *mut ::stack_t) -> ::c_int; | |
9cc50fc6 SL |
266 | pub fn sysctl(name: *const ::c_int, |
267 | namelen: ::c_uint, | |
268 | oldp: *mut ::c_void, | |
269 | oldlenp: *mut ::size_t, | |
270 | newp: *mut ::c_void, | |
271 | newlen: ::size_t) | |
272 | -> ::c_int; | |
273 | pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; | |
274 | } |