1 pub type pthread_t = c_ulong; 2 pub type __priority_which_t = ::c_uint; 3 pub type __rlimit_resource_t = ::c_uint; 4 5 s! { 6 pub struct statx { 7 pub stx_mask: u32, 8 pub stx_blksize: u32, 9 pub stx_attributes: u64, 10 pub stx_nlink: u32, 11 pub stx_uid: u32, 12 pub stx_gid: u32, 13 pub stx_mode: u16, 14 pub __statx_pad1: [u16; 1], 15 pub stx_ino: u64, 16 pub stx_size: u64, 17 pub stx_blocks: u64, 18 pub stx_attributes_mask: u64, 19 pub stx_atime: ::statx_timestamp, 20 pub stx_btime: ::statx_timestamp, 21 pub stx_ctime: ::statx_timestamp, 22 pub stx_mtime: ::statx_timestamp, 23 pub stx_rdev_major: u32, 24 pub stx_rdev_minor: u32, 25 pub stx_dev_major: u32, 26 pub stx_dev_minor: u32, 27 pub __statx_pad2: [u64; 14], 28 } 29 30 pub struct statx_timestamp { 31 pub tv_sec: i64, 32 pub tv_nsec: u32, 33 pub __statx_timestamp_pad1: [i32; 1], 34 } 35 36 pub struct aiocb { 37 pub aio_fildes: ::c_int, 38 pub aio_lio_opcode: ::c_int, 39 pub aio_reqprio: ::c_int, 40 pub aio_buf: *mut ::c_void, 41 pub aio_nbytes: ::size_t, 42 pub aio_sigevent: ::sigevent, 43 __next_prio: *mut aiocb, 44 __abs_prio: ::c_int, 45 __policy: ::c_int, 46 __error_code: ::c_int, 47 __return_value: ::ssize_t, 48 pub aio_offset: off_t, 49 #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] 50 __unused1: [::c_char; 4], 51 __glibc_reserved: [::c_char; 32] 52 } 53 54 pub struct __exit_status { 55 pub e_termination: ::c_short, 56 pub e_exit: ::c_short, 57 } 58 59 pub struct __timeval { 60 pub tv_sec: i32, 61 pub tv_usec: i32, 62 } 63 64 pub struct sigaction { 65 pub sa_sigaction: ::sighandler_t, 66 pub sa_mask: ::sigset_t, 67 #[cfg(target_arch = "sparc64")] 68 __reserved0: ::c_int, 69 pub sa_flags: ::c_int, 70 pub sa_restorer: ::Option<extern fn()>, 71 } 72 73 pub struct stack_t { 74 pub ss_sp: *mut ::c_void, 75 pub ss_flags: ::c_int, 76 pub ss_size: ::size_t 77 } 78 79 pub struct siginfo_t { 80 pub si_signo: ::c_int, 81 pub si_errno: ::c_int, 82 pub si_code: ::c_int, 83 #[doc(hidden)] 84 #[deprecated( 85 since="0.2.54", 86 note="Please leave a comment on \ 87 https://github.com/rust-lang/libc/pull/1316 if you're using \ 88 this field" 89 )] 90 pub _pad: [::c_int; 29], 91 #[cfg(target_arch = "x86_64")] 92 _align: [u64; 0], 93 #[cfg(not(target_arch = "x86_64"))] 94 _align: [usize; 0], 95 } 96 97 pub struct glob64_t { 98 pub gl_pathc: ::size_t, 99 pub gl_pathv: *mut *mut ::c_char, 100 pub gl_offs: ::size_t, 101 pub gl_flags: ::c_int, 102 103 __unused1: *mut ::c_void, 104 __unused2: *mut ::c_void, 105 __unused3: *mut ::c_void, 106 __unused4: *mut ::c_void, 107 __unused5: *mut ::c_void, 108 } 109 110 pub struct statfs { 111 pub f_type: __fsword_t, 112 pub f_bsize: __fsword_t, 113 pub f_blocks: ::fsblkcnt_t, 114 pub f_bfree: ::fsblkcnt_t, 115 pub f_bavail: ::fsblkcnt_t, 116 117 pub f_files: ::fsfilcnt_t, 118 pub f_ffree: ::fsfilcnt_t, 119 pub f_fsid: ::fsid_t, 120 121 pub f_namelen: __fsword_t, 122 pub f_frsize: __fsword_t, 123 f_spare: [__fsword_t; 5], 124 } 125 126 pub struct msghdr { 127 pub msg_name: *mut ::c_void, 128 pub msg_namelen: ::socklen_t, 129 pub msg_iov: *mut ::iovec, 130 pub msg_iovlen: ::size_t, 131 pub msg_control: *mut ::c_void, 132 pub msg_controllen: ::size_t, 133 pub msg_flags: ::c_int, 134 } 135 136 pub struct cmsghdr { 137 pub cmsg_len: ::size_t, 138 pub cmsg_level: ::c_int, 139 pub cmsg_type: ::c_int, 140 } 141 142 pub struct termios { 143 pub c_iflag: ::tcflag_t, 144 pub c_oflag: ::tcflag_t, 145 pub c_cflag: ::tcflag_t, 146 pub c_lflag: ::tcflag_t, 147 pub c_line: ::cc_t, 148 pub c_cc: [::cc_t; ::NCCS], 149 #[cfg(not(target_arch = "sparc64"))] 150 pub c_ispeed: ::speed_t, 151 #[cfg(not(target_arch = "sparc64"))] 152 pub c_ospeed: ::speed_t, 153 } 154 155 pub struct flock { 156 pub l_type: ::c_short, 157 pub l_whence: ::c_short, 158 pub l_start: ::off_t, 159 pub l_len: ::off_t, 160 pub l_pid: ::pid_t, 161 } 162 163 pub struct mallinfo { 164 pub arena: ::c_int, 165 pub ordblks: ::c_int, 166 pub smblks: ::c_int, 167 pub hblks: ::c_int, 168 pub hblkhd: ::c_int, 169 pub usmblks: ::c_int, 170 pub fsmblks: ::c_int, 171 pub uordblks: ::c_int, 172 pub fordblks: ::c_int, 173 pub keepcost: ::c_int, 174 } 175 176 pub struct nlmsghdr { 177 pub nlmsg_len: u32, 178 pub nlmsg_type: u16, 179 pub nlmsg_flags: u16, 180 pub nlmsg_seq: u32, 181 pub nlmsg_pid: u32, 182 } 183 184 pub struct nlmsgerr { 185 pub error: ::c_int, 186 pub msg: nlmsghdr, 187 } 188 189 pub struct nl_pktinfo { 190 pub group: u32, 191 } 192 193 pub struct nl_mmap_req { 194 pub nm_block_size: ::c_uint, 195 pub nm_block_nr: ::c_uint, 196 pub nm_frame_size: ::c_uint, 197 pub nm_frame_nr: ::c_uint, 198 } 199 200 pub struct nl_mmap_hdr { 201 pub nm_status: ::c_uint, 202 pub nm_len: ::c_uint, 203 pub nm_group: u32, 204 pub nm_pid: u32, 205 pub nm_uid: u32, 206 pub nm_gid: u32, 207 } 208 209 pub struct nlattr { 210 pub nla_len: u16, 211 pub nla_type: u16, 212 } 213 214 pub struct rtentry { 215 pub rt_pad1: ::c_ulong, 216 pub rt_dst: ::sockaddr, 217 pub rt_gateway: ::sockaddr, 218 pub rt_genmask: ::sockaddr, 219 pub rt_flags: ::c_ushort, 220 pub rt_pad2: ::c_short, 221 pub rt_pad3: ::c_ulong, 222 pub rt_tos: ::c_uchar, 223 pub rt_class: ::c_uchar, 224 #[cfg(target_pointer_width = "64")] 225 pub rt_pad4: [::c_short; 3usize], 226 #[cfg(not(target_pointer_width = "64"))] 227 pub rt_pad4: ::c_short, 228 pub rt_metric: ::c_short, 229 pub rt_dev: *mut ::c_char, 230 pub rt_mtu: ::c_ulong, 231 pub rt_window: ::c_ulong, 232 pub rt_irtt: ::c_ushort, 233 } 234 } 235 236 impl siginfo_t { si_addr(&self) -> *mut ::c_void237 pub unsafe fn si_addr(&self) -> *mut ::c_void { 238 #[repr(C)] 239 struct siginfo_sigfault { 240 _si_signo: ::c_int, 241 _si_errno: ::c_int, 242 _si_code: ::c_int, 243 si_addr: *mut ::c_void 244 } 245 (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr 246 } 247 } 248 249 s_no_extra_traits! { 250 pub struct utmpx { 251 pub ut_type: ::c_short, 252 pub ut_pid: ::pid_t, 253 pub ut_line: [::c_char; __UT_LINESIZE], 254 pub ut_id: [::c_char; 4], 255 256 pub ut_user: [::c_char; __UT_NAMESIZE], 257 pub ut_host: [::c_char; __UT_HOSTSIZE], 258 pub ut_exit: __exit_status, 259 260 #[cfg(any(target_arch = "aarch64", 261 all(target_pointer_width = "32", 262 not(target_arch = "x86_64"))))] 263 pub ut_session: ::c_long, 264 #[cfg(any(target_arch = "aarch64", 265 all(target_pointer_width = "32", 266 not(target_arch = "x86_64"))))] 267 pub ut_tv: ::timeval, 268 269 #[cfg(not(any(target_arch = "aarch64", 270 all(target_pointer_width = "32", 271 not(target_arch = "x86_64")))))] 272 pub ut_session: i32, 273 #[cfg(not(any(target_arch = "aarch64", 274 all(target_pointer_width = "32", 275 not(target_arch = "x86_64")))))] 276 pub ut_tv: __timeval, 277 278 pub ut_addr_v6: [i32; 4], 279 __glibc_reserved: [::c_char; 20], 280 } 281 } 282 283 cfg_if! { 284 if #[cfg(feature = "extra_traits")] { 285 impl PartialEq for utmpx { 286 fn eq(&self, other: &utmpx) -> bool { 287 self.ut_type == other.ut_type 288 && self.ut_pid == other.ut_pid 289 && self.ut_line == other.ut_line 290 && self.ut_id == other.ut_id 291 && self.ut_user == other.ut_user 292 && self 293 .ut_host 294 .iter() 295 .zip(other.ut_host.iter()) 296 .all(|(a,b)| a == b) 297 && self.ut_exit == other.ut_exit 298 && self.ut_session == other.ut_session 299 && self.ut_tv == other.ut_tv 300 && self.ut_addr_v6 == other.ut_addr_v6 301 && self.__glibc_reserved == other.__glibc_reserved 302 } 303 } 304 305 impl Eq for utmpx {} 306 307 impl ::fmt::Debug for utmpx { 308 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 309 f.debug_struct("utmpx") 310 .field("ut_type", &self.ut_type) 311 .field("ut_pid", &self.ut_pid) 312 .field("ut_line", &self.ut_line) 313 .field("ut_id", &self.ut_id) 314 .field("ut_user", &self.ut_user) 315 // FIXME: .field("ut_host", &self.ut_host) 316 .field("ut_exit", &self.ut_exit) 317 .field("ut_session", &self.ut_session) 318 .field("ut_tv", &self.ut_tv) 319 .field("ut_addr_v6", &self.ut_addr_v6) 320 .field("__glibc_reserved", &self.__glibc_reserved) 321 .finish() 322 } 323 } 324 325 impl ::hash::Hash for utmpx { 326 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 327 self.ut_type.hash(state); 328 self.ut_pid.hash(state); 329 self.ut_line.hash(state); 330 self.ut_id.hash(state); 331 self.ut_user.hash(state); 332 self.ut_host.hash(state); 333 self.ut_exit.hash(state); 334 self.ut_session.hash(state); 335 self.ut_tv.hash(state); 336 self.ut_addr_v6.hash(state); 337 self.__glibc_reserved.hash(state); 338 } 339 } 340 } 341 } 342 343 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; 344 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; 345 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; 346 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; 347 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; 348 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; 349 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; 350 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; 351 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; 352 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; 353 354 pub const MADV_SOFT_OFFLINE: ::c_int = 101; 355 pub const MS_RMT_MASK: ::c_ulong = 0x02800051; 356 357 pub const __UT_LINESIZE: usize = 32; 358 pub const __UT_NAMESIZE: usize = 32; 359 pub const __UT_HOSTSIZE: usize = 256; 360 pub const EMPTY: ::c_short = 0; 361 pub const RUN_LVL: ::c_short = 1; 362 pub const BOOT_TIME: ::c_short = 2; 363 pub const NEW_TIME: ::c_short = 3; 364 pub const OLD_TIME: ::c_short = 4; 365 pub const INIT_PROCESS: ::c_short = 5; 366 pub const LOGIN_PROCESS: ::c_short = 6; 367 pub const USER_PROCESS: ::c_short = 7; 368 pub const DEAD_PROCESS: ::c_short = 8; 369 pub const ACCOUNTING: ::c_short = 9; 370 371 pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; 372 pub const RLIMIT_AS: ::__rlimit_resource_t = 9; 373 pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; 374 pub const RLIM_INFINITY: ::rlim_t = !0; 375 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; 376 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16; 377 378 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; 379 380 pub const SOL_RXRPC: ::c_int = 272; 381 pub const SOL_PPPOL2TP: ::c_int = 273; 382 pub const SOL_PNPIPE: ::c_int = 275; 383 pub const SOL_RDS: ::c_int = 276; 384 pub const SOL_IUCV: ::c_int = 277; 385 pub const SOL_CAIF: ::c_int = 278; 386 pub const SOL_NFC: ::c_int = 280; 387 pub const SOL_XDP: ::c_int = 283; 388 389 pub const MSG_TRYHARD: ::c_int = 4; 390 391 pub const LC_PAPER: ::c_int = 7; 392 pub const LC_NAME: ::c_int = 8; 393 pub const LC_ADDRESS: ::c_int = 9; 394 pub const LC_TELEPHONE: ::c_int = 10; 395 pub const LC_MEASUREMENT: ::c_int = 11; 396 pub const LC_IDENTIFICATION: ::c_int = 12; 397 pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER); 398 pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME); 399 pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS); 400 pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE); 401 pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT); 402 pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION); 403 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK 404 | ::LC_NUMERIC_MASK 405 | ::LC_TIME_MASK 406 | ::LC_COLLATE_MASK 407 | ::LC_MONETARY_MASK 408 | ::LC_MESSAGES_MASK 409 | LC_PAPER_MASK 410 | LC_NAME_MASK 411 | LC_ADDRESS_MASK 412 | LC_TELEPHONE_MASK 413 | LC_MEASUREMENT_MASK 414 | LC_IDENTIFICATION_MASK; 415 416 pub const MAP_ANON: ::c_int = 0x0020; 417 pub const MAP_ANONYMOUS: ::c_int = 0x0020; 418 pub const MAP_DENYWRITE: ::c_int = 0x0800; 419 pub const MAP_EXECUTABLE: ::c_int = 0x01000; 420 pub const MAP_POPULATE: ::c_int = 0x08000; 421 pub const MAP_NONBLOCK: ::c_int = 0x010000; 422 pub const MAP_STACK: ::c_int = 0x020000; 423 pub const MAP_SHARED_VALIDATE: ::c_int = 0x3; 424 pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000; 425 426 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 427 pub const EUCLEAN: ::c_int = 117; 428 pub const ENOTNAM: ::c_int = 118; 429 pub const ENAVAIL: ::c_int = 119; 430 pub const EISNAM: ::c_int = 120; 431 pub const EREMOTEIO: ::c_int = 121; 432 433 pub const SOCK_STREAM: ::c_int = 1; 434 pub const SOCK_DGRAM: ::c_int = 2; 435 pub const SOCK_SEQPACKET: ::c_int = 5; 436 pub const SOCK_DCCP: ::c_int = 6; 437 pub const SOCK_PACKET: ::c_int = 10; 438 439 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; 440 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; 441 pub const TCP_THIN_DUPACK: ::c_int = 17; 442 pub const TCP_USER_TIMEOUT: ::c_int = 18; 443 pub const TCP_REPAIR: ::c_int = 19; 444 pub const TCP_REPAIR_QUEUE: ::c_int = 20; 445 pub const TCP_QUEUE_SEQ: ::c_int = 21; 446 pub const TCP_REPAIR_OPTIONS: ::c_int = 22; 447 pub const TCP_FASTOPEN: ::c_int = 23; 448 pub const TCP_TIMESTAMP: ::c_int = 24; 449 450 /* DCCP socket options */ 451 pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; 452 pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; 453 pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; 454 pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; 455 pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; 456 pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; 457 pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; 458 pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; 459 pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; 460 pub const DCCP_SOCKOPT_CCID: ::c_int = 13; 461 pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; 462 pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; 463 pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; 464 pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; 465 pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; 466 pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; 467 468 /// maximum number of services provided on the same listening port 469 pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; 470 471 pub const SIGTTIN: ::c_int = 21; 472 pub const SIGTTOU: ::c_int = 22; 473 pub const SIGXCPU: ::c_int = 24; 474 pub const SIGXFSZ: ::c_int = 25; 475 pub const SIGVTALRM: ::c_int = 26; 476 pub const SIGPROF: ::c_int = 27; 477 pub const SIGWINCH: ::c_int = 28; 478 479 pub const SIGEV_THREAD_ID: ::c_int = 4; 480 481 pub const BUFSIZ: ::c_uint = 8192; 482 pub const TMP_MAX: ::c_uint = 238328; 483 pub const FOPEN_MAX: ::c_uint = 16; 484 pub const POSIX_FADV_DONTNEED: ::c_int = 4; 485 pub const POSIX_FADV_NOREUSE: ::c_int = 5; 486 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 487 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41; 488 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45; 489 pub const _SC_PII: ::c_int = 53; 490 pub const _SC_PII_XTI: ::c_int = 54; 491 pub const _SC_PII_SOCKET: ::c_int = 55; 492 pub const _SC_PII_INTERNET: ::c_int = 56; 493 pub const _SC_PII_OSI: ::c_int = 57; 494 pub const _SC_POLL: ::c_int = 58; 495 pub const _SC_SELECT: ::c_int = 59; 496 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61; 497 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62; 498 pub const _SC_PII_OSI_COTS: ::c_int = 63; 499 pub const _SC_PII_OSI_CLTS: ::c_int = 64; 500 pub const _SC_PII_OSI_M: ::c_int = 65; 501 pub const _SC_T_IOV_MAX: ::c_int = 66; 502 pub const _SC_2_C_VERSION: ::c_int = 96; 503 pub const _SC_CHAR_BIT: ::c_int = 101; 504 pub const _SC_CHAR_MAX: ::c_int = 102; 505 pub const _SC_CHAR_MIN: ::c_int = 103; 506 pub const _SC_INT_MAX: ::c_int = 104; 507 pub const _SC_INT_MIN: ::c_int = 105; 508 pub const _SC_LONG_BIT: ::c_int = 106; 509 pub const _SC_WORD_BIT: ::c_int = 107; 510 pub const _SC_MB_LEN_MAX: ::c_int = 108; 511 pub const _SC_SSIZE_MAX: ::c_int = 110; 512 pub const _SC_SCHAR_MAX: ::c_int = 111; 513 pub const _SC_SCHAR_MIN: ::c_int = 112; 514 pub const _SC_SHRT_MAX: ::c_int = 113; 515 pub const _SC_SHRT_MIN: ::c_int = 114; 516 pub const _SC_UCHAR_MAX: ::c_int = 115; 517 pub const _SC_UINT_MAX: ::c_int = 116; 518 pub const _SC_ULONG_MAX: ::c_int = 117; 519 pub const _SC_USHRT_MAX: ::c_int = 118; 520 pub const _SC_NL_ARGMAX: ::c_int = 119; 521 pub const _SC_NL_LANGMAX: ::c_int = 120; 522 pub const _SC_NL_MSGMAX: ::c_int = 121; 523 pub const _SC_NL_NMAX: ::c_int = 122; 524 pub const _SC_NL_SETMAX: ::c_int = 123; 525 pub const _SC_NL_TEXTMAX: ::c_int = 124; 526 pub const _SC_BASE: ::c_int = 134; 527 pub const _SC_C_LANG_SUPPORT: ::c_int = 135; 528 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136; 529 pub const _SC_DEVICE_IO: ::c_int = 140; 530 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141; 531 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142; 532 pub const _SC_FD_MGMT: ::c_int = 143; 533 pub const _SC_FIFO: ::c_int = 144; 534 pub const _SC_PIPE: ::c_int = 145; 535 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146; 536 pub const _SC_FILE_LOCKING: ::c_int = 147; 537 pub const _SC_FILE_SYSTEM: ::c_int = 148; 538 pub const _SC_MULTI_PROCESS: ::c_int = 150; 539 pub const _SC_SINGLE_PROCESS: ::c_int = 151; 540 pub const _SC_NETWORKING: ::c_int = 152; 541 pub const _SC_REGEX_VERSION: ::c_int = 156; 542 pub const _SC_SIGNALS: ::c_int = 158; 543 pub const _SC_SYSTEM_DATABASE: ::c_int = 162; 544 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163; 545 pub const _SC_USER_GROUPS: ::c_int = 166; 546 pub const _SC_USER_GROUPS_R: ::c_int = 167; 547 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185; 548 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186; 549 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187; 550 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188; 551 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189; 552 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190; 553 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191; 554 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192; 555 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193; 556 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194; 557 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195; 558 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196; 559 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197; 560 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198; 561 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199; 562 pub const O_ACCMODE: ::c_int = 3; 563 pub const ST_RELATIME: ::c_ulong = 4096; 564 pub const NI_MAXHOST: ::socklen_t = 1025; 565 566 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; 567 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; 568 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; 569 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; 570 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; 571 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; 572 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; 573 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; 574 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; 575 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; 576 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; 577 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; 578 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; 579 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; 580 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; 581 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; 582 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; 583 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; 584 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; 585 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; 586 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; 587 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; 588 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; 589 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; 590 pub const TMPFS_MAGIC: ::c_long = 0x01021994; 591 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; 592 593 pub const VEOF: usize = 4; 594 595 pub const CPU_SETSIZE: ::c_int = 0x400; 596 597 pub const PTRACE_TRACEME: ::c_uint = 0; 598 pub const PTRACE_PEEKTEXT: ::c_uint = 1; 599 pub const PTRACE_PEEKDATA: ::c_uint = 2; 600 pub const PTRACE_PEEKUSER: ::c_uint = 3; 601 pub const PTRACE_POKETEXT: ::c_uint = 4; 602 pub const PTRACE_POKEDATA: ::c_uint = 5; 603 pub const PTRACE_POKEUSER: ::c_uint = 6; 604 pub const PTRACE_CONT: ::c_uint = 7; 605 pub const PTRACE_KILL: ::c_uint = 8; 606 pub const PTRACE_SINGLESTEP: ::c_uint = 9; 607 pub const PTRACE_ATTACH: ::c_uint = 16; 608 pub const PTRACE_SYSCALL: ::c_uint = 24; 609 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; 610 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; 611 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; 612 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; 613 pub const PTRACE_GETREGSET: ::c_uint = 0x4204; 614 pub const PTRACE_SETREGSET: ::c_uint = 0x4205; 615 pub const PTRACE_SEIZE: ::c_uint = 0x4206; 616 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; 617 pub const PTRACE_LISTEN: ::c_uint = 0x4208; 618 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; 619 620 pub const EPOLLWAKEUP: ::c_int = 0x20000000; 621 622 pub const MAP_HUGETLB: ::c_int = 0x040000; 623 624 pub const SEEK_DATA: ::c_int = 3; 625 pub const SEEK_HOLE: ::c_int = 4; 626 627 pub const TCSANOW: ::c_int = 0; 628 pub const TCSADRAIN: ::c_int = 1; 629 pub const TCSAFLUSH: ::c_int = 2; 630 631 pub const TIOCLINUX: ::c_ulong = 0x541C; 632 pub const TIOCGSERIAL: ::c_ulong = 0x541E; 633 634 pub const RTLD_DEEPBIND: ::c_int = 0x8; 635 pub const RTLD_GLOBAL: ::c_int = 0x100; 636 pub const RTLD_NOLOAD: ::c_int = 0x4; 637 638 pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; 639 pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; 640 pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; 641 pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; 642 pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; 643 644 pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; 645 pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; 646 pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; 647 pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; 648 pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; 649 pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; 650 pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; 651 pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; 652 653 // linux/rtnetlink.h 654 pub const TCA_PAD: ::c_ushort = 9; 655 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10; 656 pub const TCA_CHAIN: ::c_ushort = 11; 657 pub const TCA_HW_OFFLOAD: ::c_ushort = 12; 658 659 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000; 660 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000; 661 662 pub const RTA_VIA: ::c_ushort = 18; 663 pub const RTA_NEWDST: ::c_ushort = 19; 664 pub const RTA_PREF: ::c_ushort = 20; 665 pub const RTA_ENCAP_TYPE: ::c_ushort = 21; 666 pub const RTA_ENCAP: ::c_ushort = 22; 667 pub const RTA_EXPIRES: ::c_ushort = 23; 668 pub const RTA_PAD: ::c_ushort = 24; 669 pub const RTA_UID: ::c_ushort = 25; 670 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26; 671 672 // linux/neighbor.h 673 pub const NTF_EXT_LEARNED: u8 = 0x10; 674 pub const NTF_OFFLOADED: u8 = 0x20; 675 676 pub const NDA_MASTER: ::c_ushort = 9; 677 pub const NDA_LINK_NETNSID: ::c_ushort = 10; 678 pub const NDA_SRC_VNI: ::c_ushort = 11; 679 680 // linux/if_addr.h 681 pub const IFA_FLAGS: ::c_ushort = 8; 682 683 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100; 684 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; 685 pub const IFA_F_MCAUTOJOIN: u32 = 0x400; 686 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; 687 688 pub const NETLINK_ROUTE: ::c_int = 0; 689 pub const NETLINK_UNUSED: ::c_int = 1; 690 pub const NETLINK_USERSOCK: ::c_int = 2; 691 pub const NETLINK_FIREWALL: ::c_int = 3; 692 pub const NETLINK_SOCK_DIAG: ::c_int = 4; 693 pub const NETLINK_NFLOG: ::c_int = 5; 694 pub const NETLINK_XFRM: ::c_int = 6; 695 pub const NETLINK_SELINUX: ::c_int = 7; 696 pub const NETLINK_ISCSI: ::c_int = 8; 697 pub const NETLINK_AUDIT: ::c_int = 9; 698 pub const NETLINK_FIB_LOOKUP: ::c_int = 10; 699 pub const NETLINK_CONNECTOR: ::c_int = 11; 700 pub const NETLINK_NETFILTER: ::c_int = 12; 701 pub const NETLINK_IP6_FW: ::c_int = 13; 702 pub const NETLINK_DNRTMSG: ::c_int = 14; 703 pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15; 704 pub const NETLINK_GENERIC: ::c_int = 16; 705 pub const NETLINK_SCSITRANSPORT: ::c_int = 18; 706 pub const NETLINK_ECRYPTFS: ::c_int = 19; 707 pub const NETLINK_RDMA: ::c_int = 20; 708 pub const NETLINK_CRYPTO: ::c_int = 21; 709 pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG; 710 711 pub const MAX_LINKS: ::c_int = 32; 712 713 pub const NLM_F_REQUEST: ::c_int = 1; 714 pub const NLM_F_MULTI: ::c_int = 2; 715 pub const NLM_F_ACK: ::c_int = 4; 716 pub const NLM_F_ECHO: ::c_int = 8; 717 pub const NLM_F_DUMP_INTR: ::c_int = 16; 718 pub const NLM_F_DUMP_FILTERED: ::c_int = 32; 719 720 pub const NLM_F_ROOT: ::c_int = 0x100; 721 pub const NLM_F_MATCH: ::c_int = 0x200; 722 pub const NLM_F_ATOMIC: ::c_int = 0x400; 723 pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH; 724 725 pub const NLM_F_REPLACE: ::c_int = 0x100; 726 pub const NLM_F_EXCL: ::c_int = 0x200; 727 pub const NLM_F_CREATE: ::c_int = 0x400; 728 pub const NLM_F_APPEND: ::c_int = 0x800; 729 730 pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1; 731 pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2; 732 pub const NETLINK_PKTINFO: ::c_int = 3; 733 pub const NETLINK_BROADCAST_ERROR: ::c_int = 4; 734 pub const NETLINK_NO_ENOBUFS: ::c_int = 5; 735 pub const NETLINK_RX_RING: ::c_int = 6; 736 pub const NETLINK_TX_RING: ::c_int = 7; 737 pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8; 738 pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9; 739 pub const NETLINK_CAP_ACK: ::c_int = 10; 740 741 pub const NLA_F_NESTED: ::c_int = 1 << 15; 742 pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14; 743 pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); 744 745 pub const NLA_ALIGNTO: ::c_int = 4; 746 747 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; 748 749 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; 750 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2; 751 752 pub const TIOCM_LE: ::c_int = 0x001; 753 pub const TIOCM_DTR: ::c_int = 0x002; 754 pub const TIOCM_RTS: ::c_int = 0x004; 755 pub const TIOCM_ST: ::c_int = 0x008; 756 pub const TIOCM_SR: ::c_int = 0x010; 757 pub const TIOCM_CTS: ::c_int = 0x020; 758 pub const TIOCM_CAR: ::c_int = 0x040; 759 pub const TIOCM_RNG: ::c_int = 0x080; 760 pub const TIOCM_DSR: ::c_int = 0x100; 761 pub const TIOCM_CD: ::c_int = TIOCM_CAR; 762 pub const TIOCM_RI: ::c_int = TIOCM_RNG; 763 764 pub const NF_NETDEV_INGRESS: ::c_int = 0; 765 pub const NF_NETDEV_NUMHOOKS: ::c_int = 1; 766 767 pub const NFPROTO_INET: ::c_int = 1; 768 pub const NFPROTO_NETDEV: ::c_int = 5; 769 770 // linux/netfilter/nf_tables.h 771 pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; 772 pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; 773 pub const NFT_SET_MAXNAMELEN: ::c_int = 256; 774 pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256; 775 pub const NFT_USERDATA_MAXLEN: ::c_int = 256; 776 777 pub const NFT_REG_VERDICT: ::c_int = 0; 778 pub const NFT_REG_1: ::c_int = 1; 779 pub const NFT_REG_2: ::c_int = 2; 780 pub const NFT_REG_3: ::c_int = 3; 781 pub const NFT_REG_4: ::c_int = 4; 782 pub const __NFT_REG_MAX: ::c_int = 5; 783 pub const NFT_REG32_00: ::c_int = 8; 784 pub const NFT_REG32_01: ::c_int = 9; 785 pub const NFT_REG32_02: ::c_int = 10; 786 pub const NFT_REG32_03: ::c_int = 11; 787 pub const NFT_REG32_04: ::c_int = 12; 788 pub const NFT_REG32_05: ::c_int = 13; 789 pub const NFT_REG32_06: ::c_int = 14; 790 pub const NFT_REG32_07: ::c_int = 15; 791 pub const NFT_REG32_08: ::c_int = 16; 792 pub const NFT_REG32_09: ::c_int = 17; 793 pub const NFT_REG32_10: ::c_int = 18; 794 pub const NFT_REG32_11: ::c_int = 19; 795 pub const NFT_REG32_12: ::c_int = 20; 796 pub const NFT_REG32_13: ::c_int = 21; 797 pub const NFT_REG32_14: ::c_int = 22; 798 pub const NFT_REG32_15: ::c_int = 23; 799 800 pub const NFT_REG_SIZE: ::c_int = 16; 801 pub const NFT_REG32_SIZE: ::c_int = 4; 802 803 pub const NFT_CONTINUE: ::c_int = -1; 804 pub const NFT_BREAK: ::c_int = -2; 805 pub const NFT_JUMP: ::c_int = -3; 806 pub const NFT_GOTO: ::c_int = -4; 807 pub const NFT_RETURN: ::c_int = -5; 808 809 pub const NFT_MSG_NEWTABLE: ::c_int = 0; 810 pub const NFT_MSG_GETTABLE: ::c_int = 1; 811 pub const NFT_MSG_DELTABLE: ::c_int = 2; 812 pub const NFT_MSG_NEWCHAIN: ::c_int = 3; 813 pub const NFT_MSG_GETCHAIN: ::c_int = 4; 814 pub const NFT_MSG_DELCHAIN: ::c_int = 5; 815 pub const NFT_MSG_NEWRULE: ::c_int = 6; 816 pub const NFT_MSG_GETRULE: ::c_int = 7; 817 pub const NFT_MSG_DELRULE: ::c_int = 8; 818 pub const NFT_MSG_NEWSET: ::c_int = 9; 819 pub const NFT_MSG_GETSET: ::c_int = 10; 820 pub const NFT_MSG_DELSET: ::c_int = 11; 821 pub const NFT_MSG_NEWSETELEM: ::c_int = 12; 822 pub const NFT_MSG_GETSETELEM: ::c_int = 13; 823 pub const NFT_MSG_DELSETELEM: ::c_int = 14; 824 pub const NFT_MSG_NEWGEN: ::c_int = 15; 825 pub const NFT_MSG_GETGEN: ::c_int = 16; 826 pub const NFT_MSG_TRACE: ::c_int = 17; 827 cfg_if! { 828 if #[cfg(not(target_arch = "sparc64"))] { 829 pub const NFT_MSG_NEWOBJ: ::c_int = 18; 830 pub const NFT_MSG_GETOBJ: ::c_int = 19; 831 pub const NFT_MSG_DELOBJ: ::c_int = 20; 832 pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21; 833 } 834 } 835 pub const NFT_MSG_MAX: ::c_int = 25; 836 837 pub const NFT_SET_ANONYMOUS: ::c_int = 0x1; 838 pub const NFT_SET_CONSTANT: ::c_int = 0x2; 839 pub const NFT_SET_INTERVAL: ::c_int = 0x4; 840 pub const NFT_SET_MAP: ::c_int = 0x8; 841 pub const NFT_SET_TIMEOUT: ::c_int = 0x10; 842 pub const NFT_SET_EVAL: ::c_int = 0x20; 843 844 pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0; 845 pub const NFT_SET_POL_MEMORY: ::c_int = 1; 846 847 pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1; 848 849 pub const NFT_DATA_VALUE: ::c_uint = 0; 850 pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00; 851 852 pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00; 853 854 pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64; 855 856 pub const NFT_BYTEORDER_NTOH: ::c_int = 0; 857 pub const NFT_BYTEORDER_HTON: ::c_int = 1; 858 859 pub const NFT_CMP_EQ: ::c_int = 0; 860 pub const NFT_CMP_NEQ: ::c_int = 1; 861 pub const NFT_CMP_LT: ::c_int = 2; 862 pub const NFT_CMP_LTE: ::c_int = 3; 863 pub const NFT_CMP_GT: ::c_int = 4; 864 pub const NFT_CMP_GTE: ::c_int = 5; 865 866 pub const NFT_RANGE_EQ: ::c_int = 0; 867 pub const NFT_RANGE_NEQ: ::c_int = 1; 868 869 pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0); 870 871 pub const NFT_DYNSET_OP_ADD: ::c_int = 0; 872 pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; 873 874 pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0); 875 876 pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; 877 pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; 878 pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2; 879 880 pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0; 881 pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1; 882 883 pub const NFT_META_LEN: ::c_int = 0; 884 pub const NFT_META_PROTOCOL: ::c_int = 1; 885 pub const NFT_META_PRIORITY: ::c_int = 2; 886 pub const NFT_META_MARK: ::c_int = 3; 887 pub const NFT_META_IIF: ::c_int = 4; 888 pub const NFT_META_OIF: ::c_int = 5; 889 pub const NFT_META_IIFNAME: ::c_int = 6; 890 pub const NFT_META_OIFNAME: ::c_int = 7; 891 pub const NFT_META_IIFTYPE: ::c_int = 8; 892 pub const NFT_META_OIFTYPE: ::c_int = 9; 893 pub const NFT_META_SKUID: ::c_int = 10; 894 pub const NFT_META_SKGID: ::c_int = 11; 895 pub const NFT_META_NFTRACE: ::c_int = 12; 896 pub const NFT_META_RTCLASSID: ::c_int = 13; 897 pub const NFT_META_SECMARK: ::c_int = 14; 898 pub const NFT_META_NFPROTO: ::c_int = 15; 899 pub const NFT_META_L4PROTO: ::c_int = 16; 900 pub const NFT_META_BRI_IIFNAME: ::c_int = 17; 901 pub const NFT_META_BRI_OIFNAME: ::c_int = 18; 902 pub const NFT_META_PKTTYPE: ::c_int = 19; 903 pub const NFT_META_CPU: ::c_int = 20; 904 pub const NFT_META_IIFGROUP: ::c_int = 21; 905 pub const NFT_META_OIFGROUP: ::c_int = 22; 906 pub const NFT_META_CGROUP: ::c_int = 23; 907 pub const NFT_META_PRANDOM: ::c_int = 24; 908 909 pub const NFT_CT_STATE: ::c_int = 0; 910 pub const NFT_CT_DIRECTION: ::c_int = 1; 911 pub const NFT_CT_STATUS: ::c_int = 2; 912 pub const NFT_CT_MARK: ::c_int = 3; 913 pub const NFT_CT_SECMARK: ::c_int = 4; 914 pub const NFT_CT_EXPIRATION: ::c_int = 5; 915 pub const NFT_CT_HELPER: ::c_int = 6; 916 pub const NFT_CT_L3PROTOCOL: ::c_int = 7; 917 pub const NFT_CT_SRC: ::c_int = 8; 918 pub const NFT_CT_DST: ::c_int = 9; 919 pub const NFT_CT_PROTOCOL: ::c_int = 10; 920 pub const NFT_CT_PROTO_SRC: ::c_int = 11; 921 pub const NFT_CT_PROTO_DST: ::c_int = 12; 922 pub const NFT_CT_LABELS: ::c_int = 13; 923 pub const NFT_CT_PKTS: ::c_int = 14; 924 pub const NFT_CT_BYTES: ::c_int = 15; 925 926 pub const NFT_LIMIT_PKTS: ::c_int = 0; 927 pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; 928 929 pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0); 930 931 pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; 932 pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; 933 pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; 934 935 pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0); 936 937 pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; 938 pub const NFT_REJECT_TCP_RST: ::c_int = 1; 939 pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2; 940 941 pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0; 942 pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1; 943 pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2; 944 pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3; 945 946 pub const NFT_NAT_SNAT: ::c_int = 0; 947 pub const NFT_NAT_DNAT: ::c_int = 1; 948 949 pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0; 950 pub const NFT_TRACETYPE_POLICY: ::c_int = 1; 951 pub const NFT_TRACETYPE_RETURN: ::c_int = 2; 952 pub const NFT_TRACETYPE_RULE: ::c_int = 3; 953 954 pub const NFT_NG_INCREMENTAL: ::c_int = 0; 955 pub const NFT_NG_RANDOM: ::c_int = 1; 956 957 pub const M_MXFAST: ::c_int = 1; 958 pub const M_NLBLKS: ::c_int = 2; 959 pub const M_GRAIN: ::c_int = 3; 960 pub const M_KEEP: ::c_int = 4; 961 pub const M_TRIM_THRESHOLD: ::c_int = -1; 962 pub const M_TOP_PAD: ::c_int = -2; 963 pub const M_MMAP_THRESHOLD: ::c_int = -3; 964 pub const M_MMAP_MAX: ::c_int = -4; 965 pub const M_CHECK_ACTION: ::c_int = -5; 966 pub const M_PERTURB: ::c_int = -6; 967 pub const M_ARENA_TEST: ::c_int = -7; 968 pub const M_ARENA_MAX: ::c_int = -8; 969 970 #[doc(hidden)] 971 #[deprecated( 972 since = "0.2.55", 973 note = "If you are using this report to: \ 974 https://github.com/rust-lang/libc/issues/665" 975 )] 976 pub const AF_MAX: ::c_int = 45; 977 #[doc(hidden)] 978 #[deprecated( 979 since = "0.2.55", 980 note = "If you are using this report to: \ 981 https://github.com/rust-lang/libc/issues/665" 982 )] 983 #[allow(deprecated)] 984 pub const PF_MAX: ::c_int = AF_MAX; 985 986 pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000; 987 pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000; 988 pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000; 989 pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000; 990 pub const STATX_TYPE: ::c_uint = 0x0001; 991 pub const STATX_MODE: ::c_uint = 0x0002; 992 pub const STATX_NLINK: ::c_uint = 0x0004; 993 pub const STATX_UID: ::c_uint = 0x0008; 994 pub const STATX_GID: ::c_uint = 0x0010; 995 pub const STATX_ATIME: ::c_uint = 0x0020; 996 pub const STATX_MTIME: ::c_uint = 0x0040; 997 pub const STATX_CTIME: ::c_uint = 0x0080; 998 pub const STATX_INO: ::c_uint = 0x0100; 999 pub const STATX_SIZE: ::c_uint = 0x0200; 1000 pub const STATX_BLOCKS: ::c_uint = 0x0400; 1001 pub const STATX_BASIC_STATS: ::c_uint = 0x07ff; 1002 pub const STATX_BTIME: ::c_uint = 0x0800; 1003 pub const STATX_ALL: ::c_uint = 0x0fff; 1004 pub const STATX__RESERVED: ::c_int = 0x80000000; 1005 pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004; 1006 pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010; 1007 pub const STATX_ATTR_APPEND: ::c_int = 0x0020; 1008 pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; 1009 pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; 1010 pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; 1011 1012 cfg_if! { 1013 if #[cfg(any(target_arch = "arm", target_arch = "x86", 1014 target_arch = "x86_64"))] { 1015 pub const PTHREAD_STACK_MIN: ::size_t = 16384; 1016 } else if #[cfg(target_arch = "sparc64")] { 1017 pub const PTHREAD_STACK_MIN: ::size_t = 0x6000; 1018 } else { 1019 pub const PTHREAD_STACK_MIN: ::size_t = 131072; 1020 } 1021 } 1022 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; 1023 1024 f! { 1025 pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { 1026 return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) 1027 } 1028 } 1029 1030 extern { sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int) -> ::c_int1031 pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, 1032 flags: ::c_int) -> ::c_int; recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, flags: ::c_int, timeout: *mut ::timespec) -> ::c_int1033 pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint, 1034 flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; 1035 getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int1036 pub fn getrlimit64(resource: ::__rlimit_resource_t, 1037 rlim: *mut ::rlimit64) -> ::c_int; setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int1038 pub fn setrlimit64(resource: ::__rlimit_resource_t, 1039 rlim: *const ::rlimit64) -> ::c_int; getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int1040 pub fn getrlimit(resource: ::__rlimit_resource_t, 1041 rlim: *mut ::rlimit) -> ::c_int; setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int1042 pub fn setrlimit(resource: ::__rlimit_resource_t, 1043 rlim: *const ::rlimit) -> ::c_int; prlimit(pid: ::pid_t, resource: ::__rlimit_resource_t, new_limit: *const ::rlimit, old_limit: *mut ::rlimit) -> ::c_int1044 pub fn prlimit(pid: ::pid_t, 1045 resource: ::__rlimit_resource_t, new_limit: *const ::rlimit, 1046 old_limit: *mut ::rlimit) -> ::c_int; prlimit64(pid: ::pid_t, resource: ::__rlimit_resource_t, new_limit: *const ::rlimit64, old_limit: *mut ::rlimit64) -> ::c_int1047 pub fn prlimit64(pid: ::pid_t, 1048 resource: ::__rlimit_resource_t, 1049 new_limit: *const ::rlimit64, 1050 old_limit: *mut ::rlimit64) -> ::c_int; utmpxname(file: *const ::c_char) -> ::c_int1051 pub fn utmpxname(file: *const ::c_char) -> ::c_int; getutxent() -> *mut utmpx1052 pub fn getutxent() -> *mut utmpx; getutxid(ut: *const utmpx) -> *mut utmpx1053 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; getutxline(ut: *const utmpx) -> *mut utmpx1054 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; pututxline(ut: *const utmpx) -> *mut utmpx1055 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; setutxent()1056 pub fn setutxent(); endutxent()1057 pub fn endutxent(); getpt() -> ::c_int1058 pub fn getpt() -> ::c_int; mallopt(param: ::c_int, value: ::c_int) -> ::c_int1059 pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int1060 pub fn gettimeofday(tp: *mut ::timeval, 1061 tz: *mut ::timezone) -> ::c_int; statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int, mask: ::c_uint, statxbuf: *mut statx) -> ::c_int1062 pub fn statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int, 1063 mask: ::c_uint, statxbuf: *mut statx) -> ::c_int; 1064 } 1065 1066 #[link(name = "util")] 1067 extern { ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int1068 pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int1069 pub fn backtrace(buf: *mut *mut ::c_void, 1070 sz: ::c_int) -> ::c_int; glob64(pattern: *const ::c_char, flags: ::c_int, errfunc: ::Option<extern fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>, pglob: *mut glob64_t) -> ::c_int1071 pub fn glob64(pattern: *const ::c_char, 1072 flags: ::c_int, 1073 errfunc: ::Option<extern fn(epath: *const ::c_char, 1074 errno: ::c_int) 1075 -> ::c_int>, 1076 pglob: *mut glob64_t) -> ::c_int; globfree64(pglob: *mut glob64_t)1077 pub fn globfree64(pglob: *mut glob64_t); ptrace(request: ::c_uint, ...) -> ::c_long1078 pub fn ptrace(request: ::c_uint, ...) -> ::c_long; pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t, cpusetsize: ::size_t, cpuset: *mut ::cpu_set_t) -> ::c_int1079 pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t, 1080 cpusetsize: ::size_t, 1081 cpuset: *mut ::cpu_set_t) -> ::c_int; pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, cpusetsize: ::size_t, cpuset: *const ::cpu_set_t) -> ::c_int1082 pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, 1083 cpusetsize: ::size_t, 1084 cpuset: *const ::cpu_set_t) -> ::c_int; getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int1085 pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int1086 pub fn setpriority(which: ::__priority_which_t, who: ::id_t, 1087 prio: ::c_int) -> ::c_int; pthread_getaffinity_np(thread: ::pthread_t, cpusetsize: ::size_t, cpuset: *mut ::cpu_set_t) -> ::c_int1088 pub fn pthread_getaffinity_np(thread: ::pthread_t, 1089 cpusetsize: ::size_t, 1090 cpuset: *mut ::cpu_set_t) -> ::c_int; pthread_setaffinity_np(thread: ::pthread_t, cpusetsize: ::size_t, cpuset: *const ::cpu_set_t) -> ::c_int1091 pub fn pthread_setaffinity_np(thread: ::pthread_t, 1092 cpusetsize: ::size_t, 1093 cpuset: *const ::cpu_set_t) -> ::c_int; pthread_rwlockattr_getkind_np(attr: *const ::pthread_rwlockattr_t, val: *mut ::c_int) -> ::c_int1094 pub fn pthread_rwlockattr_getkind_np(attr: *const ::pthread_rwlockattr_t, 1095 val: *mut ::c_int) -> ::c_int; pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t, val: ::c_int) -> ::c_int1096 pub fn pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t, 1097 val: ::c_int) -> ::c_int; sched_getcpu() -> ::c_int1098 pub fn sched_getcpu() -> ::c_int; mallinfo() -> ::mallinfo1099 pub fn mallinfo() -> ::mallinfo; malloc_usable_size(ptr: *mut ::c_void) -> ::size_t1100 pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; getauxval(type_: ::c_ulong) -> ::c_ulong1101 pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; 1102 #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] 1103 #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")] getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::unix::notbsd ::linux::passwd) -> ::c_int1104 pub fn getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd, 1105 buf: *mut ::c_char, 1106 buflen: ::size_t, 1107 result: *mut *mut ::unix::notbsd 1108 ::linux::passwd) -> ::c_int; 1109 #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")] 1110 #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")] getgrent_r(grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group) -> ::c_int1111 pub fn getgrent_r(grp: *mut ::group, 1112 buf: *mut ::c_char, 1113 buflen: ::size_t, 1114 result: *mut *mut ::group) -> ::c_int; 1115 } 1116 1117 cfg_if! { 1118 if #[cfg(any(target_arch = "x86", 1119 target_arch = "arm", 1120 target_arch = "powerpc"))] { 1121 mod b32; 1122 pub use self::b32::*; 1123 } else if #[cfg(any(target_arch = "x86_64", 1124 target_arch = "aarch64", 1125 target_arch = "powerpc64", 1126 target_arch = "sparc64"))] { 1127 mod b64; 1128 pub use self::b64::*; 1129 } else { 1130 // Unknown target_arch 1131 } 1132 } 1133 1134 cfg_if! { 1135 if #[cfg(libc_align)] { 1136 mod align; 1137 pub use self::align::*; 1138 } else { 1139 mod no_align; 1140 pub use self::no_align::*; 1141 } 1142 } 1143