]> git.proxmox.com Git - rustc.git/blame - src/liblibc/src/unix/notbsd/linux/musl/mod.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / liblibc / src / unix / notbsd / linux / musl / mod.rs
CommitLineData
7453a54e
SL
1pub type clock_t = c_long;
2pub type time_t = c_long;
3pub type suseconds_t = c_long;
4pub type ino_t = u64;
5pub type off_t = i64;
6pub type blkcnt_t = i64;
7
8pub type blksize_t = c_long;
9pub type fsblkcnt_t = ::c_ulonglong;
10pub type fsfilcnt_t = ::c_ulonglong;
11pub type rlim_t = ::c_ulonglong;
12
13s! {
14 pub struct sigaction {
15 pub sa_sigaction: ::sighandler_t,
16 pub sa_mask: ::sigset_t,
17 pub sa_flags: ::c_int,
18 _restorer: *mut ::c_void,
19 }
20
21 pub struct siginfo_t {
22 pub si_signo: ::c_int,
23 pub si_errno: ::c_int,
24 pub si_code: ::c_int,
25 pub _pad: [::c_int; 29],
26 _align: [usize; 0],
27 }
28
29 pub struct ipc_perm {
30 pub __ipc_perm_key: ::key_t,
31 pub uid: ::uid_t,
32 pub gid: ::gid_t,
33 pub cuid: ::uid_t,
34 pub cgid: ::gid_t,
35 pub mode: ::mode_t,
36 pub __seq: ::c_int,
37 __unused1: ::c_long,
38 __unused2: ::c_long
39 }
40
41 pub struct termios {
42 pub c_iflag: ::tcflag_t,
43 pub c_oflag: ::tcflag_t,
44 pub c_cflag: ::tcflag_t,
45 pub c_lflag: ::tcflag_t,
46 pub c_line: ::cc_t,
47 pub c_cc: [::cc_t; ::NCCS],
48 pub __c_ispeed: ::speed_t,
49 pub __c_ospeed: ::speed_t,
50 }
51
52 pub struct flock {
53 pub l_type: ::c_short,
54 pub l_whence: ::c_short,
55 pub l_start: ::off_t,
56 pub l_len: ::off_t,
57 pub l_pid: ::pid_t,
58 }
59}
60
61pub const BUFSIZ: ::c_uint = 1024;
62pub const TMP_MAX: ::c_uint = 10000;
63pub const FOPEN_MAX: ::c_uint = 1000;
64pub const POSIX_MADV_DONTNEED: ::c_int = 0;
65pub const O_ACCMODE: ::c_int = 0o10000003;
66pub const O_NDELAY: ::c_int = O_NONBLOCK;
67pub const RUSAGE_CHILDREN: ::c_int = 1;
68pub const NI_MAXHOST: ::socklen_t = 255;
69pub const PTHREAD_STACK_MIN: ::size_t = 2048;
70
71pub const RLIM_INFINITY: ::rlim_t = !0;
72pub const RLIMIT_RTTIME: ::c_int = 15;
73pub const RLIMIT_NLIMITS: ::c_int = 16;
74
75pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
76
77pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
78pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
79pub const TCP_THIN_DUPACK: ::c_int = 17;
80pub const TCP_USER_TIMEOUT: ::c_int = 18;
81pub const TCP_REPAIR: ::c_int = 19;
82pub const TCP_REPAIR_QUEUE: ::c_int = 20;
83pub const TCP_QUEUE_SEQ: ::c_int = 21;
84pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
85pub const TCP_FASTOPEN: ::c_int = 23;
86pub const TCP_TIMESTAMP: ::c_int = 24;
87
88pub const SIGUNUSED: ::c_int = ::SIGSYS;
89
90pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
91pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
92
93pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
94
95pub const CPU_SETSIZE: ::c_int = 128;
96
97pub const QFMT_VFS_V1: ::c_int = 4;
98
99pub const PTRACE_TRACEME: ::c_int = 0;
100pub const PTRACE_PEEKTEXT: ::c_int = 1;
101pub const PTRACE_PEEKDATA: ::c_int = 2;
102pub const PTRACE_PEEKUSER: ::c_int = 3;
103pub const PTRACE_POKETEXT: ::c_int = 4;
104pub const PTRACE_POKEDATA: ::c_int = 5;
105pub const PTRACE_POKEUSER: ::c_int = 6;
106pub const PTRACE_CONT: ::c_int = 7;
107pub const PTRACE_KILL: ::c_int = 8;
108pub const PTRACE_SINGLESTEP: ::c_int = 9;
109pub const PTRACE_ATTACH: ::c_int = 16;
110pub const PTRACE_DETACH: ::c_int = 17;
111pub const PTRACE_SYSCALL: ::c_int = 24;
112pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
113pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
114pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
115pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
116pub const PTRACE_GETREGSET: ::c_int = 0x4204;
117pub const PTRACE_SETREGSET: ::c_int = 0x4205;
118pub const PTRACE_SEIZE: ::c_int = 0x4206;
119pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
120pub const PTRACE_LISTEN: ::c_int = 0x4208;
121pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
122
123pub const MADV_DODUMP: ::c_int = 17;
124pub const MADV_DONTDUMP: ::c_int = 16;
125
126pub const EPOLLWAKEUP: ::c_int = 0x20000000;
127
128pub const MADV_HUGEPAGE: ::c_int = 14;
129pub const MADV_NOHUGEPAGE: ::c_int = 15;
130
131pub const PTRACE_GETFPREGS: ::c_uint = 14;
132pub const PTRACE_SETFPREGS: ::c_uint = 15;
133pub const PTRACE_GETFPXREGS: ::c_uint = 18;
134pub const PTRACE_SETFPXREGS: ::c_uint = 19;
135pub const PTRACE_GETREGS: ::c_uint = 12;
136pub const PTRACE_SETREGS: ::c_uint = 13;
137
138pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
139
140pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
141
142pub const TCSANOW: ::c_int = 0;
143pub const TCSADRAIN: ::c_int = 1;
144pub const TCSAFLUSH: ::c_int = 2;
145
146pub const TIOCINQ: ::c_ulong = ::FIONREAD;
147
148pub const RTLD_GLOBAL: ::c_int = 0x100;
149pub const RTLD_NOLOAD: ::c_int = 0x4;
150
54a0048b
SL
151// TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux
152// kernel 3.10). See also notbsd/mod.rs
153pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
154pub const CLOCK_TAI: ::clockid_t = 11;
155
7453a54e
SL
156extern {
157 pub fn getnameinfo(sa: *const ::sockaddr,
158 salen: ::socklen_t,
159 host: *mut ::c_char,
160 hostlen: ::socklen_t,
161 serv: *mut ::c_char,
162 sevlen: ::socklen_t,
163 flags: ::c_int) -> ::c_int;
164 pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
165 pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
166 pub fn ptrace(request: ::c_int, ...) -> ::c_long;
167}
168
169cfg_if! {
170 if #[cfg(any(target_arch = "x86_64"))] {
171 mod b64;
172 pub use self::b64::*;
173 } else if #[cfg(any(target_arch = "x86",
174 target_arch = "mips",
175 target_arch = "arm",
176 target_arch = "asmjs"))] {
177 mod b32;
178 pub use self::b32::*;
179 } else { }
180}