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