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