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