Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 1 | //! Linux-specific definitions for linux-like values |
| 2 | |
Peter Jin | 1a190c7 | 2016-02-05 15:06:39 -0800 | [diff] [blame] | 3 | use dox::mem; |
| 4 | |
Alex Crichton | 918f8e1 | 2015-09-15 16:39:51 -0700 | [diff] [blame] | 5 | pub type useconds_t = u32; |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 6 | pub type dev_t = u64; |
| 7 | pub type socklen_t = u32; |
| 8 | pub type pthread_t = c_ulong; |
Alex Crichton | c4a8d60 | 2015-09-18 15:00:49 -0700 | [diff] [blame] | 9 | pub type mode_t = u32; |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 10 | pub type ino64_t = u64; |
| 11 | pub type off64_t = i64; |
| 12 | pub type blkcnt64_t = i64; |
| 13 | pub type rlim64_t = u64; |
Alexander Polakov | 5850156 | 2015-12-14 02:09:45 +0300 | [diff] [blame] | 14 | pub type shmatt_t = ::c_ulong; |
Alex Crichton | 881ef9b | 2015-12-01 09:04:13 -0800 | [diff] [blame] | 15 | pub type mqd_t = ::c_int; |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 16 | pub type msgqnum_t = ::c_ulong; |
| 17 | pub type msglen_t = ::c_ulong; |
David Henningsson | 9d2493e | 2015-12-25 22:06:44 +0100 | [diff] [blame] | 18 | pub type nfds_t = ::c_ulong; |
A.J. Gardner | 24c84f1 | 2016-03-31 20:08:03 -0500 | [diff] [blame] | 19 | pub type nl_item = ::c_int; |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 20 | |
| 21 | pub enum fpos64_t {} // TODO: fill this out with a struct |
Alex Crichton | 918f8e1 | 2015-09-15 16:39:51 -0700 | [diff] [blame] | 22 | |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 23 | s! { |
Alex Crichton | d6e07e2 | 2015-10-29 22:59:44 -0700 | [diff] [blame] | 24 | pub struct dirent { |
| 25 | pub d_ino: ::ino_t, |
| 26 | pub d_off: ::off_t, |
| 27 | pub d_reclen: ::c_ushort, |
| 28 | pub d_type: ::c_uchar, |
| 29 | pub d_name: [::c_char; 256], |
| 30 | } |
| 31 | |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 32 | pub struct dirent64 { |
| 33 | pub d_ino: ::ino64_t, |
| 34 | pub d_off: ::off64_t, |
| 35 | pub d_reclen: ::c_ushort, |
| 36 | pub d_type: ::c_uchar, |
| 37 | pub d_name: [::c_char; 256], |
| 38 | } |
| 39 | |
| 40 | pub struct rlimit64 { |
| 41 | pub rlim_cur: rlim64_t, |
| 42 | pub rlim_max: rlim64_t, |
| 43 | } |
| 44 | |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 45 | pub struct glob_t { |
Alex Crichton | 1791046 | 2015-09-22 19:11:04 -0700 | [diff] [blame] | 46 | pub gl_pathc: ::size_t, |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 47 | pub gl_pathv: *mut *mut c_char, |
Alex Crichton | 1791046 | 2015-09-22 19:11:04 -0700 | [diff] [blame] | 48 | pub gl_offs: ::size_t, |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 49 | pub gl_flags: ::c_int, |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 50 | |
| 51 | __unused1: *mut ::c_void, |
| 52 | __unused2: *mut ::c_void, |
| 53 | __unused3: *mut ::c_void, |
| 54 | __unused4: *mut ::c_void, |
| 55 | __unused5: *mut ::c_void, |
| 56 | } |
| 57 | |
| 58 | pub struct ifaddrs { |
| 59 | pub ifa_next: *mut ifaddrs, |
| 60 | pub ifa_name: *mut c_char, |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 61 | pub ifa_flags: ::c_uint, |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 62 | pub ifa_addr: *mut ::sockaddr, |
| 63 | pub ifa_netmask: *mut ::sockaddr, |
| 64 | pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union |
| 65 | pub ifa_data: *mut ::c_void |
| 66 | } |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 67 | |
| 68 | pub struct pthread_mutex_t { |
| 69 | #[cfg(any(target_arch = "mips", target_arch = "mipsel", |
Alex Crichton | 8018a50 | 2016-08-26 22:54:58 -0700 | [diff] [blame] | 70 | target_arch = "arm", target_arch = "powerpc"))] |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 71 | __align: [::c_long; 0], |
| 72 | #[cfg(not(any(target_arch = "mips", target_arch = "mipsel", |
Alex Crichton | 8018a50 | 2016-08-26 22:54:58 -0700 | [diff] [blame] | 73 | target_arch = "arm", target_arch = "powerpc")))] |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 74 | __align: [::c_longlong; 0], |
| 75 | size: [u8; __SIZEOF_PTHREAD_MUTEX_T], |
| 76 | } |
| 77 | |
| 78 | pub struct pthread_rwlock_t { |
| 79 | #[cfg(any(target_arch = "mips", target_arch = "mipsel", |
Alex Crichton | 8018a50 | 2016-08-26 22:54:58 -0700 | [diff] [blame] | 80 | target_arch = "arm", target_arch = "powerpc"))] |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 81 | __align: [::c_long; 0], |
| 82 | #[cfg(not(any(target_arch = "mips", target_arch = "mipsel", |
Alex Crichton | 8018a50 | 2016-08-26 22:54:58 -0700 | [diff] [blame] | 83 | target_arch = "arm", target_arch = "powerpc")))] |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 84 | __align: [::c_longlong; 0], |
| 85 | size: [u8; __SIZEOF_PTHREAD_RWLOCK_T], |
| 86 | } |
| 87 | |
| 88 | pub struct pthread_mutexattr_t { |
Jorge Aparicio | 196b0e8 | 2016-08-26 22:30:42 -0500 | [diff] [blame] | 89 | #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 90 | target_arch = "mips64", target_arch = "s390x"))] |
Alex Crichton | b347b44 | 2015-09-17 15:48:30 -0700 | [diff] [blame] | 91 | __align: [::c_int; 0], |
Jorge Aparicio | 196b0e8 | 2016-08-26 22:30:42 -0500 | [diff] [blame] | 92 | #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 93 | target_arch = "mips64", target_arch = "s390x")))] |
Alex Crichton | 684cfa4 | 2015-09-17 15:18:18 -0700 | [diff] [blame] | 94 | __align: [::c_long; 0], |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 95 | size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T], |
| 96 | } |
| 97 | |
| 98 | pub struct pthread_cond_t { |
Jorge Aparicio | 23a5092 | 2016-07-26 16:13:03 -0500 | [diff] [blame] | 99 | #[cfg(any(target_env = "musl"))] |
Jorge Aparicio | 751bea3 | 2016-01-30 01:28:50 -0500 | [diff] [blame] | 100 | __align: [*const ::c_void; 0], |
Jorge Aparicio | 23a5092 | 2016-07-26 16:13:03 -0500 | [diff] [blame] | 101 | #[cfg(not(any(target_env = "musl")))] |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 102 | __align: [::c_longlong; 0], |
| 103 | size: [u8; __SIZEOF_PTHREAD_COND_T], |
| 104 | } |
| 105 | |
Tomasz MiÄ…sko | cb64485 | 2016-07-20 07:31:48 +0200 | [diff] [blame] | 106 | pub struct pthread_condattr_t { |
| 107 | __align: [::c_int; 0], |
| 108 | size: [u8; __SIZEOF_PTHREAD_CONDATTR_T], |
| 109 | } |
| 110 | |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 111 | pub struct passwd { |
| 112 | pub pw_name: *mut ::c_char, |
| 113 | pub pw_passwd: *mut ::c_char, |
| 114 | pub pw_uid: ::uid_t, |
| 115 | pub pw_gid: ::gid_t, |
| 116 | pub pw_gecos: *mut ::c_char, |
| 117 | pub pw_dir: *mut ::c_char, |
| 118 | pub pw_shell: *mut ::c_char, |
| 119 | } |
Dan Burkert | 85a76f8 | 2015-11-04 20:26:27 -0800 | [diff] [blame] | 120 | |
Philipp Keller | 26f3eb9 | 2016-09-26 22:00:29 +0200 | [diff] [blame] | 121 | pub struct spwd { |
| 122 | pub sp_namp: *mut ::c_char, |
| 123 | pub sp_pwdp: *mut ::c_char, |
| 124 | pub sp_lstchg: ::c_long, |
| 125 | pub sp_min: ::c_long, |
| 126 | pub sp_max: ::c_long, |
| 127 | pub sp_warn: ::c_long, |
| 128 | pub sp_inact: ::c_long, |
| 129 | pub sp_expire: ::c_long, |
| 130 | pub sp_flag: ::c_ulong, |
| 131 | } |
| 132 | |
Dan Burkert | 85a76f8 | 2015-11-04 20:26:27 -0800 | [diff] [blame] | 133 | pub struct statvfs { |
| 134 | pub f_bsize: ::c_ulong, |
| 135 | pub f_frsize: ::c_ulong, |
| 136 | pub f_blocks: ::fsblkcnt_t, |
| 137 | pub f_bfree: ::fsblkcnt_t, |
| 138 | pub f_bavail: ::fsblkcnt_t, |
| 139 | pub f_files: ::fsfilcnt_t, |
| 140 | pub f_ffree: ::fsfilcnt_t, |
| 141 | pub f_favail: ::fsfilcnt_t, |
Jorge Aparicio | 3df0057 | 2016-09-11 23:57:37 -0500 | [diff] [blame] | 142 | #[cfg(target_endian = "little")] |
Dan Burkert | 85a76f8 | 2015-11-04 20:26:27 -0800 | [diff] [blame] | 143 | pub f_fsid: ::c_ulong, |
| 144 | #[cfg(target_pointer_width = "32")] |
Jorge Aparicio | 41101f2 | 2016-09-12 23:41:17 -0500 | [diff] [blame] | 145 | __f_unused: ::c_int, |
Jorge Aparicio | 3df0057 | 2016-09-11 23:57:37 -0500 | [diff] [blame] | 146 | #[cfg(target_endian = "big")] |
| 147 | pub f_fsid: ::c_ulong, |
Dan Burkert | 85a76f8 | 2015-11-04 20:26:27 -0800 | [diff] [blame] | 148 | pub f_flag: ::c_ulong, |
| 149 | pub f_namemax: ::c_ulong, |
| 150 | __f_spare: [::c_int; 6], |
| 151 | } |
Alexander Polakov | 440bd53 | 2015-11-07 15:42:38 +0300 | [diff] [blame] | 152 | |
Alex Crichton | 8dce9ad | 2015-12-03 11:44:14 -0800 | [diff] [blame] | 153 | pub struct dqblk { |
| 154 | pub dqb_bhardlimit: ::uint64_t, |
| 155 | pub dqb_bsoftlimit: ::uint64_t, |
| 156 | pub dqb_curspace: ::uint64_t, |
| 157 | pub dqb_ihardlimit: ::uint64_t, |
| 158 | pub dqb_isoftlimit: ::uint64_t, |
| 159 | pub dqb_curinodes: ::uint64_t, |
| 160 | pub dqb_btime: ::uint64_t, |
| 161 | pub dqb_itime: ::uint64_t, |
| 162 | pub dqb_valid: ::uint32_t, |
| 163 | } |
| 164 | |
| 165 | pub struct signalfd_siginfo { |
| 166 | pub ssi_signo: ::uint32_t, |
| 167 | pub ssi_errno: ::int32_t, |
| 168 | pub ssi_code: ::int32_t, |
| 169 | pub ssi_pid: ::uint32_t, |
| 170 | pub ssi_uid: ::uint32_t, |
| 171 | pub ssi_fd: ::int32_t, |
| 172 | pub ssi_tid: ::uint32_t, |
| 173 | pub ssi_band: ::uint32_t, |
| 174 | pub ssi_overrun: ::uint32_t, |
| 175 | pub ssi_trapno: ::uint32_t, |
| 176 | pub ssi_status: ::int32_t, |
| 177 | pub ssi_int: ::int32_t, |
| 178 | pub ssi_ptr: ::uint64_t, |
| 179 | pub ssi_utime: ::uint64_t, |
| 180 | pub ssi_stime: ::uint64_t, |
| 181 | pub ssi_addr: ::uint64_t, |
| 182 | _pad: [::uint8_t; 48], |
| 183 | } |
| 184 | |
| 185 | pub struct fsid_t { |
| 186 | __val: [::c_int; 2], |
| 187 | } |
| 188 | |
| 189 | pub struct mq_attr { |
| 190 | pub mq_flags: ::c_long, |
| 191 | pub mq_maxmsg: ::c_long, |
| 192 | pub mq_msgsize: ::c_long, |
| 193 | pub mq_curmsgs: ::c_long, |
| 194 | pad: [::c_long; 4] |
| 195 | } |
| 196 | |
| 197 | pub struct cpu_set_t { |
| 198 | #[cfg(target_pointer_width = "32")] |
| 199 | bits: [u32; 32], |
| 200 | #[cfg(target_pointer_width = "64")] |
| 201 | bits: [u64; 16], |
| 202 | } |
Charles J. Schneider | 332bd86 | 2016-07-12 09:32:42 +0200 | [diff] [blame] | 203 | |
| 204 | pub struct if_nameindex { |
| 205 | pub if_index: ::c_uint, |
| 206 | pub if_name: *mut ::c_char, |
| 207 | } |
| 208 | |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 209 | // System V IPC |
| 210 | pub struct msginfo { |
| 211 | pub msgpool: ::c_int, |
| 212 | pub msgmap: ::c_int, |
| 213 | pub msgmax: ::c_int, |
| 214 | pub msgmnb: ::c_int, |
| 215 | pub msgmni: ::c_int, |
| 216 | pub msgssz: ::c_int, |
| 217 | pub msgtql: ::c_int, |
| 218 | pub msgseg: ::c_ushort, |
| 219 | } |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 220 | } |
| 221 | |
A.J. Gardner | 24c84f1 | 2016-03-31 20:08:03 -0500 | [diff] [blame] | 222 | pub const ABDAY_1: ::nl_item = 0x20000; |
| 223 | pub const ABDAY_2: ::nl_item = 0x20001; |
| 224 | pub const ABDAY_3: ::nl_item = 0x20002; |
| 225 | pub const ABDAY_4: ::nl_item = 0x20003; |
| 226 | pub const ABDAY_5: ::nl_item = 0x20004; |
| 227 | pub const ABDAY_6: ::nl_item = 0x20005; |
| 228 | pub const ABDAY_7: ::nl_item = 0x20006; |
| 229 | |
| 230 | pub const DAY_1: ::nl_item = 0x20007; |
| 231 | pub const DAY_2: ::nl_item = 0x20008; |
| 232 | pub const DAY_3: ::nl_item = 0x20009; |
| 233 | pub const DAY_4: ::nl_item = 0x2000A; |
| 234 | pub const DAY_5: ::nl_item = 0x2000B; |
| 235 | pub const DAY_6: ::nl_item = 0x2000C; |
| 236 | pub const DAY_7: ::nl_item = 0x2000D; |
| 237 | |
| 238 | pub const ABMON_1: ::nl_item = 0x2000E; |
| 239 | pub const ABMON_2: ::nl_item = 0x2000F; |
| 240 | pub const ABMON_3: ::nl_item = 0x20010; |
| 241 | pub const ABMON_4: ::nl_item = 0x20011; |
| 242 | pub const ABMON_5: ::nl_item = 0x20012; |
| 243 | pub const ABMON_6: ::nl_item = 0x20013; |
| 244 | pub const ABMON_7: ::nl_item = 0x20014; |
| 245 | pub const ABMON_8: ::nl_item = 0x20015; |
| 246 | pub const ABMON_9: ::nl_item = 0x20016; |
| 247 | pub const ABMON_10: ::nl_item = 0x20017; |
| 248 | pub const ABMON_11: ::nl_item = 0x20018; |
| 249 | pub const ABMON_12: ::nl_item = 0x20019; |
| 250 | |
Ian Denhardt | 2faafb3 | 2016-10-02 15:02:28 -0400 | [diff] [blame^] | 251 | pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; |
| 252 | |
A.J. Gardner | 24c84f1 | 2016-03-31 20:08:03 -0500 | [diff] [blame] | 253 | pub const MON_1: ::nl_item = 0x2001A; |
| 254 | pub const MON_2: ::nl_item = 0x2001B; |
| 255 | pub const MON_3: ::nl_item = 0x2001C; |
| 256 | pub const MON_4: ::nl_item = 0x2001D; |
| 257 | pub const MON_5: ::nl_item = 0x2001E; |
| 258 | pub const MON_6: ::nl_item = 0x2001F; |
| 259 | pub const MON_7: ::nl_item = 0x20020; |
| 260 | pub const MON_8: ::nl_item = 0x20021; |
| 261 | pub const MON_9: ::nl_item = 0x20022; |
| 262 | pub const MON_10: ::nl_item = 0x20023; |
| 263 | pub const MON_11: ::nl_item = 0x20024; |
| 264 | pub const MON_12: ::nl_item = 0x20025; |
| 265 | |
| 266 | pub const AM_STR: ::nl_item = 0x20026; |
| 267 | pub const PM_STR: ::nl_item = 0x20027; |
| 268 | |
| 269 | pub const D_T_FMT: ::nl_item = 0x20028; |
| 270 | pub const D_FMT: ::nl_item = 0x20029; |
| 271 | pub const T_FMT: ::nl_item = 0x2002A; |
| 272 | pub const T_FMT_AMPM: ::nl_item = 0x2002B; |
| 273 | |
| 274 | pub const ERA: ::nl_item = 0x2002C; |
| 275 | pub const ERA_D_FMT: ::nl_item = 0x2002E; |
| 276 | pub const ALT_DIGITS: ::nl_item = 0x2002F; |
| 277 | pub const ERA_D_T_FMT: ::nl_item = 0x20030; |
| 278 | pub const ERA_T_FMT: ::nl_item = 0x20031; |
| 279 | |
| 280 | pub const CODESET: ::nl_item = 14; |
| 281 | |
| 282 | pub const CRNCYSTR: ::nl_item = 0x4000F; |
| 283 | |
| 284 | pub const RADIXCHAR: ::nl_item = 0x10000; |
| 285 | pub const THOUSEP: ::nl_item = 0x10001; |
| 286 | |
| 287 | pub const YESEXPR: ::nl_item = 0x50000; |
| 288 | pub const NOEXPR: ::nl_item = 0x50001; |
| 289 | pub const YESSTR: ::nl_item = 0x50002; |
| 290 | pub const NOSTR: ::nl_item = 0x50003; |
| 291 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 292 | pub const FILENAME_MAX: ::c_uint = 4096; |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 293 | pub const L_tmpnam: ::c_uint = 20; |
Philipp Keller | 2cad6ca | 2016-07-06 21:15:38 +0200 | [diff] [blame] | 294 | pub const _PC_LINK_MAX: ::c_int = 0; |
| 295 | pub const _PC_MAX_CANON: ::c_int = 1; |
| 296 | pub const _PC_MAX_INPUT: ::c_int = 2; |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 297 | pub const _PC_NAME_MAX: ::c_int = 3; |
Philipp Keller | 2cad6ca | 2016-07-06 21:15:38 +0200 | [diff] [blame] | 298 | pub const _PC_PATH_MAX: ::c_int = 4; |
| 299 | pub const _PC_PIPE_BUF: ::c_int = 5; |
| 300 | pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; |
| 301 | pub const _PC_NO_TRUNC: ::c_int = 7; |
| 302 | pub const _PC_VDISABLE: ::c_int = 8; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 303 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 304 | pub const _SC_ARG_MAX: ::c_int = 0; |
| 305 | pub const _SC_CHILD_MAX: ::c_int = 1; |
| 306 | pub const _SC_CLK_TCK: ::c_int = 2; |
| 307 | pub const _SC_NGROUPS_MAX: ::c_int = 3; |
| 308 | pub const _SC_OPEN_MAX: ::c_int = 4; |
| 309 | pub const _SC_STREAM_MAX: ::c_int = 5; |
| 310 | pub const _SC_TZNAME_MAX: ::c_int = 6; |
| 311 | pub const _SC_JOB_CONTROL: ::c_int = 7; |
| 312 | pub const _SC_SAVED_IDS: ::c_int = 8; |
| 313 | pub const _SC_REALTIME_SIGNALS: ::c_int = 9; |
| 314 | pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10; |
| 315 | pub const _SC_TIMERS: ::c_int = 11; |
| 316 | pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12; |
| 317 | pub const _SC_PRIORITIZED_IO: ::c_int = 13; |
| 318 | pub const _SC_SYNCHRONIZED_IO: ::c_int = 14; |
| 319 | pub const _SC_FSYNC: ::c_int = 15; |
| 320 | pub const _SC_MAPPED_FILES: ::c_int = 16; |
| 321 | pub const _SC_MEMLOCK: ::c_int = 17; |
| 322 | pub const _SC_MEMLOCK_RANGE: ::c_int = 18; |
| 323 | pub const _SC_MEMORY_PROTECTION: ::c_int = 19; |
| 324 | pub const _SC_MESSAGE_PASSING: ::c_int = 20; |
| 325 | pub const _SC_SEMAPHORES: ::c_int = 21; |
| 326 | pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22; |
| 327 | pub const _SC_AIO_LISTIO_MAX: ::c_int = 23; |
| 328 | pub const _SC_AIO_MAX: ::c_int = 24; |
| 329 | pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25; |
| 330 | pub const _SC_DELAYTIMER_MAX: ::c_int = 26; |
| 331 | pub const _SC_MQ_OPEN_MAX: ::c_int = 27; |
| 332 | pub const _SC_MQ_PRIO_MAX: ::c_int = 28; |
| 333 | pub const _SC_VERSION: ::c_int = 29; |
| 334 | pub const _SC_PAGESIZE: ::c_int = 30; |
Brian Campbell | 11f29f5 | 2016-01-31 21:28:16 -0500 | [diff] [blame] | 335 | pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 336 | pub const _SC_RTSIG_MAX: ::c_int = 31; |
| 337 | pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; |
| 338 | pub const _SC_SEM_VALUE_MAX: ::c_int = 33; |
| 339 | pub const _SC_SIGQUEUE_MAX: ::c_int = 34; |
| 340 | pub const _SC_TIMER_MAX: ::c_int = 35; |
| 341 | pub const _SC_BC_BASE_MAX: ::c_int = 36; |
| 342 | pub const _SC_BC_DIM_MAX: ::c_int = 37; |
| 343 | pub const _SC_BC_SCALE_MAX: ::c_int = 38; |
| 344 | pub const _SC_BC_STRING_MAX: ::c_int = 39; |
| 345 | pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40; |
| 346 | pub const _SC_EXPR_NEST_MAX: ::c_int = 42; |
| 347 | pub const _SC_LINE_MAX: ::c_int = 43; |
| 348 | pub const _SC_RE_DUP_MAX: ::c_int = 44; |
| 349 | pub const _SC_2_VERSION: ::c_int = 46; |
| 350 | pub const _SC_2_C_BIND: ::c_int = 47; |
| 351 | pub const _SC_2_C_DEV: ::c_int = 48; |
| 352 | pub const _SC_2_FORT_DEV: ::c_int = 49; |
| 353 | pub const _SC_2_FORT_RUN: ::c_int = 50; |
| 354 | pub const _SC_2_SW_DEV: ::c_int = 51; |
| 355 | pub const _SC_2_LOCALEDEF: ::c_int = 52; |
| 356 | pub const _SC_IOV_MAX: ::c_int = 60; |
| 357 | pub const _SC_THREADS: ::c_int = 67; |
| 358 | pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68; |
| 359 | pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69; |
| 360 | pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70; |
| 361 | pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; |
| 362 | pub const _SC_TTY_NAME_MAX: ::c_int = 72; |
| 363 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73; |
| 364 | pub const _SC_THREAD_KEYS_MAX: ::c_int = 74; |
| 365 | pub const _SC_THREAD_STACK_MIN: ::c_int = 75; |
| 366 | pub const _SC_THREAD_THREADS_MAX: ::c_int = 76; |
| 367 | pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; |
| 368 | pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; |
| 369 | pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79; |
| 370 | pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80; |
| 371 | pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81; |
| 372 | pub const _SC_NPROCESSORS_ONLN: ::c_int = 84; |
| 373 | pub const _SC_ATEXIT_MAX: ::c_int = 87; |
| 374 | pub const _SC_XOPEN_VERSION: ::c_int = 89; |
| 375 | pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; |
| 376 | pub const _SC_XOPEN_UNIX: ::c_int = 91; |
| 377 | pub const _SC_XOPEN_CRYPT: ::c_int = 92; |
| 378 | pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; |
| 379 | pub const _SC_XOPEN_SHM: ::c_int = 94; |
| 380 | pub const _SC_2_CHAR_TERM: ::c_int = 95; |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 381 | pub const _SC_2_UPE: ::c_int = 97; |
| 382 | pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125; |
| 383 | pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; |
| 384 | pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128; |
| 385 | pub const _SC_XOPEN_LEGACY: ::c_int = 129; |
| 386 | pub const _SC_XOPEN_REALTIME: ::c_int = 130; |
| 387 | pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131; |
Raphael Cohn | f365111 | 2016-05-04 10:35:08 +0100 | [diff] [blame] | 388 | pub const _SC_HOST_NAME_MAX: ::c_int = 180; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 389 | |
| 390 | pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY; |
| 391 | pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY; |
| 392 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 393 | pub const GLOB_ERR: ::c_int = 1 << 0; |
| 394 | pub const GLOB_MARK: ::c_int = 1 << 1; |
| 395 | pub const GLOB_NOSORT: ::c_int = 1 << 2; |
| 396 | pub const GLOB_DOOFFS: ::c_int = 1 << 3; |
| 397 | pub const GLOB_NOCHECK: ::c_int = 1 << 4; |
| 398 | pub const GLOB_APPEND: ::c_int = 1 << 5; |
| 399 | pub const GLOB_NOESCAPE: ::c_int = 1 << 6; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 400 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 401 | pub const GLOB_NOSPACE: ::c_int = 1; |
| 402 | pub const GLOB_ABORTED: ::c_int = 2; |
| 403 | pub const GLOB_NOMATCH: ::c_int = 3; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 404 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 405 | pub const POSIX_MADV_NORMAL: ::c_int = 0; |
| 406 | pub const POSIX_MADV_RANDOM: ::c_int = 1; |
| 407 | pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; |
| 408 | pub const POSIX_MADV_WILLNEED: ::c_int = 3; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 409 | |
| 410 | pub const S_IEXEC: mode_t = 64; |
| 411 | pub const S_IWRITE: mode_t = 128; |
| 412 | pub const S_IREAD: mode_t = 256; |
| 413 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 414 | pub const F_LOCK: ::c_int = 1; |
| 415 | pub const F_TEST: ::c_int = 3; |
| 416 | pub const F_TLOCK: ::c_int = 2; |
| 417 | pub const F_ULOCK: ::c_int = 0; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 418 | |
Dan Burkert | 85a76f8 | 2015-11-04 20:26:27 -0800 | [diff] [blame] | 419 | pub const ST_RDONLY: ::c_ulong = 1; |
| 420 | pub const ST_NOSUID: ::c_ulong = 2; |
| 421 | pub const ST_NODEV: ::c_ulong = 4; |
| 422 | pub const ST_NOEXEC: ::c_ulong = 8; |
| 423 | pub const ST_SYNCHRONOUS: ::c_ulong = 16; |
| 424 | pub const ST_MANDLOCK: ::c_ulong = 64; |
| 425 | pub const ST_WRITE: ::c_ulong = 128; |
| 426 | pub const ST_APPEND: ::c_ulong = 256; |
| 427 | pub const ST_IMMUTABLE: ::c_ulong = 512; |
| 428 | pub const ST_NOATIME: ::c_ulong = 1024; |
| 429 | pub const ST_NODIRATIME: ::c_ulong = 2048; |
| 430 | |
Dong Zhou | 188bef6 | 2015-11-29 22:24:10 -0500 | [diff] [blame] | 431 | pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; |
| 432 | pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; |
Alex Crichton | 29de598 | 2016-02-04 13:48:13 -0800 | [diff] [blame] | 433 | pub const RTLD_NODELETE: ::c_int = 0x1000; |
| 434 | pub const RTLD_NOW: ::c_int = 0x2; |
Dong Zhou | 51ed574 | 2015-11-29 21:42:14 -0500 | [diff] [blame] | 435 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 436 | pub const TCP_MD5SIG: ::c_int = 14; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 437 | |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 438 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { |
| 439 | __align: [], |
| 440 | size: [0; __SIZEOF_PTHREAD_MUTEX_T], |
| 441 | }; |
| 442 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { |
| 443 | __align: [], |
| 444 | size: [0; __SIZEOF_PTHREAD_COND_T], |
| 445 | }; |
| 446 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { |
| 447 | __align: [], |
| 448 | size: [0; __SIZEOF_PTHREAD_RWLOCK_T], |
| 449 | }; |
Amanieu d'Antras | b2b9f29 | 2016-05-21 06:40:14 +0100 | [diff] [blame] | 450 | pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 451 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; |
Amanieu d'Antras | b2b9f29 | 2016-05-21 06:40:14 +0100 | [diff] [blame] | 452 | pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; |
| 453 | pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 454 | pub const __SIZEOF_PTHREAD_COND_T: usize = 48; |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 455 | |
Alexander Polakov | 26974c7 | 2015-11-27 03:02:44 +0300 | [diff] [blame] | 456 | pub const SCHED_OTHER: ::c_int = 0; |
| 457 | pub const SCHED_FIFO: ::c_int = 1; |
| 458 | pub const SCHED_RR: ::c_int = 2; |
| 459 | pub const SCHED_BATCH: ::c_int = 3; |
| 460 | pub const SCHED_IDLE: ::c_int = 5; |
| 461 | |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 462 | // System V IPC |
| 463 | pub const IPC_PRIVATE: ::key_t = 0; |
| 464 | |
Alexander Polakov | 5850156 | 2015-12-14 02:09:45 +0300 | [diff] [blame] | 465 | pub const IPC_CREAT: ::c_int = 0o1000; |
| 466 | pub const IPC_EXCL: ::c_int = 0o2000; |
| 467 | pub const IPC_NOWAIT: ::c_int = 0o4000; |
| 468 | |
| 469 | pub const IPC_RMID: ::c_int = 0; |
| 470 | pub const IPC_SET: ::c_int = 1; |
| 471 | pub const IPC_STAT: ::c_int = 2; |
| 472 | pub const IPC_INFO: ::c_int = 3; |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 473 | pub const MSG_STAT: ::c_int = 11; |
| 474 | pub const MSG_INFO: ::c_int = 12; |
| 475 | |
| 476 | pub const MSG_NOERROR: ::c_int = 0o10000; |
| 477 | pub const MSG_EXCEPT: ::c_int = 0o20000; |
| 478 | pub const MSG_COPY: ::c_int = 0o40000; |
Alexander Polakov | 5850156 | 2015-12-14 02:09:45 +0300 | [diff] [blame] | 479 | |
| 480 | pub const SHM_R: ::c_int = 0o400; |
| 481 | pub const SHM_W: ::c_int = 0o200; |
| 482 | |
| 483 | pub const SHM_RDONLY: ::c_int = 0o10000; |
| 484 | pub const SHM_RND: ::c_int = 0o20000; |
| 485 | pub const SHM_REMAP: ::c_int = 0o40000; |
| 486 | pub const SHM_EXEC: ::c_int = 0o100000; |
| 487 | |
| 488 | pub const SHM_LOCK: ::c_int = 11; |
| 489 | pub const SHM_UNLOCK: ::c_int = 12; |
| 490 | |
| 491 | pub const SHM_HUGETLB: ::c_int = 0o4000; |
| 492 | pub const SHM_NORESERVE: ::c_int = 0o10000; |
| 493 | |
Alex Crichton | 8dce9ad | 2015-12-03 11:44:14 -0800 | [diff] [blame] | 494 | pub const EPOLLRDHUP: ::c_int = 0x2000; |
| 495 | pub const EPOLLONESHOT: ::c_int = 0x40000000; |
| 496 | |
| 497 | pub const QFMT_VFS_OLD: ::c_int = 1; |
| 498 | pub const QFMT_VFS_V0: ::c_int = 2; |
| 499 | |
| 500 | pub const SFD_CLOEXEC: ::c_int = 0x080000; |
| 501 | |
| 502 | pub const EFD_SEMAPHORE: ::c_int = 0x1; |
| 503 | |
| 504 | pub const NCCS: usize = 32; |
| 505 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 506 | pub const AF_NETLINK: ::c_int = 16; |
| 507 | |
Raphael Cohn | 1c6c0ca | 2016-05-05 17:45:29 +0100 | [diff] [blame] | 508 | pub const LOG_NFACILITIES: ::c_int = 24; |
| 509 | |
Steven Fackler | 41699f7 | 2016-06-03 21:02:56 -0700 | [diff] [blame] | 510 | pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; |
| 511 | |
Philipp Matthias Schaefer | 5a68b6a | 2016-07-15 23:19:00 +0200 | [diff] [blame] | 512 | pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; |
| 513 | pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; |
| 514 | pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; |
| 515 | pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; |
| 516 | pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; |
| 517 | pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; |
| 518 | pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; |
Sergey Bugaev | 5d65c3f | 2016-07-12 20:55:08 +0300 | [diff] [blame] | 519 | |
Chris Kaminski | ae6cbcd | 2016-09-07 13:15:49 -0400 | [diff] [blame] | 520 | pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; |
| 521 | pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; |
| 522 | pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; |
Chris Kaminski | 37552b7 | 2016-09-06 20:20:00 -0400 | [diff] [blame] | 523 | |
Tomasz MiÄ…sko | f514d46 | 2016-09-19 12:29:45 +0200 | [diff] [blame] | 524 | pub const EAI_SYSTEM: ::c_int = -11; |
| 525 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 526 | f! { |
| 527 | pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { |
| 528 | for slot in cpuset.bits.iter_mut() { |
| 529 | *slot = 0; |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { |
NODA, Kai | afa77df | 2016-04-10 19:13:46 +0800 | [diff] [blame] | 534 | let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc |
| 535 | let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 536 | cpuset.bits[idx] |= 1 << offset; |
| 537 | () |
| 538 | } |
| 539 | |
Philipp Matthias Schaefer | 2def04a | 2016-08-18 21:47:08 +0200 | [diff] [blame] | 540 | pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { |
| 541 | let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc |
| 542 | let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); |
| 543 | cpuset.bits[idx] &= !(1 << offset); |
| 544 | () |
| 545 | } |
| 546 | |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 547 | pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { |
NODA, Kai | afa77df | 2016-04-10 19:13:46 +0800 | [diff] [blame] | 548 | let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); |
| 549 | let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 550 | 0 != (cpuset.bits[idx] & (1 << offset)) |
| 551 | } |
| 552 | |
| 553 | pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { |
| 554 | set1.bits == set2.bits |
| 555 | } |
| 556 | } |
| 557 | |
Raphael Cohn | 893d4d8 | 2016-05-08 11:40:57 +0100 | [diff] [blame] | 558 | extern { |
knight42 | c289365 | 2016-08-28 00:32:35 +0800 | [diff] [blame] | 559 | pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; |
| 560 | |
Knight | 19fb32a | 2016-07-31 17:00:15 +0800 | [diff] [blame] | 561 | pub fn setpwent(); |
| 562 | pub fn getpwent() -> *mut passwd; |
Philipp Keller | 26f3eb9 | 2016-09-26 22:00:29 +0200 | [diff] [blame] | 563 | pub fn setspent(); |
| 564 | pub fn endspent(); |
| 565 | pub fn getspent() -> *mut spwd; |
| 566 | pub fn getspnam(__name: *const ::c_char) -> *mut spwd; |
| 567 | |
Alex Crichton | 5260587 | 2015-09-15 16:49:37 -0700 | [diff] [blame] | 568 | pub fn shm_open(name: *const c_char, oflag: ::c_int, |
| 569 | mode: mode_t) -> ::c_int; |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 570 | |
| 571 | // System V IPC |
Alexander Polakov | 5850156 | 2015-12-14 02:09:45 +0300 | [diff] [blame] | 572 | pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 573 | pub fn shmat(shmid: ::c_int, |
| 574 | shmaddr: *const ::c_void, |
| 575 | shmflg: ::c_int) -> *mut ::c_void; |
Alexander Polakov | 5850156 | 2015-12-14 02:09:45 +0300 | [diff] [blame] | 576 | pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 577 | pub fn shmctl(shmid: ::c_int, |
| 578 | cmd: ::c_int, |
| 579 | buf: *mut ::shmid_ds) -> ::c_int; |
Alexander Schlarb | 7590565 | 2016-09-17 22:17:17 +0200 | [diff] [blame] | 580 | pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; |
| 581 | pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; |
| 582 | pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; |
| 583 | pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t, |
| 584 | msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t; |
| 585 | pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, |
| 586 | msgflg: ::c_int) -> ::c_int; |
| 587 | |
Alex Crichton | 9d5b8b2 | 2015-09-15 17:14:23 -0700 | [diff] [blame] | 588 | pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) |
| 589 | -> ::c_int; |
Alex Crichton | cd9b33e | 2015-09-17 14:47:40 -0700 | [diff] [blame] | 590 | pub fn __errno_location() -> *mut ::c_int; |
Alex Crichton | 15b83c2 | 2015-09-17 17:25:52 -0700 | [diff] [blame] | 591 | |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 592 | pub fn fopen64(filename: *const c_char, |
| 593 | mode: *const c_char) -> *mut ::FILE; |
| 594 | pub fn freopen64(filename: *const c_char, mode: *const c_char, |
| 595 | file: *mut ::FILE) -> *mut ::FILE; |
| 596 | pub fn tmpfile64() -> *mut ::FILE; |
| 597 | pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; |
| 598 | pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 599 | pub fn fseeko64(stream: *mut ::FILE, |
| 600 | offset: ::off64_t, |
| 601 | whence: ::c_int) -> ::c_int; |
| 602 | pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; |
Dan Burkert | 0b46775 | 2015-11-03 20:58:44 -0800 | [diff] [blame] | 603 | pub fn fallocate(fd: ::c_int, mode: ::c_int, |
| 604 | offset: ::off_t, len: ::off_t) -> ::c_int; |
Dan Burkert | 44bba4c | 2015-11-03 21:02:46 -0800 | [diff] [blame] | 605 | pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, |
| 606 | len: ::off_t) -> ::c_int; |
Dan Burkert | fe3968f | 2015-11-04 22:20:29 -0800 | [diff] [blame] | 607 | pub fn readahead(fd: ::c_int, offset: ::off64_t, |
| 608 | count: ::size_t) -> ::ssize_t; |
Alexander Polakov | 30baed0 | 2015-12-01 15:29:05 +0300 | [diff] [blame] | 609 | pub fn getxattr(path: *const c_char, name: *const c_char, |
| 610 | value: *mut ::c_void, size: ::size_t) -> ::ssize_t; |
| 611 | pub fn lgetxattr(path: *const c_char, name: *const c_char, |
| 612 | value: *mut ::c_void, size: ::size_t) -> ::ssize_t; |
| 613 | pub fn fgetxattr(filedes: ::c_int, name: *const c_char, |
| 614 | value: *mut ::c_void, size: ::size_t) -> ::ssize_t; |
| 615 | pub fn setxattr(path: *const c_char, name: *const c_char, |
| 616 | value: *const ::c_void, size: ::size_t, |
| 617 | flags: ::c_int) -> ::c_int; |
| 618 | pub fn lsetxattr(path: *const c_char, name: *const c_char, |
| 619 | value: *const ::c_void, size: ::size_t, |
| 620 | flags: ::c_int) -> ::c_int; |
| 621 | pub fn fsetxattr(filedes: ::c_int, name: *const c_char, |
| 622 | value: *const ::c_void, size: ::size_t, |
| 623 | flags: ::c_int) -> ::c_int; |
| 624 | pub fn listxattr(path: *const c_char, list: *mut c_char, |
| 625 | size: ::size_t) -> ::ssize_t; |
| 626 | pub fn llistxattr(path: *const c_char, list: *mut c_char, |
| 627 | size: ::size_t) -> ::ssize_t; |
| 628 | pub fn flistxattr(filedes: ::c_int, list: *mut c_char, |
| 629 | size: ::size_t) -> ::ssize_t; |
| 630 | pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; |
| 631 | pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; |
| 632 | pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; |
Alex Crichton | 8dce9ad | 2015-12-03 11:44:14 -0800 | [diff] [blame] | 633 | pub fn signalfd(fd: ::c_int, |
| 634 | mask: *const ::sigset_t, |
| 635 | flags: ::c_int) -> ::c_int; |
| 636 | pub fn pwritev(fd: ::c_int, |
| 637 | iov: *const ::iovec, |
| 638 | iovcnt: ::c_int, |
| 639 | offset: ::off_t) -> ::ssize_t; |
| 640 | pub fn preadv(fd: ::c_int, |
| 641 | iov: *const ::iovec, |
| 642 | iovcnt: ::c_int, |
| 643 | offset: ::off_t) -> ::ssize_t; |
| 644 | pub fn quotactl(cmd: ::c_int, |
| 645 | special: *const ::c_char, |
| 646 | id: ::c_int, |
| 647 | data: *mut ::c_char) -> ::c_int; |
| 648 | pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; |
| 649 | pub fn mq_close(mqd: ::mqd_t) -> ::c_int; |
| 650 | pub fn mq_unlink(name: *const ::c_char) -> ::c_int; |
| 651 | pub fn mq_receive(mqd: ::mqd_t, |
| 652 | msg_ptr: *mut ::c_char, |
| 653 | msg_len: ::size_t, |
| 654 | msq_prio: *mut ::c_uint) -> ::ssize_t; |
| 655 | pub fn mq_send(mqd: ::mqd_t, |
| 656 | msg_ptr: *const ::c_char, |
| 657 | msg_len: ::size_t, |
| 658 | msq_prio: ::c_uint) -> ::c_int; |
| 659 | pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; |
| 660 | pub fn mq_setattr(mqd: ::mqd_t, |
| 661 | newattr: *const ::mq_attr, |
| 662 | oldattr: *mut ::mq_attr) -> ::c_int; |
Alex Crichton | 8dce9ad | 2015-12-03 11:44:14 -0800 | [diff] [blame] | 663 | pub fn epoll_pwait(epfd: ::c_int, |
| 664 | events: *mut ::epoll_event, |
| 665 | maxevents: ::c_int, |
| 666 | timeout: ::c_int, |
| 667 | sigmask: *const ::sigset_t) -> ::c_int; |
| 668 | pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; |
Alex Crichton | 8dce9ad | 2015-12-03 11:44:14 -0800 | [diff] [blame] | 669 | pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; |
Kamal Marhubi | 511a780 | 2016-02-15 00:40:19 -0500 | [diff] [blame] | 670 | pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; |
Alex Crichton | 8a8bc66 | 2016-02-29 23:02:36 -0800 | [diff] [blame] | 671 | pub fn mkostemps(template: *mut ::c_char, |
| 672 | suffixlen: ::c_int, |
| 673 | flags: ::c_int) -> ::c_int; |
Philipp Matthias Schaefer | c1982a4 | 2016-02-28 16:06:45 +0100 | [diff] [blame] | 674 | pub fn sigtimedwait(set: *const sigset_t, |
| 675 | info: *mut siginfo_t, |
| 676 | timeout: *const ::timespec) -> ::c_int; |
| 677 | pub fn sigwaitinfo(set: *const sigset_t, |
| 678 | info: *mut siginfo_t) -> ::c_int; |
Kamal Marhubi | 9c4af10 | 2016-02-27 14:58:43 -0500 | [diff] [blame] | 679 | pub fn openpty(amaster: *mut ::c_int, |
| 680 | aslave: *mut ::c_int, |
| 681 | name: *mut ::c_char, |
| 682 | termp: *const termios, |
| 683 | winp: *const ::winsize) -> ::c_int; |
| 684 | pub fn forkpty(amaster: *mut ::c_int, |
| 685 | name: *mut ::c_char, |
| 686 | termp: *const termios, |
| 687 | winp: *const ::winsize) -> ::pid_t; |
A.J. Gardner | 24c84f1 | 2016-03-31 20:08:03 -0500 | [diff] [blame] | 688 | pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; |
Kamal Marhubi | b9750b6 | 2016-04-27 14:04:31 -0400 | [diff] [blame] | 689 | pub fn getnameinfo(sa: *const ::sockaddr, |
| 690 | salen: ::socklen_t, |
| 691 | host: *mut ::c_char, |
| 692 | hostlen: ::socklen_t, |
| 693 | serv: *mut ::c_char, |
| 694 | sevlen: ::socklen_t, |
| 695 | flags: ::c_int) -> ::c_int; |
Kamal Marhubi | 9569599 | 2016-04-27 14:29:19 -0400 | [diff] [blame] | 696 | pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit, |
| 697 | old_limit: *mut ::rlimit) -> ::c_int; |
| 698 | pub fn prlimit64(pid: ::pid_t, |
| 699 | resource: ::c_int, |
| 700 | new_limit: *const ::rlimit64, |
| 701 | old_limit: *mut ::rlimit64) -> ::c_int; |
Raphael Cohn | 72f1fb6 | 2016-05-11 18:06:14 +0100 | [diff] [blame] | 702 | pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; |
Julia Evans | c9496fe | 2016-05-11 08:44:27 -0400 | [diff] [blame] | 703 | pub fn process_vm_readv(pid: ::pid_t, |
| 704 | local_iov: *const ::iovec, |
| 705 | liovcnt: ::c_ulong, |
| 706 | remote_iov: *const ::iovec, |
| 707 | riovcnt: ::c_ulong, |
| 708 | flags: ::c_ulong) -> isize; |
| 709 | pub fn process_vm_writev(pid: ::pid_t, |
| 710 | local_iov: *const ::iovec, |
| 711 | liovcnt: ::c_ulong, |
| 712 | remote_iov: *const ::iovec, |
| 713 | riovcnt: ::c_ulong, |
| 714 | flags: ::c_ulong) -> isize; |
Sergey Bugaev | 8b76797 | 2016-07-12 20:56:43 +0300 | [diff] [blame] | 715 | pub fn reboot(how_to: ::c_int) -> ::c_int; |
Axel Viala | 26ee782 | 2016-06-10 02:33:32 +0200 | [diff] [blame] | 716 | |
| 717 | // Not available now on Android |
| 718 | pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, |
| 719 | mode: ::mode_t) -> ::c_int; |
Charles J. Schneider | 332bd86 | 2016-07-12 09:32:42 +0200 | [diff] [blame] | 720 | pub fn if_nameindex() -> *mut if_nameindex; |
| 721 | pub fn if_freenameindex(ptr: *mut if_nameindex); |
Chris Kaminski | 37552b7 | 2016-09-06 20:20:00 -0400 | [diff] [blame] | 722 | pub fn sync_file_range(fd: ::c_int, offset: ::off64_t, |
| 723 | nbytes: ::off64_t, flags: ::c_uint) -> ::c_int; |
Niels Sascha Reedijk | a3ff955 | 2016-02-02 21:21:36 +0100 | [diff] [blame] | 724 | pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; |
| 725 | pub fn freeifaddrs(ifa: *mut ::ifaddrs); |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 726 | } |
| 727 | |
| 728 | cfg_if! { |
Brian Anderson | 7d1d575 | 2015-11-26 23:27:45 +0000 | [diff] [blame] | 729 | if #[cfg(any(target_env = "musl", |
| 730 | target_os = "emscripten"))] { |
Alex Crichton | 7482522 | 2015-10-29 17:36:55 -0700 | [diff] [blame] | 731 | mod musl; |
| 732 | pub use self::musl::*; |
Alex Crichton | 62a6c82 | 2015-11-09 13:58:44 -0800 | [diff] [blame] | 733 | } else if #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] { |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 734 | mod mips; |
| 735 | pub use self::mips::*; |
Jorge Aparicio | e7480ed | 2016-09-02 21:08:02 -0500 | [diff] [blame] | 736 | } else if #[cfg(any(target_arch = "s390x"))] { |
| 737 | mod s390x; |
| 738 | pub use self::s390x::*; |
Jorge Aparicio | 196b0e8 | 2016-08-26 22:30:42 -0500 | [diff] [blame] | 739 | } else if #[cfg(any(target_arch = "mips64"))] { |
| 740 | mod mips64; |
| 741 | pub use self::mips64::*; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 742 | } else { |
Alex Crichton | 62a6c82 | 2015-11-09 13:58:44 -0800 | [diff] [blame] | 743 | mod other; |
| 744 | pub use self::other::*; |
Alex Crichton | 50a42e2 | 2015-09-15 14:27:15 -0700 | [diff] [blame] | 745 | } |
| 746 | } |