]> git.proxmox.com Git - rustc.git/blame - src/liblibc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
New upstream version 1.16.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / freebsdlike / dragonfly / mod.rs
CommitLineData
54a0048b
SL
1pub type clock_t = u64;
2pub type ino_t = u64;
3pub type nlink_t = u32;
4pub type blksize_t = i64;
5pub type clockid_t = ::c_ulong;
6
7pub type c_long = i64;
8pub type c_ulong = u64;
9pub type time_t = i64;
10pub type suseconds_t = i64;
11
12pub type uuid_t = ::uuid;
13
14pub type fsblkcnt_t = u64;
15pub type fsfilcnt_t = u64;
16
32a655c1
SL
17pub type sem_t = *mut sem;
18
19pub enum sem {}
20
54a0048b 21s! {
32a655c1
SL
22
23 pub struct exit_status {
24 pub e_termination: u16,
25 pub e_exit: u16
26 }
27
28 pub struct utmpx {
29 pub ut_name: [::c_char; 32],
30 pub ut_id: [::c_char; 4],
31
32 pub ut_line: [::c_char; 32],
33 pub ut_host: [::c_char; 256],
34
35 pub ut_unused: [u8; 16],
36 pub ut_session: u16,
37 pub ut_type: u16,
38 pub ut_pid: ::pid_t,
39 ut_exit: exit_status,
40 ut_ss: ::sockaddr_storage,
41 pub ut_tv: ::timeval,
42 pub ut_unused2: [u8; 16],
43 }
44
476ff2be
SL
45 pub struct aiocb {
46 pub aio_fildes: ::c_int,
47 pub aio_offset: ::off_t,
48 pub aio_buf: *mut ::c_void,
49 pub aio_nbytes: ::size_t,
50 pub aio_sigevent: sigevent,
51 pub aio_lio_opcode: ::c_int,
52 pub aio_reqprio: ::c_int,
53 _aio_val: ::c_int,
54 _aio_err: ::c_int
55 }
56
54a0048b
SL
57 pub struct dirent {
58 pub d_fileno: ::ino_t,
59 pub d_namlen: u16,
60 pub d_type: u8,
61 __unused1: u8,
62 __unused2: u32,
63 pub d_name: [::c_char; 256],
64 }
65
66 pub struct uuid {
67 pub time_low: u32,
68 pub time_mid: u16,
69 pub time_hi_and_version: u16,
70 pub clock_seq_hi_and_reserved: u8,
71 pub clock_seq_low: u8,
72 pub node: [u8; 6],
73 }
74
476ff2be
SL
75 pub struct sigevent {
76 pub sigev_notify: ::c_int,
32a655c1 77 // The union is 8-byte in size, so it is aligned at a 8-byte offset.
476ff2be
SL
78 #[cfg(target_pointer_width = "64")]
79 __unused1: ::c_int,
32a655c1
SL
80 pub sigev_signo: ::c_int, //actually a union
81 // pad the union
82 #[cfg(target_pointer_width = "64")]
83 __unused2: ::c_int,
476ff2be 84 pub sigev_value: ::sigval,
32a655c1 85 __unused3: *mut ::c_void //actually a function pointer
476ff2be
SL
86 }
87
54a0048b
SL
88 pub struct statvfs {
89 pub f_bsize: ::c_ulong,
90 pub f_frsize: ::c_ulong,
91 pub f_blocks: ::fsblkcnt_t,
92 pub f_bfree: ::fsblkcnt_t,
93 pub f_bavail: ::fsblkcnt_t,
94 pub f_files: ::fsfilcnt_t,
95 pub f_ffree: ::fsfilcnt_t,
96 pub f_favail: ::fsfilcnt_t,
97 pub f_fsid: ::c_ulong,
98 pub f_flag: ::c_ulong,
99 pub f_namemax: ::c_ulong,
100 pub f_owner: ::uid_t,
101 pub f_type: ::c_uint,
102 pub f_syncreads: u64,
103 pub f_syncwrites: u64,
104 pub f_asyncreads: u64,
105 pub f_asyncwrites: u64,
106 pub f_fsid_uuid: ::uuid_t,
107 pub f_uid_uuid: ::uuid_t,
108 }
109
110 pub struct stat {
111 pub st_ino: ::ino_t,
112 pub st_nlink: ::nlink_t,
113 pub st_dev: ::dev_t,
114 pub st_mode: ::mode_t,
115 pub st_padding1: ::uint16_t,
116 pub st_uid: ::uid_t,
117 pub st_gid: ::gid_t,
118 pub st_rdev: ::dev_t,
119 pub st_atime: ::time_t,
120 pub st_atime_nsec: ::c_long,
121 pub st_mtime: ::time_t,
122 pub st_mtime_nsec: ::c_long,
123 pub st_ctime: ::time_t,
124 pub st_ctime_nsec: ::c_long,
125 pub st_size: ::off_t,
126 pub st_blocks: ::int64_t,
127 pub st_blksize: ::uint32_t,
128 pub st_flags: ::uint32_t,
129 pub st_gen: ::uint32_t,
130 pub st_lspare: ::int32_t,
131 pub st_qspare1: ::int64_t,
132 pub st_qspare2: ::int64_t,
133 }
134}
135
136pub const RAND_MAX: ::c_int = 0x7fff_ffff;
137pub const PTHREAD_STACK_MIN: ::size_t = 1024;
54a0048b
SL
138pub const SIGSTKSZ: ::size_t = 40960;
139pub const MADV_INVAL: ::c_int = 10;
140pub const O_CLOEXEC: ::c_int = 0x00020000;
141pub const F_GETLK: ::c_int = 7;
142pub const F_SETLK: ::c_int = 8;
143pub const F_SETLKW: ::c_int = 9;
144pub const ELAST: ::c_int = 99;
145pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
146pub const RLIM_NLIMITS: ::rlim_t = 12;
147
148pub const Q_GETQUOTA: ::c_int = 0x300;
149pub const Q_SETQUOTA: ::c_int = 0x400;
150
151pub const CLOCK_REALTIME: clockid_t = 0;
152pub const CLOCK_VIRTUAL: clockid_t = 1;
153pub const CLOCK_PROF: clockid_t = 2;
154pub const CLOCK_MONOTONIC: clockid_t = 4;
155pub const CLOCK_UPTIME: clockid_t = 5;
156pub const CLOCK_UPTIME_PRECISE: clockid_t = 7;
157pub const CLOCK_UPTIME_FAST: clockid_t = 8;
158pub const CLOCK_REALTIME_PRECISE: clockid_t = 9;
159pub const CLOCK_REALTIME_FAST: clockid_t = 10;
160pub const CLOCK_MONOTONIC_PRECISE: clockid_t = 11;
161pub const CLOCK_MONOTONIC_FAST: clockid_t = 12;
162pub const CLOCK_SECOND: clockid_t = 13;
163pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 14;
164pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 15;
165
a7813a04
XL
166pub const CTL_UNSPEC: ::c_int = 0;
167pub const CTL_KERN: ::c_int = 1;
168pub const CTL_VM: ::c_int = 2;
169pub const CTL_VFS: ::c_int = 3;
170pub const CTL_NET: ::c_int = 4;
171pub const CTL_DEBUG: ::c_int = 5;
172pub const CTL_HW: ::c_int = 6;
173pub const CTL_MACHDEP: ::c_int = 7;
174pub const CTL_USER: ::c_int = 8;
175pub const CTL_P1003_1B: ::c_int = 9;
176pub const CTL_LWKT: ::c_int = 10;
177pub const CTL_MAXID: ::c_int = 11;
178pub const KERN_OSTYPE: ::c_int = 1;
179pub const KERN_OSRELEASE: ::c_int = 2;
180pub const KERN_OSREV: ::c_int = 3;
181pub const KERN_VERSION: ::c_int = 4;
182pub const KERN_MAXVNODES: ::c_int = 5;
183pub const KERN_MAXPROC: ::c_int = 6;
184pub const KERN_MAXFILES: ::c_int = 7;
185pub const KERN_ARGMAX: ::c_int = 8;
186pub const KERN_SECURELVL: ::c_int = 9;
187pub const KERN_HOSTNAME: ::c_int = 10;
188pub const KERN_HOSTID: ::c_int = 11;
189pub const KERN_CLOCKRATE: ::c_int = 12;
190pub const KERN_VNODE: ::c_int = 13;
191pub const KERN_PROC: ::c_int = 14;
192pub const KERN_FILE: ::c_int = 15;
193pub const KERN_PROF: ::c_int = 16;
194pub const KERN_POSIX1: ::c_int = 17;
195pub const KERN_NGROUPS: ::c_int = 18;
196pub const KERN_JOB_CONTROL: ::c_int = 19;
197pub const KERN_SAVED_IDS: ::c_int = 20;
198pub const KERN_BOOTTIME: ::c_int = 21;
199pub const KERN_NISDOMAINNAME: ::c_int = 22;
200pub const KERN_UPDATEINTERVAL: ::c_int = 23;
201pub const KERN_OSRELDATE: ::c_int = 24;
202pub const KERN_NTP_PLL: ::c_int = 25;
203pub const KERN_BOOTFILE: ::c_int = 26;
204pub const KERN_MAXFILESPERPROC: ::c_int = 27;
205pub const KERN_MAXPROCPERUID: ::c_int = 28;
206pub const KERN_DUMPDEV: ::c_int = 29;
207pub const KERN_IPC: ::c_int = 30;
208pub const KERN_DUMMY: ::c_int = 31;
209pub const KERN_PS_STRINGS: ::c_int = 32;
210pub const KERN_USRSTACK: ::c_int = 33;
211pub const KERN_LOGSIGEXIT: ::c_int = 34;
212pub const KERN_IOV_MAX: ::c_int = 35;
213pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36;
214pub const KERN_MAXID: ::c_int = 37;
215pub const KERN_PROC_ALL: ::c_int = 0;
216pub const KERN_PROC_PID: ::c_int = 1;
217pub const KERN_PROC_PGRP: ::c_int = 2;
218pub const KERN_PROC_SESSION: ::c_int = 3;
219pub const KERN_PROC_TTY: ::c_int = 4;
220pub const KERN_PROC_UID: ::c_int = 5;
221pub const KERN_PROC_RUID: ::c_int = 6;
222pub const KERN_PROC_ARGS: ::c_int = 7;
223pub const KERN_PROC_CWD: ::c_int = 8;
224pub const KERN_PROC_PATHNAME: ::c_int = 9;
225pub const KERN_PROC_FLAGMASK: ::c_int = 0x10;
226pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10;
227pub const KIPC_MAXSOCKBUF: ::c_int = 1;
228pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
229pub const KIPC_SOMAXCONN: ::c_int = 3;
230pub const KIPC_MAX_LINKHDR: ::c_int = 4;
231pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
232pub const KIPC_MAX_HDR: ::c_int = 6;
233pub const KIPC_MAX_DATALEN: ::c_int = 7;
234pub const KIPC_MBSTAT: ::c_int = 8;
235pub const KIPC_NMBCLUSTERS: ::c_int = 9;
236pub const HW_MACHINE: ::c_int = 1;
237pub const HW_MODEL: ::c_int = 2;
238pub const HW_NCPU: ::c_int = 3;
239pub const HW_BYTEORDER: ::c_int = 4;
240pub const HW_PHYSMEM: ::c_int = 5;
241pub const HW_USERMEM: ::c_int = 6;
242pub const HW_PAGESIZE: ::c_int = 7;
243pub const HW_DISKNAMES: ::c_int = 8;
244pub const HW_DISKSTATS: ::c_int = 9;
245pub const HW_FLOATINGPT: ::c_int = 10;
246pub const HW_MACHINE_ARCH: ::c_int = 11;
247pub const HW_MACHINE_PLATFORM: ::c_int = 12;
248pub const HW_SENSORS: ::c_int = 13;
249pub const HW_MAXID: ::c_int = 14;
250pub const USER_CS_PATH: ::c_int = 1;
251pub const USER_BC_BASE_MAX: ::c_int = 2;
252pub const USER_BC_DIM_MAX: ::c_int = 3;
253pub const USER_BC_SCALE_MAX: ::c_int = 4;
254pub const USER_BC_STRING_MAX: ::c_int = 5;
255pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
256pub const USER_EXPR_NEST_MAX: ::c_int = 7;
257pub const USER_LINE_MAX: ::c_int = 8;
258pub const USER_RE_DUP_MAX: ::c_int = 9;
259pub const USER_POSIX2_VERSION: ::c_int = 10;
260pub const USER_POSIX2_C_BIND: ::c_int = 11;
261pub const USER_POSIX2_C_DEV: ::c_int = 12;
262pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
263pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
264pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
265pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
266pub const USER_POSIX2_SW_DEV: ::c_int = 17;
267pub const USER_POSIX2_UPE: ::c_int = 18;
268pub const USER_STREAM_MAX: ::c_int = 19;
269pub const USER_TZNAME_MAX: ::c_int = 20;
270pub const USER_MAXID: ::c_int = 21;
271pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
272pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
273pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
274pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
275pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
276pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
277pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
278pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
279pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
280pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
281pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
282pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
283pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
284pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
285pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
286pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
287pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
288pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
289pub const CTL_P1003_1B_UNUSED1: ::c_int = 19;
290pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
291pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
292pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
293pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
294pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
295pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
296pub const CTL_P1003_1B_MAXID: ::c_int = 26;
297
9e0c209e
SL
298pub const EVFILT_READ: ::int16_t = -1;
299pub const EVFILT_WRITE: ::int16_t = -2;
300pub const EVFILT_AIO: ::int16_t = -3;
301pub const EVFILT_VNODE: ::int16_t = -4;
302pub const EVFILT_PROC: ::int16_t = -5;
303pub const EVFILT_SIGNAL: ::int16_t = -6;
304pub const EVFILT_TIMER: ::int16_t = -7;
9e0c209e
SL
305pub const EVFILT_USER: ::int16_t = -9;
306pub const EVFILT_FS: ::int16_t = -10;
307
308pub const EV_ADD: ::uint16_t = 0x1;
309pub const EV_DELETE: ::uint16_t = 0x2;
310pub const EV_ENABLE: ::uint16_t = 0x4;
311pub const EV_DISABLE: ::uint16_t = 0x8;
312pub const EV_ONESHOT: ::uint16_t = 0x10;
313pub const EV_CLEAR: ::uint16_t = 0x20;
314pub const EV_RECEIPT: ::uint16_t = 0x40;
315pub const EV_DISPATCH: ::uint16_t = 0x80;
316pub const EV_NODATA: ::uint16_t = 0x1000;
317pub const EV_FLAG1: ::uint16_t = 0x2000;
318pub const EV_ERROR: ::uint16_t = 0x4000;
319pub const EV_EOF: ::uint16_t = 0x8000;
320pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
321
322pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
323pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
324pub const NOTE_FFAND: ::uint32_t = 0x40000000;
325pub const NOTE_FFOR: ::uint32_t = 0x80000000;
326pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
327pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
328pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
329pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
330pub const NOTE_OOB: ::uint32_t = 0x00000002;
331pub const NOTE_DELETE: ::uint32_t = 0x00000001;
332pub const NOTE_WRITE: ::uint32_t = 0x00000002;
333pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
334pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
335pub const NOTE_LINK: ::uint32_t = 0x00000010;
336pub const NOTE_RENAME: ::uint32_t = 0x00000020;
337pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
338pub const NOTE_EXIT: ::uint32_t = 0x80000000;
339pub const NOTE_FORK: ::uint32_t = 0x40000000;
340pub const NOTE_EXEC: ::uint32_t = 0x20000000;
341pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
342pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
343pub const NOTE_TRACK: ::uint32_t = 0x00000001;
344pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
345pub const NOTE_CHILD: ::uint32_t = 0x00000004;
346
32a655c1
SL
347pub const MSG_NOSIGNAL: ::c_int = 0x400;
348
349pub const EMPTY: ::c_short = 0;
350pub const RUN_LVL: ::c_short = 1;
351pub const BOOT_TIME: ::c_short = 2;
352pub const OLD_TIME: ::c_short = 3;
353pub const NEW_TIME: ::c_short = 4;
354pub const INIT_PROCESS: ::c_short = 5;
355pub const LOGIN_PROCESS: ::c_short = 6;
356pub const USER_PROCESS: ::c_short = 7;
357pub const DEAD_PROCESS: ::c_short = 8;
358
359pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
360pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
361pub const LC_MONETARY_MASK: ::c_int = (1 << 2);
362pub const LC_NUMERIC_MASK: ::c_int = (1 << 3);
363pub const LC_TIME_MASK: ::c_int = (1 << 4);
364pub const LC_MESSAGES_MASK: ::c_int = (1 << 5);
365pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
366 | LC_CTYPE_MASK
367 | LC_MESSAGES_MASK
368 | LC_MONETARY_MASK
369 | LC_NUMERIC_MASK
370 | LC_TIME_MASK;
9e0c209e 371
54a0048b
SL
372extern {
373 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
374 -> ::c_int;
375 pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
376 pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
32a655c1
SL
377 pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
378
379 pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
380
381 pub fn aio_waitcomplete(iocbp: *mut *mut aiocb,
382 timeout: *mut ::timespec) -> ::c_int;
383
384 pub fn freelocale(loc: ::locale_t);
54a0048b 385}