]>
Commit | Line | Data |
---|---|---|
54a0048b SL |
1 | pub type clock_t = u64; |
2 | pub type ino_t = u64; | |
3 | pub type nlink_t = u32; | |
4 | pub type blksize_t = i64; | |
5 | pub type clockid_t = ::c_ulong; | |
6 | ||
7 | pub type c_long = i64; | |
8 | pub type c_ulong = u64; | |
9 | pub type time_t = i64; | |
10 | pub type suseconds_t = i64; | |
11 | ||
12 | pub type uuid_t = ::uuid; | |
13 | ||
14 | pub type fsblkcnt_t = u64; | |
15 | pub type fsfilcnt_t = u64; | |
16 | ||
17 | s! { | |
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 | ||
105 | pub const RAND_MAX: ::c_int = 0x7fff_ffff; | |
106 | pub const PTHREAD_STACK_MIN: ::size_t = 1024; | |
54a0048b SL |
107 | pub const SIGSTKSZ: ::size_t = 40960; |
108 | pub const MADV_INVAL: ::c_int = 10; | |
109 | pub const O_CLOEXEC: ::c_int = 0x00020000; | |
110 | pub const F_GETLK: ::c_int = 7; | |
111 | pub const F_SETLK: ::c_int = 8; | |
112 | pub const F_SETLKW: ::c_int = 9; | |
113 | pub const ELAST: ::c_int = 99; | |
114 | pub const RLIMIT_POSIXLOCKS: ::c_int = 11; | |
115 | pub const RLIM_NLIMITS: ::rlim_t = 12; | |
116 | ||
117 | pub const Q_GETQUOTA: ::c_int = 0x300; | |
118 | pub const Q_SETQUOTA: ::c_int = 0x400; | |
119 | ||
120 | pub const CLOCK_REALTIME: clockid_t = 0; | |
121 | pub const CLOCK_VIRTUAL: clockid_t = 1; | |
122 | pub const CLOCK_PROF: clockid_t = 2; | |
123 | pub const CLOCK_MONOTONIC: clockid_t = 4; | |
124 | pub const CLOCK_UPTIME: clockid_t = 5; | |
125 | pub const CLOCK_UPTIME_PRECISE: clockid_t = 7; | |
126 | pub const CLOCK_UPTIME_FAST: clockid_t = 8; | |
127 | pub const CLOCK_REALTIME_PRECISE: clockid_t = 9; | |
128 | pub const CLOCK_REALTIME_FAST: clockid_t = 10; | |
129 | pub const CLOCK_MONOTONIC_PRECISE: clockid_t = 11; | |
130 | pub const CLOCK_MONOTONIC_FAST: clockid_t = 12; | |
131 | pub const CLOCK_SECOND: clockid_t = 13; | |
132 | pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 14; | |
133 | pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 15; | |
134 | ||
a7813a04 XL |
135 | pub const CTL_UNSPEC: ::c_int = 0; |
136 | pub const CTL_KERN: ::c_int = 1; | |
137 | pub const CTL_VM: ::c_int = 2; | |
138 | pub const CTL_VFS: ::c_int = 3; | |
139 | pub const CTL_NET: ::c_int = 4; | |
140 | pub const CTL_DEBUG: ::c_int = 5; | |
141 | pub const CTL_HW: ::c_int = 6; | |
142 | pub const CTL_MACHDEP: ::c_int = 7; | |
143 | pub const CTL_USER: ::c_int = 8; | |
144 | pub const CTL_P1003_1B: ::c_int = 9; | |
145 | pub const CTL_LWKT: ::c_int = 10; | |
146 | pub const CTL_MAXID: ::c_int = 11; | |
147 | pub const KERN_OSTYPE: ::c_int = 1; | |
148 | pub const KERN_OSRELEASE: ::c_int = 2; | |
149 | pub const KERN_OSREV: ::c_int = 3; | |
150 | pub const KERN_VERSION: ::c_int = 4; | |
151 | pub const KERN_MAXVNODES: ::c_int = 5; | |
152 | pub const KERN_MAXPROC: ::c_int = 6; | |
153 | pub const KERN_MAXFILES: ::c_int = 7; | |
154 | pub const KERN_ARGMAX: ::c_int = 8; | |
155 | pub const KERN_SECURELVL: ::c_int = 9; | |
156 | pub const KERN_HOSTNAME: ::c_int = 10; | |
157 | pub const KERN_HOSTID: ::c_int = 11; | |
158 | pub const KERN_CLOCKRATE: ::c_int = 12; | |
159 | pub const KERN_VNODE: ::c_int = 13; | |
160 | pub const KERN_PROC: ::c_int = 14; | |
161 | pub const KERN_FILE: ::c_int = 15; | |
162 | pub const KERN_PROF: ::c_int = 16; | |
163 | pub const KERN_POSIX1: ::c_int = 17; | |
164 | pub const KERN_NGROUPS: ::c_int = 18; | |
165 | pub const KERN_JOB_CONTROL: ::c_int = 19; | |
166 | pub const KERN_SAVED_IDS: ::c_int = 20; | |
167 | pub const KERN_BOOTTIME: ::c_int = 21; | |
168 | pub const KERN_NISDOMAINNAME: ::c_int = 22; | |
169 | pub const KERN_UPDATEINTERVAL: ::c_int = 23; | |
170 | pub const KERN_OSRELDATE: ::c_int = 24; | |
171 | pub const KERN_NTP_PLL: ::c_int = 25; | |
172 | pub const KERN_BOOTFILE: ::c_int = 26; | |
173 | pub const KERN_MAXFILESPERPROC: ::c_int = 27; | |
174 | pub const KERN_MAXPROCPERUID: ::c_int = 28; | |
175 | pub const KERN_DUMPDEV: ::c_int = 29; | |
176 | pub const KERN_IPC: ::c_int = 30; | |
177 | pub const KERN_DUMMY: ::c_int = 31; | |
178 | pub const KERN_PS_STRINGS: ::c_int = 32; | |
179 | pub const KERN_USRSTACK: ::c_int = 33; | |
180 | pub const KERN_LOGSIGEXIT: ::c_int = 34; | |
181 | pub const KERN_IOV_MAX: ::c_int = 35; | |
182 | pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36; | |
183 | pub const KERN_MAXID: ::c_int = 37; | |
184 | pub const KERN_PROC_ALL: ::c_int = 0; | |
185 | pub const KERN_PROC_PID: ::c_int = 1; | |
186 | pub const KERN_PROC_PGRP: ::c_int = 2; | |
187 | pub const KERN_PROC_SESSION: ::c_int = 3; | |
188 | pub const KERN_PROC_TTY: ::c_int = 4; | |
189 | pub const KERN_PROC_UID: ::c_int = 5; | |
190 | pub const KERN_PROC_RUID: ::c_int = 6; | |
191 | pub const KERN_PROC_ARGS: ::c_int = 7; | |
192 | pub const KERN_PROC_CWD: ::c_int = 8; | |
193 | pub const KERN_PROC_PATHNAME: ::c_int = 9; | |
194 | pub const KERN_PROC_FLAGMASK: ::c_int = 0x10; | |
195 | pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10; | |
196 | pub const KIPC_MAXSOCKBUF: ::c_int = 1; | |
197 | pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; | |
198 | pub const KIPC_SOMAXCONN: ::c_int = 3; | |
199 | pub const KIPC_MAX_LINKHDR: ::c_int = 4; | |
200 | pub const KIPC_MAX_PROTOHDR: ::c_int = 5; | |
201 | pub const KIPC_MAX_HDR: ::c_int = 6; | |
202 | pub const KIPC_MAX_DATALEN: ::c_int = 7; | |
203 | pub const KIPC_MBSTAT: ::c_int = 8; | |
204 | pub const KIPC_NMBCLUSTERS: ::c_int = 9; | |
205 | pub const HW_MACHINE: ::c_int = 1; | |
206 | pub const HW_MODEL: ::c_int = 2; | |
207 | pub const HW_NCPU: ::c_int = 3; | |
208 | pub const HW_BYTEORDER: ::c_int = 4; | |
209 | pub const HW_PHYSMEM: ::c_int = 5; | |
210 | pub const HW_USERMEM: ::c_int = 6; | |
211 | pub const HW_PAGESIZE: ::c_int = 7; | |
212 | pub const HW_DISKNAMES: ::c_int = 8; | |
213 | pub const HW_DISKSTATS: ::c_int = 9; | |
214 | pub const HW_FLOATINGPT: ::c_int = 10; | |
215 | pub const HW_MACHINE_ARCH: ::c_int = 11; | |
216 | pub const HW_MACHINE_PLATFORM: ::c_int = 12; | |
217 | pub const HW_SENSORS: ::c_int = 13; | |
218 | pub const HW_MAXID: ::c_int = 14; | |
219 | pub const USER_CS_PATH: ::c_int = 1; | |
220 | pub const USER_BC_BASE_MAX: ::c_int = 2; | |
221 | pub const USER_BC_DIM_MAX: ::c_int = 3; | |
222 | pub const USER_BC_SCALE_MAX: ::c_int = 4; | |
223 | pub const USER_BC_STRING_MAX: ::c_int = 5; | |
224 | pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; | |
225 | pub const USER_EXPR_NEST_MAX: ::c_int = 7; | |
226 | pub const USER_LINE_MAX: ::c_int = 8; | |
227 | pub const USER_RE_DUP_MAX: ::c_int = 9; | |
228 | pub const USER_POSIX2_VERSION: ::c_int = 10; | |
229 | pub const USER_POSIX2_C_BIND: ::c_int = 11; | |
230 | pub const USER_POSIX2_C_DEV: ::c_int = 12; | |
231 | pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; | |
232 | pub const USER_POSIX2_FORT_DEV: ::c_int = 14; | |
233 | pub const USER_POSIX2_FORT_RUN: ::c_int = 15; | |
234 | pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; | |
235 | pub const USER_POSIX2_SW_DEV: ::c_int = 17; | |
236 | pub const USER_POSIX2_UPE: ::c_int = 18; | |
237 | pub const USER_STREAM_MAX: ::c_int = 19; | |
238 | pub const USER_TZNAME_MAX: ::c_int = 20; | |
239 | pub const USER_MAXID: ::c_int = 21; | |
240 | pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; | |
241 | pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; | |
242 | pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; | |
243 | pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; | |
244 | pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; | |
245 | pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; | |
246 | pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; | |
247 | pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; | |
248 | pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; | |
249 | pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; | |
250 | pub const CTL_P1003_1B_FSYNC: ::c_int = 11; | |
251 | pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; | |
252 | pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; | |
253 | pub const CTL_P1003_1B_TIMERS: ::c_int = 14; | |
254 | pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; | |
255 | pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; | |
256 | pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; | |
257 | pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; | |
258 | pub const CTL_P1003_1B_UNUSED1: ::c_int = 19; | |
259 | pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; | |
260 | pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; | |
261 | pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; | |
262 | pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; | |
263 | pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; | |
264 | pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; | |
265 | pub const CTL_P1003_1B_MAXID: ::c_int = 26; | |
266 | ||
9e0c209e SL |
267 | pub const EVFILT_READ: ::int16_t = -1; |
268 | pub const EVFILT_WRITE: ::int16_t = -2; | |
269 | pub const EVFILT_AIO: ::int16_t = -3; | |
270 | pub const EVFILT_VNODE: ::int16_t = -4; | |
271 | pub const EVFILT_PROC: ::int16_t = -5; | |
272 | pub const EVFILT_SIGNAL: ::int16_t = -6; | |
273 | pub const EVFILT_TIMER: ::int16_t = -7; | |
274 | pub const EVFILT_PROCDESC: ::int16_t = -8; | |
275 | pub const EVFILT_USER: ::int16_t = -9; | |
276 | pub const EVFILT_FS: ::int16_t = -10; | |
277 | ||
278 | pub const EV_ADD: ::uint16_t = 0x1; | |
279 | pub const EV_DELETE: ::uint16_t = 0x2; | |
280 | pub const EV_ENABLE: ::uint16_t = 0x4; | |
281 | pub const EV_DISABLE: ::uint16_t = 0x8; | |
282 | pub const EV_ONESHOT: ::uint16_t = 0x10; | |
283 | pub const EV_CLEAR: ::uint16_t = 0x20; | |
284 | pub const EV_RECEIPT: ::uint16_t = 0x40; | |
285 | pub const EV_DISPATCH: ::uint16_t = 0x80; | |
286 | pub const EV_NODATA: ::uint16_t = 0x1000; | |
287 | pub const EV_FLAG1: ::uint16_t = 0x2000; | |
288 | pub const EV_ERROR: ::uint16_t = 0x4000; | |
289 | pub const EV_EOF: ::uint16_t = 0x8000; | |
290 | pub const EV_SYSFLAGS: ::uint16_t = 0xf000; | |
291 | ||
292 | pub const NOTE_TRIGGER: ::uint32_t = 0x01000000; | |
293 | pub const NOTE_FFNOP: ::uint32_t = 0x00000000; | |
294 | pub const NOTE_FFAND: ::uint32_t = 0x40000000; | |
295 | pub const NOTE_FFOR: ::uint32_t = 0x80000000; | |
296 | pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000; | |
297 | pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000; | |
298 | pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff; | |
299 | pub const NOTE_LOWAT: ::uint32_t = 0x00000001; | |
300 | pub const NOTE_OOB: ::uint32_t = 0x00000002; | |
301 | pub const NOTE_DELETE: ::uint32_t = 0x00000001; | |
302 | pub const NOTE_WRITE: ::uint32_t = 0x00000002; | |
303 | pub const NOTE_EXTEND: ::uint32_t = 0x00000004; | |
304 | pub const NOTE_ATTRIB: ::uint32_t = 0x00000008; | |
305 | pub const NOTE_LINK: ::uint32_t = 0x00000010; | |
306 | pub const NOTE_RENAME: ::uint32_t = 0x00000020; | |
307 | pub const NOTE_REVOKE: ::uint32_t = 0x00000040; | |
308 | pub const NOTE_EXIT: ::uint32_t = 0x80000000; | |
309 | pub const NOTE_FORK: ::uint32_t = 0x40000000; | |
310 | pub const NOTE_EXEC: ::uint32_t = 0x20000000; | |
311 | pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff; | |
312 | pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000; | |
313 | pub const NOTE_TRACK: ::uint32_t = 0x00000001; | |
314 | pub const NOTE_TRACKERR: ::uint32_t = 0x00000002; | |
315 | pub const NOTE_CHILD: ::uint32_t = 0x00000004; | |
316 | ||
317 | pub const MSG_NOSIGNAL: ::uint32_t = 0x400; | |
318 | ||
54a0048b SL |
319 | extern { |
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 | } |