]>
Commit | Line | Data |
---|---|---|
54a0048b SL |
1 | pub type clock_t = u64; |
2 | pub type ino_t = u64; | |
2c00a5a8 | 3 | pub type lwpid_t = i32; |
54a0048b SL |
4 | pub type nlink_t = u32; |
5 | pub type blksize_t = i64; | |
6 | pub type clockid_t = ::c_ulong; | |
7 | ||
8 | pub type c_long = i64; | |
9 | pub type c_ulong = u64; | |
10 | pub type time_t = i64; | |
11 | pub type suseconds_t = i64; | |
12 | ||
13 | pub type uuid_t = ::uuid; | |
14 | ||
15 | pub type fsblkcnt_t = u64; | |
16 | pub type fsfilcnt_t = u64; | |
17 | ||
32a655c1 SL |
18 | pub type sem_t = *mut sem; |
19 | ||
20 | pub enum sem {} | |
21 | ||
54a0048b | 22 | s! { |
32a655c1 SL |
23 | |
24 | pub struct exit_status { | |
25 | pub e_termination: u16, | |
26 | pub e_exit: u16 | |
27 | } | |
28 | ||
29 | pub struct utmpx { | |
30 | pub ut_name: [::c_char; 32], | |
31 | pub ut_id: [::c_char; 4], | |
32 | ||
33 | pub ut_line: [::c_char; 32], | |
34 | pub ut_host: [::c_char; 256], | |
35 | ||
36 | pub ut_unused: [u8; 16], | |
37 | pub ut_session: u16, | |
38 | pub ut_type: u16, | |
39 | pub ut_pid: ::pid_t, | |
40 | ut_exit: exit_status, | |
41 | ut_ss: ::sockaddr_storage, | |
42 | pub ut_tv: ::timeval, | |
43 | pub ut_unused2: [u8; 16], | |
44 | } | |
45 | ||
476ff2be SL |
46 | pub struct aiocb { |
47 | pub aio_fildes: ::c_int, | |
48 | pub aio_offset: ::off_t, | |
49 | pub aio_buf: *mut ::c_void, | |
50 | pub aio_nbytes: ::size_t, | |
51 | pub aio_sigevent: sigevent, | |
52 | pub aio_lio_opcode: ::c_int, | |
53 | pub aio_reqprio: ::c_int, | |
54 | _aio_val: ::c_int, | |
55 | _aio_err: ::c_int | |
56 | } | |
57 | ||
54a0048b SL |
58 | pub struct dirent { |
59 | pub d_fileno: ::ino_t, | |
60 | pub d_namlen: u16, | |
61 | pub d_type: u8, | |
62 | __unused1: u8, | |
63 | __unused2: u32, | |
64 | pub d_name: [::c_char; 256], | |
65 | } | |
66 | ||
67 | pub struct uuid { | |
68 | pub time_low: u32, | |
69 | pub time_mid: u16, | |
70 | pub time_hi_and_version: u16, | |
71 | pub clock_seq_hi_and_reserved: u8, | |
72 | pub clock_seq_low: u8, | |
73 | pub node: [u8; 6], | |
74 | } | |
75 | ||
ff7c6d11 XL |
76 | pub struct mq_attr { |
77 | pub mq_flags: ::c_long, | |
78 | pub mq_maxmsg: ::c_long, | |
79 | pub mq_msgsize: ::c_long, | |
80 | pub mq_curmsgs: ::c_long, | |
81 | } | |
82 | ||
476ff2be SL |
83 | pub struct sigevent { |
84 | pub sigev_notify: ::c_int, | |
32a655c1 | 85 | // The union is 8-byte in size, so it is aligned at a 8-byte offset. |
476ff2be SL |
86 | #[cfg(target_pointer_width = "64")] |
87 | __unused1: ::c_int, | |
32a655c1 SL |
88 | pub sigev_signo: ::c_int, //actually a union |
89 | // pad the union | |
90 | #[cfg(target_pointer_width = "64")] | |
91 | __unused2: ::c_int, | |
476ff2be | 92 | pub sigev_value: ::sigval, |
32a655c1 | 93 | __unused3: *mut ::c_void //actually a function pointer |
476ff2be SL |
94 | } |
95 | ||
54a0048b SL |
96 | pub struct statvfs { |
97 | pub f_bsize: ::c_ulong, | |
98 | pub f_frsize: ::c_ulong, | |
99 | pub f_blocks: ::fsblkcnt_t, | |
100 | pub f_bfree: ::fsblkcnt_t, | |
101 | pub f_bavail: ::fsblkcnt_t, | |
102 | pub f_files: ::fsfilcnt_t, | |
103 | pub f_ffree: ::fsfilcnt_t, | |
104 | pub f_favail: ::fsfilcnt_t, | |
105 | pub f_fsid: ::c_ulong, | |
106 | pub f_flag: ::c_ulong, | |
107 | pub f_namemax: ::c_ulong, | |
108 | pub f_owner: ::uid_t, | |
109 | pub f_type: ::c_uint, | |
110 | pub f_syncreads: u64, | |
111 | pub f_syncwrites: u64, | |
112 | pub f_asyncreads: u64, | |
113 | pub f_asyncwrites: u64, | |
114 | pub f_fsid_uuid: ::uuid_t, | |
115 | pub f_uid_uuid: ::uuid_t, | |
116 | } | |
117 | ||
118 | pub struct stat { | |
119 | pub st_ino: ::ino_t, | |
120 | pub st_nlink: ::nlink_t, | |
121 | pub st_dev: ::dev_t, | |
122 | pub st_mode: ::mode_t, | |
123 | pub st_padding1: ::uint16_t, | |
124 | pub st_uid: ::uid_t, | |
125 | pub st_gid: ::gid_t, | |
126 | pub st_rdev: ::dev_t, | |
127 | pub st_atime: ::time_t, | |
128 | pub st_atime_nsec: ::c_long, | |
129 | pub st_mtime: ::time_t, | |
130 | pub st_mtime_nsec: ::c_long, | |
131 | pub st_ctime: ::time_t, | |
132 | pub st_ctime_nsec: ::c_long, | |
133 | pub st_size: ::off_t, | |
134 | pub st_blocks: ::int64_t, | |
135 | pub st_blksize: ::uint32_t, | |
136 | pub st_flags: ::uint32_t, | |
137 | pub st_gen: ::uint32_t, | |
138 | pub st_lspare: ::int32_t, | |
139 | pub st_qspare1: ::int64_t, | |
140 | pub st_qspare2: ::int64_t, | |
141 | } | |
3b2f2976 XL |
142 | |
143 | pub struct if_data { | |
144 | pub ifi_type: ::c_uchar, | |
145 | pub ifi_physical: ::c_uchar, | |
146 | pub ifi_addrlen: ::c_uchar, | |
147 | pub ifi_hdrlen: ::c_uchar, | |
148 | pub ifi_recvquota: ::c_uchar, | |
149 | pub ifi_xmitquota: ::c_uchar, | |
150 | pub ifi_mtu: ::c_ulong, | |
151 | pub ifi_metric: ::c_ulong, | |
152 | pub ifi_link_state: ::c_ulong, | |
153 | pub ifi_baudrate: u64, | |
154 | pub ifi_ipackets: ::c_ulong, | |
155 | pub ifi_ierrors: ::c_ulong, | |
156 | pub ifi_opackets: ::c_ulong, | |
157 | pub ifi_oerrors: ::c_ulong, | |
158 | pub ifi_collisions: ::c_ulong, | |
159 | pub ifi_ibytes: ::c_ulong, | |
160 | pub ifi_obytes: ::c_ulong, | |
161 | pub ifi_imcasts: ::c_ulong, | |
162 | pub ifi_omcasts: ::c_ulong, | |
163 | pub ifi_iqdrops: ::c_ulong, | |
164 | pub ifi_noproto: ::c_ulong, | |
165 | pub ifi_hwassist: ::c_ulong, | |
166 | pub ifi_oqdrops: ::c_ulong, | |
167 | pub ifi_lastchange: ::timeval, | |
168 | } | |
169 | ||
170 | pub struct if_msghdr { | |
171 | pub ifm_msglen: ::c_ushort, | |
172 | pub ifm_version: ::c_uchar, | |
173 | pub ifm_type: ::c_uchar, | |
174 | pub ifm_addrs: ::c_int, | |
175 | pub ifm_flags: ::c_int, | |
176 | pub ifm_index: ::c_ushort, | |
177 | pub ifm_data: if_data, | |
178 | } | |
ff7c6d11 XL |
179 | |
180 | pub struct sockaddr_dl { | |
181 | pub sdl_len: ::c_uchar, | |
182 | pub sdl_family: ::c_uchar, | |
183 | pub sdl_index: ::c_ushort, | |
184 | pub sdl_type: ::c_uchar, | |
185 | pub sdl_nlen: ::c_uchar, | |
186 | pub sdl_alen: ::c_uchar, | |
187 | pub sdl_slen: ::c_uchar, | |
188 | pub sdl_data: [::c_char; 12], | |
189 | pub sdl_rcf: ::c_ushort, | |
190 | pub sdl_route: [::c_ushort; 16], | |
191 | } | |
54a0048b SL |
192 | } |
193 | ||
194 | pub const RAND_MAX: ::c_int = 0x7fff_ffff; | |
3b2f2976 | 195 | pub const PTHREAD_STACK_MIN: ::size_t = 16384; |
54a0048b SL |
196 | pub const SIGSTKSZ: ::size_t = 40960; |
197 | pub const MADV_INVAL: ::c_int = 10; | |
ff7c6d11 | 198 | pub const MADV_SETMAP: ::c_int = 11; |
54a0048b | 199 | pub const O_CLOEXEC: ::c_int = 0x00020000; |
3b2f2976 | 200 | pub const O_DIRECTORY: ::c_int = 0x08000000; |
54a0048b SL |
201 | pub const F_GETLK: ::c_int = 7; |
202 | pub const F_SETLK: ::c_int = 8; | |
203 | pub const F_SETLKW: ::c_int = 9; | |
204 | pub const ELAST: ::c_int = 99; | |
205 | pub const RLIMIT_POSIXLOCKS: ::c_int = 11; | |
206 | pub const RLIM_NLIMITS: ::rlim_t = 12; | |
207 | ||
208 | pub const Q_GETQUOTA: ::c_int = 0x300; | |
209 | pub const Q_SETQUOTA: ::c_int = 0x400; | |
210 | ||
3b2f2976 XL |
211 | pub const CLOCK_REALTIME: ::clockid_t = 0; |
212 | pub const CLOCK_VIRTUAL: ::clockid_t = 1; | |
213 | pub const CLOCK_PROF: ::clockid_t = 2; | |
214 | pub const CLOCK_MONOTONIC: ::clockid_t = 4; | |
215 | pub const CLOCK_UPTIME: ::clockid_t = 5; | |
216 | pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; | |
217 | pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; | |
218 | pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; | |
219 | pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; | |
220 | pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; | |
221 | pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; | |
222 | pub const CLOCK_SECOND: ::clockid_t = 13; | |
223 | pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; | |
224 | pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; | |
54a0048b | 225 | |
a7813a04 XL |
226 | pub const CTL_UNSPEC: ::c_int = 0; |
227 | pub const CTL_KERN: ::c_int = 1; | |
228 | pub const CTL_VM: ::c_int = 2; | |
229 | pub const CTL_VFS: ::c_int = 3; | |
230 | pub const CTL_NET: ::c_int = 4; | |
231 | pub const CTL_DEBUG: ::c_int = 5; | |
232 | pub const CTL_HW: ::c_int = 6; | |
233 | pub const CTL_MACHDEP: ::c_int = 7; | |
234 | pub const CTL_USER: ::c_int = 8; | |
235 | pub const CTL_P1003_1B: ::c_int = 9; | |
236 | pub const CTL_LWKT: ::c_int = 10; | |
237 | pub const CTL_MAXID: ::c_int = 11; | |
238 | pub const KERN_OSTYPE: ::c_int = 1; | |
239 | pub const KERN_OSRELEASE: ::c_int = 2; | |
240 | pub const KERN_OSREV: ::c_int = 3; | |
241 | pub const KERN_VERSION: ::c_int = 4; | |
242 | pub const KERN_MAXVNODES: ::c_int = 5; | |
243 | pub const KERN_MAXPROC: ::c_int = 6; | |
244 | pub const KERN_MAXFILES: ::c_int = 7; | |
245 | pub const KERN_ARGMAX: ::c_int = 8; | |
246 | pub const KERN_SECURELVL: ::c_int = 9; | |
247 | pub const KERN_HOSTNAME: ::c_int = 10; | |
248 | pub const KERN_HOSTID: ::c_int = 11; | |
249 | pub const KERN_CLOCKRATE: ::c_int = 12; | |
250 | pub const KERN_VNODE: ::c_int = 13; | |
251 | pub const KERN_PROC: ::c_int = 14; | |
252 | pub const KERN_FILE: ::c_int = 15; | |
253 | pub const KERN_PROF: ::c_int = 16; | |
254 | pub const KERN_POSIX1: ::c_int = 17; | |
255 | pub const KERN_NGROUPS: ::c_int = 18; | |
256 | pub const KERN_JOB_CONTROL: ::c_int = 19; | |
257 | pub const KERN_SAVED_IDS: ::c_int = 20; | |
258 | pub const KERN_BOOTTIME: ::c_int = 21; | |
259 | pub const KERN_NISDOMAINNAME: ::c_int = 22; | |
260 | pub const KERN_UPDATEINTERVAL: ::c_int = 23; | |
261 | pub const KERN_OSRELDATE: ::c_int = 24; | |
262 | pub const KERN_NTP_PLL: ::c_int = 25; | |
263 | pub const KERN_BOOTFILE: ::c_int = 26; | |
264 | pub const KERN_MAXFILESPERPROC: ::c_int = 27; | |
265 | pub const KERN_MAXPROCPERUID: ::c_int = 28; | |
266 | pub const KERN_DUMPDEV: ::c_int = 29; | |
267 | pub const KERN_IPC: ::c_int = 30; | |
268 | pub const KERN_DUMMY: ::c_int = 31; | |
269 | pub const KERN_PS_STRINGS: ::c_int = 32; | |
270 | pub const KERN_USRSTACK: ::c_int = 33; | |
271 | pub const KERN_LOGSIGEXIT: ::c_int = 34; | |
272 | pub const KERN_IOV_MAX: ::c_int = 35; | |
273 | pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36; | |
274 | pub const KERN_MAXID: ::c_int = 37; | |
275 | pub const KERN_PROC_ALL: ::c_int = 0; | |
276 | pub const KERN_PROC_PID: ::c_int = 1; | |
277 | pub const KERN_PROC_PGRP: ::c_int = 2; | |
278 | pub const KERN_PROC_SESSION: ::c_int = 3; | |
279 | pub const KERN_PROC_TTY: ::c_int = 4; | |
280 | pub const KERN_PROC_UID: ::c_int = 5; | |
281 | pub const KERN_PROC_RUID: ::c_int = 6; | |
282 | pub const KERN_PROC_ARGS: ::c_int = 7; | |
283 | pub const KERN_PROC_CWD: ::c_int = 8; | |
284 | pub const KERN_PROC_PATHNAME: ::c_int = 9; | |
285 | pub const KERN_PROC_FLAGMASK: ::c_int = 0x10; | |
286 | pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10; | |
287 | pub const KIPC_MAXSOCKBUF: ::c_int = 1; | |
288 | pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; | |
289 | pub const KIPC_SOMAXCONN: ::c_int = 3; | |
290 | pub const KIPC_MAX_LINKHDR: ::c_int = 4; | |
291 | pub const KIPC_MAX_PROTOHDR: ::c_int = 5; | |
292 | pub const KIPC_MAX_HDR: ::c_int = 6; | |
293 | pub const KIPC_MAX_DATALEN: ::c_int = 7; | |
294 | pub const KIPC_MBSTAT: ::c_int = 8; | |
295 | pub const KIPC_NMBCLUSTERS: ::c_int = 9; | |
296 | pub const HW_MACHINE: ::c_int = 1; | |
297 | pub const HW_MODEL: ::c_int = 2; | |
298 | pub const HW_NCPU: ::c_int = 3; | |
299 | pub const HW_BYTEORDER: ::c_int = 4; | |
300 | pub const HW_PHYSMEM: ::c_int = 5; | |
301 | pub const HW_USERMEM: ::c_int = 6; | |
302 | pub const HW_PAGESIZE: ::c_int = 7; | |
303 | pub const HW_DISKNAMES: ::c_int = 8; | |
304 | pub const HW_DISKSTATS: ::c_int = 9; | |
305 | pub const HW_FLOATINGPT: ::c_int = 10; | |
306 | pub const HW_MACHINE_ARCH: ::c_int = 11; | |
307 | pub const HW_MACHINE_PLATFORM: ::c_int = 12; | |
308 | pub const HW_SENSORS: ::c_int = 13; | |
309 | pub const HW_MAXID: ::c_int = 14; | |
310 | pub const USER_CS_PATH: ::c_int = 1; | |
311 | pub const USER_BC_BASE_MAX: ::c_int = 2; | |
312 | pub const USER_BC_DIM_MAX: ::c_int = 3; | |
313 | pub const USER_BC_SCALE_MAX: ::c_int = 4; | |
314 | pub const USER_BC_STRING_MAX: ::c_int = 5; | |
315 | pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; | |
316 | pub const USER_EXPR_NEST_MAX: ::c_int = 7; | |
317 | pub const USER_LINE_MAX: ::c_int = 8; | |
318 | pub const USER_RE_DUP_MAX: ::c_int = 9; | |
319 | pub const USER_POSIX2_VERSION: ::c_int = 10; | |
320 | pub const USER_POSIX2_C_BIND: ::c_int = 11; | |
321 | pub const USER_POSIX2_C_DEV: ::c_int = 12; | |
322 | pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; | |
323 | pub const USER_POSIX2_FORT_DEV: ::c_int = 14; | |
324 | pub const USER_POSIX2_FORT_RUN: ::c_int = 15; | |
325 | pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; | |
326 | pub const USER_POSIX2_SW_DEV: ::c_int = 17; | |
327 | pub const USER_POSIX2_UPE: ::c_int = 18; | |
328 | pub const USER_STREAM_MAX: ::c_int = 19; | |
329 | pub const USER_TZNAME_MAX: ::c_int = 20; | |
330 | pub const USER_MAXID: ::c_int = 21; | |
331 | pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; | |
332 | pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; | |
333 | pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; | |
334 | pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; | |
335 | pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; | |
336 | pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; | |
337 | pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; | |
338 | pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; | |
339 | pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; | |
340 | pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; | |
341 | pub const CTL_P1003_1B_FSYNC: ::c_int = 11; | |
342 | pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; | |
343 | pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; | |
344 | pub const CTL_P1003_1B_TIMERS: ::c_int = 14; | |
345 | pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; | |
346 | pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; | |
347 | pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; | |
348 | pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; | |
349 | pub const CTL_P1003_1B_UNUSED1: ::c_int = 19; | |
350 | pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; | |
351 | pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; | |
352 | pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; | |
353 | pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; | |
354 | pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; | |
355 | pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; | |
356 | pub const CTL_P1003_1B_MAXID: ::c_int = 26; | |
357 | ||
9e0c209e SL |
358 | pub const EVFILT_READ: ::int16_t = -1; |
359 | pub const EVFILT_WRITE: ::int16_t = -2; | |
360 | pub const EVFILT_AIO: ::int16_t = -3; | |
361 | pub const EVFILT_VNODE: ::int16_t = -4; | |
362 | pub const EVFILT_PROC: ::int16_t = -5; | |
363 | pub const EVFILT_SIGNAL: ::int16_t = -6; | |
364 | pub const EVFILT_TIMER: ::int16_t = -7; | |
3b2f2976 | 365 | pub const EVFILT_EXCEPT: ::int16_t = -8; |
9e0c209e SL |
366 | pub const EVFILT_USER: ::int16_t = -9; |
367 | pub const EVFILT_FS: ::int16_t = -10; | |
368 | ||
369 | pub const EV_ADD: ::uint16_t = 0x1; | |
370 | pub const EV_DELETE: ::uint16_t = 0x2; | |
371 | pub const EV_ENABLE: ::uint16_t = 0x4; | |
372 | pub const EV_DISABLE: ::uint16_t = 0x8; | |
373 | pub const EV_ONESHOT: ::uint16_t = 0x10; | |
374 | pub const EV_CLEAR: ::uint16_t = 0x20; | |
375 | pub const EV_RECEIPT: ::uint16_t = 0x40; | |
376 | pub const EV_DISPATCH: ::uint16_t = 0x80; | |
377 | pub const EV_NODATA: ::uint16_t = 0x1000; | |
378 | pub const EV_FLAG1: ::uint16_t = 0x2000; | |
379 | pub const EV_ERROR: ::uint16_t = 0x4000; | |
380 | pub const EV_EOF: ::uint16_t = 0x8000; | |
381 | pub const EV_SYSFLAGS: ::uint16_t = 0xf000; | |
382 | ||
383 | pub const NOTE_TRIGGER: ::uint32_t = 0x01000000; | |
384 | pub const NOTE_FFNOP: ::uint32_t = 0x00000000; | |
385 | pub const NOTE_FFAND: ::uint32_t = 0x40000000; | |
386 | pub const NOTE_FFOR: ::uint32_t = 0x80000000; | |
387 | pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000; | |
388 | pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000; | |
389 | pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff; | |
390 | pub const NOTE_LOWAT: ::uint32_t = 0x00000001; | |
391 | pub const NOTE_OOB: ::uint32_t = 0x00000002; | |
392 | pub const NOTE_DELETE: ::uint32_t = 0x00000001; | |
393 | pub const NOTE_WRITE: ::uint32_t = 0x00000002; | |
394 | pub const NOTE_EXTEND: ::uint32_t = 0x00000004; | |
395 | pub const NOTE_ATTRIB: ::uint32_t = 0x00000008; | |
396 | pub const NOTE_LINK: ::uint32_t = 0x00000010; | |
397 | pub const NOTE_RENAME: ::uint32_t = 0x00000020; | |
398 | pub const NOTE_REVOKE: ::uint32_t = 0x00000040; | |
399 | pub const NOTE_EXIT: ::uint32_t = 0x80000000; | |
400 | pub const NOTE_FORK: ::uint32_t = 0x40000000; | |
401 | pub const NOTE_EXEC: ::uint32_t = 0x20000000; | |
402 | pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff; | |
403 | pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000; | |
404 | pub const NOTE_TRACK: ::uint32_t = 0x00000001; | |
405 | pub const NOTE_TRACKERR: ::uint32_t = 0x00000002; | |
406 | pub const NOTE_CHILD: ::uint32_t = 0x00000004; | |
407 | ||
cc61c64b XL |
408 | pub const SO_SNDSPACE: ::c_int = 0x100a; |
409 | pub const SO_CPUHINT: ::c_int = 0x1030; | |
410 | ||
abe05a73 XL |
411 | // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101 |
412 | pub const IFF_UP: ::c_int = 0x1; // interface is up | |
413 | pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid | |
414 | pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging | |
415 | pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net | |
416 | pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link | |
417 | pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes | |
418 | pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated | |
419 | pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol | |
420 | pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets | |
421 | pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets | |
422 | pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress | |
423 | pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions | |
424 | pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit | |
425 | pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit | |
426 | pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit | |
427 | pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection | |
428 | pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast | |
429 | // was interface is in polling mode | |
430 | pub const IFF_POLLING_COMPAT: ::c_int = 0x10000; | |
431 | pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode | |
432 | pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode | |
433 | pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP | |
434 | pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode | |
435 | pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input | |
436 | ||
3b2f2976 XL |
437 | // |
438 | // sys/netinet/in.h | |
439 | // Protocols (RFC 1700) | |
440 | // NOTE: These are in addition to the constants defined in src/unix/mod.rs | |
441 | ||
442 | // IPPROTO_IP defined in src/unix/mod.rs | |
443 | /// IP6 hop-by-hop options | |
444 | pub const IPPROTO_HOPOPTS: ::c_int = 0; | |
445 | // IPPROTO_ICMP defined in src/unix/mod.rs | |
446 | /// group mgmt protocol | |
447 | pub const IPPROTO_IGMP: ::c_int = 2; | |
448 | /// gateway^2 (deprecated) | |
449 | pub const IPPROTO_GGP: ::c_int = 3; | |
450 | /// for compatibility | |
451 | pub const IPPROTO_IPIP: ::c_int = 4; | |
452 | // IPPROTO_TCP defined in src/unix/mod.rs | |
453 | /// Stream protocol II. | |
454 | pub const IPPROTO_ST: ::c_int = 7; | |
455 | /// exterior gateway protocol | |
456 | pub const IPPROTO_EGP: ::c_int = 8; | |
457 | /// private interior gateway | |
458 | pub const IPPROTO_PIGP: ::c_int = 9; | |
459 | /// BBN RCC Monitoring | |
460 | pub const IPPROTO_RCCMON: ::c_int = 10; | |
461 | /// network voice protocol | |
462 | pub const IPPROTO_NVPII: ::c_int = 11; | |
463 | /// pup | |
464 | pub const IPPROTO_PUP: ::c_int = 12; | |
465 | /// Argus | |
466 | pub const IPPROTO_ARGUS: ::c_int = 13; | |
467 | /// EMCON | |
468 | pub const IPPROTO_EMCON: ::c_int = 14; | |
469 | /// Cross Net Debugger | |
470 | pub const IPPROTO_XNET: ::c_int = 15; | |
471 | /// Chaos | |
472 | pub const IPPROTO_CHAOS: ::c_int = 16; | |
473 | // IPPROTO_UDP defined in src/unix/mod.rs | |
474 | /// Multiplexing | |
475 | pub const IPPROTO_MUX: ::c_int = 18; | |
476 | /// DCN Measurement Subsystems | |
477 | pub const IPPROTO_MEAS: ::c_int = 19; | |
478 | /// Host Monitoring | |
479 | pub const IPPROTO_HMP: ::c_int = 20; | |
480 | /// Packet Radio Measurement | |
481 | pub const IPPROTO_PRM: ::c_int = 21; | |
482 | /// xns idp | |
483 | pub const IPPROTO_IDP: ::c_int = 22; | |
484 | /// Trunk-1 | |
485 | pub const IPPROTO_TRUNK1: ::c_int = 23; | |
486 | /// Trunk-2 | |
487 | pub const IPPROTO_TRUNK2: ::c_int = 24; | |
488 | /// Leaf-1 | |
489 | pub const IPPROTO_LEAF1: ::c_int = 25; | |
490 | /// Leaf-2 | |
491 | pub const IPPROTO_LEAF2: ::c_int = 26; | |
492 | /// Reliable Data | |
493 | pub const IPPROTO_RDP: ::c_int = 27; | |
494 | /// Reliable Transaction | |
495 | pub const IPPROTO_IRTP: ::c_int = 28; | |
496 | /// tp-4 w/ class negotiation | |
497 | pub const IPPROTO_TP: ::c_int = 29; | |
498 | /// Bulk Data Transfer | |
499 | pub const IPPROTO_BLT: ::c_int = 30; | |
500 | /// Network Services | |
501 | pub const IPPROTO_NSP: ::c_int = 31; | |
502 | /// Merit Internodal | |
503 | pub const IPPROTO_INP: ::c_int = 32; | |
504 | /// Sequential Exchange | |
505 | pub const IPPROTO_SEP: ::c_int = 33; | |
506 | /// Third Party Connect | |
507 | pub const IPPROTO_3PC: ::c_int = 34; | |
508 | /// InterDomain Policy Routing | |
509 | pub const IPPROTO_IDPR: ::c_int = 35; | |
510 | /// XTP | |
511 | pub const IPPROTO_XTP: ::c_int = 36; | |
512 | /// Datagram Delivery | |
513 | pub const IPPROTO_DDP: ::c_int = 37; | |
514 | /// Control Message Transport | |
515 | pub const IPPROTO_CMTP: ::c_int = 38; | |
516 | /// TP++ Transport | |
517 | pub const IPPROTO_TPXX: ::c_int = 39; | |
518 | /// IL transport protocol | |
519 | pub const IPPROTO_IL: ::c_int = 40; | |
520 | // IPPROTO_IPV6 defined in src/unix/mod.rs | |
521 | /// Source Demand Routing | |
522 | pub const IPPROTO_SDRP: ::c_int = 42; | |
523 | /// IP6 routing header | |
524 | pub const IPPROTO_ROUTING: ::c_int = 43; | |
525 | /// IP6 fragmentation header | |
526 | pub const IPPROTO_FRAGMENT: ::c_int = 44; | |
527 | /// InterDomain Routing | |
528 | pub const IPPROTO_IDRP: ::c_int = 45; | |
529 | /// resource reservation | |
530 | pub const IPPROTO_RSVP: ::c_int = 46; | |
531 | /// General Routing Encap. | |
532 | pub const IPPROTO_GRE: ::c_int = 47; | |
533 | /// Mobile Host Routing | |
534 | pub const IPPROTO_MHRP: ::c_int = 48; | |
535 | /// BHA | |
536 | pub const IPPROTO_BHA: ::c_int = 49; | |
537 | /// IP6 Encap Sec. Payload | |
538 | pub const IPPROTO_ESP: ::c_int = 50; | |
539 | /// IP6 Auth Header | |
540 | pub const IPPROTO_AH: ::c_int = 51; | |
541 | /// Integ. Net Layer Security | |
542 | pub const IPPROTO_INLSP: ::c_int = 52; | |
543 | /// IP with encryption | |
544 | pub const IPPROTO_SWIPE: ::c_int = 53; | |
545 | /// Next Hop Resolution | |
546 | pub const IPPROTO_NHRP: ::c_int = 54; | |
547 | /// IP Mobility | |
548 | pub const IPPROTO_MOBILE: ::c_int = 55; | |
549 | /// Transport Layer Security | |
550 | pub const IPPROTO_TLSP: ::c_int = 56; | |
551 | /// SKIP | |
552 | pub const IPPROTO_SKIP: ::c_int = 57; | |
553 | // IPPROTO_ICMPV6 defined in src/unix/mod.rs | |
554 | /// IP6 no next header | |
555 | pub const IPPROTO_NONE: ::c_int = 59; | |
556 | /// IP6 destination option | |
557 | pub const IPPROTO_DSTOPTS: ::c_int = 60; | |
558 | /// any host internal protocol | |
559 | pub const IPPROTO_AHIP: ::c_int = 61; | |
560 | /// CFTP | |
561 | pub const IPPROTO_CFTP: ::c_int = 62; | |
562 | /// "hello" routing protocol | |
563 | pub const IPPROTO_HELLO: ::c_int = 63; | |
564 | /// SATNET/Backroom EXPAK | |
565 | pub const IPPROTO_SATEXPAK: ::c_int = 64; | |
566 | /// Kryptolan | |
567 | pub const IPPROTO_KRYPTOLAN: ::c_int = 65; | |
568 | /// Remote Virtual Disk | |
569 | pub const IPPROTO_RVD: ::c_int = 66; | |
570 | /// Pluribus Packet Core | |
571 | pub const IPPROTO_IPPC: ::c_int = 67; | |
572 | /// Any distributed FS | |
573 | pub const IPPROTO_ADFS: ::c_int = 68; | |
574 | /// Satnet Monitoring | |
575 | pub const IPPROTO_SATMON: ::c_int = 69; | |
576 | /// VISA Protocol | |
577 | pub const IPPROTO_VISA: ::c_int = 70; | |
578 | /// Packet Core Utility | |
579 | pub const IPPROTO_IPCV: ::c_int = 71; | |
580 | /// Comp. Prot. Net. Executive | |
581 | pub const IPPROTO_CPNX: ::c_int = 72; | |
582 | /// Comp. Prot. HeartBeat | |
583 | pub const IPPROTO_CPHB: ::c_int = 73; | |
584 | /// Wang Span Network | |
585 | pub const IPPROTO_WSN: ::c_int = 74; | |
586 | /// Packet Video Protocol | |
587 | pub const IPPROTO_PVP: ::c_int = 75; | |
588 | /// BackRoom SATNET Monitoring | |
589 | pub const IPPROTO_BRSATMON: ::c_int = 76; | |
590 | /// Sun net disk proto (temp.) | |
591 | pub const IPPROTO_ND: ::c_int = 77; | |
592 | /// WIDEBAND Monitoring | |
593 | pub const IPPROTO_WBMON: ::c_int = 78; | |
594 | /// WIDEBAND EXPAK | |
595 | pub const IPPROTO_WBEXPAK: ::c_int = 79; | |
596 | /// ISO cnlp | |
597 | pub const IPPROTO_EON: ::c_int = 80; | |
598 | /// VMTP | |
599 | pub const IPPROTO_VMTP: ::c_int = 81; | |
600 | /// Secure VMTP | |
601 | pub const IPPROTO_SVMTP: ::c_int = 82; | |
602 | /// Banyon VINES | |
603 | pub const IPPROTO_VINES: ::c_int = 83; | |
604 | /// TTP | |
605 | pub const IPPROTO_TTP: ::c_int = 84; | |
606 | /// NSFNET-IGP | |
607 | pub const IPPROTO_IGP: ::c_int = 85; | |
608 | /// dissimilar gateway prot. | |
609 | pub const IPPROTO_DGP: ::c_int = 86; | |
610 | /// TCF | |
611 | pub const IPPROTO_TCF: ::c_int = 87; | |
612 | /// Cisco/GXS IGRP | |
613 | pub const IPPROTO_IGRP: ::c_int = 88; | |
614 | /// OSPFIGP | |
615 | pub const IPPROTO_OSPFIGP: ::c_int = 89; | |
616 | /// Strite RPC protocol | |
617 | pub const IPPROTO_SRPC: ::c_int = 90; | |
618 | /// Locus Address Resoloution | |
619 | pub const IPPROTO_LARP: ::c_int = 91; | |
620 | /// Multicast Transport | |
621 | pub const IPPROTO_MTP: ::c_int = 92; | |
622 | /// AX.25 Frames | |
623 | pub const IPPROTO_AX25: ::c_int = 93; | |
624 | /// IP encapsulated in IP | |
625 | pub const IPPROTO_IPEIP: ::c_int = 94; | |
626 | /// Mobile Int.ing control | |
627 | pub const IPPROTO_MICP: ::c_int = 95; | |
628 | /// Semaphore Comm. security | |
629 | pub const IPPROTO_SCCSP: ::c_int = 96; | |
630 | /// Ethernet IP encapsulation | |
631 | pub const IPPROTO_ETHERIP: ::c_int = 97; | |
632 | /// encapsulation header | |
633 | pub const IPPROTO_ENCAP: ::c_int = 98; | |
634 | /// any private encr. scheme | |
635 | pub const IPPROTO_APES: ::c_int = 99; | |
636 | /// GMTP | |
637 | pub const IPPROTO_GMTP: ::c_int = 100; | |
638 | /// payload compression (IPComp) | |
639 | pub const IPPROTO_IPCOMP: ::c_int = 108; | |
640 | ||
641 | /* 101-254: Partly Unassigned */ | |
642 | /// Protocol Independent Mcast | |
643 | pub const IPPROTO_PIM: ::c_int = 103; | |
644 | /// CARP | |
645 | pub const IPPROTO_CARP: ::c_int = 112; | |
646 | /// PGM | |
647 | pub const IPPROTO_PGM: ::c_int = 113; | |
648 | /// PFSYNC | |
649 | pub const IPPROTO_PFSYNC: ::c_int = 240; | |
650 | ||
651 | /* 255: Reserved */ | |
652 | /* BSD Private, local use, namespace incursion, no longer used */ | |
653 | /// divert pseudo-protocol | |
654 | pub const IPPROTO_DIVERT: ::c_int = 254; | |
655 | pub const IPPROTO_MAX: ::c_int = 256; | |
656 | /// last return value of *_input(), meaning "all job for this pkt is done". | |
657 | pub const IPPROTO_DONE: ::c_int = 257; | |
658 | ||
659 | /// Used by RSS: the layer3 protocol is unknown | |
660 | pub const IPPROTO_UNKNOWN: ::c_int = 258; | |
661 | ||
cc61c64b XL |
662 | pub const AF_BLUETOOTH: ::c_int = 33; |
663 | pub const AF_MPLS: ::c_int = 34; | |
664 | pub const AF_IEEE80211: ::c_int = 35; | |
665 | pub const AF_MAX: ::c_int = 36; | |
666 | ||
667 | pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; | |
668 | pub const PF_MAX: ::c_int = AF_MAX; | |
669 | ||
670 | pub const NET_RT_DUMP: ::c_int = 1; | |
671 | pub const NET_RT_FLAGS: ::c_int = 2; | |
672 | pub const NET_RT_IFLIST: ::c_int = 3; | |
673 | pub const NET_RT_MAXID: ::c_int = 4; | |
674 | ||
675 | pub const SOMAXOPT_SIZE: ::c_int = 65536; | |
676 | ||
677 | #[doc(hidden)] | |
678 | pub const NET_MAXID: ::c_int = AF_MAX; | |
679 | ||
680 | pub const MSG_UNUSED09: ::c_int = 0x00000200; | |
681 | pub const MSG_NOSIGNAL: ::c_int = 0x00000400; | |
682 | pub const MSG_SYNC: ::c_int = 0x00000800; | |
683 | pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000; | |
684 | pub const MSG_FBLOCKING: ::c_int = 0x00010000; | |
685 | pub const MSG_FNONBLOCKING: ::c_int = 0x00020000; | |
686 | pub const MSG_FMASK: ::c_int = 0xFFFF0000; | |
32a655c1 SL |
687 | |
688 | pub const EMPTY: ::c_short = 0; | |
689 | pub const RUN_LVL: ::c_short = 1; | |
690 | pub const BOOT_TIME: ::c_short = 2; | |
691 | pub const OLD_TIME: ::c_short = 3; | |
692 | pub const NEW_TIME: ::c_short = 4; | |
693 | pub const INIT_PROCESS: ::c_short = 5; | |
694 | pub const LOGIN_PROCESS: ::c_short = 6; | |
695 | pub const USER_PROCESS: ::c_short = 7; | |
696 | pub const DEAD_PROCESS: ::c_short = 8; | |
697 | ||
698 | pub const LC_COLLATE_MASK: ::c_int = (1 << 0); | |
699 | pub const LC_CTYPE_MASK: ::c_int = (1 << 1); | |
700 | pub const LC_MONETARY_MASK: ::c_int = (1 << 2); | |
701 | pub const LC_NUMERIC_MASK: ::c_int = (1 << 3); | |
702 | pub const LC_TIME_MASK: ::c_int = (1 << 4); | |
703 | pub const LC_MESSAGES_MASK: ::c_int = (1 << 5); | |
704 | pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK | |
705 | | LC_CTYPE_MASK | |
706 | | LC_MESSAGES_MASK | |
707 | | LC_MONETARY_MASK | |
708 | | LC_NUMERIC_MASK | |
709 | | LC_TIME_MASK; | |
9e0c209e | 710 | |
8bb4bdeb XL |
711 | pub const TIOCSIG: ::c_uint = 0x2000745f; |
712 | pub const BTUARTDISC: ::c_int = 0x7; | |
713 | pub const TIOCDCDTIMESTAMP: ::c_uint = 0x40107458; | |
714 | pub const TIOCISPTMASTER: ::c_uint = 0x20007455; | |
715 | pub const TIOCMODG: ::c_uint = 0x40047403; | |
716 | pub const TIOCMODS: ::c_ulong = 0x80047404; | |
717 | pub const TIOCREMOTE: ::c_ulong = 0x80047469; | |
718 | ||
3b2f2976 XL |
719 | // Constants used by "at" family of system calls. |
720 | pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor | |
721 | pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1; | |
722 | pub const AT_REMOVEDIR: ::c_int = 2; | |
723 | pub const AT_EACCESS: ::c_int = 4; | |
724 | pub const AT_SYMLINK_FOLLOW: ::c_int = 8; | |
725 | ||
726 | pub const VCHECKPT: usize = 19; | |
727 | ||
728 | pub const _PC_2_SYMLINKS: ::c_int = 22; | |
729 | pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23; | |
730 | ||
731 | pub const _SC_V7_ILP32_OFF32: ::c_int = 122; | |
732 | pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123; | |
733 | pub const _SC_V7_LP64_OFF64: ::c_int = 124; | |
734 | pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125; | |
735 | pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126; | |
736 | pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127; | |
737 | ||
ff7c6d11 XL |
738 | pub const WCONTINUED: ::c_int = 4; |
739 | pub const WSTOPPED: ::c_int = 0o177; | |
740 | ||
2c00a5a8 XL |
741 | // Values for struct rtprio (type_ field) |
742 | pub const RTP_PRIO_REALTIME: ::c_ushort = 0; | |
743 | pub const RTP_PRIO_NORMAL: ::c_ushort = 1; | |
744 | pub const RTP_PRIO_IDLE: ::c_ushort = 2; | |
745 | pub const RTP_PRIO_THREAD: ::c_ushort = 3; | |
746 | ||
54a0048b SL |
747 | extern { |
748 | pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) | |
749 | -> ::c_int; | |
3b2f2976 XL |
750 | pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; |
751 | pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; | |
752 | pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; | |
32a655c1 SL |
753 | |
754 | pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int; | |
755 | ||
756 | pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, | |
757 | timeout: *mut ::timespec) -> ::c_int; | |
758 | ||
759 | pub fn freelocale(loc: ::locale_t); | |
2c00a5a8 XL |
760 | |
761 | pub fn lwp_rtprio(function: ::c_int, pid: ::pid_t, lwpid: lwpid_t, | |
762 | rtp: *mut super::rtprio) -> ::c_int; | |
54a0048b | 763 | } |