]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/bsd/openbsdlike/bitrig.rs
Imported Upstream version 1.11.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / openbsdlike / bitrig.rs
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 = ::uint32_t;
6 pub type fsblkcnt_t = ::c_uint;
7 pub type fsfilcnt_t = ::c_uint;
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
14 s! {
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
25 pub struct glob_t {
26 pub gl_pathc: ::c_int,
27 pub gl_matchc: ::c_int,
28 pub gl_offs: ::c_int,
29 pub gl_flags: ::c_int,
30 pub gl_pathv: *mut *mut ::c_char,
31 __unused1: *mut ::c_void,
32 __unused2: *mut ::c_void,
33 __unused3: *mut ::c_void,
34 __unused4: *mut ::c_void,
35 __unused5: *mut ::c_void,
36 __unused6: *mut ::c_void,
37 __unused7: *mut ::c_void,
38 }
39
40 pub struct stat {
41 pub st_mode: ::mode_t,
42 pub st_dev: ::dev_t,
43 pub st_ino: ::ino_t,
44 pub st_nlink: ::nlink_t,
45 pub st_uid: ::uid_t,
46 pub st_gid: ::gid_t,
47 pub st_rdev: ::dev_t,
48 pub st_atime: ::time_t,
49 pub st_atime_nsec: ::c_long,
50 pub st_mtime: ::time_t,
51 pub st_mtime_nsec: ::c_long,
52 pub st_ctime: ::time_t,
53 pub st_ctime_nsec: ::c_long,
54 pub st_size: ::off_t,
55 pub st_blocks: ::blkcnt_t,
56 pub st_blksize: ::blksize_t,
57 pub st_flags: ::uint32_t,
58 pub st_gen: ::uint32_t,
59 pub st_birthtime: ::time_t,
60 pub st_birthtime_nsec: ::c_long,
61 }
62
63 pub struct statvfs {
64 pub f_bsize: ::c_ulong,
65 pub f_frsize: ::c_ulong,
66 pub f_blocks: ::fsblkcnt_t,
67 pub f_bfree: ::fsblkcnt_t,
68 pub f_bavail: ::fsblkcnt_t,
69 pub f_files: ::fsfilcnt_t,
70 pub f_ffree: ::fsfilcnt_t,
71 pub f_favail: ::fsfilcnt_t,
72 pub f_fsid: ::c_ulong,
73 pub f_flag: ::c_ulong,
74 pub f_namemax: ::c_ulong,
75 }
76
77 pub struct addrinfo {
78 pub ai_flags: ::c_int,
79 pub ai_family: ::c_int,
80 pub ai_socktype: ::c_int,
81 pub ai_protocol: ::c_int,
82 pub ai_addrlen: ::socklen_t,
83 pub ai_addr: *mut ::sockaddr,
84 pub ai_canonname: *mut ::c_char,
85 pub ai_next: *mut ::addrinfo,
86 }
87
88 pub struct sockaddr_storage {
89 pub ss_len: u8,
90 pub ss_family: ::sa_family_t,
91 __ss_pad1: [u8; 6],
92 __ss_pad2: i64,
93 __ss_pad3: [u8; 240],
94 }
95
96 pub struct siginfo_t {
97 pub si_signo: ::c_int,
98 pub si_code: ::c_int,
99 pub si_errno: ::c_int,
100 pub si_addr: *mut ::c_void
101 }
102
103 pub struct Dl_info {
104 pub dli_fname: *const ::c_char,
105 pub dli_fbase: *mut ::c_void,
106 pub dli_sname: *const ::c_char,
107 pub dli_saddr: *mut ::c_void,
108 }
109
110 pub struct lconv {
111 pub decimal_point: *mut ::c_char,
112 pub thousands_sep: *mut ::c_char,
113 pub grouping: *mut ::c_char,
114 pub int_curr_symbol: *mut ::c_char,
115 pub currency_symbol: *mut ::c_char,
116 pub mon_decimal_point: *mut ::c_char,
117 pub mon_thousands_sep: *mut ::c_char,
118 pub mon_grouping: *mut ::c_char,
119 pub positive_sign: *mut ::c_char,
120 pub negative_sign: *mut ::c_char,
121 pub int_frac_digits: ::c_char,
122 pub frac_digits: ::c_char,
123 pub p_cs_precedes: ::c_char,
124 pub p_sep_by_space: ::c_char,
125 pub n_cs_precedes: ::c_char,
126 pub n_sep_by_space: ::c_char,
127 pub p_sign_posn: ::c_char,
128 pub n_sign_posn: ::c_char,
129 pub int_p_cs_precedes: ::c_char,
130 pub int_n_cs_precedes: ::c_char,
131 pub int_p_sep_by_space: ::c_char,
132 pub int_n_sep_by_space: ::c_char,
133 pub int_p_sign_posn: ::c_char,
134 pub int_n_sign_posn: ::c_char,
135 }
136 }
137
138 pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
139 pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
140 pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
141 pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
142 pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
143 pub const LC_TIME_MASK: ::c_int = (1 << 5);
144 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
145 | LC_CTYPE_MASK
146 | LC_MESSAGES_MASK
147 | LC_MONETARY_MASK
148 | LC_NUMERIC_MASK
149 | LC_TIME_MASK;
150
151 pub const ERA: ::nl_item = 52;
152 pub const ERA_D_FMT: ::nl_item = 53;
153 pub const ERA_D_T_FMT: ::nl_item = 54;
154 pub const ERA_T_FMT: ::nl_item = 55;
155 pub const ALT_DIGITS: ::nl_item = 56;
156
157 pub const D_MD_ORDER: ::nl_item = 57;
158
159 pub const ALTMON_1: ::nl_item = 58;
160 pub const ALTMON_2: ::nl_item = 59;
161 pub const ALTMON_3: ::nl_item = 60;
162 pub const ALTMON_4: ::nl_item = 61;
163 pub const ALTMON_5: ::nl_item = 62;
164 pub const ALTMON_6: ::nl_item = 63;
165 pub const ALTMON_7: ::nl_item = 64;
166 pub const ALTMON_8: ::nl_item = 65;
167 pub const ALTMON_9: ::nl_item = 66;
168 pub const ALTMON_10: ::nl_item = 67;
169 pub const ALTMON_11: ::nl_item = 68;
170 pub const ALTMON_12: ::nl_item = 69;
171
172 pub const O_CLOEXEC: ::c_int = 0x10000;
173
174 pub const MS_SYNC : ::c_int = 0x0002;
175 pub const MS_INVALIDATE : ::c_int = 0x0004;
176
177 pub const PTHREAD_STACK_MIN : ::size_t = 2048;
178
179 pub const ENOATTR : ::c_int = 83;
180 pub const EILSEQ : ::c_int = 84;
181 pub const EOVERFLOW : ::c_int = 87;
182 pub const ECANCELED : ::c_int = 88;
183 pub const EIDRM : ::c_int = 89;
184 pub const ENOMSG : ::c_int = 90;
185 pub const ENOTSUP : ::c_int = 91;
186 pub const ELAST : ::c_int = 91;
187
188 pub const F_DUPFD_CLOEXEC : ::c_int = 10;
189
190 pub const RLIM_NLIMITS: ::c_int = 9;
191
192 pub const SO_SNDTIMEO: ::c_int = 0x1005;
193 pub const SO_RCVTIMEO: ::c_int = 0x1006;
194
195 pub const O_DSYNC : ::c_int = 128;
196
197 pub const MAP_RENAME : ::c_int = 0x0000;
198 pub const MAP_NORESERVE : ::c_int = 0x0000;
199 pub const MAP_HASSEMAPHORE : ::c_int = 0x0000;
200
201 pub const EIPSEC : ::c_int = 82;
202 pub const ENOMEDIUM : ::c_int = 85;
203 pub const EMEDIUMTYPE : ::c_int = 86;
204
205 pub const RUSAGE_THREAD: ::c_int = 1;
206
207 pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12;
208 pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13;
209
210 pub const MAP_COPY : ::c_int = 0x0002;
211 pub const MAP_NOEXTEND : ::c_int = 0x0000;
212
213 pub const _SC_IOV_MAX : ::c_int = 51;
214 pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100;
215 pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101;
216 pub const _SC_LOGIN_NAME_MAX : ::c_int = 102;
217 pub const _SC_MQ_PRIO_MAX : ::c_int = 59;
218 pub const _SC_NPROCESSORS_ONLN : ::c_int = 503;
219 pub const _SC_THREADS : ::c_int = 91;
220 pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77;
221 pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78;
222 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80;
223 pub const _SC_THREAD_KEYS_MAX : ::c_int = 81;
224 pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82;
225 pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83;
226 pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84;
227 pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85;
228 pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103;
229 pub const _SC_THREAD_STACK_MIN : ::c_int = 89;
230 pub const _SC_THREAD_THREADS_MAX : ::c_int = 90;
231 pub const _SC_TTY_NAME_MAX : ::c_int = 107;
232 pub const _SC_ATEXIT_MAX : ::c_int = 46;
233 pub const _SC_CLK_TCK : ::c_int = 3;
234 pub const _SC_AIO_LISTIO_MAX : ::c_int = 42;
235 pub const _SC_AIO_MAX : ::c_int = 43;
236 pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45;
237 pub const _SC_MAPPED_FILES : ::c_int = 53;
238 pub const _SC_MEMLOCK : ::c_int = 54;
239 pub const _SC_MEMLOCK_RANGE : ::c_int = 55;
240 pub const _SC_MEMORY_PROTECTION : ::c_int = 56;
241 pub const _SC_MESSAGE_PASSING : ::c_int = 57;
242 pub const _SC_MQ_OPEN_MAX : ::c_int = 58;
243 pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61;
244 pub const _SC_SEMAPHORES : ::c_int = 67;
245 pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68;
246 pub const _SC_SYNCHRONIZED_IO : ::c_int = 75;
247 pub const _SC_TIMERS : ::c_int = 94;
248 pub const _SC_XOPEN_CRYPT : ::c_int = 117;
249 pub const _SC_XOPEN_ENH_I18N : ::c_int = 118;
250 pub const _SC_XOPEN_LEGACY : ::c_int = 119;
251 pub const _SC_XOPEN_REALTIME : ::c_int = 120;
252 pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121;
253 pub const _SC_XOPEN_UNIX : ::c_int = 123;
254 pub const _SC_XOPEN_VERSION : ::c_int = 125;
255 pub const _SC_SEM_NSEMS_MAX : ::c_int = 31;
256 pub const _SC_SEM_VALUE_MAX : ::c_int = 32;
257 pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44;
258 pub const _SC_DELAYTIMER_MAX : ::c_int = 50;
259 pub const _SC_PRIORITIZED_IO : ::c_int = 60;
260 pub const _SC_REALTIME_SIGNALS : ::c_int = 64;
261 pub const _SC_RTSIG_MAX : ::c_int = 66;
262 pub const _SC_SIGQUEUE_MAX : ::c_int = 70;
263 pub const _SC_TIMER_MAX : ::c_int = 93;
264 pub const _SC_HOST_NAME_MAX: ::c_int = 33;
265
266 pub const FD_SETSIZE: usize = 1024;
267
268 pub const ST_NOSUID: ::c_ulong = 2;
269
270 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
271 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
272 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
273
274 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
275 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
276 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
277 pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
278 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
279
280 pub const TMP_MAX : ::c_uint = 0x7fffffff;
281
282 pub const NI_MAXHOST: ::size_t = 256;
283
284 pub const CTL_MAXNAME: ::c_int = 12;
285 pub const CTLTYPE_NODE: ::c_int = 1;
286 pub const CTLTYPE_INT: ::c_int = 2;
287 pub const CTLTYPE_STRING: ::c_int = 3;
288 pub const CTLTYPE_QUAD: ::c_int = 4;
289 pub const CTLTYPE_STRUCT: ::c_int = 5;
290 pub const CTL_UNSPEC: ::c_int = 0;
291 pub const CTL_KERN: ::c_int = 1;
292 pub const CTL_VM: ::c_int = 2;
293 pub const CTL_FS: ::c_int = 3;
294 pub const CTL_NET: ::c_int = 4;
295 pub const CTL_DEBUG: ::c_int = 5;
296 pub const CTL_HW: ::c_int = 6;
297 pub const CTL_MACHDEP: ::c_int = 7;
298 pub const CTL_DDB: ::c_int = 9;
299 pub const CTL_VFS: ::c_int = 10;
300 pub const CTL_MAXID: ::c_int = 11;
301 pub const KERN_OSTYPE: ::c_int = 1;
302 pub const KERN_OSRELEASE: ::c_int = 2;
303 pub const KERN_OSREV: ::c_int = 3;
304 pub const KERN_VERSION: ::c_int = 4;
305 pub const KERN_MAXVNODES: ::c_int = 5;
306 pub const KERN_MAXPROC: ::c_int = 6;
307 pub const KERN_MAXFILES: ::c_int = 7;
308 pub const KERN_ARGMAX: ::c_int = 8;
309 pub const KERN_SECURELVL: ::c_int = 9;
310 pub const KERN_HOSTNAME: ::c_int = 10;
311 pub const KERN_HOSTID: ::c_int = 11;
312 pub const KERN_CLOCKRATE: ::c_int = 12;
313 pub const KERN_PROF: ::c_int = 16;
314 pub const KERN_POSIX1: ::c_int = 17;
315 pub const KERN_NGROUPS: ::c_int = 18;
316 pub const KERN_JOB_CONTROL: ::c_int = 19;
317 pub const KERN_SAVED_IDS: ::c_int = 20;
318 pub const KERN_BOOTTIME: ::c_int = 21;
319 pub const KERN_DOMAINNAME: ::c_int = 22;
320 pub const KERN_MAXPARTITIONS: ::c_int = 23;
321 pub const KERN_RAWPARTITION: ::c_int = 24;
322 pub const KERN_MAXTHREAD: ::c_int = 25;
323 pub const KERN_NTHREADS: ::c_int = 26;
324 pub const KERN_OSVERSION: ::c_int = 27;
325 pub const KERN_SOMAXCONN: ::c_int = 28;
326 pub const KERN_SOMINCONN: ::c_int = 29;
327 pub const KERN_USERMOUNT: ::c_int = 30;
328 pub const KERN_RND: ::c_int = 31;
329 pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
330 pub const KERN_FSYNC: ::c_int = 33;
331 pub const KERN_SYSVMSG: ::c_int = 34;
332 pub const KERN_SYSVSEM: ::c_int = 35;
333 pub const KERN_SYSVSHM: ::c_int = 36;
334 pub const KERN_ARND: ::c_int = 37;
335 pub const KERN_MSGBUFSIZE: ::c_int = 38;
336 pub const KERN_MALLOCSTATS: ::c_int = 39;
337 pub const KERN_CPTIME: ::c_int = 40;
338 pub const KERN_NCHSTATS: ::c_int = 41;
339 pub const KERN_FORKSTAT: ::c_int = 42;
340 pub const KERN_NSELCOLL: ::c_int = 43;
341 pub const KERN_TTY: ::c_int = 44;
342 pub const KERN_CCPU: ::c_int = 45;
343 pub const KERN_FSCALE: ::c_int = 46;
344 pub const KERN_NPROCS: ::c_int = 47;
345 pub const KERN_MSGBUF: ::c_int = 48;
346 pub const KERN_POOL: ::c_int = 49;
347 pub const KERN_STACKGAPRANDOM: ::c_int = 50;
348 pub const KERN_SYSVIPC_INFO: ::c_int = 51;
349 pub const KERN_SPLASSERT: ::c_int = 54;
350 pub const KERN_PROC_ARGS: ::c_int = 55;
351 pub const KERN_NFILES: ::c_int = 56;
352 pub const KERN_TTYCOUNT: ::c_int = 57;
353 pub const KERN_NUMVNODES: ::c_int = 58;
354 pub const KERN_MBSTAT: ::c_int = 59;
355 pub const KERN_SEMINFO: ::c_int = 61;
356 pub const KERN_SHMINFO: ::c_int = 62;
357 pub const KERN_INTRCNT: ::c_int = 63;
358 pub const KERN_WATCHDOG: ::c_int = 64;
359 pub const KERN_PROC: ::c_int = 66;
360 pub const KERN_MAXCLUSTERS: ::c_int = 67;
361 pub const KERN_EVCOUNT: ::c_int = 68;
362 pub const KERN_TIMECOUNTER: ::c_int = 69;
363 pub const KERN_MAXLOCKSPERUID: ::c_int = 70;
364 pub const KERN_CPTIME2: ::c_int = 71;
365 pub const KERN_CACHEPCT: ::c_int = 72;
366 pub const KERN_FILE: ::c_int = 73;
367 pub const KERN_CONSDEV: ::c_int = 75;
368 pub const KERN_NETLIVELOCKS: ::c_int = 76;
369 pub const KERN_POOL_DEBUG: ::c_int = 77;
370 pub const KERN_PROC_CWD: ::c_int = 78;
371 pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79;
372 pub const KERN_PROC_VMMAP: ::c_int = 80;
373 pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
374 pub const KERN_CONSBUFSIZE: ::c_int = 82;
375 pub const KERN_CONSBUF: ::c_int = 83;
376 pub const KERN_MAXID: ::c_int = 84;
377 pub const KERN_PROC_ALL: ::c_int = 0;
378 pub const KERN_PROC_PID: ::c_int = 1;
379 pub const KERN_PROC_PGRP: ::c_int = 2;
380 pub const KERN_PROC_SESSION: ::c_int = 3;
381 pub const KERN_PROC_TTY: ::c_int = 4;
382 pub const KERN_PROC_UID: ::c_int = 5;
383 pub const KERN_PROC_RUID: ::c_int = 6;
384 pub const KERN_PROC_KTHREAD: ::c_int = 7;
385 pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000;
386 pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1;
387 pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2;
388 pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3;
389 pub const KERN_PROC_ARGV: ::c_int = 1;
390 pub const KERN_PROC_NARGV: ::c_int = 2;
391 pub const KERN_PROC_ENV: ::c_int = 3;
392 pub const KERN_PROC_NENV: ::c_int = 4;
393 pub const KI_NGROUPS: ::c_int = 16;
394 pub const KI_MAXCOMLEN: ::c_int = 24;
395 pub const KI_WMESGLEN: ::c_int = 8;
396 pub const KI_MAXLOGNAME: ::c_int = 32;
397 pub const KI_EMULNAMELEN: ::c_int = 8;
398
399 extern {
400 pub fn getnameinfo(sa: *const ::sockaddr,
401 salen: ::socklen_t,
402 host: *mut ::c_char,
403 hostlen: ::size_t,
404 serv: *mut ::c_char,
405 servlen: ::size_t,
406 flags: ::c_int) -> ::c_int;
407 pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
408 -> ::c_int;
409 pub fn pthread_main_np() -> ::c_int;
410 pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
411 pub fn pthread_stackseg_np(thread: ::pthread_t,
412 sinfo: *mut ::stack_t) -> ::c_int;
413 pub fn sysctl(name: *mut ::c_int,
414 namelen: ::c_uint,
415 oldp: *mut ::c_void,
416 oldlenp: *mut ::size_t,
417 newp: *mut ::c_void,
418 newlen: ::size_t)
419 -> ::c_int;
420 pub fn sysctlbyname(name: *const ::c_char,
421 oldp: *mut ::c_void,
422 oldlenp: *mut ::size_t,
423 newp: *mut ::c_void,
424 newlen: ::size_t)
425 -> ::c_int;
426 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
427 pub fn duplocale(base: ::locale_t) -> ::locale_t;
428 pub fn freelocale(loc: ::locale_t) -> ::c_int;
429 pub fn newlocale(mask: ::c_int,
430 locale: *const ::c_char,
431 base: ::locale_t) -> ::locale_t;
432 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
433 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
434 }