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