]>
Commit | Line | Data |
---|---|---|
476ff2be SL |
1 | pub type clock_t = ::c_uint; |
2 | pub type suseconds_t = ::c_int; | |
3 | pub type dev_t = u64; | |
4 | pub type blksize_t = ::int32_t; | |
5 | pub type fsblkcnt_t = ::uint64_t; | |
6 | pub type fsfilcnt_t = ::uint64_t; | |
8bb4bdeb | 7 | pub type idtype_t = ::c_int; |
476ff2be SL |
8 | |
9 | s! { | |
8bb4bdeb XL |
10 | pub struct aiocb { |
11 | pub aio_offset: ::off_t, | |
12 | pub aio_buf: *mut ::c_void, | |
13 | pub aio_nbytes: ::size_t, | |
14 | pub aio_fildes: ::c_int, | |
15 | pub aio_lio_opcode: ::c_int, | |
16 | pub aio_reqprio: ::c_int, | |
17 | pub aio_sigevent: ::sigevent, | |
18 | _state: ::c_int, | |
19 | _errno: ::c_int, | |
20 | _retval: ::ssize_t | |
21 | } | |
22 | ||
476ff2be SL |
23 | pub struct dirent { |
24 | pub d_fileno: ::ino_t, | |
25 | pub d_reclen: u16, | |
26 | pub d_namlen: u16, | |
27 | pub d_type: u8, | |
28 | pub d_name: [::c_char; 512], | |
29 | } | |
30 | ||
31 | pub struct glob_t { | |
32 | pub gl_pathc: ::size_t, | |
33 | pub gl_matchc: ::size_t, | |
34 | pub gl_offs: ::size_t, | |
35 | pub gl_flags: ::c_int, | |
36 | pub gl_pathv: *mut *mut ::c_char, | |
37 | ||
38 | __unused3: *mut ::c_void, | |
39 | ||
40 | __unused4: *mut ::c_void, | |
41 | __unused5: *mut ::c_void, | |
42 | __unused6: *mut ::c_void, | |
43 | __unused7: *mut ::c_void, | |
44 | __unused8: *mut ::c_void, | |
45 | } | |
46 | ||
8bb4bdeb XL |
47 | pub struct sigevent { |
48 | pub sigev_notify: ::c_int, | |
49 | pub sigev_signo: ::c_int, | |
50 | pub sigev_value: ::sigval, | |
51 | __unused1: *mut ::c_void, //actually a function pointer | |
52 | pub sigev_notify_attributes: *mut ::c_void | |
53 | } | |
54 | ||
476ff2be SL |
55 | pub struct sigset_t { |
56 | __bits: [u32; 4], | |
57 | } | |
58 | ||
59 | pub struct stat { | |
60 | pub st_dev: ::dev_t, | |
61 | pub st_mode: ::mode_t, | |
62 | pub st_ino: ::ino_t, | |
63 | pub st_nlink: ::nlink_t, | |
64 | pub st_uid: ::uid_t, | |
65 | pub st_gid: ::gid_t, | |
66 | pub st_rdev: ::dev_t, | |
67 | pub st_atime: ::time_t, | |
68 | pub st_atimensec: ::c_long, | |
69 | pub st_mtime: ::time_t, | |
70 | pub st_mtimensec: ::c_long, | |
71 | pub st_ctime: ::time_t, | |
72 | pub st_ctimensec: ::c_long, | |
73 | pub st_birthtime: ::time_t, | |
74 | pub st_birthtimensec: ::c_long, | |
75 | pub st_size: ::off_t, | |
76 | pub st_blocks: ::blkcnt_t, | |
77 | pub st_blksize: ::blksize_t, | |
78 | pub st_flags: ::uint32_t, | |
79 | pub st_gen: ::uint32_t, | |
80 | pub st_spare: [::uint32_t; 2], | |
81 | } | |
82 | ||
83 | pub struct statvfs { | |
84 | pub f_flag: ::c_ulong, | |
85 | pub f_bsize: ::c_ulong, | |
86 | pub f_frsize: ::c_ulong, | |
87 | pub f_iosize: ::c_ulong, | |
88 | ||
89 | pub f_blocks: ::fsblkcnt_t, | |
90 | pub f_bfree: ::fsblkcnt_t, | |
91 | pub f_bavail: ::fsblkcnt_t, | |
92 | pub f_bresvd: ::fsblkcnt_t, | |
93 | ||
94 | pub f_files: ::fsfilcnt_t, | |
95 | pub f_ffree: ::fsfilcnt_t, | |
96 | pub f_favail: ::fsfilcnt_t, | |
97 | pub f_fresvd: ::fsfilcnt_t, | |
98 | ||
99 | pub f_syncreads: ::uint64_t, | |
100 | pub f_syncwrites: ::uint64_t, | |
101 | ||
102 | pub f_asyncreads: ::uint64_t, | |
103 | pub f_asyncwrites: ::uint64_t, | |
104 | ||
105 | pub f_fsidx: ::fsid_t, | |
106 | pub f_fsid: ::c_ulong, | |
107 | pub f_namemax: ::c_ulong, | |
108 | pub f_owner: ::uid_t, | |
109 | ||
110 | pub f_spare: [::uint32_t; 4], | |
111 | ||
112 | pub f_fstypename: [::c_char; 32], | |
113 | pub f_mntonname: [::c_char; 1024], | |
114 | pub f_mntfromname: [::c_char; 1024], | |
115 | } | |
116 | ||
117 | pub struct addrinfo { | |
118 | pub ai_flags: ::c_int, | |
119 | pub ai_family: ::c_int, | |
120 | pub ai_socktype: ::c_int, | |
121 | pub ai_protocol: ::c_int, | |
122 | pub ai_addrlen: ::socklen_t, | |
123 | pub ai_canonname: *mut ::c_char, | |
124 | pub ai_addr: *mut ::sockaddr, | |
125 | pub ai_next: *mut ::addrinfo, | |
126 | } | |
127 | ||
128 | pub struct sockaddr_storage { | |
129 | pub ss_len: u8, | |
130 | pub ss_family: ::sa_family_t, | |
131 | __ss_pad1: [u8; 6], | |
132 | __ss_pad2: i64, | |
133 | __ss_pad3: [u8; 112], | |
134 | } | |
135 | ||
136 | pub struct siginfo_t { | |
137 | pub si_signo: ::c_int, | |
138 | pub si_code: ::c_int, | |
139 | pub si_errno: ::c_int, | |
140 | __pad1: ::c_int, | |
141 | pub si_addr: *mut ::c_void, | |
142 | __pad2: [u64; 13], | |
143 | } | |
144 | ||
145 | pub struct pthread_attr_t { | |
146 | pta_magic: ::c_uint, | |
147 | pta_flags: ::c_int, | |
148 | pta_private: *mut ::c_void, | |
149 | } | |
150 | ||
151 | pub struct pthread_mutex_t { | |
152 | ptm_magic: ::c_uint, | |
153 | ptm_errorcheck: ::c_uchar, | |
154 | ptm_pad1: [u8; 3], | |
155 | ptm_interlock: ::c_uchar, | |
156 | ptm_pad2: [u8; 3], | |
157 | ptm_owner: ::pthread_t, | |
158 | ptm_waiters: *mut u8, | |
159 | ptm_recursed: ::c_uint, | |
160 | ptm_spare2: *mut ::c_void, | |
161 | } | |
162 | ||
163 | pub struct pthread_mutexattr_t { | |
164 | ptma_magic: ::c_uint, | |
165 | ptma_private: *mut ::c_void, | |
166 | } | |
167 | ||
041b39d2 XL |
168 | pub struct pthread_rwlockattr_t { |
169 | ptra_magic: ::c_uint, | |
170 | ptra_private: *mut ::c_void, | |
171 | } | |
172 | ||
476ff2be SL |
173 | pub struct pthread_cond_t { |
174 | ptc_magic: ::c_uint, | |
175 | ptc_lock: ::c_uchar, | |
176 | ptc_waiters_first: *mut u8, | |
177 | ptc_waiters_last: *mut u8, | |
178 | ptc_mutex: *mut ::pthread_mutex_t, | |
179 | ptc_private: *mut ::c_void, | |
180 | } | |
181 | ||
182 | pub struct pthread_condattr_t { | |
183 | ptca_magic: ::c_uint, | |
184 | ptca_private: *mut ::c_void, | |
185 | } | |
186 | ||
187 | pub struct pthread_rwlock_t { | |
188 | ptr_magic: ::c_uint, | |
189 | ptr_interlock: ::c_uchar, | |
190 | ptr_rblocked_first: *mut u8, | |
191 | ptr_rblocked_last: *mut u8, | |
192 | ptr_wblocked_first: *mut u8, | |
193 | ptr_wblocked_last: *mut u8, | |
194 | ptr_nreaders: ::c_uint, | |
195 | ptr_owner: ::pthread_t, | |
196 | ptr_private: *mut ::c_void, | |
197 | } | |
198 | ||
199 | pub struct kevent { | |
200 | pub ident: ::uintptr_t, | |
201 | pub filter: ::uint32_t, | |
202 | pub flags: ::uint32_t, | |
203 | pub fflags: ::uint32_t, | |
204 | pub data: ::int64_t, | |
205 | pub udata: ::intptr_t, | |
206 | } | |
207 | ||
208 | pub struct dqblk { | |
209 | pub dqb_bhardlimit: ::uint32_t, | |
210 | pub dqb_bsoftlimit: ::uint32_t, | |
211 | pub dqb_curblocks: ::uint32_t, | |
212 | pub dqb_ihardlimit: ::uint32_t, | |
213 | pub dqb_isoftlimit: ::uint32_t, | |
214 | pub dqb_curinodes: ::uint32_t, | |
215 | pub dqb_btime: ::int32_t, | |
216 | pub dqb_itime: ::int32_t, | |
217 | } | |
218 | ||
219 | pub struct Dl_info { | |
220 | pub dli_fname: *const ::c_char, | |
221 | pub dli_fbase: *mut ::c_void, | |
222 | pub dli_sname: *const ::c_char, | |
223 | pub dli_saddr: *const ::c_void, | |
224 | } | |
225 | ||
226 | pub struct lconv { | |
227 | pub decimal_point: *mut ::c_char, | |
228 | pub thousands_sep: *mut ::c_char, | |
229 | pub grouping: *mut ::c_char, | |
230 | pub int_curr_symbol: *mut ::c_char, | |
231 | pub currency_symbol: *mut ::c_char, | |
232 | pub mon_decimal_point: *mut ::c_char, | |
233 | pub mon_thousands_sep: *mut ::c_char, | |
234 | pub mon_grouping: *mut ::c_char, | |
235 | pub positive_sign: *mut ::c_char, | |
236 | pub negative_sign: *mut ::c_char, | |
237 | pub int_frac_digits: ::c_char, | |
238 | pub frac_digits: ::c_char, | |
239 | pub p_cs_precedes: ::c_char, | |
240 | pub p_sep_by_space: ::c_char, | |
241 | pub n_cs_precedes: ::c_char, | |
242 | pub n_sep_by_space: ::c_char, | |
243 | pub p_sign_posn: ::c_char, | |
244 | pub n_sign_posn: ::c_char, | |
245 | pub int_p_cs_precedes: ::c_char, | |
246 | pub int_n_cs_precedes: ::c_char, | |
247 | pub int_p_sep_by_space: ::c_char, | |
248 | pub int_n_sep_by_space: ::c_char, | |
249 | pub int_p_sign_posn: ::c_char, | |
250 | pub int_n_sign_posn: ::c_char, | |
251 | } | |
3b2f2976 XL |
252 | |
253 | pub struct if_data { | |
254 | pub ifi_type: ::c_uchar, | |
255 | pub ifi_addrlen: ::c_uchar, | |
256 | pub ifi_hdrlen: ::c_uchar, | |
257 | pub ifi_link_state: ::c_int, | |
258 | pub ifi_mtu: u64, | |
259 | pub ifi_metric: u64, | |
260 | pub ifi_baudrate: u64, | |
261 | pub ifi_ipackets: u64, | |
262 | pub ifi_ierrors: u64, | |
263 | pub ifi_opackets: u64, | |
264 | pub ifi_oerrors: u64, | |
265 | pub ifi_collisions: u64, | |
266 | pub ifi_ibytes: u64, | |
267 | pub ifi_obytes: u64, | |
268 | pub ifi_imcasts: u64, | |
269 | pub ifi_omcasts: u64, | |
270 | pub ifi_iqdrops: u64, | |
271 | pub ifi_noproto: u64, | |
272 | pub ifi_lastchange: ::timespec, | |
273 | } | |
274 | ||
275 | pub struct if_msghdr { | |
276 | pub ifm_msglen: ::c_ushort, | |
277 | pub ifm_version: ::c_uchar, | |
278 | pub ifm_type: ::c_uchar, | |
279 | pub ifm_addrs: ::c_int, | |
280 | pub ifm_flags: ::c_int, | |
281 | pub ifm_index: ::c_ushort, | |
282 | pub ifm_data: if_data, | |
283 | } | |
476ff2be SL |
284 | } |
285 | ||
7cac9316 XL |
286 | pub const AT_FDCWD: ::c_int = -100; |
287 | pub const AT_EACCESS: ::c_int = 0x100; | |
288 | pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; | |
289 | pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; | |
290 | pub const AT_REMOVEDIR: ::c_int = 0x800; | |
291 | ||
476ff2be SL |
292 | pub const LC_COLLATE_MASK: ::c_int = (1 << ::LC_COLLATE); |
293 | pub const LC_CTYPE_MASK: ::c_int = (1 << ::LC_CTYPE); | |
294 | pub const LC_MONETARY_MASK: ::c_int = (1 << ::LC_MONETARY); | |
295 | pub const LC_NUMERIC_MASK: ::c_int = (1 << ::LC_NUMERIC); | |
296 | pub const LC_TIME_MASK: ::c_int = (1 << ::LC_TIME); | |
297 | pub const LC_MESSAGES_MASK: ::c_int = (1 << ::LC_MESSAGES); | |
298 | pub const LC_ALL_MASK: ::c_int = !0; | |
299 | ||
300 | pub const ERA: ::nl_item = 52; | |
301 | pub const ERA_D_FMT: ::nl_item = 53; | |
302 | pub const ERA_D_T_FMT: ::nl_item = 54; | |
303 | pub const ERA_T_FMT: ::nl_item = 55; | |
304 | pub const ALT_DIGITS: ::nl_item = 56; | |
305 | ||
306 | pub const O_CLOEXEC: ::c_int = 0x400000; | |
307 | pub const O_ALT_IO: ::c_int = 0x40000; | |
308 | pub const O_NOSIGPIPE: ::c_int = 0x1000000; | |
309 | pub const O_SEARCH: ::c_int = 0x800000; | |
476ff2be | 310 | pub const O_DIRECTORY: ::c_int = 0x200000; |
041b39d2 XL |
311 | pub const O_DIRECT : ::c_int = 0x00080000; |
312 | pub const O_RSYNC : ::c_int = 0x00020000; | |
476ff2be SL |
313 | |
314 | pub const MS_SYNC : ::c_int = 0x4; | |
315 | pub const MS_INVALIDATE : ::c_int = 0x2; | |
316 | ||
317 | pub const RLIM_NLIMITS: ::c_int = 12; | |
318 | ||
319 | pub const ENOATTR : ::c_int = 93; | |
320 | pub const EILSEQ : ::c_int = 85; | |
321 | pub const EOVERFLOW : ::c_int = 84; | |
322 | pub const ECANCELED : ::c_int = 87; | |
323 | pub const EIDRM : ::c_int = 82; | |
324 | pub const ENOMSG : ::c_int = 83; | |
325 | pub const ENOTSUP : ::c_int = 86; | |
326 | pub const ELAST : ::c_int = 96; | |
327 | ||
328 | pub const F_DUPFD_CLOEXEC : ::c_int = 12; | |
329 | pub const F_CLOSEM: ::c_int = 10; | |
330 | pub const F_GETNOSIGPIPE: ::c_int = 13; | |
331 | pub const F_SETNOSIGPIPE: ::c_int = 14; | |
332 | pub const F_MAXFD: ::c_int = 11; | |
333 | ||
334 | pub const IPV6_JOIN_GROUP: ::c_int = 12; | |
335 | pub const IPV6_LEAVE_GROUP: ::c_int = 13; | |
336 | ||
8bb4bdeb XL |
337 | pub const SOCK_CONN_DGRAM: ::c_int = 6; |
338 | pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM; | |
339 | pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000; | |
340 | pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000; | |
341 | ||
476ff2be SL |
342 | pub const SO_SNDTIMEO: ::c_int = 0x100b; |
343 | pub const SO_RCVTIMEO: ::c_int = 0x100c; | |
8bb4bdeb XL |
344 | pub const SO_ACCEPTFILTER: ::c_int = 0x1000; |
345 | pub const SO_TIMESTAMP: ::c_int = 0x2000; | |
346 | pub const SO_OVERFLOWED: ::c_int = 0x1009; | |
347 | pub const SO_NOHEADER: ::c_int = 0x100a; | |
348 | ||
ea8adc8c XL |
349 | // sys/netinet/in.h |
350 | // Protocols (RFC 1700) | |
351 | // NOTE: These are in addition to the constants defined in src/unix/mod.rs | |
352 | ||
353 | // IPPROTO_IP defined in src/unix/mod.rs | |
354 | /// Hop-by-hop option header | |
355 | pub const IPPROTO_HOPOPTS: ::c_int = 0; | |
356 | // IPPROTO_ICMP defined in src/unix/mod.rs | |
357 | /// group mgmt protocol | |
358 | pub const IPPROTO_IGMP: ::c_int = 2; | |
359 | /// gateway^2 (deprecated) | |
360 | pub const IPPROTO_GGP: ::c_int = 3; | |
361 | /// for compatibility | |
362 | pub const IPPROTO_IPIP: ::c_int = 4; | |
363 | // IPPROTO_TCP defined in src/unix/mod.rs | |
364 | /// exterior gateway protocol | |
365 | pub const IPPROTO_EGP: ::c_int = 8; | |
366 | /// pup | |
367 | pub const IPPROTO_PUP: ::c_int = 12; | |
368 | // IPPROTO_UDP defined in src/unix/mod.rs | |
369 | /// xns idp | |
370 | pub const IPPROTO_IDP: ::c_int = 22; | |
371 | /// tp-4 w/ class negotiation | |
372 | pub const IPPROTO_TP: ::c_int = 29; | |
373 | /// DCCP | |
374 | pub const IPPROTO_DCCP: ::c_int = 33; | |
375 | // IPPROTO_IPV6 defined in src/unix/mod.rs | |
376 | /// IP6 routing header | |
377 | pub const IPPROTO_ROUTING: ::c_int = 43; | |
378 | /// IP6 fragmentation header | |
379 | pub const IPPROTO_FRAGMENT: ::c_int = 44; | |
380 | /// resource reservation | |
381 | pub const IPPROTO_RSVP: ::c_int = 46; | |
382 | /// General Routing Encap. | |
383 | pub const IPPROTO_GRE: ::c_int = 47; | |
384 | /// IP6 Encap Sec. Payload | |
385 | pub const IPPROTO_ESP: ::c_int = 50; | |
386 | /// IP6 Auth Header | |
387 | pub const IPPROTO_AH: ::c_int = 51; | |
388 | /// IP Mobility RFC 2004 | |
389 | pub const IPPROTO_MOBILE: ::c_int = 55; | |
390 | /// IPv6 ICMP | |
391 | pub const IPPROTO_IPV6_ICMP: ::c_int = 58; | |
392 | // IPPROTO_ICMPV6 defined in src/unix/mod.rs | |
393 | /// IP6 no next header | |
394 | pub const IPPROTO_NONE: ::c_int = 59; | |
395 | /// IP6 destination option | |
396 | pub const IPPROTO_DSTOPTS: ::c_int = 60; | |
397 | /// ISO cnlp | |
398 | pub const IPPROTO_EON: ::c_int = 80; | |
399 | /// Ethernet-in-IP | |
400 | pub const IPPROTO_ETHERIP: ::c_int = 97; | |
401 | /// encapsulation header | |
402 | pub const IPPROTO_ENCAP: ::c_int = 98; | |
403 | /// Protocol indep. multicast | |
404 | pub const IPPROTO_PIM: ::c_int = 103; | |
405 | /// IP Payload Comp. Protocol | |
406 | pub const IPPROTO_IPCOMP: ::c_int = 108; | |
407 | /// VRRP RFC 2338 | |
408 | pub const IPPROTO_VRRP: ::c_int = 112; | |
409 | /// Common Address Resolution Protocol | |
410 | pub const IPPROTO_CARP: ::c_int = 112; | |
411 | /// L2TPv3 | |
412 | // TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16, | |
413 | // but isn't yet supported by the NetBSD rumprun kernel image used for | |
414 | // libc testing. | |
415 | //pub const IPPROTO_L2TP: ::c_int = 115; | |
416 | /// SCTP | |
417 | pub const IPPROTO_SCTP: ::c_int = 132; | |
418 | /// PFSYNC | |
419 | pub const IPPROTO_PFSYNC: ::c_int = 240; | |
420 | pub const IPPROTO_MAX: ::c_int = 256; | |
421 | ||
422 | /// last return value of *_input(), meaning "all job for this pkt is done". | |
423 | pub const IPPROTO_DONE: ::c_int = 257; | |
424 | ||
425 | /// sysctl placeholder for (FAST_)IPSEC | |
426 | pub const CTL_IPPROTO_IPSEC: ::c_int = 258; | |
427 | ||
8bb4bdeb XL |
428 | pub const AF_OROUTE: ::c_int = 17; |
429 | pub const AF_ARP: ::c_int = 28; | |
430 | pub const pseudo_AF_KEY: ::c_int = 29; | |
431 | pub const pseudo_AF_HDRCMPLT: ::c_int = 30; | |
432 | pub const AF_BLUETOOTH: ::c_int = 31; | |
433 | pub const AF_IEEE80211: ::c_int = 32; | |
434 | pub const AF_MPLS: ::c_int = 33; | |
435 | pub const AF_ROUTE: ::c_int = 34; | |
436 | pub const AF_MAX: ::c_int = 35; | |
437 | ||
438 | pub const NET_MAXID: ::c_int = AF_MAX; | |
439 | pub const NET_RT_DUMP: ::c_int = 1; | |
440 | pub const NET_RT_FLAGS: ::c_int = 2; | |
441 | pub const NET_RT_OOIFLIST: ::c_int = 3; | |
442 | pub const NET_RT_OIFLIST: ::c_int = 4; | |
443 | pub const NET_RT_IFLIST: ::c_int = 5; | |
444 | pub const NET_RT_MAXID: ::c_int = 6; | |
445 | ||
446 | pub const PF_OROUTE: ::c_int = AF_OROUTE; | |
447 | pub const PF_ARP: ::c_int = AF_ARP; | |
448 | pub const PF_KEY: ::c_int = pseudo_AF_KEY; | |
449 | pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; | |
450 | pub const PF_MPLS: ::c_int = AF_MPLS; | |
451 | pub const PF_ROUTE: ::c_int = AF_ROUTE; | |
452 | pub const PF_MAX: ::c_int = AF_MAX; | |
453 | ||
454 | pub const MSG_NBIO: ::c_int = 0x1000; | |
455 | pub const MSG_WAITFORONE: ::c_int = 0x2000; | |
456 | pub const MSG_NOTIFICATION: ::c_int = 0x4000; | |
457 | ||
458 | pub const SCM_TIMESTAMP: ::c_int = 0x08; | |
459 | pub const SCM_CREDS: ::c_int = 0x10; | |
476ff2be SL |
460 | |
461 | pub const O_DSYNC : ::c_int = 0x10000; | |
462 | ||
463 | pub const MAP_RENAME : ::c_int = 0x20; | |
464 | pub const MAP_NORESERVE : ::c_int = 0x40; | |
465 | pub const MAP_HASSEMAPHORE : ::c_int = 0x200; | |
466 | pub const MAP_WIRED: ::c_int = 0x800; | |
467 | ||
abe05a73 XL |
468 | pub const DCCP_TYPE_REQUEST: ::c_int = 0; |
469 | pub const DCCP_TYPE_RESPONSE: ::c_int = 1; | |
470 | pub const DCCP_TYPE_DATA: ::c_int = 2; | |
471 | pub const DCCP_TYPE_ACK: ::c_int = 3; | |
472 | pub const DCCP_TYPE_DATAACK: ::c_int = 4; | |
473 | pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5; | |
474 | pub const DCCP_TYPE_CLOSE: ::c_int = 6; | |
475 | pub const DCCP_TYPE_RESET: ::c_int = 7; | |
476 | pub const DCCP_TYPE_MOVE: ::c_int = 8; | |
477 | ||
478 | pub const DCCP_FEATURE_CC: ::c_int = 1; | |
479 | pub const DCCP_FEATURE_ECN: ::c_int = 2; | |
480 | pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3; | |
481 | pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4; | |
482 | pub const DCCP_FEATURE_MOBILITY: ::c_int = 5; | |
483 | pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6; | |
484 | pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8; | |
485 | pub const DCCP_FEATURE_IDENTREG: ::c_int = 7; | |
486 | ||
487 | pub const DCCP_OPT_PADDING: ::c_int = 0; | |
488 | pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1; | |
489 | pub const DCCP_OPT_SLOW_RECV: ::c_int = 2; | |
490 | pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3; | |
491 | pub const DCCP_OPT_CHANGE_L: ::c_int = 32; | |
492 | pub const DCCP_OPT_CONFIRM_L: ::c_int = 33; | |
493 | pub const DCCP_OPT_CHANGE_R: ::c_int = 34; | |
494 | pub const DCCP_OPT_CONFIRM_R: ::c_int = 35; | |
495 | pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36; | |
496 | pub const DCCP_OPT_NDP_COUNT: ::c_int = 37; | |
497 | pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38; | |
498 | pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39; | |
499 | pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40; | |
500 | pub const DCCP_OPT_TIMESTAMP: ::c_int = 41; | |
501 | pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42; | |
502 | pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43; | |
503 | pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44; | |
504 | ||
505 | pub const DCCP_REASON_UNSPEC: ::c_int = 0; | |
506 | pub const DCCP_REASON_CLOSED: ::c_int = 1; | |
507 | pub const DCCP_REASON_INVALID: ::c_int = 2; | |
508 | pub const DCCP_REASON_OPTION_ERR: ::c_int = 3; | |
509 | pub const DCCP_REASON_FEA_ERR: ::c_int = 4; | |
510 | pub const DCCP_REASON_CONN_REF: ::c_int = 5; | |
511 | pub const DCCP_REASON_BAD_SNAME: ::c_int = 6; | |
512 | pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7; | |
513 | pub const DCCP_REASON_INV_MOVE: ::c_int = 8; | |
514 | pub const DCCP_REASON_UNANSW_CH: ::c_int = 10; | |
515 | pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11; | |
516 | ||
517 | pub const DCCP_CCID: ::c_int = 1; | |
518 | pub const DCCP_CSLEN: ::c_int = 2; | |
519 | pub const DCCP_MAXSEG: ::c_int = 4; | |
520 | pub const DCCP_SERVICE: ::c_int = 8; | |
521 | ||
522 | pub const DCCP_NDP_LIMIT: ::c_int = 16; | |
523 | pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216; | |
524 | pub const DCCP_MAX_OPTIONS: ::c_int = 32; | |
525 | pub const DCCP_MAX_PKTS: ::c_int = 100; | |
526 | ||
041b39d2 XL |
527 | pub const _PC_LINK_MAX : ::c_int = 1; |
528 | pub const _PC_MAX_CANON : ::c_int = 2; | |
529 | pub const _PC_MAX_INPUT : ::c_int = 3; | |
530 | pub const _PC_NAME_MAX : ::c_int = 4; | |
531 | pub const _PC_PATH_MAX : ::c_int = 5; | |
532 | pub const _PC_PIPE_BUF : ::c_int = 6; | |
533 | pub const _PC_CHOWN_RESTRICTED : ::c_int = 7; | |
534 | pub const _PC_NO_TRUNC : ::c_int = 8; | |
535 | pub const _PC_VDISABLE : ::c_int = 9; | |
536 | pub const _PC_SYNC_IO : ::c_int = 10; | |
537 | pub const _PC_FILESIZEBITS : ::c_int = 11; | |
538 | pub const _PC_SYMLINK_MAX : ::c_int = 12; | |
539 | pub const _PC_2_SYMLINKS : ::c_int = 13; | |
540 | pub const _PC_ACL_EXTENDED : ::c_int = 14; | |
541 | pub const _PC_MIN_HOLE_SIZE : ::c_int = 15; | |
542 | ||
543 | pub const _SC_SYNCHRONIZED_IO : ::c_int = 31; | |
476ff2be | 544 | pub const _SC_IOV_MAX : ::c_int = 32; |
041b39d2 XL |
545 | pub const _SC_MAPPED_FILES : ::c_int = 33; |
546 | pub const _SC_MEMLOCK : ::c_int = 34; | |
547 | pub const _SC_MEMLOCK_RANGE : ::c_int = 35; | |
548 | pub const _SC_MEMORY_PROTECTION : ::c_int = 36; | |
549 | pub const _SC_LOGIN_NAME_MAX : ::c_int = 37; | |
550 | pub const _SC_MONOTONIC_CLOCK : ::c_int = 38; | |
551 | pub const _SC_CLK_TCK : ::c_int = 39; | |
552 | pub const _SC_ATEXIT_MAX : ::c_int = 40; | |
553 | pub const _SC_THREADS : ::c_int = 41; | |
554 | pub const _SC_SEMAPHORES : ::c_int = 42; | |
555 | pub const _SC_BARRIERS : ::c_int = 43; | |
556 | pub const _SC_TIMERS : ::c_int = 44; | |
557 | pub const _SC_SPIN_LOCKS : ::c_int = 45; | |
558 | pub const _SC_READER_WRITER_LOCKS : ::c_int = 46; | |
476ff2be SL |
559 | pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 47; |
560 | pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 48; | |
041b39d2 XL |
561 | pub const _SC_CLOCK_SELECTION : ::c_int = 49; |
562 | pub const _SC_ASYNCHRONOUS_IO : ::c_int = 50; | |
563 | pub const _SC_AIO_LISTIO_MAX : ::c_int = 51; | |
564 | pub const _SC_AIO_MAX : ::c_int = 52; | |
565 | pub const _SC_MESSAGE_PASSING : ::c_int = 53; | |
566 | pub const _SC_MQ_OPEN_MAX : ::c_int = 54; | |
476ff2be | 567 | pub const _SC_MQ_PRIO_MAX : ::c_int = 55; |
041b39d2 | 568 | pub const _SC_PRIORITY_SCHEDULING : ::c_int = 56; |
476ff2be SL |
569 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 57; |
570 | pub const _SC_THREAD_KEYS_MAX : ::c_int = 58; | |
041b39d2 XL |
571 | pub const _SC_THREAD_STACK_MIN : ::c_int = 59; |
572 | pub const _SC_THREAD_THREADS_MAX : ::c_int = 60; | |
573 | pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 61; | |
574 | pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 62; | |
575 | pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 63; | |
476ff2be SL |
576 | pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 64; |
577 | pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 65; | |
476ff2be SL |
578 | pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 66; |
579 | pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 67; | |
476ff2be | 580 | pub const _SC_TTY_NAME_MAX : ::c_int = 68; |
476ff2be | 581 | pub const _SC_HOST_NAME_MAX : ::c_int = 69; |
041b39d2 XL |
582 | pub const _SC_PASS_MAX : ::c_int = 70; |
583 | pub const _SC_REGEXP : ::c_int = 71; | |
584 | pub const _SC_SHELL : ::c_int = 72; | |
585 | pub const _SC_SYMLOOP_MAX : ::c_int = 73; | |
586 | pub const _SC_V6_ILP32_OFF32 : ::c_int = 74; | |
587 | pub const _SC_V6_ILP32_OFFBIG : ::c_int = 75; | |
588 | pub const _SC_V6_LP64_OFF64 : ::c_int = 76; | |
589 | pub const _SC_V6_LPBIG_OFFBIG : ::c_int = 77; | |
590 | pub const _SC_2_PBS : ::c_int = 80; | |
591 | pub const _SC_2_PBS_ACCOUNTING : ::c_int = 81; | |
592 | pub const _SC_2_PBS_CHECKPOINT : ::c_int = 82; | |
593 | pub const _SC_2_PBS_LOCATE : ::c_int = 83; | |
594 | pub const _SC_2_PBS_MESSAGE : ::c_int = 84; | |
595 | pub const _SC_2_PBS_TRACK : ::c_int = 85; | |
596 | pub const _SC_SPAWN : ::c_int = 86; | |
597 | pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 87; | |
598 | pub const _SC_TIMER_MAX : ::c_int = 88; | |
599 | pub const _SC_SEM_NSEMS_MAX : ::c_int = 89; | |
600 | pub const _SC_CPUTIME : ::c_int = 90; | |
601 | pub const _SC_THREAD_CPUTIME : ::c_int = 91; | |
602 | pub const _SC_DELAYTIMER_MAX : ::c_int = 92; | |
603 | // These two variables will be supported in NetBSD 8.0 | |
604 | // pub const _SC_SIGQUEUE_MAX : ::c_int = 93; | |
605 | // pub const _SC_REALTIME_SIGNALS : ::c_int = 94; | |
606 | pub const _SC_PHYS_PAGES : ::c_int = 121; | |
607 | pub const _SC_NPROCESSORS_CONF : ::c_int = 1001; | |
608 | pub const _SC_NPROCESSORS_ONLN : ::c_int = 1002; | |
609 | pub const _SC_SCHED_RT_TS : ::c_int = 2001; | |
610 | pub const _SC_SCHED_PRI_MIN : ::c_int = 2002; | |
611 | pub const _SC_SCHED_PRI_MAX : ::c_int = 2003; | |
476ff2be SL |
612 | |
613 | pub const FD_SETSIZE: usize = 0x100; | |
614 | ||
615 | pub const ST_NOSUID: ::c_ulong = 8; | |
616 | ||
617 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { | |
618 | ptm_magic: 0x33330003, | |
619 | ptm_errorcheck: 0, | |
620 | ptm_interlock: 0, | |
621 | ptm_waiters: 0 as *mut _, | |
622 | ptm_owner: 0, | |
623 | ptm_pad1: [0; 3], | |
624 | ptm_pad2: [0; 3], | |
625 | ptm_recursed: 0, | |
626 | ptm_spare2: 0 as *mut _, | |
627 | }; | |
628 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { | |
629 | ptc_magic: 0x55550005, | |
630 | ptc_lock: 0, | |
631 | ptc_waiters_first: 0 as *mut _, | |
632 | ptc_waiters_last: 0 as *mut _, | |
633 | ptc_mutex: 0 as *mut _, | |
634 | ptc_private: 0 as *mut _, | |
635 | }; | |
636 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { | |
637 | ptr_magic: 0x99990009, | |
638 | ptr_interlock: 0, | |
639 | ptr_rblocked_first: 0 as *mut _, | |
640 | ptr_rblocked_last: 0 as *mut _, | |
641 | ptr_wblocked_first: 0 as *mut _, | |
642 | ptr_wblocked_last: 0 as *mut _, | |
643 | ptr_nreaders: 0, | |
644 | ptr_owner: 0, | |
645 | ptr_private: 0 as *mut _, | |
646 | }; | |
647 | pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; | |
648 | pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; | |
649 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; | |
650 | pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; | |
651 | ||
abe05a73 XL |
652 | pub const EVFILT_AIO: ::uint32_t = 2; |
653 | pub const EVFILT_PROC: ::uint32_t = 4; | |
654 | pub const EVFILT_READ: ::uint32_t = 0; | |
655 | pub const EVFILT_SIGNAL: ::uint32_t = 5; | |
656 | pub const EVFILT_TIMER: ::uint32_t = 6; | |
657 | pub const EVFILT_VNODE: ::uint32_t = 3; | |
658 | pub const EVFILT_WRITE: ::uint32_t = 1; | |
476ff2be SL |
659 | |
660 | pub const EV_ADD: ::uint32_t = 0x1; | |
661 | pub const EV_DELETE: ::uint32_t = 0x2; | |
662 | pub const EV_ENABLE: ::uint32_t = 0x4; | |
663 | pub const EV_DISABLE: ::uint32_t = 0x8; | |
664 | pub const EV_ONESHOT: ::uint32_t = 0x10; | |
665 | pub const EV_CLEAR: ::uint32_t = 0x20; | |
666 | pub const EV_RECEIPT: ::uint32_t = 0x40; | |
667 | pub const EV_DISPATCH: ::uint32_t = 0x80; | |
668 | pub const EV_FLAG1: ::uint32_t = 0x2000; | |
669 | pub const EV_ERROR: ::uint32_t = 0x4000; | |
670 | pub const EV_EOF: ::uint32_t = 0x8000; | |
671 | pub const EV_SYSFLAGS: ::uint32_t = 0xf000; | |
672 | ||
673 | pub const NOTE_LOWAT: ::uint32_t = 0x00000001; | |
674 | pub const NOTE_DELETE: ::uint32_t = 0x00000001; | |
675 | pub const NOTE_WRITE: ::uint32_t = 0x00000002; | |
676 | pub const NOTE_EXTEND: ::uint32_t = 0x00000004; | |
677 | pub const NOTE_ATTRIB: ::uint32_t = 0x00000008; | |
678 | pub const NOTE_LINK: ::uint32_t = 0x00000010; | |
679 | pub const NOTE_RENAME: ::uint32_t = 0x00000020; | |
680 | pub const NOTE_REVOKE: ::uint32_t = 0x00000040; | |
681 | pub const NOTE_EXIT: ::uint32_t = 0x80000000; | |
682 | pub const NOTE_FORK: ::uint32_t = 0x40000000; | |
683 | pub const NOTE_EXEC: ::uint32_t = 0x20000000; | |
684 | pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff; | |
685 | pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000; | |
686 | pub const NOTE_TRACK: ::uint32_t = 0x00000001; | |
687 | pub const NOTE_TRACKERR: ::uint32_t = 0x00000002; | |
688 | pub const NOTE_CHILD: ::uint32_t = 0x00000004; | |
689 | ||
476ff2be SL |
690 | pub const TMP_MAX : ::c_uint = 308915776; |
691 | ||
692 | pub const NI_MAXHOST: ::socklen_t = 1025; | |
693 | ||
694 | pub const RTLD_NOLOAD: ::c_int = 0x2000; | |
695 | pub const RTLD_LOCAL: ::c_int = 0x200; | |
696 | ||
697 | pub const CTL_MAXNAME: ::c_int = 12; | |
698 | pub const SYSCTL_NAMELEN: ::c_int = 32; | |
699 | pub const SYSCTL_DEFSIZE: ::c_int = 8; | |
700 | pub const CTLTYPE_NODE: ::c_int = 1; | |
701 | pub const CTLTYPE_INT: ::c_int = 2; | |
702 | pub const CTLTYPE_STRING: ::c_int = 3; | |
703 | pub const CTLTYPE_QUAD: ::c_int = 4; | |
704 | pub const CTLTYPE_STRUCT: ::c_int = 5; | |
705 | pub const CTLTYPE_BOOL: ::c_int = 6; | |
706 | pub const CTLFLAG_READONLY: ::c_int = 0x00000000; | |
707 | pub const CTLFLAG_READWRITE: ::c_int = 0x00000070; | |
708 | pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080; | |
709 | pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100; | |
710 | pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200; | |
711 | pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400; | |
712 | pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800; | |
713 | pub const CTLFLAG_HEX: ::c_int = 0x00001000; | |
714 | pub const CTLFLAG_ROOT: ::c_int = 0x00002000; | |
715 | pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000; | |
716 | pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000; | |
717 | pub const CTLFLAG_ALIAS: ::c_int = 0x00010000; | |
718 | pub const CTLFLAG_MMAP: ::c_int = 0x00020000; | |
719 | pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000; | |
720 | pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000; | |
721 | pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000; | |
722 | pub const SYSCTL_VERS_0: ::c_int = 0x00000000; | |
723 | pub const SYSCTL_VERS_1: ::c_int = 0x01000000; | |
724 | pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1; | |
725 | pub const CTL_EOL: ::c_int = -1; | |
726 | pub const CTL_QUERY: ::c_int = -2; | |
727 | pub const CTL_CREATE: ::c_int = -3; | |
728 | pub const CTL_CREATESYM: ::c_int = -4; | |
729 | pub const CTL_DESTROY: ::c_int = -5; | |
730 | pub const CTL_MMAP: ::c_int = -6; | |
731 | pub const CTL_DESCRIBE: ::c_int = -7; | |
732 | pub const CTL_UNSPEC: ::c_int = 0; | |
733 | pub const CTL_KERN: ::c_int = 1; | |
734 | pub const CTL_VM: ::c_int = 2; | |
735 | pub const CTL_VFS: ::c_int = 3; | |
736 | pub const CTL_NET: ::c_int = 4; | |
737 | pub const CTL_DEBUG: ::c_int = 5; | |
738 | pub const CTL_HW: ::c_int = 6; | |
739 | pub const CTL_MACHDEP: ::c_int = 7; | |
740 | pub const CTL_USER: ::c_int = 8; | |
741 | pub const CTL_DDB: ::c_int = 9; | |
742 | pub const CTL_PROC: ::c_int = 10; | |
743 | pub const CTL_VENDOR: ::c_int = 11; | |
744 | pub const CTL_EMUL: ::c_int = 12; | |
745 | pub const CTL_SECURITY: ::c_int = 13; | |
746 | pub const CTL_MAXID: ::c_int = 14; | |
747 | pub const KERN_OSTYPE: ::c_int = 1; | |
748 | pub const KERN_OSRELEASE: ::c_int = 2; | |
749 | pub const KERN_OSREV: ::c_int = 3; | |
750 | pub const KERN_VERSION: ::c_int = 4; | |
751 | pub const KERN_MAXVNODES: ::c_int = 5; | |
752 | pub const KERN_MAXPROC: ::c_int = 6; | |
753 | pub const KERN_MAXFILES: ::c_int = 7; | |
754 | pub const KERN_ARGMAX: ::c_int = 8; | |
755 | pub const KERN_SECURELVL: ::c_int = 9; | |
756 | pub const KERN_HOSTNAME: ::c_int = 10; | |
757 | pub const KERN_HOSTID: ::c_int = 11; | |
758 | pub const KERN_CLOCKRATE: ::c_int = 12; | |
759 | pub const KERN_VNODE: ::c_int = 13; | |
760 | pub const KERN_PROC: ::c_int = 14; | |
761 | pub const KERN_FILE: ::c_int = 15; | |
762 | pub const KERN_PROF: ::c_int = 16; | |
763 | pub const KERN_POSIX1: ::c_int = 17; | |
764 | pub const KERN_NGROUPS: ::c_int = 18; | |
765 | pub const KERN_JOB_CONTROL: ::c_int = 19; | |
766 | pub const KERN_SAVED_IDS: ::c_int = 20; | |
767 | pub const KERN_OBOOTTIME: ::c_int = 21; | |
768 | pub const KERN_DOMAINNAME: ::c_int = 22; | |
769 | pub const KERN_MAXPARTITIONS: ::c_int = 23; | |
770 | pub const KERN_RAWPARTITION: ::c_int = 24; | |
771 | pub const KERN_NTPTIME: ::c_int = 25; | |
772 | pub const KERN_TIMEX: ::c_int = 26; | |
773 | pub const KERN_AUTONICETIME: ::c_int = 27; | |
774 | pub const KERN_AUTONICEVAL: ::c_int = 28; | |
775 | pub const KERN_RTC_OFFSET: ::c_int = 29; | |
776 | pub const KERN_ROOT_DEVICE: ::c_int = 30; | |
777 | pub const KERN_MSGBUFSIZE: ::c_int = 31; | |
778 | pub const KERN_FSYNC: ::c_int = 32; | |
779 | pub const KERN_OLDSYSVMSG: ::c_int = 33; | |
780 | pub const KERN_OLDSYSVSEM: ::c_int = 34; | |
781 | pub const KERN_OLDSYSVSHM: ::c_int = 35; | |
782 | pub const KERN_OLDSHORTCORENAME: ::c_int = 36; | |
783 | pub const KERN_SYNCHRONIZED_IO: ::c_int = 37; | |
784 | pub const KERN_IOV_MAX: ::c_int = 38; | |
785 | pub const KERN_MBUF: ::c_int = 39; | |
786 | pub const KERN_MAPPED_FILES: ::c_int = 40; | |
787 | pub const KERN_MEMLOCK: ::c_int = 41; | |
788 | pub const KERN_MEMLOCK_RANGE: ::c_int = 42; | |
789 | pub const KERN_MEMORY_PROTECTION: ::c_int = 43; | |
790 | pub const KERN_LOGIN_NAME_MAX: ::c_int = 44; | |
791 | pub const KERN_DEFCORENAME: ::c_int = 45; | |
792 | pub const KERN_LOGSIGEXIT: ::c_int = 46; | |
793 | pub const KERN_PROC2: ::c_int = 47; | |
794 | pub const KERN_PROC_ARGS: ::c_int = 48; | |
795 | pub const KERN_FSCALE: ::c_int = 49; | |
796 | pub const KERN_CCPU: ::c_int = 50; | |
797 | pub const KERN_CP_TIME: ::c_int = 51; | |
798 | pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52; | |
799 | pub const KERN_MSGBUF: ::c_int = 53; | |
800 | pub const KERN_CONSDEV: ::c_int = 54; | |
801 | pub const KERN_MAXPTYS: ::c_int = 55; | |
802 | pub const KERN_PIPE: ::c_int = 56; | |
803 | pub const KERN_MAXPHYS: ::c_int = 57; | |
804 | pub const KERN_SBMAX: ::c_int = 58; | |
805 | pub const KERN_TKSTAT: ::c_int = 59; | |
806 | pub const KERN_MONOTONIC_CLOCK: ::c_int = 60; | |
807 | pub const KERN_URND: ::c_int = 61; | |
808 | pub const KERN_LABELSECTOR: ::c_int = 62; | |
809 | pub const KERN_LABELOFFSET: ::c_int = 63; | |
810 | pub const KERN_LWP: ::c_int = 64; | |
811 | pub const KERN_FORKFSLEEP: ::c_int = 65; | |
812 | pub const KERN_POSIX_THREADS: ::c_int = 66; | |
813 | pub const KERN_POSIX_SEMAPHORES: ::c_int = 67; | |
814 | pub const KERN_POSIX_BARRIERS: ::c_int = 68; | |
815 | pub const KERN_POSIX_TIMERS: ::c_int = 69; | |
816 | pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70; | |
817 | pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71; | |
818 | pub const KERN_DUMP_ON_PANIC: ::c_int = 72; | |
819 | pub const KERN_SOMAXKVA: ::c_int = 73; | |
820 | pub const KERN_ROOT_PARTITION: ::c_int = 74; | |
821 | pub const KERN_DRIVERS: ::c_int = 75; | |
822 | pub const KERN_BUF: ::c_int = 76; | |
823 | pub const KERN_FILE2: ::c_int = 77; | |
824 | pub const KERN_VERIEXEC: ::c_int = 78; | |
825 | pub const KERN_CP_ID: ::c_int = 79; | |
826 | pub const KERN_HARDCLOCK_TICKS: ::c_int = 80; | |
827 | pub const KERN_ARND: ::c_int = 81; | |
828 | pub const KERN_SYSVIPC: ::c_int = 82; | |
829 | pub const KERN_BOOTTIME: ::c_int = 83; | |
830 | pub const KERN_EVCNT: ::c_int = 84; | |
831 | pub const KERN_MAXID: ::c_int = 85; | |
832 | pub const KERN_PROC_ALL: ::c_int = 0; | |
833 | pub const KERN_PROC_PID: ::c_int = 1; | |
834 | pub const KERN_PROC_PGRP: ::c_int = 2; | |
835 | pub const KERN_PROC_SESSION: ::c_int = 3; | |
836 | pub const KERN_PROC_TTY: ::c_int = 4; | |
837 | pub const KERN_PROC_UID: ::c_int = 5; | |
838 | pub const KERN_PROC_RUID: ::c_int = 6; | |
839 | pub const KERN_PROC_GID: ::c_int = 7; | |
840 | pub const KERN_PROC_RGID: ::c_int = 8; | |
abe05a73 XL |
841 | pub const KERN_PROC_ARGV: ::c_int = 1; |
842 | pub const KERN_PROC_NARGV: ::c_int = 2; | |
843 | pub const KERN_PROC_ENV: ::c_int = 3; | |
844 | pub const KERN_PROC_NENV: ::c_int = 4; | |
845 | pub const KERN_PROC_PATHNAME: ::c_int = 5; | |
476ff2be SL |
846 | |
847 | pub const EAI_SYSTEM: ::c_int = 11; | |
848 | ||
8bb4bdeb XL |
849 | pub const AIO_CANCELED: ::c_int = 1; |
850 | pub const AIO_NOTCANCELED: ::c_int = 2; | |
851 | pub const AIO_ALLDONE: ::c_int = 3; | |
852 | pub const LIO_NOP: ::c_int = 0; | |
853 | pub const LIO_WRITE: ::c_int = 1; | |
854 | pub const LIO_READ: ::c_int = 2; | |
855 | pub const LIO_WAIT: ::c_int = 1; | |
856 | pub const LIO_NOWAIT: ::c_int = 0; | |
857 | ||
858 | pub const SIGEV_NONE: ::c_int = 0; | |
859 | pub const SIGEV_SIGNAL: ::c_int = 1; | |
860 | pub const SIGEV_THREAD: ::c_int = 2; | |
861 | ||
862 | pub const WSTOPPED: ::c_int = 0x00000002; // same as WUNTRACED | |
863 | pub const WCONTINUED: ::c_int = 0x00000010; | |
864 | pub const WEXITED: ::c_int = 0x000000020; | |
865 | pub const WNOWAIT: ::c_int = 0x00010000; | |
866 | ||
867 | pub const P_ALL: idtype_t = 0; | |
868 | pub const P_PID: idtype_t = 1; | |
869 | pub const P_PGID: idtype_t = 4; | |
870 | ||
7cac9316 XL |
871 | pub const B460800: ::speed_t = 460800; |
872 | pub const B921600: ::speed_t = 921600; | |
873 | ||
041b39d2 XL |
874 | pub const ONOCR: ::tcflag_t = 0x20; |
875 | pub const ONLRET: ::tcflag_t = 0x40; | |
876 | pub const CDTRCTS: ::tcflag_t = 0x00020000; | |
877 | pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS; | |
878 | ||
ea8adc8c XL |
879 | pub const SOCK_CLOEXEC: ::c_int = 0x10000000; |
880 | pub const SOCK_NONBLOCK: ::c_int = 0x20000000; | |
881 | ||
041b39d2 XL |
882 | // dirfd() is a macro on netbsd to access |
883 | // the first field of the struct where dirp points to: | |
884 | // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36 | |
885 | f! { | |
886 | pub fn dirfd(dirp: *mut ::DIR) -> ::c_int { | |
887 | unsafe { *(dirp as *const ::c_int) } | |
888 | } | |
ea8adc8c XL |
889 | |
890 | pub fn WIFCONTINUED(status: ::c_int) -> bool { | |
891 | status == 0xffff | |
892 | } | |
041b39d2 XL |
893 | } |
894 | ||
476ff2be | 895 | extern { |
8bb4bdeb XL |
896 | pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; |
897 | pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; | |
898 | pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; | |
899 | pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; | |
900 | pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; | |
901 | #[link_name = "__aio_suspend50"] | |
902 | pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int, | |
903 | timeout: *const ::timespec) -> ::c_int; | |
904 | pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; | |
905 | pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb, | |
906 | nitems: ::c_int, sevp: *mut sigevent) -> ::c_int; | |
907 | ||
476ff2be SL |
908 | pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; |
909 | pub fn getnameinfo(sa: *const ::sockaddr, | |
910 | salen: ::socklen_t, | |
911 | host: *mut ::c_char, | |
912 | hostlen: ::socklen_t, | |
913 | serv: *mut ::c_char, | |
914 | sevlen: ::socklen_t, | |
915 | flags: ::c_int) -> ::c_int; | |
916 | pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) | |
917 | -> ::c_int; | |
918 | pub fn sysctl(name: *const ::c_int, | |
919 | namelen: ::c_uint, | |
920 | oldp: *mut ::c_void, | |
921 | oldlenp: *mut ::size_t, | |
922 | newp: *const ::c_void, | |
923 | newlen: ::size_t) | |
924 | -> ::c_int; | |
925 | pub fn sysctlbyname(name: *const ::c_char, | |
926 | oldp: *mut ::c_void, | |
927 | oldlenp: *mut ::size_t, | |
928 | newp: *const ::c_void, | |
929 | newlen: ::size_t) | |
930 | -> ::c_int; | |
931 | #[link_name = "__kevent50"] | |
932 | pub fn kevent(kq: ::c_int, | |
933 | changelist: *const ::kevent, | |
934 | nchanges: ::size_t, | |
935 | eventlist: *mut ::kevent, | |
936 | nevents: ::size_t, | |
937 | timeout: *const ::timespec) -> ::c_int; | |
938 | #[link_name = "__mount50"] | |
939 | pub fn mount(src: *const ::c_char, | |
940 | target: *const ::c_char, | |
941 | flags: ::c_int, | |
942 | data: *mut ::c_void, | |
943 | size: ::size_t) -> ::c_int; | |
ea8adc8c | 944 | pub fn ptrace(request: ::c_int, |
476ff2be SL |
945 | pid: ::pid_t, |
946 | addr: *mut ::c_void, | |
947 | data: ::c_int) -> ::c_int; | |
948 | pub fn pthread_setname_np(t: ::pthread_t, | |
949 | name: *const ::c_char, | |
950 | arg: *mut ::c_void) -> ::c_int; | |
951 | pub fn pthread_getattr_np(native: ::pthread_t, | |
952 | attr: *mut ::pthread_attr_t) -> ::c_int; | |
953 | pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t, | |
954 | guardsize: *mut ::size_t) -> ::c_int; | |
955 | pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t, | |
956 | stackaddr: *mut *mut ::c_void, | |
957 | stacksize: *mut ::size_t) -> ::c_int; | |
958 | #[link_name = "__sigtimedwait50"] | |
959 | pub fn sigtimedwait(set: *const sigset_t, | |
960 | info: *mut siginfo_t, | |
961 | timeout: *const ::timespec) -> ::c_int; | |
962 | pub fn sigwaitinfo(set: *const sigset_t, | |
963 | info: *mut siginfo_t) -> ::c_int; | |
964 | pub fn duplocale(base: ::locale_t) -> ::locale_t; | |
965 | pub fn freelocale(loc: ::locale_t); | |
966 | pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; | |
967 | pub fn newlocale(mask: ::c_int, | |
968 | locale: *const ::c_char, | |
969 | base: ::locale_t) -> ::locale_t; | |
041b39d2 XL |
970 | #[link_name = "__settimeofday50"] |
971 | pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; | |
476ff2be SL |
972 | } |
973 | ||
974 | mod other; | |
975 | pub use self::other::*; |