aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-01-15 09:30:24 -0800
committerDaniel Mueller <deso@posteo.net>2018-01-15 09:30:24 -0800
commitd8a58488bd56ef9c09e167173124c3519bc7405d (patch)
treef52c843b4862a8ce80b3912805638be5846166fc /libc/src/unix
parent7e6a449f276cd85ebd9201ef1a62aff3bc4d1595 (diff)
downloadnitrocli-d8a58488bd56ef9c09e167173124c3519bc7405d.tar.gz
nitrocli-d8a58488bd56ef9c09e167173124c3519bc7405d.tar.bz2
Update libc crate to 0.2.36
Import subrepo libc/:libc at 16a0f4a3d6c836f88f50c58f5d0a74a32cbf0193
Diffstat (limited to 'libc/src/unix')
-rw-r--r--libc/src/unix/bsd/apple/b32.rs7
-rw-r--r--libc/src/unix/bsd/apple/b64.rs7
-rw-r--r--libc/src/unix/bsd/apple/mod.rs579
-rw-r--r--libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs275
-rw-r--r--libc/src/unix/bsd/freebsdlike/freebsd/mod.rs314
-rw-r--r--libc/src/unix/bsd/freebsdlike/mod.rs57
-rw-r--r--libc/src/unix/bsd/mod.rs15
-rw-r--r--libc/src/unix/bsd/netbsdlike/mod.rs4
-rw-r--r--libc/src/unix/bsd/netbsdlike/netbsd/mod.rs280
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs (renamed from libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs)14
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs (renamed from libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs)0
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs (renamed from libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs)0
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs116
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs3
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs (renamed from libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs)15
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs3
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs3
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs11
-rw-r--r--libc/src/unix/haiku/b32.rs1
-rw-r--r--libc/src/unix/haiku/b64.rs1
-rw-r--r--libc/src/unix/haiku/mod.rs490
-rw-r--r--libc/src/unix/mod.rs73
-rw-r--r--libc/src/unix/newlib/aarch64/mod.rs5
-rw-r--r--libc/src/unix/newlib/mod.rs32
-rw-r--r--libc/src/unix/notbsd/android/b32/arm.rs345
-rw-r--r--libc/src/unix/notbsd/android/b64/aarch64.rs268
-rw-r--r--libc/src/unix/notbsd/android/mod.rs75
-rw-r--r--libc/src/unix/notbsd/linux/mips/mips32.rs371
-rw-r--r--libc/src/unix/notbsd/linux/mips/mips64.rs330
-rw-r--r--libc/src/unix/notbsd/linux/mips/mod.rs44
-rw-r--r--libc/src/unix/notbsd/linux/mod.rs390
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/arm.rs379
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/mips.rs381
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/mod.rs16
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/x86.rs16
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/aarch64.rs334
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/mod.rs60
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs76
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/x86_64.rs71
-rw-r--r--libc/src/unix/notbsd/linux/musl/mod.rs28
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/arm.rs371
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/mod.rs18
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/powerpc.rs376
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/x86.rs12
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/aarch64.rs306
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/mod.rs51
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/not_x32.rs351
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/powerpc64.rs383
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/sparc64.rs400
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x32.rs331
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x86_64.rs380
-rw-r--r--libc/src/unix/notbsd/linux/other/mod.rs63
-rw-r--r--libc/src/unix/notbsd/linux/s390x.rs358
-rw-r--r--libc/src/unix/notbsd/mod.rs24
-rw-r--r--libc/src/unix/solaris/mod.rs101
-rw-r--r--libc/src/unix/uclibc/mips/mips32.rs2
-rw-r--r--libc/src/unix/uclibc/mod.rs108
-rw-r--r--libc/src/unix/uclibc/x86_64/mod.rs8
58 files changed, 8386 insertions, 746 deletions
diff --git a/libc/src/unix/bsd/apple/b32.rs b/libc/src/unix/bsd/apple/b32.rs
index 53fc0ae..5dea472 100644
--- a/libc/src/unix/bsd/apple/b32.rs
+++ b/libc/src/unix/bsd/apple/b32.rs
@@ -41,6 +41,13 @@ s! {
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
+
+ pub struct bpf_hdr {
+ pub bh_tstamp: ::timeval,
+ pub bh_caplen: ::uint32_t,
+ pub bh_datalen: ::uint32_t,
+ pub bh_hdrlen: ::c_ushort,
+ }
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
diff --git a/libc/src/unix/bsd/apple/b64.rs b/libc/src/unix/bsd/apple/b64.rs
index e4a3981..2b34f85 100644
--- a/libc/src/unix/bsd/apple/b64.rs
+++ b/libc/src/unix/bsd/apple/b64.rs
@@ -46,6 +46,13 @@ s! {
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
+
+ pub struct bpf_hdr {
+ pub bh_tstamp: ::timeval32,
+ pub bh_caplen: ::uint32_t,
+ pub bh_datalen: ::uint32_t,
+ pub bh_hdrlen: ::c_ushort,
+ }
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
diff --git a/libc/src/unix/bsd/apple/mod.rs b/libc/src/unix/bsd/apple/mod.rs
index 2f57592..7281f91 100644
--- a/libc/src/unix/bsd/apple/mod.rs
+++ b/libc/src/unix/bsd/apple/mod.rs
@@ -2,6 +2,7 @@
//!
//! This covers *-apple-* triples currently
+pub type c_char = i8;
pub type clock_t = c_ulong;
pub type time_t = c_long;
pub type suseconds_t = i32;
@@ -14,6 +15,7 @@ pub type rlim_t = u64;
pub type mach_timebase_info_data_t = mach_timebase_info;
pub type pthread_key_t = c_ulong;
pub type sigset_t = u32;
+pub type clockid_t = ::c_uint;
pub type fsblkcnt_t = ::c_uint;
pub type fsfilcnt_t = ::c_uint;
pub type speed_t = ::c_ulong;
@@ -22,6 +24,10 @@ pub type nl_item = ::c_int;
pub type id_t = ::c_uint;
pub type sem_t = ::c_int;
pub type idtype_t = ::c_uint;
+pub type integer_t = ::c_int;
+pub type cpu_type_t = integer_t;
+pub type cpu_subtype_t = integer_t;
+pub type vm_prot_t = ::c_int;
pub enum timezone {}
@@ -410,6 +416,88 @@ s! {
pub xsu_pagesize: u32,
pub xsu_encrypted: ::boolean_t,
}
+
+ pub struct xucred {
+ pub cr_version: ::c_uint,
+ pub cr_uid: ::uid_t,
+ pub cr_ngroups: ::c_short,
+ pub cr_groups: [::gid_t;16]
+ }
+
+ pub struct mach_header {
+ pub magic: u32,
+ pub cputype: cpu_type_t,
+ pub cpusubtype: cpu_subtype_t,
+ pub filetype: u32,
+ pub ncmds: u32,
+ pub sizeofcmds: u32,
+ pub flags: u32,
+ }
+
+ pub struct mach_header_64 {
+ pub magic: u32,
+ pub cputype: cpu_type_t,
+ pub cpusubtype: cpu_subtype_t,
+ pub filetype: u32,
+ pub ncmds: u32,
+ pub sizeofcmds: u32,
+ pub flags: u32,
+ pub reserved: u32,
+ }
+
+ pub struct segment_command {
+ pub cmd: u32,
+ pub cmdsize: u32,
+ pub segname: [::c_char; 16],
+ pub vmaddr: u32,
+ pub vmsize: u32,
+ pub fileoff: u32,
+ pub filesize: u32,
+ pub maxprot: vm_prot_t,
+ pub initprot: vm_prot_t,
+ pub nsects: u32,
+ pub flags: u32,
+ }
+
+ pub struct segment_command_64 {
+ pub cmd: u32,
+ pub cmdsize: u32,
+ pub segname: [::c_char; 16],
+ pub vmaddr: u64,
+ pub vmsize: u64,
+ pub fileoff: u64,
+ pub filesize: u64,
+ pub maxprot: vm_prot_t,
+ pub initprot: vm_prot_t,
+ pub nsects: u32,
+ pub flags: u32,
+ }
+
+ pub struct load_command {
+ pub cmd: u32,
+ pub cmdsize: u32,
+ }
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::c_uchar,
+ pub sdl_index: ::c_ushort,
+ pub sdl_type: ::c_uchar,
+ pub sdl_nlen: ::c_uchar,
+ pub sdl_alen: ::c_uchar,
+ pub sdl_slen: ::c_uchar,
+ pub sdl_data: [::c_char; 12],
+ }
+
+ pub struct sockaddr_inarp {
+ pub sin_len: ::c_uchar,
+ pub sin_family: ::c_uchar,
+ pub sin_port: ::c_ushort,
+ pub sin_addr: ::in_addr,
+ pub sin_srcaddr: ::in_addr,
+ pub sin_tos: ::c_ushort,
+ pub sin_other: ::c_ushort,
+ }
}
pub const _UTX_USERSIZE: usize = 256;
@@ -493,6 +581,11 @@ pub const ABMON_10: ::nl_item = 42;
pub const ABMON_11: ::nl_item = 43;
pub const ABMON_12: ::nl_item = 44;
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 6;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
+
pub const ERA: ::nl_item = 45;
pub const ERA_D_FMT: ::nl_item = 46;
pub const ERA_D_T_FMT: ::nl_item = 47;
@@ -601,6 +694,112 @@ pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
+pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
+pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
+pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
+pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
+pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
+pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
+pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
+pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
+pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
+pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
+pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
+pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
+pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
+ VM_FLAGS_PURGABLE |
+ VM_FLAGS_RANDOM_ADDR |
+ VM_FLAGS_NO_CACHE |
+ VM_FLAGS_OVERWRITE |
+ VM_FLAGS_SUPERPAGE_MASK |
+ VM_FLAGS_ALIAS_MASK;
+pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE |
+ VM_FLAGS_RETURN_4K_DATA_ADDR |
+ VM_FLAGS_RETURN_DATA_ADDR;
+pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
+ VM_FLAGS_RANDOM_ADDR |
+ VM_FLAGS_OVERWRITE |
+ VM_FLAGS_RETURN_DATA_ADDR |
+ VM_FLAGS_RESILIENT_CODESIGN;
+
+pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
+pub const SUPERPAGE_NONE: ::c_int = 0;
+pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
+pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
+ VM_FLAGS_SUPERPAGE_SHIFT;
+pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
+ VM_FLAGS_SUPERPAGE_SHIFT;
+pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
+pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
+ VM_FLAGS_SUPERPAGE_SHIFT;
+
+pub const VM_MEMORY_MALLOC: ::c_int = 1;
+pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
+pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
+pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
+pub const VM_MEMORY_SBRK: ::c_int = 5;
+pub const VM_MEMORY_REALLOC: ::c_int = 6;
+pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
+pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
+pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
+pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
+pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
+pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
+pub const VM_MEMORY_IOKIT: ::c_int = 21;
+pub const VM_MEMORY_STACK: ::c_int = 30;
+pub const VM_MEMORY_GUARD: ::c_int = 31;
+pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
+pub const VM_MEMORY_DYLIB: ::c_int = 33;
+pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
+pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
+pub const VM_MEMORY_APPKIT: ::c_int = 40;
+pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
+pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
+pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
+pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
+pub const VM_MEMORY_JAVA: ::c_int = 44;
+pub const VM_MEMORY_COREDATA: ::c_int = 45;
+pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
+pub const VM_MEMORY_ATS: ::c_int = 50;
+pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
+pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
+pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
+pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
+pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
+pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
+pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
+pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
+pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
+pub const VM_MEMORY_DYLD: ::c_int = 60;
+pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
+pub const VM_MEMORY_SQLITE: ::c_int = 62;
+pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
+pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
+pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
+pub const VM_MEMORY_GLSL: ::c_int = 66;
+pub const VM_MEMORY_OPENCL: ::c_int = 67;
+pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
+pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
+pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
+pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
+pub const VM_MEMORY_ASSETSD: ::c_int = 72;
+pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
+pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
+pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
+pub const VM_MEMORY_COREUI: ::c_int = 76;
+pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
+pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
+pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
+pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
+pub const VM_MEMORY_ASL: ::c_int = 81;
+pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
+pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
+pub const VM_MEMORY_DHMM: ::c_int = 84;
+pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
+pub const VM_MEMORY_SKYWALK: ::c_int = 87;
+pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
+pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
+
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MCL_CURRENT: ::c_int = 0x0001;
@@ -722,7 +921,17 @@ pub const EOWNERDEAD: ::c_int = 105;
pub const EQFULL: ::c_int = 106;
pub const ELAST: ::c_int = 106;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
pub const F_DUPFD: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 67;
@@ -933,6 +1142,223 @@ pub const MINCORE_MODIFIED: ::c_int = 0x4;
pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
+//
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway<sup>2</sup> (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+/// Sequential Exchange
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/* 55-57: Unassigned */
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion */
+/// divert pseudo-protocol
+pub const IPPROTO_DIVERT: ::c_int = 254;
+/// raw IP packet
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
@@ -1042,6 +1468,15 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const TCP_NODELAY: ::c_int = 0x01;
pub const TCP_KEEPALIVE: ::c_int = 0x10;
+
+pub const SOL_LOCAL: ::c_int = 0;
+
+pub const LOCAL_PEERCRED: ::c_int = 0x001;
+pub const LOCAL_PEERPID: ::c_int = 0x002;
+pub const LOCAL_PEEREPID: ::c_int = 0x003;
+pub const LOCAL_PEERUUID: ::c_int = 0x004;
+pub const LOCAL_PEEREUUID: ::c_int = 0x005;
+
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
@@ -1098,7 +1533,24 @@ pub const MSG_RCVMORE: ::c_int = 0x4000;
pub const SCM_TIMESTAMP: ::c_int = 0x02;
pub const SCM_CREDS: ::c_int = 0x03;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
+// https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100;// receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200;// receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400;// transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800;// can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000;// per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000;// per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000;// per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;// use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000;// supports multicast
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -1117,8 +1569,6 @@ pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
pub const MAP_NOCACHE: ::c_int = 0x0400;
pub const MAP_JIT: ::c_int = 0x0800;
-pub const IPPROTO_RAW: ::c_int = 255;
-
pub const _SC_ARG_MAX: ::c_int = 1;
pub const _SC_CHILD_MAX: ::c_int = 2;
pub const _SC_CLK_TCK: ::c_int = 3;
@@ -1612,7 +2062,90 @@ pub const XATTR_NODEFAULT: ::c_int = 0x0010;
pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
pub const NET_RT_IFLIST2: ::c_int = 0x0006;
-pub const RTM_IFINFO2: ::c_int = 0x0012;
+
+// net/route.h
+pub const RTF_UP: ::c_int = 0x1;
+pub const RTF_GATEWAY: ::c_int = 0x2;
+pub const RTF_HOST: ::c_int = 0x4;
+pub const RTF_REJECT: ::c_int = 0x8;
+pub const RTF_DYNAMIC: ::c_int = 0x10;
+pub const RTF_MODIFIED: ::c_int = 0x20;
+pub const RTF_DONE: ::c_int = 0x40;
+pub const RTF_DELCLONE: ::c_int = 0x80;
+pub const RTF_CLONING: ::c_int = 0x100;
+pub const RTF_XRESOLVE: ::c_int = 0x200;
+pub const RTF_LLINFO: ::c_int = 0x400;
+pub const RTF_STATIC: ::c_int = 0x800;
+pub const RTF_BLACKHOLE: ::c_int = 0x1000;
+pub const RTF_NOIFREF: ::c_int = 0x2000;
+pub const RTF_PROTO2: ::c_int = 0x4000;
+pub const RTF_PROTO1: ::c_int = 0x8000;
+pub const RTF_PRCLONING: ::c_int = 0x10000;
+pub const RTF_WASCLONED: ::c_int = 0x20000;
+pub const RTF_PROTO3: ::c_int = 0x40000;
+pub const RTF_PINNED: ::c_int = 0x100000;
+pub const RTF_LOCAL: ::c_int = 0x200000;
+pub const RTF_BROADCAST: ::c_int = 0x400000;
+pub const RTF_MULTICAST: ::c_int = 0x800000;
+pub const RTF_IFSCOPE: ::c_int = 0x1000000;
+pub const RTF_CONDEMNED: ::c_int = 0x2000000;
+pub const RTF_IFREF: ::c_int = 0x4000000;
+pub const RTF_PROXY: ::c_int = 0x8000000;
+pub const RTF_ROUTER: ::c_int = 0x10000000;
+
+pub const RTM_VERSION: ::c_int = 5;
+
+// Message types
+pub const RTM_ADD: ::c_int = 0x1;
+pub const RTM_DELETE: ::c_int = 0x2;
+pub const RTM_CHANGE: ::c_int = 0x3;
+pub const RTM_GET: ::c_int = 0x4;
+pub const RTM_LOSING: ::c_int = 0x5;
+pub const RTM_REDIRECT: ::c_int = 0x6;
+pub const RTM_MISS: ::c_int = 0x7;
+pub const RTM_LOCK: ::c_int = 0x8;
+pub const RTM_OLDADD: ::c_int = 0x9;
+pub const RTM_OLDDEL: ::c_int = 0xa;
+pub const RTM_RESOLVE: ::c_int = 0xb;
+pub const RTM_NEWADDR: ::c_int = 0xc;
+pub const RTM_DELADDR: ::c_int = 0xd;
+pub const RTM_IFINFO: ::c_int = 0xe;
+pub const RTM_NEWMADDR: ::c_int = 0xf;
+pub const RTM_DELMADDR: ::c_int = 0x10;
+pub const RTM_IFINFO2: ::c_int = 0x12;
+pub const RTM_NEWMADDR2: ::c_int = 0x13;
+pub const RTM_GET2: ::c_int = 0x14;
+
+// Bitmask values for rtm_inits and rmx_locks.
+pub const RTV_MTU: ::c_int = 0x1;
+pub const RTV_HOPCOUNT: ::c_int = 0x2;
+pub const RTV_EXPIRE: ::c_int = 0x4;
+pub const RTV_RPIPE: ::c_int = 0x8;
+pub const RTV_SPIPE: ::c_int = 0x10;
+pub const RTV_SSTHRESH: ::c_int = 0x20;
+pub const RTV_RTT: ::c_int = 0x40;
+pub const RTV_RTTVAR: ::c_int = 0x80;
+
+// Bitmask values for rtm_addrs.
+pub const RTA_DST: ::c_int = 0x1;
+pub const RTA_GATEWAY: ::c_int = 0x2;
+pub const RTA_NETMASK: ::c_int = 0x4;
+pub const RTA_GENMASK: ::c_int = 0x8;
+pub const RTA_IFP: ::c_int = 0x10;
+pub const RTA_IFA: ::c_int = 0x20;
+pub const RTA_AUTHOR: ::c_int = 0x40;
+pub const RTA_BRD: ::c_int = 0x80;
+
+// Index offsets for sockaddr array for alternate internal encoding.
+pub const RTAX_DST: ::c_int = 0;
+pub const RTAX_GATEWAY: ::c_int = 1;
+pub const RTAX_NETMASK: ::c_int = 2;
+pub const RTAX_GENMASK: ::c_int = 3;
+pub const RTAX_IFP: ::c_int = 4;
+pub const RTAX_IFA: ::c_int = 5;
+pub const RTAX_AUTHOR: ::c_int = 6;
+pub const RTAX_BRD: ::c_int = 7;
+pub const RTAX_MAX: ::c_int = 8;
pub const KERN_PROCARGS2: ::c_int = 49;
@@ -1622,6 +2155,38 @@ pub const PROC_PIDTHREADINFO: ::c_int = 5;
pub const MAXCOMLEN: usize = 16;
pub const MAXTHREADNAMESIZE: usize = 64;
+pub const XUCRED_VERSION: ::c_uint = 0;
+
+pub const LC_SEGMENT: u32 = 0x1;
+pub const LC_SEGMENT_64: u32 = 0x19;
+
+pub const MH_MAGIC: u32 = 0xfeedface;
+pub const MH_MAGIC_64: u32 = 0xfeedfacf;
+
+// net/if_utun.h
+pub const UTUN_OPT_FLAGS: ::c_int = 1;
+pub const UTUN_OPT_IFNAME: ::c_int = 2;
+
+// net/bpf.h
+pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation
+pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb)
+pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb)
+pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25
+pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring
+pub const DLT_CHAOS: ::c_uint = 5; // Chaos
+pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks
+pub const DLT_ARCNET: ::c_uint = 7; // ARCNET
+pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP
+pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol
+pub const DLT_FDDI: ::c_uint = 10; // FDDI
+pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm
+pub const DLT_RAW: ::c_uint = 12; // raw IP
+pub const DLT_LOOP: ::c_uint = 108;
+
+// https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100
+// sizeof(int32_t)
+pub const BPF_ALIGNMENT: ::c_int = 4;
+
f! {
pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
status >> 8
@@ -1655,6 +2220,8 @@ extern {
pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
timeout: *const ::timespec) -> ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+ pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
@@ -1811,6 +2378,10 @@ extern {
pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+ pub fn _dyld_image_count() -> u32;
+ pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
+ pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
+ pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
}
cfg_if! {
diff --git a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 038a886..620fad4 100644
--- a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -72,6 +72,13 @@ s! {
pub node: [u8; 6],
}
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ }
+
pub struct sigevent {
pub sigev_notify: ::c_int,
// The union is 8-byte in size, so it is aligned at a 8-byte offset.
@@ -168,12 +175,26 @@ s! {
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::c_uchar,
+ pub sdl_index: ::c_ushort,
+ pub sdl_type: ::c_uchar,
+ pub sdl_nlen: ::c_uchar,
+ pub sdl_alen: ::c_uchar,
+ pub sdl_slen: ::c_uchar,
+ pub sdl_data: [::c_char; 12],
+ pub sdl_rcf: ::c_ushort,
+ pub sdl_route: [::c_ushort; 16],
+ }
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
pub const SIGSTKSZ: ::size_t = 40960;
pub const MADV_INVAL: ::c_int = 10;
+pub const MADV_SETMAP: ::c_int = 11;
pub const O_CLOEXEC: ::c_int = 0x00020000;
pub const O_DIRECTORY: ::c_int = 0x08000000;
pub const F_GETLK: ::c_int = 7;
@@ -386,6 +407,257 @@ pub const NOTE_CHILD: ::uint32_t = 0x00000004;
pub const SO_SNDSPACE: ::c_int = 0x100a;
pub const SO_CPUHINT: ::c_int = 0x1030;
+// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+// was interface is in polling mode
+pub const IFF_POLLING_COMPAT: ::c_int = 0x10000;
+pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode
+pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode
+pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP
+pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode
+pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input
+
+//
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+/// Sequential Exchange
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/// IP Mobility
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// Transport Layer Security
+pub const IPPROTO_TLSP: ::c_int = 56;
+/// SKIP
+pub const IPPROTO_SKIP: ::c_int = 57;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion, no longer used */
+/// divert pseudo-protocol
+pub const IPPROTO_DIVERT: ::c_int = 254;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/// Used by RSS: the layer3 protocol is unknown
+pub const IPPROTO_UNKNOWN: ::c_int = 258;
+
pub const AF_BLUETOOTH: ::c_int = 33;
pub const AF_MPLS: ::c_int = 34;
pub const AF_IEEE80211: ::c_int = 35;
@@ -462,6 +734,9 @@ pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
+pub const WCONTINUED: ::c_int = 4;
+pub const WSTOPPED: ::c_int = 0o177;
+
extern {
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
diff --git a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
index dbf7fd3..74f2cf8 100644
--- a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -62,6 +62,14 @@ s! {
pub ip6: *mut ::in6_addr,
}
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ __reserved: [::c_long; 4]
+ }
+
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
@@ -127,6 +135,25 @@ s! {
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
+
+ pub struct xucred {
+ pub cr_version: ::c_uint,
+ pub cr_uid: ::uid_t,
+ pub cr_ngroups: ::c_short,
+ pub cr_groups: [::gid_t;16],
+ __cr_unused1: *mut ::c_void,
+ }
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::c_uchar,
+ pub sdl_index: ::c_ushort,
+ pub sdl_type: ::c_uchar,
+ pub sdl_nlen: ::c_uchar,
+ pub sdl_alen: ::c_uchar,
+ pub sdl_slen: ::c_uchar,
+ pub sdl_data: [::c_char; 46],
+ }
}
pub const SIGEV_THREAD_ID: ::c_int = 4;
@@ -145,6 +172,10 @@ pub const O_TTY_INIT: ::c_int = 0x00080000;
pub const F_GETLK: ::c_int = 11;
pub const F_SETLK: ::c_int = 12;
pub const F_SETLKW: ::c_int = 13;
+pub const ENOTCAPABLE: ::c_int = 93;
+pub const ECAPMODE: ::c_int = 94;
+pub const ENOTRECOVERABLE: ::c_int = 95;
+pub const EOWNERDEAD: ::c_int = 96;
pub const ELAST: ::c_int = 96;
pub const RLIMIT_NPTS: ::c_int = 11;
pub const RLIMIT_SWAP: ::c_int = 12;
@@ -402,6 +433,11 @@ pub const SO_PROTOCOL: ::c_int = 0x1016;
pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
pub const SO_VENDOR: ::c_int = 0x80000000;
+pub const LOCAL_PEERCRED: ::c_int = 1;
+pub const LOCAL_CREDS: ::c_int = 2;
+pub const LOCAL_CONNWAIT: ::c_int = 4;
+pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
+
pub const AF_SLOW: ::c_int = 33;
pub const AF_SCLUSTER: ::c_int = 34;
pub const AF_ARP: ::c_int = 35;
@@ -412,7 +448,278 @@ pub const AF_INET6_SDP: ::c_int = 42;
#[doc(hidden)]
pub const AF_MAX: ::c_int = 42;
+// https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
+pub const IFF_UP: ::c_int = 0x1; // (n) interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
+// 0x20 was IFF_SMART
+pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
+#[doc(hidden)]
+// IFF_DRV_RUNNING is deprecated. Use the portable `IFF_RUNNING` instead
+pub const IFF_DRV_RUNNING: ::c_int = 0x40;
+pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
+#[doc(hidden)]
+// IFF_DRV_OACTIVE is deprecated. Use the portable `IFF_OACTIVE` instead
+pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
+pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast
+// (i) unconfigurable using ioctl(2)
+pub const IFF_CANTCONFIG: ::c_int = 0x10000;
+pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode
+pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode
+pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP
+pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down
+pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+/// Sequential Exchange
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/// IP Mobility
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// Transport Layer Security
+pub const IPPROTO_TLSP: ::c_int = 56;
+/// SKIP
+pub const IPPROTO_SKIP: ::c_int = 57;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+/// IPv6 Mobility Header
+pub const IPPROTO_MH: ::c_int = 135;
+/// UDP-Lite
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+/// IP6 Host Identity Protocol
+pub const IPPROTO_HIP: ::c_int = 139;
+/// IP6 Shim6 Protocol
+pub const IPPROTO_SHIM6: ::c_int = 140;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// MPLS-in-IP
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion, no longer used */
+/// OLD divert pseudo-proto
+pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/* Only used internally, so can be outside the range of valid IP protocols. */
+/// divert pseudo-protocol
pub const IPPROTO_DIVERT: ::c_int = 258;
+/// SeND pseudo-protocol
+pub const IPPROTO_SEND: ::c_int = 259;
+
+pub const IP_BINDANY: ::c_int = 24;
pub const PF_SLOW: ::c_int = AF_SLOW;
pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
@@ -451,6 +758,7 @@ pub const SHM_LOCK: ::c_int = 11;
pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_STAT: ::c_int = 13;
pub const SHM_INFO: ::c_int = 14;
+pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
// The *_MAXID constants never should've been used outside of the
// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID,
@@ -527,6 +835,9 @@ pub const _PC_ACL_NFS4: ::c_int = 64;
pub const _SC_CPUSET_SIZE: ::c_int = 122;
+pub const XU_NGROUPS: ::c_int = 16;
+pub const XUCRED_VERSION: ::c_uint = 0;
+
extern {
pub fn __error() -> *mut ::c_int;
@@ -579,6 +890,9 @@ extern {
pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
msgflg: ::c_int) -> ::c_int;
pub fn cfmakesane(termios: *mut ::termios);
+ pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
+ envp: *const *const ::c_char)
+ -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/bsd/freebsdlike/mod.rs b/libc/src/unix/bsd/freebsdlike/mod.rs
index 8cc87ce..5cea759 100644
--- a/libc/src/unix/bsd/freebsdlike/mod.rs
+++ b/libc/src/unix/bsd/freebsdlike/mod.rs
@@ -1,7 +1,9 @@
+pub type c_char = i8;
pub type dev_t = u32;
pub type mode_t = u16;
pub type pthread_attr_t = *mut ::c_void;
pub type rlim_t = i64;
+pub type mqd_t = *mut ::c_void;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
@@ -159,6 +161,15 @@ s! {
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
+
+ pub struct cmsgcred {
+ pub cmcred_pid: ::pid_t,
+ pub cmcred_uid: ::uid_t,
+ pub cmcred_euid: ::uid_t,
+ pub cmcred_gid: ::gid_t,
+ pub cmcred_ngroups: ::c_short,
+ pub cmcred_groups: [::gid_t; CMGROUP_MAX],
+ }
}
pub const AIO_LISTIO_MAX: ::c_int = 16;
@@ -446,7 +457,16 @@ pub const POLLSTANDARD: ::c_short = ::POLLIN | ::POLLPRI | ::POLLOUT |
::POLLRDNORM | ::POLLRDBAND | ::POLLWRBAND | ::POLLERR |
::POLLHUP | ::POLLNVAL;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
@@ -640,8 +660,6 @@ pub const SO_RCVTIMEO: ::c_int = 0x1006;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
-
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
@@ -936,6 +954,12 @@ pub const OCRNL: ::tcflag_t = 0x10;
pub const ONOCR: ::tcflag_t = 0x20;
pub const ONLRET: ::tcflag_t = 0x40;
+pub const CMGROUP_MAX: usize = 16;
+
+// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h
+// sizeof(long)
+pub const BPF_ALIGNMENT: ::c_int = 8;
+
f! {
pub fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
@@ -969,6 +993,32 @@ extern {
groups: *mut ::gid_t,
ngroups: *mut ::c_int) -> ::c_int;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+ pub fn mq_receive(mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msq_prio: *mut ::c_uint) -> ::ssize_t;
+ pub fn mq_send(mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msq_prio: ::c_uint) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t,
+ newattr: *const ::mq_attr,
+ oldattr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_timedreceive(mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msq_prio: *mut ::c_uint,
+ abs_timeout: *const ::timespec) -> ::ssize_t;
+ pub fn mq_timedsend(mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msq_prio: ::c_uint,
+ abs_timeout: *const ::timespec) -> ::c_int;
+ pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
}
#[link(name = "util")]
@@ -1107,9 +1157,6 @@ extern {
timeout: *const ::timespec,
sigmask: *const sigset_t) -> ::c_int;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
- pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
- envp: *const *const ::c_char)
- -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/bsd/mod.rs b/libc/src/unix/bsd/mod.rs
index 94b8576..b9a88f0 100644
--- a/libc/src/unix/bsd/mod.rs
+++ b/libc/src/unix/bsd/mod.rs
@@ -1,6 +1,5 @@
use dox::{mem, Option};
-pub type c_char = i8;
pub type wchar_t = i32;
pub type off_t = i64;
pub type useconds_t = u32;
@@ -299,6 +298,7 @@ pub const MDMBUF: ::tcflag_t = 0x00100000;
pub const WNOHANG: ::c_int = 0x00000001;
pub const WUNTRACED: ::c_int = 0x00000002;
+pub const RTLD_LAZY: ::c_int = 0x1;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
@@ -313,6 +313,12 @@ pub const TCP_MAXSEG: ::c_int = 2;
pub const PIPE_BUF: usize = 512;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLRDBAND: ::c_short = 0x080;
@@ -360,6 +366,10 @@ f! {
pub fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0o200) != 0
}
+
+ pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+ (cmd << 8) | (type_ & 0x00ff)
+ }
}
extern {
@@ -480,6 +490,9 @@ extern {
oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+ #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
+ link_name = "pthread_cancel$UNIX2003")]
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
diff --git a/libc/src/unix/bsd/netbsdlike/mod.rs b/libc/src/unix/bsd/netbsdlike/mod.rs
index e43f2ab..9179e6a 100644
--- a/libc/src/unix/bsd/netbsdlike/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/mod.rs
@@ -448,8 +448,6 @@ pub const MSG_MCAST: ::c_int = 0x200;
pub const MSG_NOSIGNAL: ::c_int = 0x400;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
-
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
@@ -589,6 +587,8 @@ extern {
iovcnt: ::c_int,
offset: ::off_t) -> ::ssize_t;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+ pub fn utimensat(dirfd: ::c_int, path: *const ::c_char,
+ times: *const ::timespec, flag: ::c_int) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn openpty(amaster: *mut ::c_int,
aslave: *mut ::c_int,
diff --git a/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
index ff6dd24..4c528b5 100644
--- a/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1,3 +1,6 @@
+use dox::mem;
+
+pub type c_char = i8;
pub type clock_t = ::c_uint;
pub type suseconds_t = ::c_int;
pub type dev_t = u64;
@@ -5,6 +8,7 @@ pub type blksize_t = ::int32_t;
pub type fsblkcnt_t = ::uint64_t;
pub type fsfilcnt_t = ::uint64_t;
pub type idtype_t = ::c_int;
+pub type mqd_t = ::c_int;
s! {
pub struct aiocb {
@@ -44,6 +48,13 @@ s! {
__unused8: *mut ::c_void,
}
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ }
+
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
@@ -281,6 +292,27 @@ s! {
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
+
+ pub struct sockcred {
+ pub sc_pid: ::pid_t,
+ pub sc_uid: ::uid_t,
+ pub sc_euid: ::uid_t,
+ pub sc_gid: ::gid_t,
+ pub sc_egid: ::gid_t,
+ pub sc_ngroups: ::c_int,
+ pub sc_groups: [::gid_t; 1],
+ }
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::c_uchar,
+ pub sdl_index: ::c_ushort,
+ pub sdl_type: ::uint8_t,
+ pub sdl_nlen: ::uint8_t,
+ pub sdl_alen: ::uint8_t,
+ pub sdl_slen: ::uint8_t,
+ pub sdl_data: [::c_char; 12],
+ }
}
pub const AT_FDCWD: ::c_int = -100;
@@ -316,14 +348,22 @@ pub const MS_INVALIDATE : ::c_int = 0x2;
pub const RLIM_NLIMITS: ::c_int = 12;
-pub const ENOATTR : ::c_int = 93;
-pub const EILSEQ : ::c_int = 85;
-pub const EOVERFLOW : ::c_int = 84;
-pub const ECANCELED : ::c_int = 87;
-pub const EIDRM : ::c_int = 82;
-pub const ENOMSG : ::c_int = 83;
-pub const ENOTSUP : ::c_int = 86;
-pub const ELAST : ::c_int = 96;
+pub const EIDRM: ::c_int = 82;
+pub const ENOMSG: ::c_int = 83;
+pub const EOVERFLOW: ::c_int = 84;
+pub const EILSEQ: ::c_int = 85;
+pub const ENOTSUP: ::c_int = 86;
+pub const ECANCELED: ::c_int = 87;
+pub const EBADMSG: ::c_int = 88;
+pub const ENODATA: ::c_int = 89;
+pub const ENOSR: ::c_int = 90;
+pub const ENOSTR: ::c_int = 91;
+pub const ETIME: ::c_int = 92;
+pub const ENOATTR: ::c_int = 93;
+pub const EMULTIHOP: ::c_int = 94;
+pub const ENOLINK: ::c_int = 95;
+pub const EPROTO: ::c_int = 96;
+pub const ELAST: ::c_int = 96;
pub const F_DUPFD_CLOEXEC : ::c_int = 12;
pub const F_CLOSEM: ::c_int = 10;
@@ -346,6 +386,103 @@ pub const SO_TIMESTAMP: ::c_int = 0x2000;
pub const SO_OVERFLOWED: ::c_int = 0x1009;
pub const SO_NOHEADER: ::c_int = 0x100a;
+// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
+pub const IFF_UP: ::c_int = 0x0001; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x0002; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x0004; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x0008; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x0010; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x0020; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x0040; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x0080; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x0400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x0800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// IP Mobility RFC 2004
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// IPv6 ICMP
+pub const IPPROTO_IPV6_ICMP: ::c_int = 58;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// Ethernet-in-IP
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// VRRP RFC 2338
+pub const IPPROTO_VRRP: ::c_int = 112;
+/// Common Address Resolution Protocol
+pub const IPPROTO_CARP: ::c_int = 112;
+/// L2TPv3
+// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16,
+// but isn't yet supported by the NetBSD rumprun kernel image used for
+// libc testing.
+//pub const IPPROTO_L2TP: ::c_int = 115;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+pub const IPPROTO_MAX: ::c_int = 256;
+
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/// sysctl placeholder for (FAST_)IPSEC
+pub const CTL_IPPROTO_IPSEC: ::c_int = 258;
+
pub const AF_OROUTE: ::c_int = 17;
pub const AF_ARP: ::c_int = 28;
pub const pseudo_AF_KEY: ::c_int = 29;
@@ -386,6 +523,65 @@ pub const MAP_NORESERVE : ::c_int = 0x40;
pub const MAP_HASSEMAPHORE : ::c_int = 0x200;
pub const MAP_WIRED: ::c_int = 0x800;
+pub const DCCP_TYPE_REQUEST: ::c_int = 0;
+pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
+pub const DCCP_TYPE_DATA: ::c_int = 2;
+pub const DCCP_TYPE_ACK: ::c_int = 3;
+pub const DCCP_TYPE_DATAACK: ::c_int = 4;
+pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5;
+pub const DCCP_TYPE_CLOSE: ::c_int = 6;
+pub const DCCP_TYPE_RESET: ::c_int = 7;
+pub const DCCP_TYPE_MOVE: ::c_int = 8;
+
+pub const DCCP_FEATURE_CC: ::c_int = 1;
+pub const DCCP_FEATURE_ECN: ::c_int = 2;
+pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3;
+pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4;
+pub const DCCP_FEATURE_MOBILITY: ::c_int = 5;
+pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6;
+pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8;
+pub const DCCP_FEATURE_IDENTREG: ::c_int = 7;
+
+pub const DCCP_OPT_PADDING: ::c_int = 0;
+pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1;
+pub const DCCP_OPT_SLOW_RECV: ::c_int = 2;
+pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3;
+pub const DCCP_OPT_CHANGE_L: ::c_int = 32;
+pub const DCCP_OPT_CONFIRM_L: ::c_int = 33;
+pub const DCCP_OPT_CHANGE_R: ::c_int = 34;
+pub const DCCP_OPT_CONFIRM_R: ::c_int = 35;
+pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36;
+pub const DCCP_OPT_NDP_COUNT: ::c_int = 37;
+pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38;
+pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39;
+pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40;
+pub const DCCP_OPT_TIMESTAMP: ::c_int = 41;
+pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42;
+pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43;
+pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44;
+
+pub const DCCP_REASON_UNSPEC: ::c_int = 0;
+pub const DCCP_REASON_CLOSED: ::c_int = 1;
+pub const DCCP_REASON_INVALID: ::c_int = 2;
+pub const DCCP_REASON_OPTION_ERR: ::c_int = 3;
+pub const DCCP_REASON_FEA_ERR: ::c_int = 4;
+pub const DCCP_REASON_CONN_REF: ::c_int = 5;
+pub const DCCP_REASON_BAD_SNAME: ::c_int = 6;
+pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7;
+pub const DCCP_REASON_INV_MOVE: ::c_int = 8;
+pub const DCCP_REASON_UNANSW_CH: ::c_int = 10;
+pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11;
+
+pub const DCCP_CCID: ::c_int = 1;
+pub const DCCP_CSLEN: ::c_int = 2;
+pub const DCCP_MAXSEG: ::c_int = 4;
+pub const DCCP_SERVICE: ::c_int = 8;
+
+pub const DCCP_NDP_LIMIT: ::c_int = 16;
+pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216;
+pub const DCCP_MAX_OPTIONS: ::c_int = 32;
+pub const DCCP_MAX_PKTS: ::c_int = 100;
+
pub const _PC_LINK_MAX : ::c_int = 1;
pub const _PC_MAX_CANON : ::c_int = 2;
pub const _PC_MAX_INPUT : ::c_int = 3;
@@ -511,13 +707,13 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
-pub const EVFILT_AIO: ::int32_t = 2;
-pub const EVFILT_PROC: ::int32_t = 4;
-pub const EVFILT_READ: ::int32_t = 0;
-pub const EVFILT_SIGNAL: ::int32_t = 5;
-pub const EVFILT_TIMER: ::int32_t = 6;
-pub const EVFILT_VNODE: ::int32_t = 3;
-pub const EVFILT_WRITE: ::int32_t = 1;
+pub const EVFILT_AIO: ::uint32_t = 2;
+pub const EVFILT_PROC: ::uint32_t = 4;
+pub const EVFILT_READ: ::uint32_t = 0;
+pub const EVFILT_SIGNAL: ::uint32_t = 5;
+pub const EVFILT_TIMER: ::uint32_t = 6;
+pub const EVFILT_VNODE: ::uint32_t = 3;
+pub const EVFILT_WRITE: ::uint32_t = 1;
pub const EV_ADD: ::uint32_t = 0x1;
pub const EV_DELETE: ::uint32_t = 0x2;
@@ -700,8 +896,23 @@ pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_GID: ::c_int = 7;
pub const KERN_PROC_RGID: ::c_int = 8;
-
+pub const KERN_PROC_ARGV: ::c_int = 1;
+pub const KERN_PROC_NARGV: ::c_int = 2;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_NENV: ::c_int = 4;
+pub const KERN_PROC_PATHNAME: ::c_int = 5;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
pub const AIO_CANCELED: ::c_int = 1;
pub const AIO_NOTCANCELED: ::c_int = 2;
@@ -741,12 +952,21 @@ pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
// http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
f! {
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int {
- unsafe { *(dirp as *const ::c_int) }
+ *(dirp as *const ::c_int)
}
pub fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0xffff
}
+
+ pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+ let ngrps = if ngrps > 0 {
+ ngrps - 1
+ } else {
+ 0
+ };
+ mem::size_of::<sockcred>() + mem::size_of::<::gid_t>() * ngrps
+ }
}
extern {
@@ -798,6 +1018,32 @@ extern {
flags: ::c_int,
data: *mut ::c_void,
size: ::size_t) -> ::c_int;
+ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+ pub fn mq_receive(mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msq_prio: *mut ::c_uint) -> ::ssize_t;
+ pub fn mq_send(mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msq_prio: ::c_uint) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t,
+ newattr: *const ::mq_attr,
+ oldattr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_timedreceive(mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msq_prio: *mut ::c_uint,
+ abs_timeout: *const ::timespec) -> ::ssize_t;
+ pub fn mq_timedsend(mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msq_prio: ::c_uint,
+ abs_timeout: *const ::timespec) -> ::c_int;
+ pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
pub fn ptrace(request: ::c_int,
pid: ::pid_t,
addr: *mut ::c_void,
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs
index 695cf68..ac4acad 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs
@@ -1,3 +1,5 @@
+pub type c_char = i8;
+
s! {
pub struct lconv {
pub decimal_point: *mut ::c_char,
@@ -73,3 +75,15 @@ extern {
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86")] {
+ mod x86;
+ pub use self::x86::*;
+ } else if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
+ } else {
+ // Unknown target_arch
+ }
+}
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs
index 9b0b338..9b0b338 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs
index b07c476..b07c476 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index 37c7708..1f40e34 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -176,6 +176,17 @@ s! {
pub ifm_xflags: ::c_int,
pub ifm_data: if_data,
}
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::c_uchar,
+ pub sdl_index: ::c_ushort,
+ pub sdl_type: ::c_uchar,
+ pub sdl_nlen: ::c_uchar,
+ pub sdl_alen: ::c_uchar,
+ pub sdl_slen: ::c_uchar,
+ pub sdl_data: [::c_char; 24],
+ }
}
pub const UT_NAMESIZE: usize = 32;
@@ -200,7 +211,11 @@ pub const ECANCELED : ::c_int = 88;
pub const EIDRM : ::c_int = 89;
pub const ENOMSG : ::c_int = 90;
pub const ENOTSUP : ::c_int = 91;
-pub const ELAST : ::c_int = 91;
+pub const EBADMSG : ::c_int = 92;
+pub const ENOTRECOVERABLE : ::c_int = 93;
+pub const EOWNERDEAD : ::c_int = 94;
+pub const EPROTO : ::c_int = 95;
+pub const ELAST : ::c_int = 95;
pub const F_DUPFD_CLOEXEC : ::c_int = 10;
@@ -221,6 +236,90 @@ pub const SO_RTABLE: ::c_int = 0x1021;
pub const SO_PEERCRED: ::c_int = 0x1022;
pub const SO_SPLICE: ::c_int = 0x1023;
+// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// IP Mobility RFC 2004
+pub const IPPROTO_MOBILE: ::c_int = 55;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// Ethernet-in-IP
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// unicast MPLS packet
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+pub const IPPROTO_MAX: ::c_int = 256;
+
+/* Only used internally, so it can be outside the range of valid IP protocols */
+/// Divert sockets
+pub const IPPROTO_DIVERT: ::c_int = 258;
+
pub const AF_ECMA: ::c_int = 8;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_ENCAP: ::c_int = 28;
@@ -273,7 +372,17 @@ pub const EIPSEC : ::c_int = 82;
pub const ENOMEDIUM : ::c_int = 85;
pub const EMEDIUMTYPE : ::c_int = 86;
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -14;
pub const RUSAGE_THREAD: ::c_int = 1;
@@ -585,6 +694,8 @@ pub const SOCK_CLOEXEC: ::c_int = 0x8000;
pub const SOCK_NONBLOCK: ::c_int = 0x4000;
pub const SOCK_DNS: ::c_int = 0x1000;
+pub const WCONTINUED: ::c_int = 8;
+
f! {
pub fn WIFCONTINUED(status: ::c_int) -> bool {
status & 0o177777 == 0o177777
@@ -637,6 +748,3 @@ cfg_if! {
// Unknown target_os
}
}
-
-mod other;
-pub use self::other::*;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs
new file mode 100644
index 0000000..6aa9950
--- /dev/null
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs
@@ -0,0 +1,3 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs
index 5c80447..e7e5876 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs
@@ -33,3 +33,18 @@ extern {
pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char,
envp: *const *const ::c_char) -> ::c_int;
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86")] {
+ mod x86;
+ pub use self::x86::*;
+ } else if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
+ } else if #[cfg(target_arch = "aarch64")] {
+ mod aarch64;
+ pub use self::aarch64::*;
+ } else {
+ // Unknown target_arch
+ }
+}
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs
new file mode 100644
index 0000000..a00e333
--- /dev/null
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs
@@ -0,0 +1,3 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs
new file mode 100644
index 0000000..27b9412
--- /dev/null
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs
@@ -0,0 +1,3 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
deleted file mode 100644
index e4087da..0000000
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-cfg_if! {
- if #[cfg(target_arch = "x86_64")] {
- mod b64;
- pub use self::b64::*;
- } else if #[cfg(target_arch = "x86")] {
- mod b32;
- pub use self::b32::*;
- } else {
- // Unknown target_arch
- }
-}
diff --git a/libc/src/unix/haiku/b32.rs b/libc/src/unix/haiku/b32.rs
index 9b0b338..cce8864 100644
--- a/libc/src/unix/haiku/b32.rs
+++ b/libc/src/unix/haiku/b32.rs
@@ -1,2 +1,3 @@
pub type c_long = i32;
pub type c_ulong = u32;
+pub type time_t = i32;
diff --git a/libc/src/unix/haiku/b64.rs b/libc/src/unix/haiku/b64.rs
index 5d63ce9..3e66f14 100644
--- a/libc/src/unix/haiku/b64.rs
+++ b/libc/src/unix/haiku/b64.rs
@@ -1,2 +1,3 @@
pub type c_ulong = u64;
pub type c_long = i64;
+pub type time_t = i64;
diff --git a/libc/src/unix/haiku/mod.rs b/libc/src/unix/haiku/mod.rs
index a659f73..9b0252d 100644
--- a/libc/src/unix/haiku/mod.rs
+++ b/libc/src/unix/haiku/mod.rs
@@ -9,7 +9,6 @@ pub type speed_t = ::c_uint;
pub type c_char = i8;
pub type clock_t = i32;
pub type clockid_t = i32;
-pub type time_t = i32;
pub type suseconds_t = i32;
pub type wchar_t = i32;
pub type off_t = i64;
@@ -170,6 +169,14 @@ s! {
pub c_cc: [::cc_t; ::NCCS],
}
+ pub struct flock {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ }
+
pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
@@ -291,6 +298,14 @@ s! {
sa_userdata: *mut ::c_void,
}
+ pub struct sigevent {
+ pub sigev_notify: ::c_int,
+ pub sigev_signo: ::c_int,
+ pub sigev_value: ::sigval,
+ __unused1: *mut ::c_void, // actually a function pointer
+ pub sigev_notify_attributes: *mut ::pthread_attr_t,
+ }
+
pub struct sem_t {
pub se_type: i32,
pub se_named_id: i32, // this is actually a union
@@ -331,6 +346,27 @@ pub const F_GETFD: ::c_int = 0x0002;
pub const F_SETFD: ::c_int = 0x0004;
pub const F_GETFL: ::c_int = 0x0008;
pub const F_SETFL: ::c_int = 0x0010;
+pub const F_GETLK: ::c_int = 0x0020;
+pub const F_SETLK: ::c_int = 0x0080;
+pub const F_SETLKW: ::c_int = 0x0100;
+pub const F_DUPFD_CLOEXEC: ::c_int = 0x0200;
+
+pub const AT_FDCWD: ::c_int = -1;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x01;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x02;
+pub const AT_REMOVEDIR: ::c_int = 0x04;
+pub const AT_EACCESS: ::c_int = 0x08;
+
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLOUT: ::c_short = 0x0002;
+pub const POLLRDNORM: ::c_short = POLLIN;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0008;
+pub const POLLWRBAND: ::c_short = 0x0010;
+pub const POLLPRI: ::c_short = 0x0020;
+pub const POLLERR: ::c_short = 0x0004;
+pub const POLLHUP: ::c_short = 0x0080;
+pub const POLLNVAL: ::c_short = 0x1000;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
@@ -350,6 +386,8 @@ pub const RLIMIT_NLIMITS: ::c_int = 8;
pub const RUSAGE_SELF: ::c_int = 0;
+pub const RTLD_LAXY: ::c_int = 0;
+
pub const NCCS: usize = 11;
pub const O_RDONLY: ::c_int = 0x0000;
@@ -432,7 +470,25 @@ pub const SIGXCPU: ::c_int = 28;
pub const SIGXFSZ: ::c_int = 29;
pub const SIGBUS: ::c_int = 30;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 3;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
@@ -451,7 +507,9 @@ pub const LC_MESSAGES: ::c_int = 6;
pub const MAP_FILE: ::c_int = 0x00;
pub const MAP_SHARED: ::c_int = 0x01;
pub const MAP_PRIVATE: ::c_int = 0x02;
-pub const MAP_FIXED: ::c_int = 0x004;
+pub const MAP_FIXED: ::c_int = 0x04;
+pub const MAP_ANONYMOUS: ::c_int = 0x08;
+pub const MAP_ANON: ::c_int = MAP_ANONYMOUS;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
@@ -459,86 +517,95 @@ pub const MS_ASYNC: ::c_int = 0x01;
pub const MS_INVALIDATE: ::c_int = 0x04;
pub const MS_SYNC: ::c_int = 0x02;
-pub const EPERM : ::c_int = -2147483633;
-pub const ENOENT : ::c_int = -2147459069;
-pub const ESRCH : ::c_int = -2147454963;
-pub const EINTR : ::c_int = -2147483638;
-pub const EIO : ::c_int = -2147483647;
-pub const ENXIO : ::c_int = -2147454965;
pub const E2BIG : ::c_int = -2147454975;
-pub const ENOEXEC : ::c_int = -2147478782;
-pub const EBADF : ::c_int = -2147459072;
pub const ECHILD : ::c_int = -2147454974;
pub const EDEADLK : ::c_int = -2147454973;
-pub const ENOMEM : ::c_int = -2147454976;
-pub const EACCES : ::c_int = -2147483646;
-pub const EFAULT : ::c_int = -2147478783;
-// pub const ENOTBLK : ::c_int = 15;
-pub const EBUSY : ::c_int = -2147483634;
-pub const EEXIST : ::c_int = -2147459070;
-pub const EXDEV : ::c_int = -2147459061;
-pub const ENODEV : ::c_int = -2147454969;
-pub const ENOTDIR : ::c_int = -2147459067;
-pub const EISDIR : ::c_int = -2147459063;
-pub const EINVAL : ::c_int = -2147483643;
+pub const EFBIG : ::c_int = -2147454972;
+pub const EMLINK : ::c_int = -2147454971;
pub const ENFILE : ::c_int = -2147454970;
-pub const EMFILE : ::c_int = -2147459062;
+pub const ENODEV : ::c_int = -2147454969;
+pub const ENOLCK : ::c_int = -2147454968;
+pub const ENOSYS : ::c_int = -2147454967;
pub const ENOTTY : ::c_int = -2147454966;
-pub const ETXTBSY : ::c_int = -2147454917;
-pub const EFBIG : ::c_int = -2147454972;
-pub const ENOSPC : ::c_int = -2147459065;
+pub const ENXIO : ::c_int = -2147454965;
pub const ESPIPE : ::c_int = -2147454964;
-pub const EROFS : ::c_int = -2147459064;
-pub const EMLINK : ::c_int = -2147454971;
-pub const EPIPE : ::c_int = -2147459059;
+pub const ESRCH : ::c_int = -2147454963;
+pub const EFPOS : ::c_int = -2147457962;
+pub const ESIGPARM : ::c_int = -2147457961;
pub const EDOM : ::c_int = -2147454960;
pub const ERANGE : ::c_int = -2147454959;
-pub const EAGAIN : ::c_int = -2147483637;
-pub const EWOULDBLOCK : ::c_int = -2147483637;
-
-pub const EINPROGRESS : ::c_int = -2147454940;
-pub const EALREADY : ::c_int = -2147454939;
-pub const ENOTSOCK : ::c_int = -2147454932;
-pub const EDESTADDRREQ : ::c_int = -2147454928;
-pub const EMSGSIZE : ::c_int = -2147454934;
pub const EPROTOTYPE : ::c_int = -2147454958;
-pub const ENOPROTOOPT : ::c_int = -2147454942;
pub const EPROTONOSUPPORT : ::c_int = -2147454957;
-pub const EOPNOTSUPP : ::c_int = -2147454933;
pub const EPFNOSUPPORT : ::c_int = -2147454956;
pub const EAFNOSUPPORT : ::c_int = -2147454955;
pub const EADDRINUSE : ::c_int = -2147454954;
pub const EADDRNOTAVAIL : ::c_int = -2147454953;
-pub const ENETDOWN : ::c_int = -2147454953;
+pub const ENETDOWN : ::c_int = -2147454952;
pub const ENETUNREACH : ::c_int = -2147454951;
pub const ENETRESET : ::c_int = -2147454950;
pub const ECONNABORTED : ::c_int = -2147454949;
pub const ECONNRESET : ::c_int = -2147454948;
-pub const ENOBUFS : ::c_int = -2147454941;
pub const EISCONN : ::c_int = -2147454947;
pub const ENOTCONN : ::c_int = -2147454946;
pub const ESHUTDOWN : ::c_int = -2147454945;
-pub const ETIMEDOUT : ::c_int = -2147483639;
pub const ECONNREFUSED : ::c_int = -2147454944;
-pub const ELOOP : ::c_int = -2147459060;
-pub const ENAMETOOLONG : ::c_int = -2147459068;
-pub const EHOSTDOWN : ::c_int = -2147454931;
pub const EHOSTUNREACH : ::c_int = -2147454943;
-pub const ENOTEMPTY : ::c_int = -2147459066;
-pub const EDQUOT : ::c_int = -2147454927;
-pub const ESTALE : ::c_int = -2147454936;
-pub const ENOLCK : ::c_int = -2147454968;
-pub const ENOSYS : ::c_int = -2147454967;
-pub const EIDRM : ::c_int = -2147454926;
+pub const ENOPROTOOPT : ::c_int = -2147454942;
+pub const ENOBUFS : ::c_int = -2147454941;
+pub const EINPROGRESS : ::c_int = -2147454940;
+pub const EALREADY : ::c_int = -2147454939;
+pub const EILSEQ : ::c_int = -2147454938;
pub const ENOMSG : ::c_int = -2147454937;
+pub const ESTALE : ::c_int = -2147454936;
pub const EOVERFLOW : ::c_int = -2147454935;
-pub const ECANCELED : ::c_int = -2147454929;
-pub const EILSEQ : ::c_int = -2147454938;
-pub const ENOATTR : ::c_int = -2147454916;
+pub const EMSGSIZE : ::c_int = -2147454934;
+pub const EOPNOTSUPP : ::c_int = -2147454933;
+pub const ENOTSOCK : ::c_int = -2147454932;
+pub const EHOSTDOWN : ::c_int = -2147454931;
pub const EBADMSG : ::c_int = -2147454930;
+pub const ECANCELED : ::c_int = -2147454929;
+pub const EDESTADDRREQ : ::c_int = -2147454928;
+pub const EDQUOT : ::c_int = -2147454927;
+pub const EIDRM : ::c_int = -2147454926;
pub const EMULTIHOP : ::c_int = -2147454925;
+pub const ENODATA : ::c_int = -2147454924;
pub const ENOLINK : ::c_int = -2147454923;
+pub const ENOSR : ::c_int = -2147454922;
+pub const ENOSTR : ::c_int = -2147454921;
+pub const ENOTSUP : ::c_int = -2147454920;
pub const EPROTO : ::c_int = -2147454919;
+pub const ETIME : ::c_int = -2147454918;
+pub const ETXTBSY : ::c_int = -2147454917;
+pub const ENOATTR : ::c_int = -2147454916;
+
+// INT_MIN
+pub const ENOMEM : ::c_int = -2147454976;
+
+// POSIX errors that can be mapped to BeOS error codes
+pub const EACCES : ::c_int = -2147483646;
+pub const EINTR : ::c_int = -2147483638;
+pub const EIO : ::c_int = -2147483647;
+pub const EBUSY : ::c_int = -2147483634;
+pub const EFAULT : ::c_int = -2147478783;
+pub const ETIMEDOUT : ::c_int = -2147483639;
+pub const EAGAIN : ::c_int = -2147483637;
+pub const EWOULDBLOCK : ::c_int = -2147483637;
+pub const EBADF : ::c_int = -2147459072;
+pub const EEXIST : ::c_int = -2147459070;
+pub const EINVAL : ::c_int = -2147483643;
+pub const ENAMETOOLONG : ::c_int = -2147459068;
+pub const ENOENT : ::c_int = -2147459069;
+pub const EPERM : ::c_int = -2147483633;
+pub const ENOTDIR : ::c_int = -2147459067;
+pub const EISDIR : ::c_int = -2147459063;
+pub const ENOTEMPTY : ::c_int = -2147459066;
+pub const ENOSPC : ::c_int = -2147459065;
+pub const EROFS : ::c_int = -2147459064;
+pub const EMFILE : ::c_int = -2147459062;
+pub const EXDEV : ::c_int = -2147459061;
+pub const ELOOP : ::c_int = -2147459060;
+pub const ENOEXEC : ::c_int = -2147478782;
+pub const EPIPE : ::c_int = -2147459059;
pub const IPPROTO_RAW: ::c_int = 255;
@@ -549,12 +616,35 @@ pub const MADV_RANDOM: ::c_int = 3;
pub const MADV_WILLNEED: ::c_int = 4;
pub const MADV_DONTNEED: ::c_int = 5;
+// https://github.com/haiku/haiku/blob/master/headers/posix/net/if.h#L80
+pub const IFF_UP: ::c_int = 0x0001;
+pub const IFF_BROADCAST: ::c_int = 0x0002; // valid broadcast address
pub const IFF_LOOPBACK: ::c_int = 0x0008;
-
-pub const AF_UNIX: ::c_int = 9;
+pub const IFF_POINTOPOINT: ::c_int = 0x0010; // point-to-point link
+pub const IFF_NOARP: ::c_int = 0x0040; // no address resolution
+pub const IFF_AUTOUP: ::c_int = 0x0080; // auto dial
+pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
+pub const IFF_SIMPLEX: ::c_int = 0x0800; // doesn't receive own transmissions
+pub const IFF_LINK: ::c_int = 0x1000; // has link
+pub const IFF_AUTO_CONFIGURED: ::c_int = 0x2000;
+pub const IFF_CONFIGURING: ::c_int = 0x4000;
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+pub const AF_UNSEC: ::c_int = 0;
pub const AF_INET: ::c_int = 1;
-pub const AF_INET6: ::c_int = 6;
-pub const SOCK_RAW: ::c_int = 3;
+pub const AF_APPLETALK: ::c_int = 2;
+pub const AF_ROUTE: ::c_int = 3;
+pub const AF_LINK: ::c_int = 4;
+pub const AF_INET6: ::c_int = 5;
+pub const AF_DLI: ::c_int = 6;
+pub const AF_IPX: ::c_int = 7;
+pub const AF_NOTIFY: ::c_int = 8;
+pub const AF_LOCAL: ::c_int = 9;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_BLUETOOTH: ::c_int = 10;
+pub const AF_MAX: ::c_int = 11;
+
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_MULTICAST_LOOP: ::c_int = 11;
pub const IP_TTL: ::c_int = 4;
@@ -572,9 +662,17 @@ pub const IPV6_JOIN_GROUP: ::c_int = 28;
pub const IPV6_LEAVE_GROUP: ::c_int = 29;
pub const IPV6_V6ONLY: ::c_int = 30;
-pub const SO_DEBUG: ::c_int = 0x00000004;
-
-pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_OOB: ::c_int = 0x0001;
+pub const MSG_PEEK: ::c_int = 0x0002;
+pub const MSG_DONTROUTE: ::c_int = 0x0004;
+pub const MSG_EOR: ::c_int = 0x0008;
+pub const MSG_TRUNC: ::c_int = 0x0010;
+pub const MSG_CTRUNC: ::c_int = 0x0020;
+pub const MSG_WAITALL: ::c_int = 0x0040;
+pub const MSG_DONTWAIT: ::c_int = 0x0080;
+pub const MSG_BCAST: ::c_int = 0x0100;
+pub const MSG_MCAST: ::c_int = 0x0200;
+pub const MSG_EOF: ::c_int = 0x0400;
pub const MSG_NOSIGNAL: ::c_int = 0x0800;
pub const SHUT_RD: ::c_int = 0;
@@ -588,10 +686,18 @@ pub const LOCK_UN: ::c_int = 0x08;
pub const SIGSTKSZ: ::size_t = 16384;
-pub const SA_NODEFER: ::c_int = 0x08;
+pub const PATH_MAX: ::c_int = 1024;
+
+pub const SA_NOCLDSTOP: ::c_int = 0x01;
+pub const SA_NOCLDWAIT: ::c_int = 0x02;
pub const SA_RESETHAND: ::c_int = 0x04;
+pub const SA_NODEFER: ::c_int = 0x08;
pub const SA_RESTART: ::c_int = 0x10;
-pub const SA_NOCLDSTOP: ::c_int = 0x01;
+pub const SA_ONSTACK: ::c_int = 0x20;
+pub const SA_SIGINFO: ::c_int = 0x40;
+pub const SA_NOMASK: ::c_int = SA_NODEFER;
+pub const SA_STACK: ::c_int = SA_ONSTACK;
+pub const SA_ONESHOT: ::c_int = SA_RESETHAND;
pub const FD_SETSIZE: usize = 1024;
@@ -603,21 +709,78 @@ pub const FILENAME_MAX: ::c_uint = 256;
pub const FOPEN_MAX: ::c_uint = 128;
pub const L_tmpnam: ::c_uint = 512;
pub const TMP_MAX: ::c_uint = 32768;
+
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_NO_TRUNC: ::c_int = 5;
+pub const _PC_PATH_MAX: ::c_int = 6;
+pub const _PC_PIPE_BUF: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_LINK_MAX: ::c_int = 25;
+pub const _PC_SYNC_IO: ::c_int = 26;
+pub const _PC_ASYNC_IO: ::c_int = 27;
+pub const _PC_PRIO_IO: ::c_int = 28;
+pub const _PC_SOCK_MAXBUF: ::c_int = 29;
+pub const _PC_FILESIZEBITS: ::c_int = 30;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 31;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 32;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 33;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 34;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 35;
+pub const _PC_SYMLINK_MAX: ::c_int = 36;
+pub const _PC_2_SYMLINKS: ::c_int = 37;
+pub const _PC_XATTR_EXISTS: ::c_int = 38;
+pub const _PC_XATTR_ENABLED: ::c_int = 39;
pub const FIONBIO: ::c_int = 0xbe000000;
-pub const _SC_IOV_MAX : ::c_int = 32;
+pub const _SC_ARG_MAX : ::c_int = 15;
+pub const _SC_CHILD_MAX : ::c_int = 16;
+pub const _SC_CLK_TCK : ::c_int = 17;
+pub const _SC_JOB_CONTROL : ::c_int = 18;
+pub const _SC_NGROUPS_MAX : ::c_int = 19;
+pub const _SC_OPEN_MAX : ::c_int = 20;
+pub const _SC_SAVED_IDS : ::c_int = 21;
+pub const _SC_STREAM_MAX : ::c_int = 22;
+pub const _SC_TZNAME_MAX : ::c_int = 23;
+pub const _SC_VERSION : ::c_int = 24;
pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 25;
pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 26;
pub const _SC_PAGESIZE : ::c_int = 27;
+pub const _SC_PAGE_SIZE : ::c_int = 27;
+pub const _SC_SEM_NSEMS_MAX : ::c_int = 28;
+pub const _SC_SEM_VALUE_MAX : ::c_int = 29;
+pub const _SC_SEMAPHORES : ::c_int = 30;
+pub const _SC_THREADS : ::c_int = 31;
+pub const _SC_IOV_MAX : ::c_int = 32;
+pub const _SC_UIO_MAXIOV : ::c_int = 32;
+pub const _SC_NPROCESSORS_CONF : ::c_int = 34;
+pub const _SC_NPROCESSORS_ONLN : ::c_int = 35;
+pub const _SC_ATEXIT_MAX : ::c_int = 37;
+pub const _SC_PASS_MAX : ::c_int = 39;
+pub const _SC_PHYS_PAGES : ::c_int = 40;
+pub const _SC_AVPHYS_PAGES : ::c_int = 41;
+pub const _SC_PIPE : ::c_int = 42;
+pub const _SC_SELECT : ::c_int = 43;
+pub const _SC_POLL : ::c_int = 44;
+pub const _SC_MAPPED_FILES : ::c_int = 45;
+pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46;
+pub const _SC_THREAD_STACK_MIN : ::c_int = 47;
pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 48;
pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 49;
pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 50;
-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 46;
-pub const _SC_THREAD_STACK_MIN : ::c_int = 47;
-pub const _SC_THREADS : ::c_int = 31;
-pub const _SC_ATEXIT_MAX : ::c_int = 37;
+pub const _SC_REALTIME_SIGNALS : ::c_int = 51;
+pub const _SC_MEMORY_PROTECTION : ::c_int = 52;
+pub const _SC_SIGQUEUE_MAX : ::c_int = 53;
+pub const _SC_RTSIG_MAX : ::c_int = 54;
+pub const _SC_MONOTONIC_CLOCK : ::c_int = 55;
+pub const _SC_DELAYTIMER_MAX : ::c_int = 56;
+pub const _SC_TIMER_MAX : ::c_int = 57;
+pub const _SC_TIMERS : ::c_int = 58;
+pub const _SC_CPUTIME : ::c_int = 59;
+pub const _SC_THREAD_CPUTIME : ::c_int = 60;
pub const PTHREAD_STACK_MIN: ::size_t = 8192;
@@ -637,7 +800,7 @@ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
flags: 0,
- owner: 0,
+ owner: -1,
lock_sem: 0,
lock_count: 0,
reader_count: 0,
@@ -652,20 +815,17 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 3;
pub const FIOCLEX: c_ulong = 0; // TODO: does not exist on Haiku!
-pub const SA_ONSTACK: c_ulong = 0x20;
-pub const SA_SIGINFO: c_ulong = 0x40;
-pub const SA_NOCLDWAIT: c_ulong = 0x02;
-
-pub const SIG_SETMASK: ::c_int = 3;
-
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = -1;
pub const SO_ACCEPTCONN: ::c_int = 0x00000001;
pub const SO_BROADCAST: ::c_int = 0x00000002;
+pub const SO_DEBUG: ::c_int = 0x00000004;
pub const SO_DONTROUTE: ::c_int = 0x00000008;
pub const SO_KEEPALIVE: ::c_int = 0x00000010;
pub const SO_OOBINLINE: ::c_int = 0x00000020;
@@ -685,6 +845,8 @@ pub const SO_NONBLOCK: ::c_int = 0x40000009;
pub const SO_BINDTODEVICE: ::c_int = 0x4000000a;
pub const SO_PEERCRED: ::c_int = 0x4000000b;
+pub const SCM_RIGHTS: ::c_int = 0x01;
+
pub const NI_MAXHOST: ::size_t = 1025;
pub const WNOHANG: ::c_int = 0x01;
@@ -711,34 +873,83 @@ pub const VSWTCH: usize = 7;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VSUSP: usize = 10;
-pub const OLCUC: ::tcflag_t = 0o000002;
-pub const OCRNL: ::tcflag_t = 0o000010;
-pub const ONOCR: ::tcflag_t = 0o000020;
-pub const ONLRET: ::tcflag_t = 0o000040;
-pub const OFILL: ::tcflag_t = 0o000100;
-pub const OFDEL: ::tcflag_t = 0o000200;
-pub const NLDLY: ::tcflag_t = 0o000400;
-pub const NL0: ::tcflag_t = 0o000000;
-pub const NL1: ::tcflag_t = 0o000400;
-pub const CRDLY: ::tcflag_t = 0o003000;
-pub const CR0: ::tcflag_t = 0o000000;
-pub const CR1: ::tcflag_t = 0o001000;
-pub const CR2: ::tcflag_t = 0o002000;
-pub const CR3: ::tcflag_t = 0o003000;
-pub const TABDLY: ::tcflag_t = 0o014000;
-pub const TAB0: ::tcflag_t = 0o000000;
-pub const TAB1: ::tcflag_t = 0o004000;
-pub const TAB2: ::tcflag_t = 0o010000;
-pub const TAB3: ::tcflag_t = 0o014000;
-pub const BSDLY: ::tcflag_t = 0o020000;
-pub const BS0: ::tcflag_t = 0o000000;
-pub const BS1: ::tcflag_t = 0o020000;
-pub const FFDLY: ::tcflag_t = 0o100000;
-pub const FF0: ::tcflag_t = 0o000000;
-pub const FF1: ::tcflag_t = 0o100000;
-pub const VTDLY: ::tcflag_t = 0o040000;
-pub const VT0: ::tcflag_t = 0o000000;
-pub const VT1: ::tcflag_t = 0o040000;
+
+pub const IGNBRK: ::tcflag_t = 0x01;
+pub const BRKINT: ::tcflag_t = 0x02;
+pub const IGNPAR: ::tcflag_t = 0x04;
+pub const PARMRK: ::tcflag_t = 0x08;
+pub const INPCK: ::tcflag_t = 0x10;
+pub const ISTRIP: ::tcflag_t = 0x20;
+pub const INLCR: ::tcflag_t = 0x40;
+pub const IGNCR: ::tcflag_t = 0x80;
+pub const ICRNL: ::tcflag_t = 0x100;
+pub const IUCLC: ::tcflag_t = 0x200;
+pub const IXON: ::tcflag_t = 0x400;
+pub const IXANY: ::tcflag_t = 0x800;
+pub const IXOFF: ::tcflag_t = 0x1000;
+
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00008000;
+
+pub const CSIZE: ::tcflag_t = 0x00000020;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000000;
+pub const CS7: ::tcflag_t = 0x00000000;
+pub const CS8: ::tcflag_t = 0x00000020;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const XLOBLK: ::tcflag_t = 0x00001000;
+pub const CTSFLOW: ::tcflag_t = 0x00002000;
+pub const RTSFLOW: ::tcflag_t = 0x00004000;
+pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW;
+
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const IEXTEN: ::tcflag_t = 0x00000200;
+pub const ECHOCTL: ::tcflag_t = 0x00000400;
+pub const ECHOPRT: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00001000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const PENDIN: ::tcflag_t = 0x00004000;
pub const TCGB_CTS: ::c_int = 0x01;
pub const TCGB_DSR: ::c_int = 0x02;
@@ -752,6 +963,40 @@ pub const TIOCM_DSR: ::c_int = TCGB_DSR;
pub const TIOCM_DTR: ::c_int = 0x10;
pub const TIOCM_RTS: ::c_int = 0x20;
+pub const B0: speed_t = 0x00;
+pub const B50: speed_t = 0x01;
+pub const B75: speed_t = 0x02;
+pub const B110: speed_t = 0x03;
+pub const B134: speed_t = 0x04;
+pub const B150: speed_t = 0x05;
+pub const B200: speed_t = 0x06;
+pub const B300: speed_t = 0x07;
+pub const B600: speed_t = 0x08;
+pub const B1200: speed_t = 0x09;
+pub const B1800: speed_t = 0x0A;
+pub const B2400: speed_t = 0x0B;
+pub const B4800: speed_t = 0x0C;
+pub const B9600: speed_t = 0x0D;
+pub const B19200: speed_t = 0x0E;
+pub const B38400: speed_t = 0x0F;
+pub const B57600: speed_t = 0x10;
+pub const B115200: speed_t = 0x11;
+pub const B230400: speed_t = 0x12;
+pub const B31250: speed_t = 0x13;
+
+pub const TCSANOW: ::c_int = 0x01;
+pub const TCSADRAIN: ::c_int = 0x02;
+pub const TCSAFLUSH: ::c_int = 0x04;
+
+pub const TCOOFF: ::c_int = 0x01;
+pub const TCOON: ::c_int = 0x02;
+pub const TCIOFF: ::c_int = 0x04;
+pub const TCION: ::c_int = 0x08;
+
+pub const TCIFLUSH: ::c_int = 0x01;
+pub const TCOFLUSH: ::c_int = 0x02;
+pub const TCIOFLUSH: ::c_int = 0x03;
+
f! {
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let fd = fd as usize;
@@ -780,21 +1025,47 @@ f! {
}
pub fn WIFEXITED(status: ::c_int) -> bool {
- (status >> 8) == 0
+ (status & !0xff) == 0
}
pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
(status & 0xff)
}
+ pub fn WIFSIGNALED(status: ::c_int) -> bool {
+ ((status >> 8) & 0xff) != 0
+ }
+
pub fn WTERMSIG(status: ::c_int) -> ::c_int {
(status >> 8) & 0xff
}
+
+ pub fn WIFSTOPPED(status: ::c_int) -> bool {
+ ((status >> 16) & 0xff) != 0
+ }
+
+ pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
+ (status >> 16) & 0xff
+ }
+
+ // actually WIFCORED, but this is used everywhere else
+ pub fn WCOREDUMP(status: ::c_int) -> bool {
+ (status & 0x10000) != 0
+ }
+
+ pub fn WIFCONTINUED(status: ::c_int) -> bool {
+ (status & 0x20000) != 0
+ }
}
+#[link(name = "bsd")]
extern {
pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int;
+ pub fn pthread_create(thread: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void) -> ::c_int;
pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t) -> ::c_int;
pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
@@ -834,6 +1105,8 @@ extern {
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
-> ::c_int;
+ pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
+ -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
@@ -849,6 +1122,7 @@ extern {
addrlen: *mut ::socklen_t) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr,
@@ -923,6 +1197,16 @@ extern {
link_name = "popen$UNIX2003")]
pub fn popen(command: *const c_char,
mode: *const c_char) -> *mut ::FILE;
+ pub fn openpty(amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut termios,
+ winp: *mut ::winsize) -> ::c_int;
+ pub fn forkpty(amaster: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut termios,
+ winp: *mut ::winsize) -> ::pid_t;
+ pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/mod.rs b/libc/src/unix/mod.rs
index fcbc3eb..57067e0 100644
--- a/libc/src/unix/mod.rs
+++ b/libc/src/unix/mod.rs
@@ -34,9 +34,14 @@ s! {
pub tv_usec: suseconds_t,
}
+ // linux x32 compatibility
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
pub struct timespec {
pub tv_sec: time_t,
- pub tv_nsec: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub tv_nsec: i64,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pub tv_nsec: ::c_long,
}
pub struct rlimit {
@@ -48,19 +53,47 @@ s! {
pub ru_utime: timeval,
pub ru_stime: timeval,
pub ru_maxrss: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad1: u32,
pub ru_ixrss: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad2: u32,
pub ru_idrss: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad3: u32,
pub ru_isrss: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad4: u32,
pub ru_minflt: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad5: u32,
pub ru_majflt: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad6: u32,
pub ru_nswap: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad7: u32,
pub ru_inblock: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad8: u32,
pub ru_oublock: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad9: u32,
pub ru_msgsnd: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad10: u32,
pub ru_msgrcv: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad11: u32,
pub ru_nsignals: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad12: u32,
pub ru_nvcsw: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad13: u32,
pub ru_nivcsw: c_long,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ __pad14: u32,
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
__reserved: [c_long; 16],
@@ -138,6 +171,19 @@ s! {
pub tms_cutime: ::clock_t,
pub tms_cstime: ::clock_t,
}
+
+ pub struct servent {
+ pub s_name: *mut ::c_char,
+ pub s_aliases: *mut *mut ::c_char,
+ pub s_port: ::c_int,
+ pub s_proto: *mut ::c_char,
+ }
+
+ pub struct protoent {
+ pub p_name: *mut ::c_char,
+ pub p_aliases: *mut *mut ::c_char,
+ pub p_proto: ::c_int,
+ }
}
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
@@ -163,16 +209,8 @@ pub const S_ISUID: ::c_int = 0x800;
pub const S_ISGID: ::c_int = 0x400;
pub const S_ISVTX: ::c_int = 0x200;
-pub const POLLIN: ::c_short = 0x1;
-pub const POLLPRI: ::c_short = 0x2;
-pub const POLLOUT: ::c_short = 0x4;
-pub const POLLERR: ::c_short = 0x8;
-pub const POLLHUP: ::c_short = 0x10;
-pub const POLLNVAL: ::c_short = 0x20;
-
pub const IF_NAMESIZE: ::size_t = 16;
-
-pub const RTLD_LAZY: ::c_int = 0x1;
+pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
pub const LOG_EMERG: ::c_int = 0;
pub const LOG_ALERT: ::c_int = 1;
@@ -234,8 +272,8 @@ cfg_if! {
// on dox builds don't pull in anything
} else if #[cfg(target_os = "l4re")] {
// required libraries for L4Re are linked externally, ATM
- } else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
- // cargo build, don't pull in anything extra as the libstd dep
+ } else if #[cfg(feature = "use_std")] {
+ // cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
#[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
@@ -264,7 +302,7 @@ cfg_if! {
extern {}
} else if #[cfg(target_os = "fuchsia")] {
#[link(name = "c")]
- #[link(name = "mxio")]
+ #[link(name = "fdio")]
extern {}
} else if #[cfg(target_env = "newlib")] {
#[link(name = "c")]
@@ -708,7 +746,8 @@ extern {
#[cfg_attr(any(
all(target_os = "linux", not(target_env = "musl")),
target_os = "freebsd",
- target_os = "dragonfly"),
+ target_os = "dragonfly",
+ target_os = "haiku"),
link_name = "__res_init")]
#[cfg_attr(any(target_os = "macos", target_os = "ios"),
link_name = "res_9_init")]
@@ -728,12 +767,18 @@ extern {
pub fn gmtime(time_p: *const time_t) -> *mut tm;
#[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
pub fn localtime(time_p: *const time_t) -> *mut tm;
+ #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
+ pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
#[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
pub fn mknod(pathname: *const ::c_char, mode: ::mode_t,
dev: ::dev_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+ pub fn getservbyname(name: *const ::c_char,
+ proto: *const ::c_char) -> *mut servent;
+ pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
+ pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
pub fn chroot(name: *const ::c_char) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "usleep$UNIX2003")]
diff --git a/libc/src/unix/newlib/aarch64/mod.rs b/libc/src/unix/newlib/aarch64/mod.rs
new file mode 100644
index 0000000..96f381a
--- /dev/null
+++ b/libc/src/unix/newlib/aarch64/mod.rs
@@ -0,0 +1,5 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
diff --git a/libc/src/unix/newlib/mod.rs b/libc/src/unix/newlib/mod.rs
index aec3bca..6cf8633 100644
--- a/libc/src/unix/newlib/mod.rs
+++ b/libc/src/unix/newlib/mod.rs
@@ -435,6 +435,15 @@ pub const O_NONBLOCK: ::c_int = 16384;
pub const O_ACCMODE: ::c_int = 3;
pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
+pub const RTLD_LAZY: ::c_int = 0x1;
+
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
@@ -508,6 +517,26 @@ pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
pub const INET_ADDRSTRLEN: ::c_int = 16;
+// https://github.
+// com/bminor/newlib/blob/master/newlib/libc/sys/linux/include/net/if.h#L121
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
pub const IPPROTO_IP: ::c_int = 0;
pub const IPPROTO_UDP: ::c_int = 17;
pub const IPPROTO_TCP: ::c_int = 6;
@@ -650,6 +679,9 @@ cfg_if! {
if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
+ } else if #[cfg(target_arch = "aarch64")] {
+ mod aarch64;
+ pub use self::aarch64::*;
} else {
// Only tested on ARM so far. Other platforms might have different
// definitions for types and constants.
diff --git a/libc/src/unix/notbsd/android/b32/arm.rs b/libc/src/unix/notbsd/android/b32/arm.rs
index c38f644..1320b16 100644
--- a/libc/src/unix/notbsd/android/b32/arm.rs
+++ b/libc/src/unix/notbsd/android/b32/arm.rs
@@ -6,7 +6,352 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0o400000;
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_arm_fadvise64_64: ::c_long = 270;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_arm_sync_file_range: ::c_long = 341;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
diff --git a/libc/src/unix/notbsd/android/b64/aarch64.rs b/libc/src/unix/notbsd/android/b64/aarch64.rs
index f08f4f1..44dfee6 100644
--- a/libc/src/unix/notbsd/android/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/android/b64/aarch64.rs
@@ -54,10 +54,272 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0o400000;
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 5120;
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
-
-pub const SIGSTKSZ: ::size_t = 16384;
-pub const MINSIGSTKSZ: ::size_t = 5120;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_syscalls: ::c_long = 291;
diff --git a/libc/src/unix/notbsd/android/mod.rs b/libc/src/unix/notbsd/android/mod.rs
index d386db9..17f6eda 100644
--- a/libc/src/unix/notbsd/android/mod.rs
+++ b/libc/src/unix/notbsd/android/mod.rs
@@ -84,6 +84,17 @@ s! {
pub c_cc: [::cc_t; ::NCCS],
}
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
@@ -168,6 +179,12 @@ s! {
pub ssi_addr_lsb: ::uint16_t,
_pad: [::uint8_t; 46],
}
+
+ pub struct ucred {
+ pub pid: ::pid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ }
}
pub const O_TRUNC: ::c_int = 512;
@@ -485,6 +502,8 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
pub const SOL_SOCKET: ::c_int = 1;
pub const SOL_SCTP: ::c_int = 132;
@@ -499,6 +518,27 @@ pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
@@ -644,6 +684,16 @@ pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NODEV: ::c_ulong = 4;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_MANDLOCK: ::c_ulong = 64;
+pub const ST_NOATIME: ::c_ulong = 1024;
+pub const ST_NODIRATIME: ::c_ulong = 2048;
+pub const ST_RELATIME: ::c_ulong = 4096;
+
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
@@ -734,6 +784,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -750,7 +801,17 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
pub const NETLINK_ROUTE: ::c_int = 0;
pub const NETLINK_UNUSED: ::c_int = 1;
@@ -807,6 +868,13 @@ pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
pub const NETLINK_RX_RING: ::c_int = 6;
pub const NETLINK_TX_RING: ::c_int = 7;
+pub const GRND_NONBLOCK: ::c_uint = 0x0001;
+pub const GRND_RANDOM: ::c_uint = 0x0002;
+
+pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
+pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
+pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
+
pub const NLA_F_NESTED: ::c_int = 1 << 15;
pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
@@ -841,6 +909,9 @@ pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.__bits.iter_mut() {
@@ -1009,6 +1080,8 @@ extern {
in_fd: ::c_int,
offset: *mut off_t,
count: ::size_t) -> ::ssize_t;
+ pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+ pub fn setfsuid(uid: ::uid_t) -> ::c_int;
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
pub fn getgrgid_r(uid: ::uid_t,
@@ -1065,6 +1138,7 @@ extern {
group: ::gid_t,
groups: *mut ::gid_t,
ngroups: *mut ::c_int) -> ::c_int;
+ pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
@@ -1077,6 +1151,7 @@ extern {
attr: *const ::pthread_attr_t,
f: extern fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void) -> ::c_int;
+ pub fn __errno() -> *mut ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/notbsd/linux/mips/mips32.rs b/libc/src/unix/notbsd/linux/mips/mips32.rs
index 0bfcc4f..8fad85b 100644
--- a/libc/src/unix/notbsd/linux/mips/mips32.rs
+++ b/libc/src/unix/notbsd/linux/mips/mips32.rs
@@ -269,8 +269,369 @@ pub const O_LARGEFILE: ::c_int = 0x2000;
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
-// Valid for O32
-pub const SYS_pivot_root: ::c_long = 4216;
-pub const SYS_gettid: ::c_long = 4222;
-pub const SYS_perf_event_open: ::c_long = 4333;
-pub const SYS_memfd_create: ::c_long = 4354;
+pub const SYS_syscall: ::c_long = 4000 + 0;
+pub const SYS_exit: ::c_long = 4000 + 1;
+pub const SYS_fork: ::c_long = 4000 + 2;
+pub const SYS_read: ::c_long = 4000 + 3;
+pub const SYS_write: ::c_long = 4000 + 4;
+pub const SYS_open: ::c_long = 4000 + 5;
+pub const SYS_close: ::c_long = 4000 + 6;
+pub const SYS_waitpid: ::c_long = 4000 + 7;
+pub const SYS_creat: ::c_long = 4000 + 8;
+pub const SYS_link: ::c_long = 4000 + 9;
+pub const SYS_unlink: ::c_long = 4000 + 10;
+pub const SYS_execve: ::c_long = 4000 + 11;
+pub const SYS_chdir: ::c_long = 4000 + 12;
+pub const SYS_time: ::c_long = 4000 + 13;
+pub const SYS_mknod: ::c_long = 4000 + 14;
+pub const SYS_chmod: ::c_long = 4000 + 15;
+pub const SYS_lchown: ::c_long = 4000 + 16;
+pub const SYS_break: ::c_long = 4000 + 17;
+pub const SYS_unused18: ::c_long = 4000 + 18;
+pub const SYS_lseek: ::c_long = 4000 + 19;
+pub const SYS_getpid: ::c_long = 4000 + 20;
+pub const SYS_mount: ::c_long = 4000 + 21;
+pub const SYS_umount: ::c_long = 4000 + 22;
+pub const SYS_setuid: ::c_long = 4000 + 23;
+pub const SYS_getuid: ::c_long = 4000 + 24;
+pub const SYS_stime: ::c_long = 4000 + 25;
+pub const SYS_ptrace: ::c_long = 4000 + 26;
+pub const SYS_alarm: ::c_long = 4000 + 27;
+pub const SYS_unused28: ::c_long = 4000 + 28;
+pub const SYS_pause: ::c_long = 4000 + 29;
+pub const SYS_utime: ::c_long = 4000 + 30;
+pub const SYS_stty: ::c_long = 4000 + 31;
+pub const SYS_gtty: ::c_long = 4000 + 32;
+pub const SYS_access: ::c_long = 4000 + 33;
+pub const SYS_nice: ::c_long = 4000 + 34;
+pub const SYS_ftime: ::c_long = 4000 + 35;
+pub const SYS_sync: ::c_long = 4000 + 36;
+pub const SYS_kill: ::c_long = 4000 + 37;
+pub const SYS_rename: ::c_long = 4000 + 38;
+pub const SYS_mkdir: ::c_long = 4000 + 39;
+pub const SYS_rmdir: ::c_long = 4000 + 40;
+pub const SYS_dup: ::c_long = 4000 + 41;
+pub const SYS_pipe: ::c_long = 4000 + 42;
+pub const SYS_times: ::c_long = 4000 + 43;
+pub const SYS_prof: ::c_long = 4000 + 44;
+pub const SYS_brk: ::c_long = 4000 + 45;
+pub const SYS_setgid: ::c_long = 4000 + 46;
+pub const SYS_getgid: ::c_long = 4000 + 47;
+pub const SYS_signal: ::c_long = 4000 + 48;
+pub const SYS_geteuid: ::c_long = 4000 + 49;
+pub const SYS_getegid: ::c_long = 4000 + 50;
+pub const SYS_acct: ::c_long = 4000 + 51;
+pub const SYS_umount2: ::c_long = 4000 + 52;
+pub const SYS_lock: ::c_long = 4000 + 53;
+pub const SYS_ioctl: ::c_long = 4000 + 54;
+pub const SYS_fcntl: ::c_long = 4000 + 55;
+pub const SYS_mpx: ::c_long = 4000 + 56;
+pub const SYS_setpgid: ::c_long = 4000 + 57;
+pub const SYS_ulimit: ::c_long = 4000 + 58;
+pub const SYS_unused59: ::c_long = 4000 + 59;
+pub const SYS_umask: ::c_long = 4000 + 60;
+pub const SYS_chroot: ::c_long = 4000 + 61;
+pub const SYS_ustat: ::c_long = 4000 + 62;
+pub const SYS_dup2: ::c_long = 4000 + 63;
+pub const SYS_getppid: ::c_long = 4000 + 64;
+pub const SYS_getpgrp: ::c_long = 4000 + 65;
+pub const SYS_setsid: ::c_long = 4000 + 66;
+pub const SYS_sigaction: ::c_long = 4000 + 67;
+pub const SYS_sgetmask: ::c_long = 4000 + 68;
+pub const SYS_ssetmask: ::c_long = 4000 + 69;
+pub const SYS_setreuid: ::c_long = 4000 + 70;
+pub const SYS_setregid: ::c_long = 4000 + 71;
+pub const SYS_sigsuspend: ::c_long = 4000 + 72;
+pub const SYS_sigpending: ::c_long = 4000 + 73;
+pub const SYS_sethostname: ::c_long = 4000 + 74;
+pub const SYS_setrlimit: ::c_long = 4000 + 75;
+pub const SYS_getrlimit: ::c_long = 4000 + 76;
+pub const SYS_getrusage: ::c_long = 4000 + 77;
+pub const SYS_gettimeofday: ::c_long = 4000 + 78;
+pub const SYS_settimeofday: ::c_long = 4000 + 79;
+pub const SYS_getgroups: ::c_long = 4000 + 80;
+pub const SYS_setgroups: ::c_long = 4000 + 81;
+pub const SYS_reserved82: ::c_long = 4000 + 82;
+pub const SYS_symlink: ::c_long = 4000 + 83;
+pub const SYS_unused84: ::c_long = 4000 + 84;
+pub const SYS_readlink: ::c_long = 4000 + 85;
+pub const SYS_uselib: ::c_long = 4000 + 86;
+pub const SYS_swapon: ::c_long = 4000 + 87;
+pub const SYS_reboot: ::c_long = 4000 + 88;
+pub const SYS_readdir: ::c_long = 4000 + 89;
+pub const SYS_mmap: ::c_long = 4000 + 90;
+pub const SYS_munmap: ::c_long = 4000 + 91;
+pub const SYS_truncate: ::c_long = 4000 + 92;
+pub const SYS_ftruncate: ::c_long = 4000 + 93;
+pub const SYS_fchmod: ::c_long = 4000 + 94;
+pub const SYS_fchown: ::c_long = 4000 + 95;
+pub const SYS_getpriority: ::c_long = 4000 + 96;
+pub const SYS_setpriority: ::c_long = 4000 + 97;
+pub const SYS_profil: ::c_long = 4000 + 98;
+pub const SYS_statfs: ::c_long = 4000 + 99;
+pub const SYS_fstatfs: ::c_long = 4000 + 100;
+pub const SYS_ioperm: ::c_long = 4000 + 101;
+pub const SYS_socketcall: ::c_long = 4000 + 102;
+pub const SYS_syslog: ::c_long = 4000 + 103;
+pub const SYS_setitimer: ::c_long = 4000 + 104;
+pub const SYS_getitimer: ::c_long = 4000 + 105;
+pub const SYS_stat: ::c_long = 4000 + 106;
+pub const SYS_lstat: ::c_long = 4000 + 107;
+pub const SYS_fstat: ::c_long = 4000 + 108;
+pub const SYS_unused109: ::c_long = 4000 + 109;
+pub const SYS_iopl: ::c_long = 4000 + 110;
+pub const SYS_vhangup: ::c_long = 4000 + 111;
+pub const SYS_idle: ::c_long = 4000 + 112;
+pub const SYS_vm86: ::c_long = 4000 + 113;
+pub const SYS_wait4: ::c_long = 4000 + 114;
+pub const SYS_swapoff: ::c_long = 4000 + 115;
+pub const SYS_sysinfo: ::c_long = 4000 + 116;
+pub const SYS_ipc: ::c_long = 4000 + 117;
+pub const SYS_fsync: ::c_long = 4000 + 118;
+pub const SYS_sigreturn: ::c_long = 4000 + 119;
+pub const SYS_clone: ::c_long = 4000 + 120;
+pub const SYS_setdomainname: ::c_long = 4000 + 121;
+pub const SYS_uname: ::c_long = 4000 + 122;
+pub const SYS_modify_ldt: ::c_long = 4000 + 123;
+pub const SYS_adjtimex: ::c_long = 4000 + 124;
+pub const SYS_mprotect: ::c_long = 4000 + 125;
+pub const SYS_sigprocmask: ::c_long = 4000 + 126;
+pub const SYS_create_module: ::c_long = 4000 + 127;
+pub const SYS_init_module: ::c_long = 4000 + 128;
+pub const SYS_delete_module: ::c_long = 4000 + 129;
+pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
+pub const SYS_quotactl: ::c_long = 4000 + 131;
+pub const SYS_getpgid: ::c_long = 4000 + 132;
+pub const SYS_fchdir: ::c_long = 4000 + 133;
+pub const SYS_bdflush: ::c_long = 4000 + 134;
+pub const SYS_sysfs: ::c_long = 4000 + 135;
+pub const SYS_personality: ::c_long = 4000 + 136;
+pub const SYS_afs_syscall: ::c_long = 4000 + 137;
+pub const SYS_setfsuid: ::c_long = 4000 + 138;
+pub const SYS_setfsgid: ::c_long = 4000 + 139;
+pub const SYS__llseek: ::c_long = 4000 + 140;
+pub const SYS_getdents: ::c_long = 4000 + 141;
+pub const SYS__newselect: ::c_long = 4000 + 142;
+pub const SYS_flock: ::c_long = 4000 + 143;
+pub const SYS_msync: ::c_long = 4000 + 144;
+pub const SYS_readv: ::c_long = 4000 + 145;
+pub const SYS_writev: ::c_long = 4000 + 146;
+pub const SYS_cacheflush: ::c_long = 4000 + 147;
+pub const SYS_cachectl: ::c_long = 4000 + 148;
+pub const SYS_sysmips: ::c_long = 4000 + 149;
+pub const SYS_unused150: ::c_long = 4000 + 150;
+pub const SYS_getsid: ::c_long = 4000 + 151;
+pub const SYS_fdatasync: ::c_long = 4000 + 152;
+pub const SYS__sysctl: ::c_long = 4000 + 153;
+pub const SYS_mlock: ::c_long = 4000 + 154;
+pub const SYS_munlock: ::c_long = 4000 + 155;
+pub const SYS_mlockall: ::c_long = 4000 + 156;
+pub const SYS_munlockall: ::c_long = 4000 + 157;
+pub const SYS_sched_setparam: ::c_long = 4000 + 158;
+pub const SYS_sched_getparam: ::c_long = 4000 + 159;
+pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
+pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
+pub const SYS_sched_yield: ::c_long = 4000 + 162;
+pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
+pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
+pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
+pub const SYS_nanosleep: ::c_long = 4000 + 166;
+pub const SYS_mremap: ::c_long = 4000 + 167;
+pub const SYS_accept: ::c_long = 4000 + 168;
+pub const SYS_bind: ::c_long = 4000 + 169;
+pub const SYS_connect: ::c_long = 4000 + 170;
+pub const SYS_getpeername: ::c_long = 4000 + 171;
+pub const SYS_getsockname: ::c_long = 4000 + 172;
+pub const SYS_getsockopt: ::c_long = 4000 + 173;
+pub const SYS_listen: ::c_long = 4000 + 174;
+pub const SYS_recv: ::c_long = 4000 + 175;
+pub const SYS_recvfrom: ::c_long = 4000 + 176;
+pub const SYS_recvmsg: ::c_long = 4000 + 177;
+pub const SYS_send: ::c_long = 4000 + 178;
+pub const SYS_sendmsg: ::c_long = 4000 + 179;
+pub const SYS_sendto: ::c_long = 4000 + 180;
+pub const SYS_setsockopt: ::c_long = 4000 + 181;
+pub const SYS_shutdown: ::c_long = 4000 + 182;
+pub const SYS_socket: ::c_long = 4000 + 183;
+pub const SYS_socketpair: ::c_long = 4000 + 184;
+pub const SYS_setresuid: ::c_long = 4000 + 185;
+pub const SYS_getresuid: ::c_long = 4000 + 186;
+pub const SYS_query_module: ::c_long = 4000 + 187;
+pub const SYS_poll: ::c_long = 4000 + 188;
+pub const SYS_nfsservctl: ::c_long = 4000 + 189;
+pub const SYS_setresgid: ::c_long = 4000 + 190;
+pub const SYS_getresgid: ::c_long = 4000 + 191;
+pub const SYS_prctl: ::c_long = 4000 + 192;
+pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
+pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
+pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
+pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
+pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
+pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
+pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
+pub const SYS_pread64: ::c_long = 4000 + 200;
+pub const SYS_pwrite64: ::c_long = 4000 + 201;
+pub const SYS_chown: ::c_long = 4000 + 202;
+pub const SYS_getcwd: ::c_long = 4000 + 203;
+pub const SYS_capget: ::c_long = 4000 + 204;
+pub const SYS_capset: ::c_long = 4000 + 205;
+pub const SYS_sigaltstack: ::c_long = 4000 + 206;
+pub const SYS_sendfile: ::c_long = 4000 + 207;
+pub const SYS_getpmsg: ::c_long = 4000 + 208;
+pub const SYS_putpmsg: ::c_long = 4000 + 209;
+pub const SYS_mmap2: ::c_long = 4000 + 210;
+pub const SYS_truncate64: ::c_long = 4000 + 211;
+pub const SYS_ftruncate64: ::c_long = 4000 + 212;
+pub const SYS_stat64: ::c_long = 4000 + 213;
+pub const SYS_lstat64: ::c_long = 4000 + 214;
+pub const SYS_fstat64: ::c_long = 4000 + 215;
+pub const SYS_pivot_root: ::c_long = 4000 + 216;
+pub const SYS_mincore: ::c_long = 4000 + 217;
+pub const SYS_madvise: ::c_long = 4000 + 218;
+pub const SYS_getdents64: ::c_long = 4000 + 219;
+pub const SYS_fcntl64: ::c_long = 4000 + 220;
+pub const SYS_reserved221: ::c_long = 4000 + 221;
+pub const SYS_gettid: ::c_long = 4000 + 222;
+pub const SYS_readahead: ::c_long = 4000 + 223;
+pub const SYS_setxattr: ::c_long = 4000 + 224;
+pub const SYS_lsetxattr: ::c_long = 4000 + 225;
+pub const SYS_fsetxattr: ::c_long = 4000 + 226;
+pub const SYS_getxattr: ::c_long = 4000 + 227;
+pub const SYS_lgetxattr: ::c_long = 4000 + 228;
+pub const SYS_fgetxattr: ::c_long = 4000 + 229;
+pub const SYS_listxattr: ::c_long = 4000 + 230;
+pub const SYS_llistxattr: ::c_long = 4000 + 231;
+pub const SYS_flistxattr: ::c_long = 4000 + 232;
+pub const SYS_removexattr: ::c_long = 4000 + 233;
+pub const SYS_lremovexattr: ::c_long = 4000 + 234;
+pub const SYS_fremovexattr: ::c_long = 4000 + 235;
+pub const SYS_tkill: ::c_long = 4000 + 236;
+pub const SYS_sendfile64: ::c_long = 4000 + 237;
+pub const SYS_futex: ::c_long = 4000 + 238;
+pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
+pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
+pub const SYS_io_setup: ::c_long = 4000 + 241;
+pub const SYS_io_destroy: ::c_long = 4000 + 242;
+pub const SYS_io_getevents: ::c_long = 4000 + 243;
+pub const SYS_io_submit: ::c_long = 4000 + 244;
+pub const SYS_io_cancel: ::c_long = 4000 + 245;
+pub const SYS_exit_group: ::c_long = 4000 + 246;
+pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
+pub const SYS_epoll_create: ::c_long = 4000 + 248;
+pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
+pub const SYS_epoll_wait: ::c_long = 4000 + 250;
+pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
+pub const SYS_set_tid_address: ::c_long = 4000 + 252;
+pub const SYS_restart_syscall: ::c_long = 4000 + 253;
+pub const SYS_fadvise64: ::c_long = 4000 + 254;
+pub const SYS_statfs64: ::c_long = 4000 + 255;
+pub const SYS_fstatfs64: ::c_long = 4000 + 256;
+pub const SYS_timer_create: ::c_long = 4000 + 257;
+pub const SYS_timer_settime: ::c_long = 4000 + 258;
+pub const SYS_timer_gettime: ::c_long = 4000 + 259;
+pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
+pub const SYS_timer_delete: ::c_long = 4000 + 261;
+pub const SYS_clock_settime: ::c_long = 4000 + 262;
+pub const SYS_clock_gettime: ::c_long = 4000 + 263;
+pub const SYS_clock_getres: ::c_long = 4000 + 264;
+pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
+pub const SYS_tgkill: ::c_long = 4000 + 266;
+pub const SYS_utimes: ::c_long = 4000 + 267;
+pub const SYS_mbind: ::c_long = 4000 + 268;
+pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
+pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
+pub const SYS_mq_open: ::c_long = 4000 + 271;
+pub const SYS_mq_unlink: ::c_long = 4000 + 272;
+pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
+pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
+pub const SYS_mq_notify: ::c_long = 4000 + 275;
+pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
+pub const SYS_vserver: ::c_long = 4000 + 277;
+pub const SYS_waitid: ::c_long = 4000 + 278;
+/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
+pub const SYS_add_key: ::c_long = 4000 + 280;
+pub const SYS_request_key: ::c_long = 4000 + 281;
+pub const SYS_keyctl: ::c_long = 4000 + 282;
+pub const SYS_set_thread_area: ::c_long = 4000 + 283;
+pub const SYS_inotify_init: ::c_long = 4000 + 284;
+pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
+pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
+pub const SYS_migrate_pages: ::c_long = 4000 + 287;
+pub const SYS_openat: ::c_long = 4000 + 288;
+pub const SYS_mkdirat: ::c_long = 4000 + 289;
+pub const SYS_mknodat: ::c_long = 4000 + 290;
+pub const SYS_fchownat: ::c_long = 4000 + 291;
+pub const SYS_futimesat: ::c_long = 4000 + 292;
+pub const SYS_fstatat64: ::c_long = 4000 + 293;
+pub const SYS_unlinkat: ::c_long = 4000 + 294;
+pub const SYS_renameat: ::c_long = 4000 + 295;
+pub const SYS_linkat: ::c_long = 4000 + 296;
+pub const SYS_symlinkat: ::c_long = 4000 + 297;
+pub const SYS_readlinkat: ::c_long = 4000 + 298;
+pub const SYS_fchmodat: ::c_long = 4000 + 299;
+pub const SYS_faccessat: ::c_long = 4000 + 300;
+pub const SYS_pselect6: ::c_long = 4000 + 301;
+pub const SYS_ppoll: ::c_long = 4000 + 302;
+pub const SYS_unshare: ::c_long = 4000 + 303;
+pub const SYS_splice: ::c_long = 4000 + 304;
+pub const SYS_sync_file_range: ::c_long = 4000 + 305;
+pub const SYS_tee: ::c_long = 4000 + 306;
+pub const SYS_vmsplice: ::c_long = 4000 + 307;
+pub const SYS_move_pages: ::c_long = 4000 + 308;
+pub const SYS_set_robust_list: ::c_long = 4000 + 309;
+pub const SYS_get_robust_list: ::c_long = 4000 + 310;
+pub const SYS_kexec_load: ::c_long = 4000 + 311;
+pub const SYS_getcpu: ::c_long = 4000 + 312;
+pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
+pub const SYS_ioprio_set: ::c_long = 4000 + 314;
+pub const SYS_ioprio_get: ::c_long = 4000 + 315;
+pub const SYS_utimensat: ::c_long = 4000 + 316;
+pub const SYS_signalfd: ::c_long = 4000 + 317;
+pub const SYS_timerfd: ::c_long = 4000 + 318;
+pub const SYS_eventfd: ::c_long = 4000 + 319;
+pub const SYS_fallocate: ::c_long = 4000 + 320;
+pub const SYS_timerfd_create: ::c_long = 4000 + 321;
+pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
+pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
+pub const SYS_signalfd4: ::c_long = 4000 + 324;
+pub const SYS_eventfd2: ::c_long = 4000 + 325;
+pub const SYS_epoll_create1: ::c_long = 4000 + 326;
+pub const SYS_dup3: ::c_long = 4000 + 327;
+pub const SYS_pipe2: ::c_long = 4000 + 328;
+pub const SYS_inotify_init1: ::c_long = 4000 + 329;
+pub const SYS_preadv: ::c_long = 4000 + 330;
+pub const SYS_pwritev: ::c_long = 4000 + 331;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
+pub const SYS_perf_event_open: ::c_long = 4000 + 333;
+pub const SYS_accept4: ::c_long = 4000 + 334;
+pub const SYS_recvmmsg: ::c_long = 4000 + 335;
+pub const SYS_fanotify_init: ::c_long = 4000 + 336;
+pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
+pub const SYS_prlimit64: ::c_long = 4000 + 338;
+pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
+pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
+pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
+pub const SYS_syncfs: ::c_long = 4000 + 342;
+pub const SYS_sendmmsg: ::c_long = 4000 + 343;
+pub const SYS_setns: ::c_long = 4000 + 344;
+pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
+pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
+pub const SYS_kcmp: ::c_long = 4000 + 347;
+pub const SYS_finit_module: ::c_long = 4000 + 348;
+pub const SYS_sched_setattr: ::c_long = 4000 + 349;
+pub const SYS_sched_getattr: ::c_long = 4000 + 350;
+pub const SYS_renameat2: ::c_long = 4000 + 351;
+pub const SYS_seccomp: ::c_long = 4000 + 352;
+pub const SYS_getrandom: ::c_long = 4000 + 353;
+pub const SYS_memfd_create: ::c_long = 4000 + 354;
+pub const SYS_bpf: ::c_long = 4000 + 355;
+pub const SYS_execveat: ::c_long = 4000 + 356;
+pub const SYS_userfaultfd: ::c_long = 4000 + 357;
+pub const SYS_membarrier: ::c_long = 4000 + 358;
+pub const SYS_mlock2: ::c_long = 4000 + 359;
+pub const SYS_copy_file_range: ::c_long = 4000 + 360;
+pub const SYS_preadv2: ::c_long = 4000 + 361;
+pub const SYS_pwritev2: ::c_long = 4000 + 362;
+pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
+pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
+pub const SYS_pkey_free: ::c_long = 4000 + 365;
diff --git a/libc/src/unix/notbsd/linux/mips/mips64.rs b/libc/src/unix/notbsd/linux/mips/mips64.rs
index 2de7535..45b3df8 100644
--- a/libc/src/unix/notbsd/linux/mips/mips64.rs
+++ b/libc/src/unix/notbsd/linux/mips/mips64.rs
@@ -251,7 +251,329 @@ pub const O_LARGEFILE: ::c_int = 0;
pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
-// Valid for n64
-pub const SYS_pivot_root: ::c_long = 5151;
-pub const SYS_gettid: ::c_long = 5178;
-pub const SYS_memfd_create: ::c_long = 5314;
+pub const SYS_read: ::c_long = 5000 + 0;
+pub const SYS_write: ::c_long = 5000 + 1;
+pub const SYS_open: ::c_long = 5000 + 2;
+pub const SYS_close: ::c_long = 5000 + 3;
+pub const SYS_stat: ::c_long = 5000 + 4;
+pub const SYS_fstat: ::c_long = 5000 + 5;
+pub const SYS_lstat: ::c_long = 5000 + 6;
+pub const SYS_poll: ::c_long = 5000 + 7;
+pub const SYS_lseek: ::c_long = 5000 + 8;
+pub const SYS_mmap: ::c_long = 5000 + 9;
+pub const SYS_mprotect: ::c_long = 5000 + 10;
+pub const SYS_munmap: ::c_long = 5000 + 11;
+pub const SYS_brk: ::c_long = 5000 + 12;
+pub const SYS_rt_sigaction: ::c_long = 5000 + 13;
+pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14;
+pub const SYS_ioctl: ::c_long = 5000 + 15;
+pub const SYS_pread64: ::c_long = 5000 + 16;
+pub const SYS_pwrite64: ::c_long = 5000 + 17;
+pub const SYS_readv: ::c_long = 5000 + 18;
+pub const SYS_writev: ::c_long = 5000 + 19;
+pub const SYS_access: ::c_long = 5000 + 20;
+pub const SYS_pipe: ::c_long = 5000 + 21;
+pub const SYS__newselect: ::c_long = 5000 + 22;
+pub const SYS_sched_yield: ::c_long = 5000 + 23;
+pub const SYS_mremap: ::c_long = 5000 + 24;
+pub const SYS_msync: ::c_long = 5000 + 25;
+pub const SYS_mincore: ::c_long = 5000 + 26;
+pub const SYS_madvise: ::c_long = 5000 + 27;
+pub const SYS_shmget: ::c_long = 5000 + 28;
+pub const SYS_shmat: ::c_long = 5000 + 29;
+pub const SYS_shmctl: ::c_long = 5000 + 30;
+pub const SYS_dup: ::c_long = 5000 + 31;
+pub const SYS_dup2: ::c_long = 5000 + 32;
+pub const SYS_pause: ::c_long = 5000 + 33;
+pub const SYS_nanosleep: ::c_long = 5000 + 34;
+pub const SYS_getitimer: ::c_long = 5000 + 35;
+pub const SYS_setitimer: ::c_long = 5000 + 36;
+pub const SYS_alarm: ::c_long = 5000 + 37;
+pub const SYS_getpid: ::c_long = 5000 + 38;
+pub const SYS_sendfile: ::c_long = 5000 + 39;
+pub const SYS_socket: ::c_long = 5000 + 40;
+pub const SYS_connect: ::c_long = 5000 + 41;
+pub const SYS_accept: ::c_long = 5000 + 42;
+pub const SYS_sendto: ::c_long = 5000 + 43;
+pub const SYS_recvfrom: ::c_long = 5000 + 44;
+pub const SYS_sendmsg: ::c_long = 5000 + 45;
+pub const SYS_recvmsg: ::c_long = 5000 + 46;
+pub const SYS_shutdown: ::c_long = 5000 + 47;
+pub const SYS_bind: ::c_long = 5000 + 48;
+pub const SYS_listen: ::c_long = 5000 + 49;
+pub const SYS_getsockname: ::c_long = 5000 + 50;
+pub const SYS_getpeername: ::c_long = 5000 + 51;
+pub const SYS_socketpair: ::c_long = 5000 + 52;
+pub const SYS_setsockopt: ::c_long = 5000 + 53;
+pub const SYS_getsockopt: ::c_long = 5000 + 54;
+pub const SYS_clone: ::c_long = 5000 + 55;
+pub const SYS_fork: ::c_long = 5000 + 56;
+pub const SYS_execve: ::c_long = 5000 + 57;
+pub const SYS_exit: ::c_long = 5000 + 58;
+pub const SYS_wait4: ::c_long = 5000 + 59;
+pub const SYS_kill: ::c_long = 5000 + 60;
+pub const SYS_uname: ::c_long = 5000 + 61;
+pub const SYS_semget: ::c_long = 5000 + 62;
+pub const SYS_semop: ::c_long = 5000 + 63;
+pub const SYS_semctl: ::c_long = 5000 + 64;
+pub const SYS_shmdt: ::c_long = 5000 + 65;
+pub const SYS_msgget: ::c_long = 5000 + 66;
+pub const SYS_msgsnd: ::c_long = 5000 + 67;
+pub const SYS_msgrcv: ::c_long = 5000 + 68;
+pub const SYS_msgctl: ::c_long = 5000 + 69;
+pub const SYS_fcntl: ::c_long = 5000 + 70;
+pub const SYS_flock: ::c_long = 5000 + 71;
+pub const SYS_fsync: ::c_long = 5000 + 72;
+pub const SYS_fdatasync: ::c_long = 5000 + 73;
+pub const SYS_truncate: ::c_long = 5000 + 74;
+pub const SYS_ftruncate: ::c_long = 5000 + 75;
+pub const SYS_getdents: ::c_long = 5000 + 76;
+pub const SYS_getcwd: ::c_long = 5000 + 77;
+pub const SYS_chdir: ::c_long = 5000 + 78;
+pub const SYS_fchdir: ::c_long = 5000 + 79;
+pub const SYS_rename: ::c_long = 5000 + 80;
+pub const SYS_mkdir: ::c_long = 5000 + 81;
+pub const SYS_rmdir: ::c_long = 5000 + 82;
+pub const SYS_creat: ::c_long = 5000 + 83;
+pub const SYS_link: ::c_long = 5000 + 84;
+pub const SYS_unlink: ::c_long = 5000 + 85;
+pub const SYS_symlink: ::c_long = 5000 + 86;
+pub const SYS_readlink: ::c_long = 5000 + 87;
+pub const SYS_chmod: ::c_long = 5000 + 88;
+pub const SYS_fchmod: ::c_long = 5000 + 89;
+pub const SYS_chown: ::c_long = 5000 + 90;
+pub const SYS_fchown: ::c_long = 5000 + 91;
+pub const SYS_lchown: ::c_long = 5000 + 92;
+pub const SYS_umask: ::c_long = 5000 + 93;
+pub const SYS_gettimeofday: ::c_long = 5000 + 94;
+pub const SYS_getrlimit: ::c_long = 5000 + 95;
+pub const SYS_getrusage: ::c_long = 5000 + 96;
+pub const SYS_sysinfo: ::c_long = 5000 + 97;
+pub const SYS_times: ::c_long = 5000 + 98;
+pub const SYS_ptrace: ::c_long = 5000 + 99;
+pub const SYS_getuid: ::c_long = 5000 + 100;
+pub const SYS_syslog: ::c_long = 5000 + 101;
+pub const SYS_getgid: ::c_long = 5000 + 102;
+pub const SYS_setuid: ::c_long = 5000 + 103;
+pub const SYS_setgid: ::c_long = 5000 + 104;
+pub const SYS_geteuid: ::c_long = 5000 + 105;
+pub const SYS_getegid: ::c_long = 5000 + 106;
+pub const SYS_setpgid: ::c_long = 5000 + 107;
+pub const SYS_getppid: ::c_long = 5000 + 108;
+pub const SYS_getpgrp: ::c_long = 5000 + 109;
+pub const SYS_setsid: ::c_long = 5000 + 110;
+pub const SYS_setreuid: ::c_long = 5000 + 111;
+pub const SYS_setregid: ::c_long = 5000 + 112;
+pub const SYS_getgroups: ::c_long = 5000 + 113;
+pub const SYS_setgroups: ::c_long = 5000 + 114;
+pub const SYS_setresuid: ::c_long = 5000 + 115;
+pub const SYS_getresuid: ::c_long = 5000 + 116;
+pub const SYS_setresgid: ::c_long = 5000 + 117;
+pub const SYS_getresgid: ::c_long = 5000 + 118;
+pub const SYS_getpgid: ::c_long = 5000 + 119;
+pub const SYS_setfsuid: ::c_long = 5000 + 120;
+pub const SYS_setfsgid: ::c_long = 5000 + 121;
+pub const SYS_getsid: ::c_long = 5000 + 122;
+pub const SYS_capget: ::c_long = 5000 + 123;
+pub const SYS_capset: ::c_long = 5000 + 124;
+pub const SYS_rt_sigpending: ::c_long = 5000 + 125;
+pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126;
+pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127;
+pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128;
+pub const SYS_sigaltstack: ::c_long = 5000 + 129;
+pub const SYS_utime: ::c_long = 5000 + 130;
+pub const SYS_mknod: ::c_long = 5000 + 131;
+pub const SYS_personality: ::c_long = 5000 + 132;
+pub const SYS_ustat: ::c_long = 5000 + 133;
+pub const SYS_statfs: ::c_long = 5000 + 134;
+pub const SYS_fstatfs: ::c_long = 5000 + 135;
+pub const SYS_sysfs: ::c_long = 5000 + 136;
+pub const SYS_getpriority: ::c_long = 5000 + 137;
+pub const SYS_setpriority: ::c_long = 5000 + 138;
+pub const SYS_sched_setparam: ::c_long = 5000 + 139;
+pub const SYS_sched_getparam: ::c_long = 5000 + 140;
+pub const SYS_sched_setscheduler: ::c_long = 5000 + 141;
+pub const SYS_sched_getscheduler: ::c_long = 5000 + 142;
+pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143;
+pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144;
+pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145;
+pub const SYS_mlock: ::c_long = 5000 + 146;
+pub const SYS_munlock: ::c_long = 5000 + 147;
+pub const SYS_mlockall: ::c_long = 5000 + 148;
+pub const SYS_munlockall: ::c_long = 5000 + 149;
+pub const SYS_vhangup: ::c_long = 5000 + 150;
+pub const SYS_pivot_root: ::c_long = 5000 + 151;
+pub const SYS__sysctl: ::c_long = 5000 + 152;
+pub const SYS_prctl: ::c_long = 5000 + 153;
+pub const SYS_adjtimex: ::c_long = 5000 + 154;
+pub const SYS_setrlimit: ::c_long = 5000 + 155;
+pub const SYS_chroot: ::c_long = 5000 + 156;
+pub const SYS_sync: ::c_long = 5000 + 157;
+pub const SYS_acct: ::c_long = 5000 + 158;
+pub const SYS_settimeofday: ::c_long = 5000 + 159;
+pub const SYS_mount: ::c_long = 5000 + 160;
+pub const SYS_umount2: ::c_long = 5000 + 161;
+pub const SYS_swapon: ::c_long = 5000 + 162;
+pub const SYS_swapoff: ::c_long = 5000 + 163;
+pub const SYS_reboot: ::c_long = 5000 + 164;
+pub const SYS_sethostname: ::c_long = 5000 + 165;
+pub const SYS_setdomainname: ::c_long = 5000 + 166;
+pub const SYS_create_module: ::c_long = 5000 + 167;
+pub const SYS_init_module: ::c_long = 5000 + 168;
+pub const SYS_delete_module: ::c_long = 5000 + 169;
+pub const SYS_get_kernel_syms: ::c_long = 5000 + 170;
+pub const SYS_query_module: ::c_long = 5000 + 171;
+pub const SYS_quotactl: ::c_long = 5000 + 172;
+pub const SYS_nfsservctl: ::c_long = 5000 + 173;
+pub const SYS_getpmsg: ::c_long = 5000 + 174;
+pub const SYS_putpmsg: ::c_long = 5000 + 175;
+pub const SYS_afs_syscall: ::c_long = 5000 + 176;
+pub const SYS_reserved177: ::c_long = 5000 + 177;
+pub const SYS_gettid: ::c_long = 5000 + 178;
+pub const SYS_readahead: ::c_long = 5000 + 179;
+pub const SYS_setxattr: ::c_long = 5000 + 180;
+pub const SYS_lsetxattr: ::c_long = 5000 + 181;
+pub const SYS_fsetxattr: ::c_long = 5000 + 182;
+pub const SYS_getxattr: ::c_long = 5000 + 183;
+pub const SYS_lgetxattr: ::c_long = 5000 + 184;
+pub const SYS_fgetxattr: ::c_long = 5000 + 185;
+pub const SYS_listxattr: ::c_long = 5000 + 186;
+pub const SYS_llistxattr: ::c_long = 5000 + 187;
+pub const SYS_flistxattr: ::c_long = 5000 + 188;
+pub const SYS_removexattr: ::c_long = 5000 + 189;
+pub const SYS_lremovexattr: ::c_long = 5000 + 190;
+pub const SYS_fremovexattr: ::c_long = 5000 + 191;
+pub const SYS_tkill: ::c_long = 5000 + 192;
+pub const SYS_reserved193: ::c_long = 5000 + 193;
+pub const SYS_futex: ::c_long = 5000 + 194;
+pub const SYS_sched_setaffinity: ::c_long = 5000 + 195;
+pub const SYS_sched_getaffinity: ::c_long = 5000 + 196;
+pub const SYS_cacheflush: ::c_long = 5000 + 197;
+pub const SYS_cachectl: ::c_long = 5000 + 198;
+pub const SYS_sysmips: ::c_long = 5000 + 199;
+pub const SYS_io_setup: ::c_long = 5000 + 200;
+pub const SYS_io_destroy: ::c_long = 5000 + 201;
+pub const SYS_io_getevents: ::c_long = 5000 + 202;
+pub const SYS_io_submit: ::c_long = 5000 + 203;
+pub const SYS_io_cancel: ::c_long = 5000 + 204;
+pub const SYS_exit_group: ::c_long = 5000 + 205;
+pub const SYS_lookup_dcookie: ::c_long = 5000 + 206;
+pub const SYS_epoll_create: ::c_long = 5000 + 207;
+pub const SYS_epoll_ctl: ::c_long = 5000 + 208;
+pub const SYS_epoll_wait: ::c_long = 5000 + 209;
+pub const SYS_remap_file_pages: ::c_long = 5000 + 210;
+pub const SYS_rt_sigreturn: ::c_long = 5000 + 211;
+pub const SYS_set_tid_address: ::c_long = 5000 + 212;
+pub const SYS_restart_syscall: ::c_long = 5000 + 213;
+pub const SYS_semtimedop: ::c_long = 5000 + 214;
+pub const SYS_fadvise64: ::c_long = 5000 + 215;
+pub const SYS_timer_create: ::c_long = 5000 + 216;
+pub const SYS_timer_settime: ::c_long = 5000 + 217;
+pub const SYS_timer_gettime: ::c_long = 5000 + 218;
+pub const SYS_timer_getoverrun: ::c_long = 5000 + 219;
+pub const SYS_timer_delete: ::c_long = 5000 + 220;
+pub const SYS_clock_settime: ::c_long = 5000 + 221;
+pub const SYS_clock_gettime: ::c_long = 5000 + 222;
+pub const SYS_clock_getres: ::c_long = 5000 + 223;
+pub const SYS_clock_nanosleep: ::c_long = 5000 + 224;
+pub const SYS_tgkill: ::c_long = 5000 + 225;
+pub const SYS_utimes: ::c_long = 5000 + 226;
+pub const SYS_mbind: ::c_long = 5000 + 227;
+pub const SYS_get_mempolicy: ::c_long = 5000 + 228;
+pub const SYS_set_mempolicy: ::c_long = 5000 + 229;
+pub const SYS_mq_open: ::c_long = 5000 + 230;
+pub const SYS_mq_unlink: ::c_long = 5000 + 231;
+pub const SYS_mq_timedsend: ::c_long = 5000 + 232;
+pub const SYS_mq_timedreceive: ::c_long = 5000 + 233;
+pub const SYS_mq_notify: ::c_long = 5000 + 234;
+pub const SYS_mq_getsetattr: ::c_long = 5000 + 235;
+pub const SYS_vserver: ::c_long = 5000 + 236;
+pub const SYS_waitid: ::c_long = 5000 + 237;
+/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */
+pub const SYS_add_key: ::c_long = 5000 + 239;
+pub const SYS_request_key: ::c_long = 5000 + 240;
+pub const SYS_keyctl: ::c_long = 5000 + 241;
+pub const SYS_set_thread_area: ::c_long = 5000 + 242;
+pub const SYS_inotify_init: ::c_long = 5000 + 243;
+pub const SYS_inotify_add_watch: ::c_long = 5000 + 244;
+pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245;
+pub const SYS_migrate_pages: ::c_long = 5000 + 246;
+pub const SYS_openat: ::c_long = 5000 + 247;
+pub const SYS_mkdirat: ::c_long = 5000 + 248;
+pub const SYS_mknodat: ::c_long = 5000 + 249;
+pub const SYS_fchownat: ::c_long = 5000 + 250;
+pub const SYS_futimesat: ::c_long = 5000 + 251;
+pub const SYS_newfstatat: ::c_long = 5000 + 252;
+pub const SYS_unlinkat: ::c_long = 5000 + 253;
+pub const SYS_renameat: ::c_long = 5000 + 254;
+pub const SYS_linkat: ::c_long = 5000 + 255;
+pub const SYS_symlinkat: ::c_long = 5000 + 256;
+pub const SYS_readlinkat: ::c_long = 5000 + 257;
+pub const SYS_fchmodat: ::c_long = 5000 + 258;
+pub const SYS_faccessat: ::c_long = 5000 + 259;
+pub const SYS_pselect6: ::c_long = 5000 + 260;
+pub const SYS_ppoll: ::c_long = 5000 + 261;
+pub const SYS_unshare: ::c_long = 5000 + 262;
+pub const SYS_splice: ::c_long = 5000 + 263;
+pub const SYS_sync_file_range: ::c_long = 5000 + 264;
+pub const SYS_tee: ::c_long = 5000 + 265;
+pub const SYS_vmsplice: ::c_long = 5000 + 266;
+pub const SYS_move_pages: ::c_long = 5000 + 267;
+pub const SYS_set_robust_list: ::c_long = 5000 + 268;
+pub const SYS_get_robust_list: ::c_long = 5000 + 269;
+pub const SYS_kexec_load: ::c_long = 5000 + 270;
+pub const SYS_getcpu: ::c_long = 5000 + 271;
+pub const SYS_epoll_pwait: ::c_long = 5000 + 272;
+pub const SYS_ioprio_set: ::c_long = 5000 + 273;
+pub const SYS_ioprio_get: ::c_long = 5000 + 274;
+pub const SYS_utimensat: ::c_long = 5000 + 275;
+pub const SYS_signalfd: ::c_long = 5000 + 276;
+pub const SYS_timerfd: ::c_long = 5000 + 277;
+pub const SYS_eventfd: ::c_long = 5000 + 278;
+pub const SYS_fallocate: ::c_long = 5000 + 279;
+pub const SYS_timerfd_create: ::c_long = 5000 + 280;
+pub const SYS_timerfd_gettime: ::c_long = 5000 + 281;
+pub const SYS_timerfd_settime: ::c_long = 5000 + 282;
+pub const SYS_signalfd4: ::c_long = 5000 + 283;
+pub const SYS_eventfd2: ::c_long = 5000 + 284;
+pub const SYS_epoll_create1: ::c_long = 5000 + 285;
+pub const SYS_dup3: ::c_long = 5000 + 286;
+pub const SYS_pipe2: ::c_long = 5000 + 287;
+pub const SYS_inotify_init1: ::c_long = 5000 + 288;
+pub const SYS_preadv: ::c_long = 5000 + 289;
+pub const SYS_pwritev: ::c_long = 5000 + 290;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291;
+pub const SYS_perf_event_open: ::c_long = 5000 + 292;
+pub const SYS_accept4: ::c_long = 5000 + 293;
+pub const SYS_recvmmsg: ::c_long = 5000 + 294;
+pub const SYS_fanotify_init: ::c_long = 5000 + 295;
+pub const SYS_fanotify_mark: ::c_long = 5000 + 296;
+pub const SYS_prlimit64: ::c_long = 5000 + 297;
+pub const SYS_name_to_handle_at: ::c_long = 5000 + 298;
+pub const SYS_open_by_handle_at: ::c_long = 5000 + 299;
+pub const SYS_clock_adjtime: ::c_long = 5000 + 300;
+pub const SYS_syncfs: ::c_long = 5000 + 301;
+pub const SYS_sendmmsg: ::c_long = 5000 + 302;
+pub const SYS_setns: ::c_long = 5000 + 303;
+pub const SYS_process_vm_readv: ::c_long = 5000 + 304;
+pub const SYS_process_vm_writev: ::c_long = 5000 + 305;
+pub const SYS_kcmp: ::c_long = 5000 + 306;
+pub const SYS_finit_module: ::c_long = 5000 + 307;
+pub const SYS_getdents64: ::c_long = 5000 + 308;
+pub const SYS_sched_setattr: ::c_long = 5000 + 309;
+pub const SYS_sched_getattr: ::c_long = 5000 + 310;
+pub const SYS_renameat2: ::c_long = 5000 + 311;
+pub const SYS_seccomp: ::c_long = 5000 + 312;
+pub const SYS_getrandom: ::c_long = 5000 + 313;
+pub const SYS_memfd_create: ::c_long = 5000 + 314;
+pub const SYS_bpf: ::c_long = 5000 + 315;
+pub const SYS_execveat: ::c_long = 5000 + 316;
+pub const SYS_userfaultfd: ::c_long = 5000 + 317;
+pub const SYS_membarrier: ::c_long = 5000 + 318;
+pub const SYS_mlock2: ::c_long = 5000 + 319;
+pub const SYS_copy_file_range: ::c_long = 5000 + 320;
+pub const SYS_preadv2: ::c_long = 5000 + 321;
+pub const SYS_pwritev2: ::c_long = 5000 + 322;
+pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
+pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
+pub const SYS_pkey_free: ::c_long = 5000 + 325;
diff --git a/libc/src/unix/notbsd/linux/mips/mod.rs b/libc/src/unix/notbsd/linux/mips/mod.rs
index 150b607..a94e2bc 100644
--- a/libc/src/unix/notbsd/linux/mips/mod.rs
+++ b/libc/src/unix/notbsd/linux/mips/mod.rs
@@ -1,3 +1,6 @@
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;
@@ -25,6 +28,17 @@ s! {
__size: [::c_char; 32],
__align: [::c_long; 0],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 23],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const SFD_CLOEXEC: ::c_int = 0x080000;
@@ -36,6 +50,7 @@ pub const O_TRUNC: ::c_int = 512;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
@@ -294,6 +309,8 @@ pub const MAP_STACK: ::c_int = 0x40000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
pub const SOL_SOCKET: ::c_int = 0xffff;
@@ -353,6 +370,27 @@ pub const SO_INCOMING_CPU: ::c_int = 49;
pub const SO_ATTACH_BPF: ::c_int = 50;
pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
pub const FIOCLEX: ::c_ulong = 0x6601;
pub const FIONBIO: ::c_ulong = 0x667e;
@@ -591,6 +629,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -623,6 +662,11 @@ pub const EHWPOISON: ::c_int = 168;
pub const SIGEV_THREAD_ID: ::c_int = 4;
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
+
#[link(name = "util")]
extern {
pub fn sysctl(name: *mut ::c_int,
diff --git a/libc/src/unix/notbsd/linux/mod.rs b/libc/src/unix/notbsd/linux/mod.rs
index 89a6211..6ab171d 100644
--- a/libc/src/unix/notbsd/linux/mod.rs
+++ b/libc/src/unix/notbsd/linux/mod.rs
@@ -11,10 +11,7 @@ pub type ino64_t = u64;
pub type off64_t = i64;
pub type blkcnt64_t = i64;
pub type rlim64_t = u64;
-pub type shmatt_t = ::c_ulong;
pub type mqd_t = ::c_int;
-pub type msgqnum_t = ::c_ulong;
-pub type msglen_t = ::c_ulong;
pub type nfds_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
@@ -26,6 +23,17 @@ pub type __s16 = ::c_short;
pub type __u32 = ::c_uint;
pub type __s32 = ::c_int;
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+
+pub type Elf64_Half = u16;
+pub type Elf64_Word = u32;
+pub type Elf64_Off = u64;
+pub type Elf64_Addr = u64;
+pub type Elf64_Xword = u64;
+
pub enum fpos64_t {} // TODO: fill this out with a struct
s! {
@@ -74,21 +82,33 @@ s! {
}
pub struct pthread_mutex_t {
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc")))]
+ #[cfg(not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
pub struct pthread_rwlock_t {
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc")))]
+ #[cfg(not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
@@ -100,8 +120,12 @@ s! {
__align: [::c_int; 0],
#[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64")))]
+ target_arch = "sparc64", target_arch = "aarch64")))]
+ __align: [::c_long; 0],
+ #[cfg(all(target_arch = "aarch64", target_env = "gnu"))]
__align: [::c_long; 0],
+ #[cfg(all(target_arch = "aarch64", target_env = "musl"))]
+ __align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
@@ -159,7 +183,7 @@ s! {
pub f_favail: ::fsfilcnt_t,
#[cfg(target_endian = "little")]
pub f_fsid: ::c_ulong,
- #[cfg(target_pointer_width = "32")]
+ #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
__f_unused: ::c_int,
#[cfg(target_endian = "big")]
pub f_fsid: ::c_ulong,
@@ -200,22 +224,47 @@ s! {
_pad: [::uint8_t; 48],
}
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
+
pub struct fsid_t {
__val: [::c_int; 2],
}
+ // x32 compatibility
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
pub struct mq_attr {
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_flags: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_maxmsg: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_msgsize: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_curmsgs: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pad: [i64; 4],
+
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_flags: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_maxmsg: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_msgsize: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_curmsgs: ::c_long,
- pad: [::c_long; 4]
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pad: [::c_long; 4],
}
pub struct cpu_set_t {
- #[cfg(target_pointer_width = "32")]
+ #[cfg(all(target_pointer_width = "32",
+ not(target_arch = "x86_64")))]
bits: [u32; 32],
- #[cfg(target_pointer_width = "64")]
+ #[cfg(not(all(target_pointer_width = "32",
+ not(target_arch = "x86_64"))))]
bits: [u64; 16],
}
@@ -353,6 +402,67 @@ s! {
#[cfg(target_pointer_width = "32")]
pub u: [u32; 7],
}
+
+ pub struct dl_phdr_info {
+ #[cfg(target_pointer_width = "64")]
+ pub dlpi_addr: Elf64_Addr,
+ #[cfg(target_pointer_width = "32")]
+ pub dlpi_addr: Elf32_Addr,
+
+ pub dlpi_name: *const ::c_char,
+
+ #[cfg(target_pointer_width = "64")]
+ pub dlpi_phdr: *const Elf64_Phdr,
+ #[cfg(target_pointer_width = "32")]
+ pub dlpi_phdr: *const Elf32_Phdr,
+
+ #[cfg(target_pointer_width = "64")]
+ pub dlpi_phnum: Elf64_Half,
+ #[cfg(target_pointer_width = "32")]
+ pub dlpi_phnum: Elf32_Half,
+
+ pub dlpi_adds: ::c_ulonglong,
+ pub dlpi_subs: ::c_ulonglong,
+ pub dlpi_tls_modid: ::size_t,
+ pub dlpi_tls_data: *mut ::c_void,
+ }
+
+ pub struct Elf32_Phdr {
+ pub p_type: Elf32_Word,
+ pub p_offset: Elf32_Off,
+ pub p_vaddr: Elf32_Addr,
+ pub p_paddr: Elf32_Addr,
+ pub p_filesz: Elf32_Word,
+ pub p_memsz: Elf32_Word,
+ pub p_flags: Elf32_Word,
+ pub p_align: Elf32_Word,
+ }
+
+ pub struct Elf64_Phdr {
+ pub p_type: Elf64_Word,
+ pub p_flags: Elf64_Word,
+ pub p_offset: Elf64_Off,
+ pub p_vaddr: Elf64_Addr,
+ pub p_paddr: Elf64_Addr,
+ pub p_filesz: Elf64_Xword,
+ pub p_memsz: Elf64_Xword,
+ pub p_align: Elf64_Xword,
+ }
+
+ pub struct ucred {
+ pub pid: ::pid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ }
+
+ pub struct mntent {
+ pub mnt_fsname: *mut ::c_char,
+ pub mnt_dir: *mut ::c_char,
+ pub mnt_type: *mut ::c_char,
+ pub mnt_opts: *mut ::c_char,
+ pub mnt_freq: ::c_int,
+ pub mnt_passno: ::c_int,
+ }
}
pub const ABDAY_1: ::nl_item = 0x20000;
@@ -621,6 +731,32 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
+pub const IFF_LOWER_UP: ::c_int = 0x10000;
+pub const IFF_DORMANT: ::c_int = 0x20000;
+pub const IFF_ECHO: ::c_int = 0x40000;
+
+// linux/if_tun.h
+// Read queue size
+pub const TUN_READQ_SIZE: ::c_short = 500;
+// TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead.
+pub const TUN_TUN_DEV: ::c_short = IFF_TUN;
+pub const TUN_TAP_DEV: ::c_short = IFF_TAP;
+pub const TUN_TYPE_MASK: ::c_short = 0x000f;
+// TUNSETIFF ifr flags
+pub const IFF_TUN: ::c_short = 0x0001;
+pub const IFF_TAP: ::c_short = 0x0002;
+pub const IFF_NO_PI: ::c_short = 0x1000;
+// This flag has no real effect
+pub const IFF_ONE_QUEUE: ::c_short = 0x2000;
+pub const IFF_VNET_HDR: ::c_short = 0x4000;
+pub const IFF_TUN_EXCL: ::c_short = 0x8000;
+pub const IFF_MULTI_QUEUE: ::c_short = 0x0100;
+pub const IFF_ATTACH_QUEUE: ::c_short = 0x0200;
+pub const IFF_DETACH_QUEUE: ::c_short = 0x0400;
+// read-only flag
+pub const IFF_PERSIST: ::c_short = 0x0800;
+pub const IFF_NOFILTER: ::c_short = 0x1000;
+
pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
pub const ST_NODEV: ::c_ulong = 4;
@@ -660,24 +796,82 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+pub const RENAME_NOREPLACE: ::c_int = 1;
+pub const RENAME_EXCHANGE: ::c_int = 2;
+pub const RENAME_WHITEOUT: ::c_int = 4;
+
pub const SCHED_OTHER: ::c_int = 0;
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_RR: ::c_int = 2;
pub const SCHED_BATCH: ::c_int = 3;
pub const SCHED_IDLE: ::c_int = 5;
+// netinet/in.h
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_MTP: ::c_int = 92;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_COMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_MH: ::c_int = 135;
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// raw IP packet
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
pub const AF_VSOCK: ::c_int = 40;
-#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
pub const PF_IB: ::c_int = AF_IB;
pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
-#[doc(hidden)]
-pub const PF_MAX: ::c_int = AF_MAX;
// System V IPC
pub const IPC_PRIVATE: ::key_t = 0;
@@ -717,6 +911,7 @@ pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
+pub const QFMT_VFS_V1: ::c_int = 4;
pub const EFD_SEMAPHORE: ::c_int = 0x1;
@@ -745,10 +940,12 @@ pub const EAI_BADFLAGS: ::c_int = -1;
pub const EAI_NONAME: ::c_int = -2;
pub const EAI_AGAIN: ::c_int = -3;
pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
pub const EAI_FAMILY: ::c_int = -6;
pub const EAI_SOCKTYPE: ::c_int = -7;
pub const EAI_SERVICE: ::c_int = -8;
pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
pub const EAI_OVERFLOW: ::c_int = -12;
pub const NI_NUMERICHOST: ::c_int = 1;
@@ -761,8 +958,6 @@ pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
-pub const EAI_SYSTEM: ::c_int = -11;
-
pub const AIO_CANCELED: ::c_int = 0;
pub const AIO_NOTCANCELED: ::c_int = 1;
pub const AIO_ALLDONE: ::c_int = 2;
@@ -895,10 +1090,21 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
+pub const GRND_NONBLOCK: ::c_uint = 0x0001;
+pub const GRND_RANDOM: ::c_uint = 0x0002;
+
+pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
+pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
+pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
+
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const TFD_TIMER_ABSTIME: ::c_int = 1;
+
pub const XATTR_CREATE: ::c_int = 0x1;
pub const XATTR_REPLACE: ::c_int = 0x2;
@@ -919,7 +1125,118 @@ pub const ENOATTR: ::c_int = ::ENODATA;
pub const SO_ORIGINAL_DST: ::c_int = 80;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
-pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
+// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
+// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
+// so we can use that type here to avoid having to cast.
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_NUM: u32 = 8;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+
+// linux/if_ether.h
+pub const ETH_ALEN: ::c_int = 6;
+pub const ETH_HLEN: ::c_int = 14;
+pub const ETH_ZLEN: ::c_int = 60;
+pub const ETH_DATA_LEN: ::c_int = 1500;
+pub const ETH_FRAME_LEN: ::c_int = 1514;
+pub const ETH_FCS_LEN: ::c_int = 4;
+
+// These are the defined Ethernet Protocol ID's.
+pub const ETH_P_LOOP: ::c_int = 0x0060;
+pub const ETH_P_PUP: ::c_int = 0x0200;
+pub const ETH_P_PUPAT: ::c_int = 0x0201;
+pub const ETH_P_IP: ::c_int = 0x0800;
+pub const ETH_P_X25: ::c_int = 0x0805;
+pub const ETH_P_ARP: ::c_int = 0x0806;
+pub const ETH_P_BPQ: ::c_int = 0x08FF;
+pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
+pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
+pub const ETH_P_BATMAN: ::c_int = 0x4305;
+pub const ETH_P_DEC: ::c_int = 0x6000;
+pub const ETH_P_DNA_DL: ::c_int = 0x6001;
+pub const ETH_P_DNA_RC: ::c_int = 0x6002;
+pub const ETH_P_DNA_RT: ::c_int = 0x6003;
+pub const ETH_P_LAT: ::c_int = 0x6004;
+pub const ETH_P_DIAG: ::c_int = 0x6005;
+pub const ETH_P_CUST: ::c_int = 0x6006;
+pub const ETH_P_SCA: ::c_int = 0x6007;
+pub const ETH_P_TEB: ::c_int = 0x6558;
+pub const ETH_P_RARP: ::c_int = 0x8035;
+pub const ETH_P_ATALK: ::c_int = 0x809B;
+pub const ETH_P_AARP: ::c_int = 0x80F3;
+pub const ETH_P_8021Q: ::c_int = 0x8100;
+pub const ETH_P_IPX: ::c_int = 0x8137;
+pub const ETH_P_IPV6: ::c_int = 0x86DD;
+pub const ETH_P_PAUSE: ::c_int = 0x8808;
+pub const ETH_P_SLOW: ::c_int = 0x8809;
+pub const ETH_P_WCCP: ::c_int = 0x883E;
+pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
+pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
+pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
+pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
+pub const ETH_P_PPP_SES: ::c_int = 0x8864;
+pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
+pub const ETH_P_ATMFATE: ::c_int = 0x8884;
+pub const ETH_P_PAE: ::c_int = 0x888E;
+pub const ETH_P_AOE: ::c_int = 0x88A2;
+pub const ETH_P_8021AD: ::c_int = 0x88A8;
+pub const ETH_P_802_EX1: ::c_int = 0x88B5;
+pub const ETH_P_TIPC: ::c_int = 0x88CA;
+pub const ETH_P_MACSEC: ::c_int = 0x88E5;
+pub const ETH_P_8021AH: ::c_int = 0x88E7;
+pub const ETH_P_MVRP: ::c_int = 0x88F5;
+pub const ETH_P_1588: ::c_int = 0x88F7;
+pub const ETH_P_PRP: ::c_int = 0x88FB;
+pub const ETH_P_FCOE: ::c_int = 0x8906;
+pub const ETH_P_TDLS: ::c_int = 0x890D;
+pub const ETH_P_FIP: ::c_int = 0x8914;
+pub const ETH_P_80221: ::c_int = 0x8917;
+pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
+pub const ETH_P_QINQ1: ::c_int = 0x9100;
+pub const ETH_P_QINQ2: ::c_int = 0x9200;
+pub const ETH_P_QINQ3: ::c_int = 0x9300;
+pub const ETH_P_EDSA: ::c_int = 0xDADA;
+pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
+
+pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
+
+// Non DIX types. Won't clash for 1500 types.
+pub const ETH_P_802_3: ::c_int = 0x0001;
+pub const ETH_P_AX25: ::c_int = 0x0002;
+pub const ETH_P_ALL: ::c_int = 0x0003;
+pub const ETH_P_802_2: ::c_int = 0x0004;
+pub const ETH_P_SNAP: ::c_int = 0x0005;
+pub const ETH_P_DDCMP: ::c_int = 0x0006;
+pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
+pub const ETH_P_PPP_MP: ::c_int = 0x0008;
+pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
+pub const ETH_P_CANFD: ::c_int = 0x000D;
+pub const ETH_P_PPPTALK: ::c_int = 0x0010;
+pub const ETH_P_TR_802_2: ::c_int = 0x0011;
+pub const ETH_P_MOBITEX: ::c_int = 0x0015;
+pub const ETH_P_CONTROL: ::c_int = 0x0016;
+pub const ETH_P_IRDA: ::c_int = 0x0017;
+pub const ETH_P_ECONET: ::c_int = 0x0018;
+pub const ETH_P_HDLC: ::c_int = 0x0019;
+pub const ETH_P_ARCNET: ::c_int = 0x001A;
+pub const ETH_P_DSA: ::c_int = 0x001B;
+pub const ETH_P_TRAILER: ::c_int = 0x001C;
+pub const ETH_P_PHONET: ::c_int = 0x00F5;
+pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
+pub const ETH_P_CAIF: ::c_int = 0x00F7;
f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
@@ -961,7 +1278,7 @@ f! {
pub fn minor(dev: ::dev_t) -> ::c_uint {
let mut minor = 0;
- minor |= (dev & 0xfffff00000000000) >> 0;
+ minor |= (dev & 0x00000000000000ff) >> 0;
minor |= (dev & 0x00000ffffff00000) >> 12;
minor as ::c_uint
}
@@ -1073,6 +1390,13 @@ extern {
pub fn signalfd(fd: ::c_int,
mask: *const ::sigset_t,
flags: ::c_int) -> ::c_int;
+ pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int,
+ curr_value: *mut itimerspec) -> ::c_int;
+ pub fn timerfd_settime(fd: ::c_int,
+ flags: ::c_int,
+ new_value: *const itimerspec,
+ old_value: *mut itimerspec) -> ::c_int;
pub fn pwritev(fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
@@ -1321,12 +1645,14 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
+ pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_sigmask$UNIX2003")]
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
@@ -1369,6 +1695,22 @@ extern {
attr: *const ::pthread_attr_t,
f: extern fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void) -> ::c_int;
+ pub fn dl_iterate_phdr(
+ callback: Option<unsafe extern fn(
+ info: *mut ::dl_phdr_info,
+ size: ::size_t,
+ data: *mut ::c_void
+ ) -> ::c_int>,
+ data: *mut ::c_void
+ ) -> ::c_int;
+
+ pub fn setmntent(filename: *const ::c_char,
+ ty: *const ::c_char) -> *mut ::FILE;
+ pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+ pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
+ pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+ pub fn hasmntopt(mnt: *const ::mntent,
+ opt: *const ::c_char) -> *mut ::c_char;
}
cfg_if! {
diff --git a/libc/src/unix/notbsd/linux/musl/b32/arm.rs b/libc/src/unix/notbsd/linux/musl/b32/arm.rs
index d0b4660..22bf16c 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -138,11 +138,22 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
-pub const O_DIRECT: ::c_int = 0x4000;
-pub const O_DIRECTORY: ::c_int = 0x10000;
-pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_LARGEFILE: ::c_int = 0o400000;
@@ -371,11 +382,6 @@ pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
-pub const SYS_pivot_root: ::c_long = 218;
-pub const SYS_gettid: ::c_long = 224;
-pub const SYS_perf_event_open: ::c_long = 364;
-pub const SYS_memfd_create: ::c_long = 385;
-
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
@@ -390,3 +396,360 @@ pub const TIOCM_RNG: ::c_int = 0x080;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
+
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 43;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/mips.rs b/libc/src/unix/notbsd/linux/musl/b32/mips.rs
index 9403977..89231a0 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -149,6 +149,17 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 23],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0o100000;
@@ -382,12 +393,6 @@ pub const TIOCMSET: ::c_int = 0x741A;
pub const FIONREAD: ::c_int = 0x467F;
pub const TIOCCONS: ::c_int = 0x80047478;
-// Valid for O32
-pub const SYS_pivot_root: ::c_long = 4216;
-pub const SYS_gettid: ::c_long = 4222;
-pub const SYS_perf_event_open: ::c_long = 4333;
-pub const SYS_memfd_create: ::c_long = 4354;
-
pub const POLLWRNORM: ::c_short = 0x4;
pub const POLLWRBAND: ::c_short = 0x100;
@@ -402,3 +407,367 @@ pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RNG: ::c_int = 0x200;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIOCM_DSR: ::c_int = 0x400;
+
+pub const SYS_syscall: ::c_long = 4000 + 0;
+pub const SYS_exit: ::c_long = 4000 + 1;
+pub const SYS_fork: ::c_long = 4000 + 2;
+pub const SYS_read: ::c_long = 4000 + 3;
+pub const SYS_write: ::c_long = 4000 + 4;
+pub const SYS_open: ::c_long = 4000 + 5;
+pub const SYS_close: ::c_long = 4000 + 6;
+pub const SYS_waitpid: ::c_long = 4000 + 7;
+pub const SYS_creat: ::c_long = 4000 + 8;
+pub const SYS_link: ::c_long = 4000 + 9;
+pub const SYS_unlink: ::c_long = 4000 + 10;
+pub const SYS_execve: ::c_long = 4000 + 11;
+pub const SYS_chdir: ::c_long = 4000 + 12;
+pub const SYS_time: ::c_long = 4000 + 13;
+pub const SYS_mknod: ::c_long = 4000 + 14;
+pub const SYS_chmod: ::c_long = 4000 + 15;
+pub const SYS_lchown: ::c_long = 4000 + 16;
+pub const SYS_break: ::c_long = 4000 + 17;
+pub const SYS_unused18: ::c_long = 4000 + 18;
+pub const SYS_lseek: ::c_long = 4000 + 19;
+pub const SYS_getpid: ::c_long = 4000 + 20;
+pub const SYS_mount: ::c_long = 4000 + 21;
+pub const SYS_umount: ::c_long = 4000 + 22;
+pub const SYS_setuid: ::c_long = 4000 + 23;
+pub const SYS_getuid: ::c_long = 4000 + 24;
+pub const SYS_stime: ::c_long = 4000 + 25;
+pub const SYS_ptrace: ::c_long = 4000 + 26;
+pub const SYS_alarm: ::c_long = 4000 + 27;
+pub const SYS_unused28: ::c_long = 4000 + 28;
+pub const SYS_pause: ::c_long = 4000 + 29;
+pub const SYS_utime: ::c_long = 4000 + 30;
+pub const SYS_stty: ::c_long = 4000 + 31;
+pub const SYS_gtty: ::c_long = 4000 + 32;
+pub const SYS_access: ::c_long = 4000 + 33;
+pub const SYS_nice: ::c_long = 4000 + 34;
+pub const SYS_ftime: ::c_long = 4000 + 35;
+pub const SYS_sync: ::c_long = 4000 + 36;
+pub const SYS_kill: ::c_long = 4000 + 37;
+pub const SYS_rename: ::c_long = 4000 + 38;
+pub const SYS_mkdir: ::c_long = 4000 + 39;
+pub const SYS_rmdir: ::c_long = 4000 + 40;
+pub const SYS_dup: ::c_long = 4000 + 41;
+pub const SYS_pipe: ::c_long = 4000 + 42;
+pub const SYS_times: ::c_long = 4000 + 43;
+pub const SYS_prof: ::c_long = 4000 + 44;
+pub const SYS_brk: ::c_long = 4000 + 45;
+pub const SYS_setgid: ::c_long = 4000 + 46;
+pub const SYS_getgid: ::c_long = 4000 + 47;
+pub const SYS_signal: ::c_long = 4000 + 48;
+pub const SYS_geteuid: ::c_long = 4000 + 49;
+pub const SYS_getegid: ::c_long = 4000 + 50;
+pub const SYS_acct: ::c_long = 4000 + 51;
+pub const SYS_umount2: ::c_long = 4000 + 52;
+pub const SYS_lock: ::c_long = 4000 + 53;
+pub const SYS_ioctl: ::c_long = 4000 + 54;
+pub const SYS_fcntl: ::c_long = 4000 + 55;
+pub const SYS_mpx: ::c_long = 4000 + 56;
+pub const SYS_setpgid: ::c_long = 4000 + 57;
+pub const SYS_ulimit: ::c_long = 4000 + 58;
+pub const SYS_unused59: ::c_long = 4000 + 59;
+pub const SYS_umask: ::c_long = 4000 + 60;
+pub const SYS_chroot: ::c_long = 4000 + 61;
+pub const SYS_ustat: ::c_long = 4000 + 62;
+pub const SYS_dup2: ::c_long = 4000 + 63;
+pub const SYS_getppid: ::c_long = 4000 + 64;
+pub const SYS_getpgrp: ::c_long = 4000 + 65;
+pub const SYS_setsid: ::c_long = 4000 + 66;
+pub const SYS_sigaction: ::c_long = 4000 + 67;
+pub const SYS_sgetmask: ::c_long = 4000 + 68;
+pub const SYS_ssetmask: ::c_long = 4000 + 69;
+pub const SYS_setreuid: ::c_long = 4000 + 70;
+pub const SYS_setregid: ::c_long = 4000 + 71;
+pub const SYS_sigsuspend: ::c_long = 4000 + 72;
+pub const SYS_sigpending: ::c_long = 4000 + 73;
+pub const SYS_sethostname: ::c_long = 4000 + 74;
+pub const SYS_setrlimit: ::c_long = 4000 + 75;
+pub const SYS_getrlimit: ::c_long = 4000 + 76;
+pub const SYS_getrusage: ::c_long = 4000 + 77;
+pub const SYS_gettimeofday: ::c_long = 4000 + 78;
+pub const SYS_settimeofday: ::c_long = 4000 + 79;
+pub const SYS_getgroups: ::c_long = 4000 + 80;
+pub const SYS_setgroups: ::c_long = 4000 + 81;
+pub const SYS_reserved82: ::c_long = 4000 + 82;
+pub const SYS_symlink: ::c_long = 4000 + 83;
+pub const SYS_unused84: ::c_long = 4000 + 84;
+pub const SYS_readlink: ::c_long = 4000 + 85;
+pub const SYS_uselib: ::c_long = 4000 + 86;
+pub const SYS_swapon: ::c_long = 4000 + 87;
+pub const SYS_reboot: ::c_long = 4000 + 88;
+pub const SYS_readdir: ::c_long = 4000 + 89;
+pub const SYS_mmap: ::c_long = 4000 + 90;
+pub const SYS_munmap: ::c_long = 4000 + 91;
+pub const SYS_truncate: ::c_long = 4000 + 92;
+pub const SYS_ftruncate: ::c_long = 4000 + 93;
+pub const SYS_fchmod: ::c_long = 4000 + 94;
+pub const SYS_fchown: ::c_long = 4000 + 95;
+pub const SYS_getpriority: ::c_long = 4000 + 96;
+pub const SYS_setpriority: ::c_long = 4000 + 97;
+pub const SYS_profil: ::c_long = 4000 + 98;
+pub const SYS_statfs: ::c_long = 4000 + 99;
+pub const SYS_fstatfs: ::c_long = 4000 + 100;
+pub const SYS_ioperm: ::c_long = 4000 + 101;
+pub const SYS_socketcall: ::c_long = 4000 + 102;
+pub const SYS_syslog: ::c_long = 4000 + 103;
+pub const SYS_setitimer: ::c_long = 4000 + 104;
+pub const SYS_getitimer: ::c_long = 4000 + 105;
+pub const SYS_stat: ::c_long = 4000 + 106;
+pub const SYS_lstat: ::c_long = 4000 + 107;
+pub const SYS_fstat: ::c_long = 4000 + 108;
+pub const SYS_unused109: ::c_long = 4000 + 109;
+pub const SYS_iopl: ::c_long = 4000 + 110;
+pub const SYS_vhangup: ::c_long = 4000 + 111;
+pub const SYS_idle: ::c_long = 4000 + 112;
+pub const SYS_vm86: ::c_long = 4000 + 113;
+pub const SYS_wait4: ::c_long = 4000 + 114;
+pub const SYS_swapoff: ::c_long = 4000 + 115;
+pub const SYS_sysinfo: ::c_long = 4000 + 116;
+pub const SYS_ipc: ::c_long = 4000 + 117;
+pub const SYS_fsync: ::c_long = 4000 + 118;
+pub const SYS_sigreturn: ::c_long = 4000 + 119;
+pub const SYS_clone: ::c_long = 4000 + 120;
+pub const SYS_setdomainname: ::c_long = 4000 + 121;
+pub const SYS_uname: ::c_long = 4000 + 122;
+pub const SYS_modify_ldt: ::c_long = 4000 + 123;
+pub const SYS_adjtimex: ::c_long = 4000 + 124;
+pub const SYS_mprotect: ::c_long = 4000 + 125;
+pub const SYS_sigprocmask: ::c_long = 4000 + 126;
+pub const SYS_create_module: ::c_long = 4000 + 127;
+pub const SYS_init_module: ::c_long = 4000 + 128;
+pub const SYS_delete_module: ::c_long = 4000 + 129;
+pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
+pub const SYS_quotactl: ::c_long = 4000 + 131;
+pub const SYS_getpgid: ::c_long = 4000 + 132;
+pub const SYS_fchdir: ::c_long = 4000 + 133;
+pub const SYS_bdflush: ::c_long = 4000 + 134;
+pub const SYS_sysfs: ::c_long = 4000 + 135;
+pub const SYS_personality: ::c_long = 4000 + 136;
+pub const SYS_afs_syscall: ::c_long = 4000 + 137;
+pub const SYS_setfsuid: ::c_long = 4000 + 138;
+pub const SYS_setfsgid: ::c_long = 4000 + 139;
+pub const SYS__llseek: ::c_long = 4000 + 140;
+pub const SYS_getdents: ::c_long = 4000 + 141;
+pub const SYS_flock: ::c_long = 4000 + 143;
+pub const SYS_msync: ::c_long = 4000 + 144;
+pub const SYS_readv: ::c_long = 4000 + 145;
+pub const SYS_writev: ::c_long = 4000 + 146;
+pub const SYS_cacheflush: ::c_long = 4000 + 147;
+pub const SYS_cachectl: ::c_long = 4000 + 148;
+pub const SYS_sysmips: ::c_long = 4000 + 149;
+pub const SYS_unused150: ::c_long = 4000 + 150;
+pub const SYS_getsid: ::c_long = 4000 + 151;
+pub const SYS_fdatasync: ::c_long = 4000 + 152;
+pub const SYS__sysctl: ::c_long = 4000 + 153;
+pub const SYS_mlock: ::c_long = 4000 + 154;
+pub const SYS_munlock: ::c_long = 4000 + 155;
+pub const SYS_mlockall: ::c_long = 4000 + 156;
+pub const SYS_munlockall: ::c_long = 4000 + 157;
+pub const SYS_sched_setparam: ::c_long = 4000 + 158;
+pub const SYS_sched_getparam: ::c_long = 4000 + 159;
+pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
+pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
+pub const SYS_sched_yield: ::c_long = 4000 + 162;
+pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
+pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
+pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
+pub const SYS_nanosleep: ::c_long = 4000 + 166;
+pub const SYS_mremap: ::c_long = 4000 + 167;
+pub const SYS_accept: ::c_long = 4000 + 168;
+pub const SYS_bind: ::c_long = 4000 + 169;
+pub const SYS_connect: ::c_long = 4000 + 170;
+pub const SYS_getpeername: ::c_long = 4000 + 171;
+pub const SYS_getsockname: ::c_long = 4000 + 172;
+pub const SYS_getsockopt: ::c_long = 4000 + 173;
+pub const SYS_listen: ::c_long = 4000 + 174;
+pub const SYS_recv: ::c_long = 4000 + 175;
+pub const SYS_recvfrom: ::c_long = 4000 + 176;
+pub const SYS_recvmsg: ::c_long = 4000 + 177;
+pub const SYS_send: ::c_long = 4000 + 178;
+pub const SYS_sendmsg: ::c_long = 4000 + 179;
+pub const SYS_sendto: ::c_long = 4000 + 180;
+pub const SYS_setsockopt: ::c_long = 4000 + 181;
+pub const SYS_shutdown: ::c_long = 4000 + 182;
+pub const SYS_socket: ::c_long = 4000 + 183;
+pub const SYS_socketpair: ::c_long = 4000 + 184;
+pub const SYS_setresuid: ::c_long = 4000 + 185;
+pub const SYS_getresuid: ::c_long = 4000 + 186;
+pub const SYS_query_module: ::c_long = 4000 + 187;
+pub const SYS_poll: ::c_long = 4000 + 188;
+pub const SYS_nfsservctl: ::c_long = 4000 + 189;
+pub const SYS_setresgid: ::c_long = 4000 + 190;
+pub const SYS_getresgid: ::c_long = 4000 + 191;
+pub const SYS_prctl: ::c_long = 4000 + 192;
+pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
+pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
+pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
+pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
+pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
+pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
+pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
+pub const SYS_chown: ::c_long = 4000 + 202;
+pub const SYS_getcwd: ::c_long = 4000 + 203;
+pub const SYS_capget: ::c_long = 4000 + 204;
+pub const SYS_capset: ::c_long = 4000 + 205;
+pub const SYS_sigaltstack: ::c_long = 4000 + 206;
+pub const SYS_sendfile: ::c_long = 4000 + 207;
+pub const SYS_getpmsg: ::c_long = 4000 + 208;
+pub const SYS_putpmsg: ::c_long = 4000 + 209;
+pub const SYS_mmap2: ::c_long = 4000 + 210;
+pub const SYS_truncate64: ::c_long = 4000 + 211;
+pub const SYS_ftruncate64: ::c_long = 4000 + 212;
+pub const SYS_stat64: ::c_long = 4000 + 213;
+pub const SYS_lstat64: ::c_long = 4000 + 214;
+pub const SYS_fstat64: ::c_long = 4000 + 215;
+pub const SYS_pivot_root: ::c_long = 4000 + 216;
+pub const SYS_mincore: ::c_long = 4000 + 217;
+pub const SYS_madvise: ::c_long = 4000 + 218;
+pub const SYS_getdents64: ::c_long = 4000 + 219;
+pub const SYS_fcntl64: ::c_long = 4000 + 220;
+pub const SYS_reserved221: ::c_long = 4000 + 221;
+pub const SYS_gettid: ::c_long = 4000 + 222;
+pub const SYS_readahead: ::c_long = 4000 + 223;
+pub const SYS_setxattr: ::c_long = 4000 + 224;
+pub const SYS_lsetxattr: ::c_long = 4000 + 225;
+pub const SYS_fsetxattr: ::c_long = 4000 + 226;
+pub const SYS_getxattr: ::c_long = 4000 + 227;
+pub const SYS_lgetxattr: ::c_long = 4000 + 228;
+pub const SYS_fgetxattr: ::c_long = 4000 + 229;
+pub const SYS_listxattr: ::c_long = 4000 + 230;
+pub const SYS_llistxattr: ::c_long = 4000 + 231;
+pub const SYS_flistxattr: ::c_long = 4000 + 232;
+pub const SYS_removexattr: ::c_long = 4000 + 233;
+pub const SYS_lremovexattr: ::c_long = 4000 + 234;
+pub const SYS_fremovexattr: ::c_long = 4000 + 235;
+pub const SYS_tkill: ::c_long = 4000 + 236;
+pub const SYS_sendfile64: ::c_long = 4000 + 237;
+pub const SYS_futex: ::c_long = 4000 + 238;
+pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
+pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
+pub const SYS_io_setup: ::c_long = 4000 + 241;
+pub const SYS_io_destroy: ::c_long = 4000 + 242;
+pub const SYS_io_getevents: ::c_long = 4000 + 243;
+pub const SYS_io_submit: ::c_long = 4000 + 244;
+pub const SYS_io_cancel: ::c_long = 4000 + 245;
+pub const SYS_exit_group: ::c_long = 4000 + 246;
+pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
+pub const SYS_epoll_create: ::c_long = 4000 + 248;
+pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
+pub const SYS_epoll_wait: ::c_long = 4000 + 250;
+pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
+pub const SYS_set_tid_address: ::c_long = 4000 + 252;
+pub const SYS_restart_syscall: ::c_long = 4000 + 253;
+pub const SYS_statfs64: ::c_long = 4000 + 255;
+pub const SYS_fstatfs64: ::c_long = 4000 + 256;
+pub const SYS_timer_create: ::c_long = 4000 + 257;
+pub const SYS_timer_settime: ::c_long = 4000 + 258;
+pub const SYS_timer_gettime: ::c_long = 4000 + 259;
+pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
+pub const SYS_timer_delete: ::c_long = 4000 + 261;
+pub const SYS_clock_settime: ::c_long = 4000 + 262;
+pub const SYS_clock_gettime: ::c_long = 4000 + 263;
+pub const SYS_clock_getres: ::c_long = 4000 + 264;
+pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
+pub const SYS_tgkill: ::c_long = 4000 + 266;
+pub const SYS_utimes: ::c_long = 4000 + 267;
+pub const SYS_mbind: ::c_long = 4000 + 268;
+pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
+pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
+pub const SYS_mq_open: ::c_long = 4000 + 271;
+pub const SYS_mq_unlink: ::c_long = 4000 + 272;
+pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
+pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
+pub const SYS_mq_notify: ::c_long = 4000 + 275;
+pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
+pub const SYS_vserver: ::c_long = 4000 + 277;
+pub const SYS_waitid: ::c_long = 4000 + 278;
+/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
+pub const SYS_add_key: ::c_long = 4000 + 280;
+pub const SYS_request_key: ::c_long = 4000 + 281;
+pub const SYS_keyctl: ::c_long = 4000 + 282;
+pub const SYS_set_thread_area: ::c_long = 4000 + 283;
+pub const SYS_inotify_init: ::c_long = 4000 + 284;
+pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
+pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
+pub const SYS_migrate_pages: ::c_long = 4000 + 287;
+pub const SYS_openat: ::c_long = 4000 + 288;
+pub const SYS_mkdirat: ::c_long = 4000 + 289;
+pub const SYS_mknodat: ::c_long = 4000 + 290;
+pub const SYS_fchownat: ::c_long = 4000 + 291;
+pub const SYS_futimesat: ::c_long = 4000 + 292;
+pub const SYS_unlinkat: ::c_long = 4000 + 294;
+pub const SYS_renameat: ::c_long = 4000 + 295;
+pub const SYS_linkat: ::c_long = 4000 + 296;
+pub const SYS_symlinkat: ::c_long = 4000 + 297;
+pub const SYS_readlinkat: ::c_long = 4000 + 298;
+pub const SYS_fchmodat: ::c_long = 4000 + 299;
+pub const SYS_faccessat: ::c_long = 4000 + 300;
+pub const SYS_pselect6: ::c_long = 4000 + 301;
+pub const SYS_ppoll: ::c_long = 4000 + 302;
+pub const SYS_unshare: ::c_long = 4000 + 303;
+pub const SYS_splice: ::c_long = 4000 + 304;
+pub const SYS_sync_file_range: ::c_long = 4000 + 305;
+pub const SYS_tee: ::c_long = 4000 + 306;
+pub const SYS_vmsplice: ::c_long = 4000 + 307;
+pub const SYS_move_pages: ::c_long = 4000 + 308;
+pub const SYS_set_robust_list: ::c_long = 4000 + 309;
+pub const SYS_get_robust_list: ::c_long = 4000 + 310;
+pub const SYS_kexec_load: ::c_long = 4000 + 311;
+pub const SYS_getcpu: ::c_long = 4000 + 312;
+pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
+pub const SYS_ioprio_set: ::c_long = 4000 + 314;
+pub const SYS_ioprio_get: ::c_long = 4000 + 315;
+pub const SYS_utimensat: ::c_long = 4000 + 316;
+pub const SYS_signalfd: ::c_long = 4000 + 317;
+pub const SYS_timerfd: ::c_long = 4000 + 318;
+pub const SYS_eventfd: ::c_long = 4000 + 319;
+pub const SYS_fallocate: ::c_long = 4000 + 320;
+pub const SYS_timerfd_create: ::c_long = 4000 + 321;
+pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
+pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
+pub const SYS_signalfd4: ::c_long = 4000 + 324;
+pub const SYS_eventfd2: ::c_long = 4000 + 325;
+pub const SYS_epoll_create1: ::c_long = 4000 + 326;
+pub const SYS_dup3: ::c_long = 4000 + 327;
+pub const SYS_pipe2: ::c_long = 4000 + 328;
+pub const SYS_inotify_init1: ::c_long = 4000 + 329;
+pub const SYS_preadv: ::c_long = 4000 + 330;
+pub const SYS_pwritev: ::c_long = 4000 + 331;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
+pub const SYS_perf_event_open: ::c_long = 4000 + 333;
+pub const SYS_accept4: ::c_long = 4000 + 334;
+pub const SYS_recvmmsg: ::c_long = 4000 + 335;
+pub const SYS_fanotify_init: ::c_long = 4000 + 336;
+pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
+pub const SYS_prlimit64: ::c_long = 4000 + 338;
+pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
+pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
+pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
+pub const SYS_syncfs: ::c_long = 4000 + 342;
+pub const SYS_sendmmsg: ::c_long = 4000 + 343;
+pub const SYS_setns: ::c_long = 4000 + 344;
+pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
+pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
+pub const SYS_kcmp: ::c_long = 4000 + 347;
+pub const SYS_finit_module: ::c_long = 4000 + 348;
+pub const SYS_sched_setattr: ::c_long = 4000 + 349;
+pub const SYS_sched_getattr: ::c_long = 4000 + 350;
+pub const SYS_renameat2: ::c_long = 4000 + 351;
+pub const SYS_seccomp: ::c_long = 4000 + 352;
+pub const SYS_getrandom: ::c_long = 4000 + 353;
+pub const SYS_memfd_create: ::c_long = 4000 + 354;
+pub const SYS_bpf: ::c_long = 4000 + 355;
+pub const SYS_execveat: ::c_long = 4000 + 356;
+pub const SYS_userfaultfd: ::c_long = 4000 + 357;
+pub const SYS_membarrier: ::c_long = 4000 + 358;
+pub const SYS_mlock2: ::c_long = 4000 + 359;
+pub const SYS_copy_file_range: ::c_long = 4000 + 360;
+pub const SYS_preadv2: ::c_long = 4000 + 361;
+pub const SYS_pwritev2: ::c_long = 4000 + 362;
+
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/mod.rs b/libc/src/unix/notbsd/linux/musl/b32/mod.rs
index 58c971b..f6e19d9 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/mod.rs
@@ -1,6 +1,7 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type nlink_t = u32;
+pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
s! {
@@ -31,8 +32,23 @@ s! {
pub struct sem_t {
__val: [::c_int; 4],
}
+
+ pub struct ipc_perm {
+ pub __ipc_perm_key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ pub __seq: ::c_int,
+ __unused1: ::c_long,
+ __unused2: ::c_long
+ }
}
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/x86.rs b/libc/src/unix/notbsd/linux/musl/b32/x86.rs
index 812d743..fa57024 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -151,6 +151,17 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x4000;
@@ -798,3 +809,8 @@ pub const CS: ::c_int = 13;
pub const EFL: ::c_int = 14;
pub const UESP: ::c_int = 15;
pub const SS: ::c_int = 16;
+
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs b/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
index fa103aa..da0827a 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
@@ -1,7 +1,341 @@
pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
+pub type wchar_t = u32;
+pub type nlink_t = u32;
+pub type blksize_t = ::c_int;
+s! {
+ pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_mode: ::mode_t,
+ pub st_nlink: ::nlink_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: ::dev_t,
+ __pad0: ::c_ulong,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ __pad1: ::c_int,
+ pub st_blocks: ::blkcnt_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __unused: [::c_uint; 2],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_mode: ::mode_t,
+ pub st_nlink: ::nlink_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: ::dev_t,
+ __pad0: ::c_ulong,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ __pad1: ::c_int,
+ pub st_blocks: ::blkcnt_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __unused: [::c_uint; 2],
+ }
+
+ pub struct ipc_perm {
+ pub __ipc_perm_key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ pub __seq: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
+ }
+}
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_LARGEFILE: ::c_int = 0x20000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+
+pub const MINSIGSTKSZ: ::size_t = 6144;
+pub const SIGSTKSZ: ::size_t = 12288;
+
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = 43;
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = PF_MAX;
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/mod.rs b/libc/src/unix/notbsd/linux/musl/b64/mod.rs
index cdce288..70baf82 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/mod.rs
@@ -1,51 +1,7 @@
-pub type wchar_t = i32;
pub type c_long = i64;
pub type c_ulong = u64;
-pub type nlink_t = u64;
s! {
- pub struct stat {
- pub st_dev: ::dev_t,
- pub st_ino: ::ino_t,
- pub st_nlink: ::nlink_t,
- pub st_mode: ::mode_t,
- pub st_uid: ::uid_t,
- pub st_gid: ::gid_t,
- __pad0: ::c_int,
- pub st_rdev: ::dev_t,
- pub st_size: ::off_t,
- pub st_blksize: ::blksize_t,
- pub st_blocks: ::blkcnt_t,
- pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_long,
- pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_long,
- pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_long,
- __unused: [::c_long; 3],
- }
-
- pub struct stat64 {
- pub st_dev: ::dev_t,
- pub st_ino: ::ino64_t,
- pub st_nlink: ::nlink_t,
- pub st_mode: ::mode_t,
- pub st_uid: ::uid_t,
- pub st_gid: ::gid_t,
- __pad0: ::c_int,
- pub st_rdev: ::dev_t,
- pub st_size: ::off_t,
- pub st_blksize: ::blksize_t,
- pub st_blocks: ::blkcnt64_t,
- pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_long,
- pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_long,
- pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_long,
- __reserved: [::c_long; 3],
- }
-
pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
@@ -162,16 +118,23 @@ s! {
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
-pub const O_DIRECT: ::c_int = 0x4000;
-pub const O_DIRECTORY: ::c_int = 0x10000;
-pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_ASYNC: ::c_int = 0x2000;
-pub const O_LARGEFILE: ::c_int = 0;
pub const FIOCLEX: ::c_int = 0x5451;
pub const FIONBIO: ::c_int = 0x5421;
@@ -202,7 +165,6 @@ pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
-pub const MAP_32BIT: ::c_int = 0x0040;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
index 4e8b9ad..1574bff 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
@@ -1,7 +1,83 @@
pub type c_char = u8;
+pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
+pub type nlink_t = u64;
+pub type blksize_t = ::c_long;
+
+s! {
+ pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ __pad0: ::c_int,
+ pub st_rdev: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __unused: [::c_long; 3],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino64_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ __pad0: ::c_int,
+ pub st_rdev: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt64_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __reserved: [::c_long; 3],
+ }
+
+ pub struct ipc_perm {
+ pub __ipc_perm_key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ pub __seq: ::c_int,
+ __unused1: ::c_long,
+ __unused2: ::c_long
+ }
+}
pub const SYS_pivot_root: ::c_long = 203;
pub const SYS_gettid: ::c_long = 207;
pub const SYS_perf_event_open: ::c_long = 319;
pub const SYS_memfd_create: ::c_long = 360;
+
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
+
+// Syscall table
+pub const SYS_renameat2: ::c_long = 357;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs b/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
index f81efdc..78d38e4 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
@@ -1,7 +1,52 @@
pub type c_char = i8;
+pub type wchar_t = i32;
+pub type nlink_t = u64;
+pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
s! {
+ pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ __pad0: ::c_int,
+ pub st_rdev: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __unused: [::c_long; 3],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino64_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ __pad0: ::c_int,
+ pub st_rdev: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt64_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __reserved: [::c_long; 3],
+ }
+
pub struct mcontext_t {
__private: [u64; 32],
}
@@ -14,6 +59,18 @@ s! {
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
}
+
+ pub struct ipc_perm {
+ pub __ipc_perm_key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ pub __seq: ::c_int,
+ __unused1: ::c_long,
+ __unused2: ::c_long
+ }
}
// Syscall table
@@ -378,3 +435,17 @@ pub const DS: ::c_int = 23;
pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
+
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/mod.rs b/libc/src/unix/notbsd/linux/musl/mod.rs
index 640e8ab..7513aae 100644
--- a/libc/src/unix/notbsd/linux/musl/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/mod.rs
@@ -5,7 +5,9 @@ pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
-pub type blksize_t = c_long;
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulonglong;
pub type fsfilcnt_t = ::c_ulonglong;
pub type rlim_t = ::c_ulonglong;
@@ -38,18 +40,6 @@ s! {
pub sa_restorer: ::dox::Option<extern fn()>,
}
- pub struct ipc_perm {
- pub __ipc_perm_key: ::key_t,
- pub uid: ::uid_t,
- pub gid: ::gid_t,
- pub cuid: ::uid_t,
- pub cgid: ::gid_t,
- pub mode: ::mode_t,
- pub __seq: ::c_int,
- __unused1: ::c_long,
- __unused2: ::c_long
- }
-
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
@@ -94,6 +84,7 @@ pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 512;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
@@ -140,6 +131,9 @@ pub const RLIMIT_NLIMITS: ::c_int = 16;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+
pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
pub const TCP_THIN_DUPACK: ::c_int = 17;
@@ -159,8 +153,6 @@ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const CPU_SETSIZE: ::c_int = 128;
-pub const QFMT_VFS_V1: ::c_int = 4;
-
pub const PTRACE_TRACEME: ::c_int = 0;
pub const PTRACE_PEEKTEXT: ::c_int = 1;
pub const PTRACE_PEEKDATA: ::c_int = 2;
@@ -214,8 +206,6 @@ pub const CLOCK_TAI: ::clockid_t = 11;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
-pub const SIGSTKSZ: ::size_t = 8192;
-pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
@@ -317,7 +307,9 @@ extern {
}
cfg_if! {
- if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
+ if #[cfg(any(target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "powerpc64"))] {
mod b64;
pub use self::b64::*;
} else if #[cfg(any(target_arch = "x86",
diff --git a/libc/src/unix/notbsd/linux/other/b32/arm.rs b/libc/src/unix/notbsd/linux/other/b32/arm.rs
index 4de1f32..a70af43 100644
--- a/libc/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/arm.rs
@@ -101,6 +101,17 @@ s! {
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x10000;
@@ -125,11 +136,6 @@ pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;
-pub const SYS_pivot_root: ::c_long = 218;
-pub const SYS_gettid: ::c_long = 224;
-pub const SYS_perf_event_open: ::c_long = 364;
-pub const SYS_memfd_create: ::c_long = 385;
-
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
@@ -208,6 +214,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -249,3 +256,357 @@ pub const TIOCOUTQ: ::c_ulong = 0x5411;
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
pub const FIONREAD: ::c_ulong = 0x541B;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_arm_fadvise64_64: ::c_long = 270;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_arm_sync_file_range: ::c_long = 341;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
diff --git a/libc/src/unix/notbsd/linux/other/b32/mod.rs b/libc/src/unix/notbsd/linux/other/b32/mod.rs
index 247f01b..8536353 100644
--- a/libc/src/unix/notbsd/linux/other/b32/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/mod.rs
@@ -10,6 +10,12 @@ pub type off_t = i32;
pub type blkcnt_t = i32;
pub type __fsword_t = i32;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type rlim_t = c_ulong;
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
pub type blksize_t = i32;
pub type nlink_t = u32;
pub type __u64 = ::c_ulonglong;
@@ -81,6 +87,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
@@ -281,6 +288,17 @@ pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETREGS: ::c_uint = 12;
pub const PTRACE_SETREGS: ::c_uint = 13;
+#[link(name = "util")]
+extern {
+ pub fn sysctl(name: *mut ::c_int,
+ namelen: ::c_int,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t)
+ -> ::c_int;
+}
+
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
diff --git a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
index 13646b7..0ea9034 100644
--- a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -126,11 +126,6 @@ pub const SO_PEERCRED: ::c_int = 21;
pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONBIO: ::c_ulong = 0x8004667e;
-pub const SYS_pivot_root: ::c_long = 203;
-pub const SYS_gettid: ::c_long = 207;
-pub const SYS_perf_event_open: ::c_long = 319;
-pub const SYS_memfd_create: ::c_long = 360;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -220,6 +215,7 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
+pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
@@ -246,3 +242,373 @@ pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const FIONREAD: ::c_ulong = 0x4004667f;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */
+pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_fcntl64: ::c_long = 204;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_sendfile64: ::c_long = 226;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_fadvise64: ::c_long = 233;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_fadvise64_64: ::c_long = 254;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_fstatat64: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
diff --git a/libc/src/unix/notbsd/linux/other/b32/x86.rs b/libc/src/unix/notbsd/linux/other/b32/x86.rs
index 1413396..1506aca 100644
--- a/libc/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/x86.rs
@@ -200,6 +200,17 @@ s! {
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
pub const O_DIRECT: ::c_int = 0x4000;
@@ -304,6 +315,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
index f4583d5..80ebe7e 100644
--- a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -1,5 +1,7 @@
//! AArch64-specific definitions for 64-bit linux-like values
+pub type c_long = i64;
+pub type c_ulong = u64;
pub type c_char = u8;
pub type wchar_t = u32;
pub type nlink_t = u32;
@@ -111,8 +113,21 @@ s! {
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
@@ -130,6 +145,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
@@ -367,11 +383,6 @@ pub const EDEADLOCK: ::c_int = 35;
pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;
-pub const SYS_pivot_root: ::c_long = 41;
-pub const SYS_gettid: ::c_long = 178;
-pub const SYS_perf_event_open: ::c_long = 241;
-pub const SYS_memfd_create: ::c_long = 279;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -447,6 +458,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -488,3 +500,287 @@ pub const TIOCOUTQ: ::c_ulong = 0x5411;
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
pub const FIONREAD: ::c_ulong = 0x541B;
+
+// Syscall table
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_syscalls: ::c_long = 291;
+
+#[link(name = "util")]
+extern {
+ pub fn sysctl(name: *mut ::c_int,
+ namelen: ::c_int,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t)
+ -> ::c_int;
+}
diff --git a/libc/src/unix/notbsd/linux/other/b64/mod.rs b/libc/src/unix/notbsd/linux/other/b64/mod.rs
index aa0e091..7fcf8ba 100644
--- a/libc/src/unix/notbsd/linux/other/b64/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/mod.rs
@@ -1,32 +1,39 @@
//! 64-bit specific definitions for linux-like values
-pub type c_long = i64;
-pub type c_ulong = u64;
pub type clock_t = i64;
pub type time_t = i64;
pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
-pub type __fsword_t = ::c_long;
+pub type __fsword_t = i64;
+pub type shmatt_t = u64;
+pub type msgqnum_t = u64;
+pub type msglen_t = u64;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type rlim_t = u64;
s! {
pub struct sigset_t {
- __val: [::c_ulong; 16],
+ #[cfg(target_pointer_width = "32")]
+ __val: [u32; 32],
+ #[cfg(target_pointer_width = "64")]
+ __val: [u64; 16],
}
pub struct sysinfo {
- pub uptime: ::c_long,
- pub loads: [::c_ulong; 3],
- pub totalram: ::c_ulong,
- pub freeram: ::c_ulong,
- pub sharedram: ::c_ulong,
- pub bufferram: ::c_ulong,
- pub totalswap: ::c_ulong,
- pub freeswap: ::c_ulong,
+ pub uptime: i64,
+ pub loads: [u64; 3],
+ pub totalram: u64,
+ pub freeram: u64,
+ pub sharedram: u64,
+ pub bufferram: u64,
+ pub totalswap: u64,
+ pub freeswap: u64,
pub procs: ::c_ushort,
pub pad: ::c_ushort,
- pub totalhigh: ::c_ulong,
- pub freehigh: ::c_ulong,
+ pub totalhigh: u64,
+ pub freehigh: u64,
pub mem_unit: ::c_uint,
pub _f: [::c_char; 0],
}
@@ -36,17 +43,16 @@ s! {
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
- __msg_cbytes: ::c_ulong,
+ __msg_cbytes: u64,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
- __glibc_reserved4: ::c_ulong,
- __glibc_reserved5: ::c_ulong,
+ __glibc_reserved4: u64,
+ __glibc_reserved5: u64,
}
}
-pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const O_LARGEFILE: ::c_int = 0;
@@ -64,6 +70,15 @@ cfg_if! {
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
+ cfg_if! {
+ if #[cfg(target_pointer_width = "32")] {
+ mod x32;
+ pub use self::x32::*;
+ } else {
+ mod not_x32;
+ pub use self::not_x32::*;
+ }
+ }
} else {
// Unknown target_arch
}
diff --git a/libc/src/unix/notbsd/linux/other/b64/not_x32.rs b/libc/src/unix/notbsd/linux/other/b64/not_x32.rs
new file mode 100644
index 0000000..fb30a31
--- /dev/null
+++ b/libc/src/unix/notbsd/linux/other/b64/not_x32.rs
@@ -0,0 +1,351 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
+// Syscall table
+
+pub const SYS_read: ::c_long = 0;
+pub const SYS_write: ::c_long = 1;
+pub const SYS_open: ::c_long = 2;
+pub const SYS_close: ::c_long = 3;
+pub const SYS_stat: ::c_long = 4;
+pub const SYS_fstat: ::c_long = 5;
+pub const SYS_lstat: ::c_long = 6;
+pub const SYS_poll: ::c_long = 7;
+pub const SYS_lseek: ::c_long = 8;
+pub const SYS_mmap: ::c_long = 9;
+pub const SYS_mprotect: ::c_long = 10;
+pub const SYS_munmap: ::c_long = 11;
+pub const SYS_brk: ::c_long = 12;
+pub const SYS_rt_sigaction: ::c_long = 13;
+pub const SYS_rt_sigprocmask: ::c_long = 14;
+pub const SYS_rt_sigreturn: ::c_long = 15;
+pub const SYS_ioctl: ::c_long = 16;
+pub const SYS_pread64: ::c_long = 17;
+pub const SYS_pwrite64: ::c_long = 18;
+pub const SYS_readv: ::c_long = 19;
+pub const SYS_writev: ::c_long = 20;
+pub const SYS_access: ::c_long = 21;
+pub const SYS_pipe: ::c_long = 22;
+pub const SYS_select: ::c_long = 23;
+pub const SYS_sched_yield: ::c_long = 24;
+pub const SYS_mremap: ::c_long = 25;
+pub const SYS_msync: ::c_long = 26;
+pub const SYS_mincore: ::c_long = 27;
+pub const SYS_madvise: ::c_long = 28;
+pub const SYS_shmget: ::c_long = 29;
+pub const SYS_shmat: ::c_long = 30;
+pub const SYS_shmctl: ::c_long = 31;
+pub const SYS_dup: ::c_long = 32;
+pub const SYS_dup2: ::c_long = 33;
+pub const SYS_pause: ::c_long = 34;
+pub const SYS_nanosleep: ::c_long = 35;
+pub const SYS_getitimer: ::c_long = 36;
+pub const SYS_alarm: ::c_long = 37;
+pub const SYS_setitimer: ::c_long = 38;
+pub const SYS_getpid: ::c_long = 39;
+pub const SYS_sendfile: ::c_long = 40;
+pub const SYS_socket: ::c_long = 41;
+pub const SYS_connect: ::c_long = 42;
+pub const SYS_accept: ::c_long = 43;
+pub const SYS_sendto: ::c_long = 44;
+pub const SYS_recvfrom: ::c_long = 45;
+pub const SYS_sendmsg: ::c_long = 46;
+pub const SYS_recvmsg: ::c_long = 47;
+pub const SYS_shutdown: ::c_long = 48;
+pub const SYS_bind: ::c_long = 49;
+pub const SYS_listen: ::c_long = 50;
+pub const SYS_getsockname: ::c_long = 51;
+pub const SYS_getpeername: ::c_long = 52;
+pub const SYS_socketpair: ::c_long = 53;
+pub const SYS_setsockopt: ::c_long = 54;
+pub const SYS_getsockopt: ::c_long = 55;
+pub const SYS_clone: ::c_long = 56;
+pub const SYS_fork: ::c_long = 57;
+pub const SYS_vfork: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_exit: ::c_long = 60;
+pub const SYS_wait4: ::c_long = 61;
+pub const SYS_kill: ::c_long = 62;
+pub const SYS_uname: ::c_long = 63;
+pub const SYS_semget: ::c_long = 64;
+pub const SYS_semop: ::c_long = 65;
+pub const SYS_semctl: ::c_long = 66;
+pub const SYS_shmdt: ::c_long = 67;
+pub const SYS_msgget: ::c_long = 68;
+pub const SYS_msgsnd: ::c_long = 69;
+pub const SYS_msgrcv: ::c_long = 70;
+pub const SYS_msgctl: ::c_long = 71;
+pub const SYS_fcntl: ::c_long = 72;
+pub const SYS_flock: ::c_long = 73;
+pub const SYS_fsync: ::c_long = 74;
+pub const SYS_fdatasync: ::c_long = 75;
+pub const SYS_truncate: ::c_long = 76;
+pub const SYS_ftruncate: ::c_long = 77;
+pub const SYS_getdents: ::c_long = 78;
+pub const SYS_getcwd: ::c_long = 79;
+pub const SYS_chdir: ::c_long = 80;
+pub const SYS_fchdir: ::c_long = 81;
+pub const SYS_rename: ::c_long = 82;
+pub const SYS_mkdir: ::c_long = 83;
+pub const SYS_rmdir: ::c_long = 84;
+pub const SYS_creat: ::c_long = 85;
+pub const SYS_link: ::c_long = 86;
+pub const SYS_unlink: ::c_long = 87;
+pub const SYS_symlink: ::c_long = 88;
+pub const SYS_readlink: ::c_long = 89;
+pub const SYS_chmod: ::c_long = 90;
+pub const SYS_fchmod: ::c_long = 91;
+pub const SYS_chown: ::c_long = 92;
+pub const SYS_fchown: ::c_long = 93;
+pub const SYS_lchown: ::c_long = 94;
+pub const SYS_umask: ::c_long = 95;
+pub const SYS_gettimeofday: ::c_long = 96;
+pub const SYS_getrlimit: ::c_long = 97;
+pub const SYS_getrusage: ::c_long = 98;
+pub const SYS_sysinfo: ::c_long = 99;
+pub const SYS_times: ::c_long = 100;
+pub const SYS_ptrace: ::c_long = 101;
+pub const SYS_getuid: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_getgid: ::c_long = 104;
+pub const SYS_setuid: ::c_long = 105;
+pub const SYS_setgid: ::c_long = 106;
+pub const SYS_geteuid: ::c_long = 107;
+pub const SYS_getegid: ::c_long = 108;
+pub const SYS_setpgid: ::c_long = 109;
+pub const SYS_getppid: ::c_long = 110;
+pub const SYS_getpgrp: ::c_long = 111;
+pub const SYS_setsid: ::c_long = 112;
+pub const SYS_setreuid: ::c_long = 113;
+pub const SYS_setregid: ::c_long = 114;
+pub const SYS_getgroups: ::c_long = 115;
+pub const SYS_setgroups: ::c_long = 116;
+pub const SYS_setresuid: ::c_long = 117;
+pub const SYS_getresuid: ::c_long = 118;
+pub const SYS_setresgid: ::c_long = 119;
+pub const SYS_getresgid: ::c_long = 120;
+pub const SYS_getpgid: ::c_long = 121;
+pub const SYS_setfsuid: ::c_long = 122;
+pub const SYS_setfsgid: ::c_long = 123;
+pub const SYS_getsid: ::c_long = 124;
+pub const SYS_capget: ::c_long = 125;
+pub const SYS_capset: ::c_long = 126;
+pub const SYS_rt_sigpending: ::c_long = 127;
+pub const SYS_rt_sigtimedwait: ::c_long = 128;
+pub const SYS_rt_sigqueueinfo: ::c_long = 129;
+pub const SYS_rt_sigsuspend: ::c_long = 130;
+pub const SYS_sigaltstack: ::c_long = 131;
+pub const SYS_utime: ::c_long = 132;
+pub const SYS_mknod: ::c_long = 133;
+pub const SYS_uselib: ::c_long = 134;
+pub const SYS_personality: ::c_long = 135;
+pub const SYS_ustat: ::c_long = 136;
+pub const SYS_statfs: ::c_long = 137;
+pub const SYS_fstatfs: ::c_long = 138;
+pub const SYS_sysfs: ::c_long = 139;
+pub const SYS_getpriority: ::c_long = 140;
+pub const SYS_setpriority: ::c_long = 141;
+pub const SYS_sched_setparam: ::c_long = 142;
+pub const SYS_sched_getparam: ::c_long = 143;
+pub const SYS_sched_setscheduler: ::c_long = 144;
+pub const SYS_sched_getscheduler: ::c_long = 145;
+pub const SYS_sched_get_priority_max: ::c_long = 146;
+pub const SYS_sched_get_priority_min: ::c_long = 147;
+pub const SYS_sched_rr_get_interval: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 149;
+pub const SYS_munlock: ::c_long = 150;
+pub const SYS_mlockall: ::c_long = 151;
+pub const SYS_munlockall: ::c_long = 152;
+pub const SYS_vhangup: ::c_long = 153;
+pub const SYS_modify_ldt: ::c_long = 154;
+pub const SYS_pivot_root: ::c_long = 155;
+pub const SYS__sysctl: ::c_long = 156;
+pub const SYS_prctl: ::c_long = 157;
+pub const SYS_arch_prctl: ::c_long = 158;
+pub const SYS_adjtimex: ::c_long = 159;
+pub const SYS_setrlimit: ::c_long = 160;
+pub const SYS_chroot: ::c_long = 161;
+pub const SYS_sync: ::c_long = 162;
+pub const SYS_acct: ::c_long = 163;
+pub const SYS_settimeofday: ::c_long = 164;
+pub const SYS_mount: ::c_long = 165;
+pub const SYS_umount2: ::c_long = 166;
+pub const SYS_swapon: ::c_long = 167;
+pub const SYS_swapoff: ::c_long = 168;
+pub const SYS_reboot: ::c_long = 169;
+pub const SYS_sethostname: ::c_long = 170;
+pub const SYS_setdomainname: ::c_long = 171;
+pub const SYS_iopl: ::c_long = 172;
+pub const SYS_ioperm: ::c_long = 173;
+pub const SYS_create_module: ::c_long = 174;
+pub const SYS_init_module: ::c_long = 175;
+pub const SYS_delete_module: ::c_long = 176;
+pub const SYS_get_kernel_syms: ::c_long = 177;
+pub const SYS_query_module: ::c_long = 178;
+pub const SYS_quotactl: ::c_long = 179;
+pub const SYS_nfsservctl: ::c_long = 180;
+pub const SYS_getpmsg: ::c_long = 181;
+pub const SYS_putpmsg: ::c_long = 182;
+pub const SYS_afs_syscall: ::c_long = 183;
+pub const SYS_tuxcall: ::c_long = 184;
+pub const SYS_security: ::c_long = 185;
+pub const SYS_gettid: ::c_long = 186;
+pub const SYS_readahead: ::c_long = 187;
+pub const SYS_setxattr: ::c_long = 188;
+pub const SYS_lsetxattr: ::c_long = 189;
+pub const SYS_fsetxattr: ::c_long = 190;
+pub const SYS_getxattr: ::c_long = 191;
+pub const SYS_lgetxattr: ::c_long = 192;
+pub const SYS_fgetxattr: ::c_long = 193;
+pub const SYS_listxattr: ::c_long = 194;
+pub const SYS_llistxattr: ::c_long = 195;
+pub const SYS_flistxattr: ::c_long = 196;
+pub const SYS_removexattr: ::c_long = 197;
+pub const SYS_lremovexattr: ::c_long = 198;
+pub const SYS_fremovexattr: ::c_long = 199;
+pub const SYS_tkill: ::c_long = 200;
+pub const SYS_time: ::c_long = 201;
+pub const SYS_futex: ::c_long = 202;
+pub const SYS_sched_setaffinity: ::c_long = 203;
+pub const SYS_sched_getaffinity: ::c_long = 204;
+pub const SYS_set_thread_area: ::c_long = 205;
+pub const SYS_io_setup: ::c_long = 206;
+pub const SYS_io_destroy: ::c_long = 207;
+pub const SYS_io_getevents: ::c_long = 208;
+pub const SYS_io_submit: ::c_long = 209;
+pub const SYS_io_cancel: ::c_long = 210;
+pub const SYS_get_thread_area: ::c_long = 211;
+pub const SYS_lookup_dcookie: ::c_long = 212;
+pub const SYS_epoll_create: ::c_long = 213;
+pub const SYS_epoll_ctl_old: ::c_long = 214;
+pub const SYS_epoll_wait_old: ::c_long = 215;
+pub const SYS_remap_file_pages: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_set_tid_address: ::c_long = 218;
+pub const SYS_restart_syscall: ::c_long = 219;
+pub const SYS_semtimedop: ::c_long = 220;
+pub const SYS_fadvise64: ::c_long = 221;
+pub const SYS_timer_create: ::c_long = 222;
+pub const SYS_timer_settime: ::c_long = 223;
+pub const SYS_timer_gettime: ::c_long = 224;
+pub const SYS_timer_getoverrun: ::c_long = 225;
+pub const SYS_timer_delete: ::c_long = 226;
+pub const SYS_clock_settime: ::c_long = 227;
+pub const SYS_clock_gettime: ::c_long = 228;
+pub const SYS_clock_getres: ::c_long = 229;
+pub const SYS_clock_nanosleep: ::c_long = 230;
+pub const SYS_exit_group: ::c_long = 231;
+pub const SYS_epoll_wait: ::c_long = 232;
+pub const SYS_epoll_ctl: ::c_long = 233;
+pub const SYS_tgkill: ::c_long = 234;
+pub const SYS_utimes: ::c_long = 235;
+pub const SYS_vserver: ::c_long = 236;
+pub const SYS_mbind: ::c_long = 237;
+pub const SYS_set_mempolicy: ::c_long = 238;
+pub const SYS_get_mempolicy: ::c_long = 239;
+pub const SYS_mq_open: ::c_long = 240;
+pub const SYS_mq_unlink: ::c_long = 241;
+pub const SYS_mq_timedsend: ::c_long = 242;
+pub const SYS_mq_timedreceive: ::c_long = 243;
+pub const SYS_mq_notify: ::c_long = 244;
+pub const SYS_mq_getsetattr: ::c_long = 245;
+pub const SYS_kexec_load: ::c_long = 246;
+pub const SYS_waitid: ::c_long = 247;
+pub const SYS_add_key: ::c_long = 248;
+pub const SYS_request_key: ::c_long = 249;
+pub const SYS_keyctl: ::c_long = 250;
+pub const SYS_ioprio_set: ::c_long = 251;
+pub const SYS_ioprio_get: ::c_long = 252;
+pub const SYS_inotify_init: ::c_long = 253;
+pub const SYS_inotify_add_watch: ::c_long = 254;
+pub const SYS_inotify_rm_watch: ::c_long = 255;
+pub const SYS_migrate_pages: ::c_long = 256;
+pub const SYS_openat: ::c_long = 257;
+pub const SYS_mkdirat: ::c_long = 258;
+pub const SYS_mknodat: ::c_long = 259;
+pub const SYS_fchownat: ::c_long = 260;
+pub const SYS_futimesat: ::c_long = 261;
+pub const SYS_newfstatat: ::c_long = 262;
+pub const SYS_unlinkat: ::c_long = 263;
+pub const SYS_renameat: ::c_long = 264;
+pub const SYS_linkat: ::c_long = 265;
+pub const SYS_symlinkat: ::c_long = 266;
+pub const SYS_readlinkat: ::c_long = 267;
+pub const SYS_fchmodat: ::c_long = 268;
+pub const SYS_faccessat: ::c_long = 269;
+pub const SYS_pselect6: ::c_long = 270;
+pub const SYS_ppoll: ::c_long = 271;
+pub const SYS_unshare: ::c_long = 272;
+pub const SYS_set_robust_list: ::c_long = 273;
+pub const SYS_get_robust_list: ::c_long = 274;
+pub const SYS_splice: ::c_long = 275;
+pub const SYS_tee: ::c_long = 276;
+pub const SYS_sync_file_range: ::c_long = 277;
+pub const SYS_vmsplice: ::c_long = 278;
+pub const SYS_move_pages: ::c_long = 279;
+pub const SYS_utimensat: ::c_long = 280;
+pub const SYS_epoll_pwait: ::c_long = 281;
+pub const SYS_signalfd: ::c_long = 282;
+pub const SYS_timerfd_create: ::c_long = 283;
+pub const SYS_eventfd: ::c_long = 284;
+pub const SYS_fallocate: ::c_long = 285;
+pub const SYS_timerfd_settime: ::c_long = 286;
+pub const SYS_timerfd_gettime: ::c_long = 287;
+pub const SYS_accept4: ::c_long = 288;
+pub const SYS_signalfd4: ::c_long = 289;
+pub const SYS_eventfd2: ::c_long = 290;
+pub const SYS_epoll_create1: ::c_long = 291;
+pub const SYS_dup3: ::c_long = 292;
+pub const SYS_pipe2: ::c_long = 293;
+pub const SYS_inotify_init1: ::c_long = 294;
+pub const SYS_preadv: ::c_long = 295;
+pub const SYS_pwritev: ::c_long = 296;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
+pub const SYS_perf_event_open: ::c_long = 298;
+pub const SYS_recvmmsg: ::c_long = 299;
+pub const SYS_fanotify_init: ::c_long = 300;
+pub const SYS_fanotify_mark: ::c_long = 301;
+pub const SYS_prlimit64: ::c_long = 302;
+pub const SYS_name_to_handle_at: ::c_long = 303;
+pub const SYS_open_by_handle_at: ::c_long = 304;
+pub const SYS_clock_adjtime: ::c_long = 305;
+pub const SYS_syncfs: ::c_long = 306;
+pub const SYS_sendmmsg: ::c_long = 307;
+pub const SYS_setns: ::c_long = 308;
+pub const SYS_getcpu: ::c_long = 309;
+pub const SYS_process_vm_readv: ::c_long = 310;
+pub const SYS_process_vm_writev: ::c_long = 311;
+pub const SYS_kcmp: ::c_long = 312;
+pub const SYS_finit_module: ::c_long = 313;
+pub const SYS_sched_setattr: ::c_long = 314;
+pub const SYS_sched_getattr: ::c_long = 315;
+pub const SYS_renameat2: ::c_long = 316;
+pub const SYS_seccomp: ::c_long = 317;
+pub const SYS_getrandom: ::c_long = 318;
+pub const SYS_memfd_create: ::c_long = 319;
+pub const SYS_kexec_file_load: ::c_long = 320;
+pub const SYS_bpf: ::c_long = 321;
+pub const SYS_execveat: ::c_long = 322;
+pub const SYS_userfaultfd: ::c_long = 323;
+pub const SYS_membarrier: ::c_long = 324;
+pub const SYS_mlock2: ::c_long = 325;
+pub const SYS_copy_file_range: ::c_long = 326;
+pub const SYS_preadv2: ::c_long = 327;
+pub const SYS_pwritev2: ::c_long = 328;
+pub const SYS_pkey_mprotect: ::c_long = 329;
+pub const SYS_pkey_alloc: ::c_long = 330;
+pub const SYS_pkey_free: ::c_long = 331;
+
+#[link(name = "util")]
+extern {
+ pub fn sysctl(name: *mut ::c_int,
+ namelen: ::c_int,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t)
+ -> ::c_int;
+}
diff --git a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
index 56a78b0..65f2fa2 100644
--- a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -1,5 +1,7 @@
//! PowerPC64-specific definitions for 64-bit linux-like values
+pub type c_long = i64;
+pub type c_ulong = u64;
pub type c_char = u8;
pub type wchar_t = i32;
pub type nlink_t = u64;
@@ -111,6 +113,8 @@ s! {
}
}
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
@@ -128,6 +132,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
@@ -365,11 +370,6 @@ pub const EDEADLOCK: ::c_int = 58;
pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONBIO: ::c_ulong = 0x8004667e;
-pub const SYS_pivot_root: ::c_long = 203;
-pub const SYS_gettid: ::c_long = 207;
-pub const SYS_perf_event_open: ::c_long = 319;
-pub const SYS_memfd_create: ::c_long = 360;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -459,6 +459,7 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
+pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
@@ -485,3 +486,375 @@ pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const FIONREAD: ::c_ulong = 0x4004667f;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */
+pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_newfstatat: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
+
+#[link(name = "util")]
+extern {
+ pub fn sysctl(name: *mut ::c_int,
+ namelen: ::c_int,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t)
+ -> ::c_int;
+}
diff --git a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
index 487d71b..819246e 100644
--- a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -1,5 +1,7 @@
//! SPARC64-specific definitions for 64-bit linux-like values
+pub type c_long = i64;
+pub type c_ulong = u64;
pub type c_char = i8;
pub type wchar_t = i32;
pub type nlink_t = u32;
@@ -52,6 +54,36 @@ s! {
__reserved: [::c_long; 2],
}
+ pub struct statfs64 {
+ pub f_type: ::__fsword_t,
+ pub f_bsize: ::__fsword_t,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::__fsword_t,
+ pub f_frsize: ::__fsword_t,
+ pub f_flags: ::__fsword_t,
+ pub f_spare: [::__fsword_t; 4],
+ }
+
+ pub struct statvfs64 {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_favail: u64,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ __f_spare: [::c_int; 6],
+ }
+
pub struct pthread_attr_t {
__size: [u64; 7]
}
@@ -81,8 +113,21 @@ s! {
__reserved1: ::c_ulong,
__reserved2: ::c_ulong
}
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
}
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464;
pub const TIOCSSOFTCAR: ::c_ulong = 0x80047465;
@@ -100,6 +145,7 @@ pub const O_DSYNC: ::c_int = 0x2000;
pub const O_FSYNC: ::c_int = 0x802000;
pub const O_NOATIME: ::c_int = 0x200000;
pub const O_PATH: ::c_int = 0x1000000;
+pub const O_TMPFILE: ::c_int = 0o200000000 | O_DIRECTORY;
pub const MAP_GROWSDOWN: ::c_int = 0x0200;
@@ -304,9 +350,6 @@ pub const SO_SNDTIMEO: ::c_int = 0x4000;
pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONBIO: ::c_ulong = 0x8004667e;
-pub const SYS_gettid: ::c_long = 143;
-pub const SYS_perf_event_open: ::c_long = 327;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -389,3 +432,354 @@ pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const FIONREAD: ::c_ulong = 0x4004667f;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_wait4: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execv: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_chown: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_brk: ::c_long = 17;
+pub const SYS_perfctr: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_capget: ::c_long = 21;
+pub const SYS_capset: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_vmsplice: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_sigaltstack: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_stat: ::c_long = 38;
+pub const SYS_sendfile: ::c_long = 39;
+pub const SYS_lstat: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_umount2: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_memory_ordering: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_reboot: ::c_long = 55;
+pub const SYS_symlink: ::c_long = 57;
+pub const SYS_readlink: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_fstat: ::c_long = 62;
+pub const SYS_fstat64: ::c_long = 63;
+pub const SYS_getpagesize: ::c_long = 64;
+pub const SYS_msync: ::c_long = 65;
+pub const SYS_vfork: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_mmap: ::c_long = 71;
+pub const SYS_munmap: ::c_long = 73;
+pub const SYS_mprotect: ::c_long = 74;
+pub const SYS_madvise: ::c_long = 75;
+pub const SYS_vhangup: ::c_long = 76;
+pub const SYS_mincore: ::c_long = 78;
+pub const SYS_getgroups: ::c_long = 79;
+pub const SYS_setgroups: ::c_long = 80;
+pub const SYS_getpgrp: ::c_long = 81;
+pub const SYS_setitimer: ::c_long = 83;
+pub const SYS_swapon: ::c_long = 85;
+pub const SYS_getitimer: ::c_long = 86;
+pub const SYS_sethostname: ::c_long = 88;
+pub const SYS_dup2: ::c_long = 90;
+pub const SYS_fcntl: ::c_long = 92;
+pub const SYS_select: ::c_long = 93;
+pub const SYS_fsync: ::c_long = 95;
+pub const SYS_setpriority: ::c_long = 96;
+pub const SYS_socket: ::c_long = 97;
+pub const SYS_connect: ::c_long = 98;
+pub const SYS_accept: ::c_long = 99;
+pub const SYS_getpriority: ::c_long = 100;
+pub const SYS_rt_sigreturn: ::c_long = 101;
+pub const SYS_rt_sigaction: ::c_long = 102;
+pub const SYS_rt_sigprocmask: ::c_long = 103;
+pub const SYS_rt_sigpending: ::c_long = 104;
+pub const SYS_rt_sigtimedwait: ::c_long = 105;
+pub const SYS_rt_sigqueueinfo: ::c_long = 106;
+pub const SYS_rt_sigsuspend: ::c_long = 107;
+pub const SYS_setresuid: ::c_long = 108;
+pub const SYS_getresuid: ::c_long = 109;
+pub const SYS_setresgid: ::c_long = 110;
+pub const SYS_getresgid: ::c_long = 111;
+pub const SYS_recvmsg: ::c_long = 113;
+pub const SYS_sendmsg: ::c_long = 114;
+pub const SYS_gettimeofday: ::c_long = 116;
+pub const SYS_getrusage: ::c_long = 117;
+pub const SYS_getsockopt: ::c_long = 118;
+pub const SYS_getcwd: ::c_long = 119;
+pub const SYS_readv: ::c_long = 120;
+pub const SYS_writev: ::c_long = 121;
+pub const SYS_settimeofday: ::c_long = 122;
+pub const SYS_fchown: ::c_long = 123;
+pub const SYS_fchmod: ::c_long = 124;
+pub const SYS_recvfrom: ::c_long = 125;
+pub const SYS_setreuid: ::c_long = 126;
+pub const SYS_setregid: ::c_long = 127;
+pub const SYS_rename: ::c_long = 128;
+pub const SYS_truncate: ::c_long = 129;
+pub const SYS_ftruncate: ::c_long = 130;
+pub const SYS_flock: ::c_long = 131;
+pub const SYS_lstat64: ::c_long = 132;
+pub const SYS_sendto: ::c_long = 133;
+pub const SYS_shutdown: ::c_long = 134;
+pub const SYS_socketpair: ::c_long = 135;
+pub const SYS_mkdir: ::c_long = 136;
+pub const SYS_rmdir: ::c_long = 137;
+pub const SYS_utimes: ::c_long = 138;
+pub const SYS_stat64: ::c_long = 139;
+pub const SYS_sendfile64: ::c_long = 140;
+pub const SYS_getpeername: ::c_long = 141;
+pub const SYS_futex: ::c_long = 142;
+pub const SYS_gettid: ::c_long = 143;
+pub const SYS_getrlimit: ::c_long = 144;
+pub const SYS_setrlimit: ::c_long = 145;
+pub const SYS_pivot_root: ::c_long = 146;
+pub const SYS_prctl: ::c_long = 147;
+pub const SYS_pciconfig_read: ::c_long = 148;
+pub const SYS_pciconfig_write: ::c_long = 149;
+pub const SYS_getsockname: ::c_long = 150;
+pub const SYS_inotify_init: ::c_long = 151;
+pub const SYS_inotify_add_watch: ::c_long = 152;
+pub const SYS_poll: ::c_long = 153;
+pub const SYS_getdents64: ::c_long = 154;
+pub const SYS_inotify_rm_watch: ::c_long = 156;
+pub const SYS_statfs: ::c_long = 157;
+pub const SYS_fstatfs: ::c_long = 158;
+pub const SYS_umount: ::c_long = 159;
+pub const SYS_sched_set_affinity: ::c_long = 160;
+pub const SYS_sched_get_affinity: ::c_long = 161;
+pub const SYS_getdomainname: ::c_long = 162;
+pub const SYS_setdomainname: ::c_long = 163;
+pub const SYS_utrap_install: ::c_long = 164;
+pub const SYS_quotactl: ::c_long = 165;
+pub const SYS_set_tid_address: ::c_long = 166;
+pub const SYS_mount: ::c_long = 167;
+pub const SYS_ustat: ::c_long = 168;
+pub const SYS_setxattr: ::c_long = 169;
+pub const SYS_lsetxattr: ::c_long = 170;
+pub const SYS_fsetxattr: ::c_long = 171;
+pub const SYS_getxattr: ::c_long = 172;
+pub const SYS_lgetxattr: ::c_long = 173;
+pub const SYS_getdents: ::c_long = 174;
+pub const SYS_setsid: ::c_long = 175;
+pub const SYS_fchdir: ::c_long = 176;
+pub const SYS_fgetxattr: ::c_long = 177;
+pub const SYS_listxattr: ::c_long = 178;
+pub const SYS_llistxattr: ::c_long = 179;
+pub const SYS_flistxattr: ::c_long = 180;
+pub const SYS_removexattr: ::c_long = 181;
+pub const SYS_lremovexattr: ::c_long = 182;
+pub const SYS_sigpending: ::c_long = 183;
+pub const SYS_query_module: ::c_long = 184;
+pub const SYS_setpgid: ::c_long = 185;
+pub const SYS_fremovexattr: ::c_long = 186;
+pub const SYS_tkill: ::c_long = 187;
+pub const SYS_exit_group: ::c_long = 188;
+pub const SYS_uname: ::c_long = 189;
+pub const SYS_init_module: ::c_long = 190;
+pub const SYS_personality: ::c_long = 191;
+pub const SYS_remap_file_pages: ::c_long = 192;
+pub const SYS_epoll_create: ::c_long = 193;
+pub const SYS_epoll_ctl: ::c_long = 194;
+pub const SYS_epoll_wait: ::c_long = 195;
+pub const SYS_ioprio_set: ::c_long = 196;
+pub const SYS_getppid: ::c_long = 197;
+pub const SYS_sigaction: ::c_long = 198;
+pub const SYS_sgetmask: ::c_long = 199;
+pub const SYS_ssetmask: ::c_long = 200;
+pub const SYS_sigsuspend: ::c_long = 201;
+pub const SYS_oldlstat: ::c_long = 202;
+pub const SYS_uselib: ::c_long = 203;
+pub const SYS_readdir: ::c_long = 204;
+pub const SYS_readahead: ::c_long = 205;
+pub const SYS_socketcall: ::c_long = 206;
+pub const SYS_syslog: ::c_long = 207;
+pub const SYS_lookup_dcookie: ::c_long = 208;
+pub const SYS_fadvise64: ::c_long = 209;
+pub const SYS_fadvise64_64: ::c_long = 210;
+pub const SYS_tgkill: ::c_long = 211;
+pub const SYS_waitpid: ::c_long = 212;
+pub const SYS_swapoff: ::c_long = 213;
+pub const SYS_sysinfo: ::c_long = 214;
+pub const SYS_ipc: ::c_long = 215;
+pub const SYS_sigreturn: ::c_long = 216;
+pub const SYS_clone: ::c_long = 217;
+pub const SYS_ioprio_get: ::c_long = 218;
+pub const SYS_adjtimex: ::c_long = 219;
+pub const SYS_sigprocmask: ::c_long = 220;
+pub const SYS_create_module: ::c_long = 221;
+pub const SYS_delete_module: ::c_long = 222;
+pub const SYS_get_kernel_syms: ::c_long = 223;
+pub const SYS_getpgid: ::c_long = 224;
+pub const SYS_bdflush: ::c_long = 225;
+pub const SYS_sysfs: ::c_long = 226;
+pub const SYS_afs_syscall: ::c_long = 227;
+pub const SYS_setfsuid: ::c_long = 228;
+pub const SYS_setfsgid: ::c_long = 229;
+pub const SYS__newselect: ::c_long = 230;
+pub const SYS_splice: ::c_long = 232;
+pub const SYS_stime: ::c_long = 233;
+pub const SYS_statfs64: ::c_long = 234;
+pub const SYS_fstatfs64: ::c_long = 235;
+pub const SYS__llseek: ::c_long = 236;
+pub const SYS_mlock: ::c_long = 237;
+pub const SYS_munlock: ::c_long = 238;
+pub const SYS_mlockall: ::c_long = 239;
+pub const SYS_munlockall: ::c_long = 240;
+pub const SYS_sched_setparam: ::c_long = 241;
+pub const SYS_sched_getparam: ::c_long = 242;
+pub const SYS_sched_setscheduler: ::c_long =243;
+pub const SYS_sched_getscheduler: ::c_long =244;
+pub const SYS_sched_yield: ::c_long = 245;
+pub const SYS_sched_get_priority_max: ::c_long =246;
+pub const SYS_sched_get_priority_min: ::c_long =247;
+pub const SYS_sched_rr_get_interval: ::c_long = 248;
+pub const SYS_nanosleep: ::c_long = 249;
+pub const SYS_mremap: ::c_long = 250;
+pub const SYS__sysctl: ::c_long = 251;
+pub const SYS_getsid: ::c_long = 252;
+pub const SYS_fdatasync: ::c_long = 253;
+pub const SYS_nfsservctl: ::c_long = 254;
+pub const SYS_sync_file_range: ::c_long = 255;
+pub const SYS_clock_settime: ::c_long = 256;
+pub const SYS_clock_gettime: ::c_long = 257;
+pub const SYS_clock_getres: ::c_long = 258;
+pub const SYS_clock_nanosleep: ::c_long = 259;
+pub const SYS_sched_getaffinity: ::c_long = 260;
+pub const SYS_sched_setaffinity: ::c_long = 261;
+pub const SYS_timer_settime: ::c_long = 262;
+pub const SYS_timer_gettime: ::c_long = 263;
+pub const SYS_timer_getoverrun: ::c_long = 264;
+pub const SYS_timer_delete: ::c_long = 265;
+pub const SYS_timer_create: ::c_long = 266;
+pub const SYS_io_setup: ::c_long = 268;
+pub const SYS_io_destroy: ::c_long = 269;
+pub const SYS_io_submit: ::c_long = 270;
+pub const SYS_io_cancel: ::c_long = 271;
+pub const SYS_io_getevents: ::c_long = 272;
+pub const SYS_mq_open: ::c_long = 273;
+pub const SYS_mq_unlink: ::c_long = 274;
+pub const SYS_mq_timedsend: ::c_long = 275;
+pub const SYS_mq_timedreceive: ::c_long = 276;
+pub const SYS_mq_notify: ::c_long = 277;
+pub const SYS_mq_getsetattr: ::c_long = 278;
+pub const SYS_waitid: ::c_long = 279;
+pub const SYS_tee: ::c_long = 280;
+pub const SYS_add_key: ::c_long = 281;
+pub const SYS_request_key: ::c_long = 282;
+pub const SYS_keyctl: ::c_long = 283;
+pub const SYS_openat: ::c_long = 284;
+pub const SYS_mkdirat: ::c_long = 285;
+pub const SYS_mknodat: ::c_long = 286;
+pub const SYS_fchownat: ::c_long = 287;
+pub const SYS_futimesat: ::c_long = 288;
+pub const SYS_fstatat64: ::c_long = 289;
+pub const SYS_unlinkat: ::c_long = 290;
+pub const SYS_renameat: ::c_long = 291;
+pub const SYS_linkat: ::c_long = 292;
+pub const SYS_symlinkat: ::c_long = 293;
+pub const SYS_readlinkat: ::c_long = 294;
+pub const SYS_fchmodat: ::c_long = 295;
+pub const SYS_faccessat: ::c_long = 296;
+pub const SYS_pselect6: ::c_long = 297;
+pub const SYS_ppoll: ::c_long = 298;
+pub const SYS_unshare: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_get_robust_list: ::c_long = 301;
+pub const SYS_migrate_pages: ::c_long =302;
+pub const SYS_mbind: ::c_long = 303;
+pub const SYS_get_mempolicy: ::c_long = 304;
+pub const SYS_set_mempolicy: ::c_long = 305;
+pub const SYS_kexec_load: ::c_long = 306;
+pub const SYS_move_pages: ::c_long = 307;
+pub const SYS_getcpu: ::c_long = 308;
+pub const SYS_epoll_pwait: ::c_long = 309;
+pub const SYS_utimensat: ::c_long = 310;
+pub const SYS_signalfd: ::c_long = 311;
+pub const SYS_timerfd_create: ::c_long = 312;
+pub const SYS_eventfd: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_timerfd_settime: ::c_long = 315;
+pub const SYS_timerfd_gettime: ::c_long = 316;
+pub const SYS_signalfd4: ::c_long = 317;
+pub const SYS_eventfd2: ::c_long = 318;
+pub const SYS_epoll_create1: ::c_long = 319;
+pub const SYS_dup3: ::c_long = 320;
+pub const SYS_pipe2: ::c_long = 321;
+pub const SYS_inotify_init1: ::c_long = 322;
+pub const SYS_accept4: ::c_long = 323;
+pub const SYS_preadv: ::c_long = 324;
+pub const SYS_pwritev: ::c_long = 325;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 326;
+pub const SYS_perf_event_open: ::c_long = 327;
+pub const SYS_recvmmsg: ::c_long = 328;
+pub const SYS_fanotify_init: ::c_long = 329;
+pub const SYS_fanotify_mark: ::c_long = 330;
+pub const SYS_prlimit64: ::c_long = 331;
+pub const SYS_name_to_handle_at: ::c_long = 332;
+pub const SYS_open_by_handle_at: ::c_long = 333;
+pub const SYS_clock_adjtime: ::c_long = 334;
+pub const SYS_syncfs: ::c_long = 335;
+pub const SYS_sendmmsg: ::c_long = 336;
+pub const SYS_setns: ::c_long = 337;
+pub const SYS_process_vm_readv: ::c_long = 338;
+pub const SYS_process_vm_writev: ::c_long = 339;
+pub const SYS_kern_features: ::c_long = 340;
+pub const SYS_kcmp: ::c_long = 341;
+pub const SYS_finit_module: ::c_long = 342;
+pub const SYS_sched_setattr: ::c_long = 343;
+pub const SYS_sched_getattr: ::c_long = 344;
+pub const SYS_renameat2: ::c_long = 345;
+pub const SYS_seccomp: ::c_long = 346;
+pub const SYS_getrandom: ::c_long = 347;
+pub const SYS_memfd_create: ::c_long = 348;
+pub const SYS_bpf: ::c_long = 349;
+pub const SYS_execveat: ::c_long = 350;
+pub const SYS_membarrier: ::c_long = 351;
+pub const SYS_userfaultfd: ::c_long = 352;
+pub const SYS_bind: ::c_long = 353;
+pub const SYS_listen: ::c_long = 354;
+pub const SYS_setsockopt: ::c_long = 355;
+pub const SYS_mlock2: ::c_long = 356;
+pub const SYS_copy_file_range: ::c_long = 357;
+pub const SYS_preadv2: ::c_long = 358;
+pub const SYS_pwritev2: ::c_long = 359;
+
+#[link(name = "util")]
+extern {
+ pub fn sysctl(name: *mut ::c_int,
+ namelen: ::c_int,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t)
+ -> ::c_int;
+}
diff --git a/libc/src/unix/notbsd/linux/other/b64/x32.rs b/libc/src/unix/notbsd/linux/other/b64/x32.rs
new file mode 100644
index 0000000..2e97061
--- /dev/null
+++ b/libc/src/unix/notbsd/linux/other/b64/x32.rs
@@ -0,0 +1,331 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44;
+
+// Syscall table
+
+pub const __X32_SYSCALL_BIT: ::c_long = 0x40000000;
+
+pub const SYS_read: ::c_long = __X32_SYSCALL_BIT + 0;
+pub const SYS_write: ::c_long = __X32_SYSCALL_BIT + 1;
+pub const SYS_open: ::c_long = __X32_SYSCALL_BIT + 2;
+pub const SYS_close: ::c_long = __X32_SYSCALL_BIT + 3;
+pub const SYS_stat: ::c_long = __X32_SYSCALL_BIT + 4;
+pub const SYS_fstat: ::c_long = __X32_SYSCALL_BIT + 5;
+pub const SYS_lstat: ::c_long = __X32_SYSCALL_BIT + 6;
+pub const SYS_poll: ::c_long = __X32_SYSCALL_BIT + 7;
+pub const SYS_lseek: ::c_long = __X32_SYSCALL_BIT + 8;
+pub const SYS_mmap: ::c_long = __X32_SYSCALL_BIT + 9;
+pub const SYS_mprotect: ::c_long = __X32_SYSCALL_BIT + 10;
+pub const SYS_munmap: ::c_long = __X32_SYSCALL_BIT + 11;
+pub const SYS_brk: ::c_long = __X32_SYSCALL_BIT + 12;
+pub const SYS_rt_sigprocmask: ::c_long = __X32_SYSCALL_BIT + 14;
+pub const SYS_pread64: ::c_long = __X32_SYSCALL_BIT + 17;
+pub const SYS_pwrite64: ::c_long = __X32_SYSCALL_BIT + 18;
+pub const SYS_access: ::c_long = __X32_SYSCALL_BIT + 21;
+pub const SYS_pipe: ::c_long = __X32_SYSCALL_BIT + 22;
+pub const SYS_select: ::c_long = __X32_SYSCALL_BIT + 23;
+pub const SYS_sched_yield: ::c_long = __X32_SYSCALL_BIT + 24;
+pub const SYS_mremap: ::c_long = __X32_SYSCALL_BIT + 25;
+pub const SYS_msync: ::c_long = __X32_SYSCALL_BIT + 26;
+pub const SYS_mincore: ::c_long = __X32_SYSCALL_BIT + 27;
+pub const SYS_madvise: ::c_long = __X32_SYSCALL_BIT + 28;
+pub const SYS_shmget: ::c_long = __X32_SYSCALL_BIT + 29;
+pub const SYS_shmat: ::c_long = __X32_SYSCALL_BIT + 30;
+pub const SYS_shmctl: ::c_long = __X32_SYSCALL_BIT + 31;
+pub const SYS_dup: ::c_long = __X32_SYSCALL_BIT + 32;
+pub const SYS_dup2: ::c_long = __X32_SYSCALL_BIT + 33;
+pub const SYS_pause: ::c_long = __X32_SYSCALL_BIT + 34;
+pub const SYS_nanosleep: ::c_long = __X32_SYSCALL_BIT + 35;
+pub const SYS_getitimer: ::c_long = __X32_SYSCALL_BIT + 36;
+pub const SYS_alarm: ::c_long = __X32_SYSCALL_BIT + 37;
+pub const SYS_setitimer: ::c_long = __X32_SYSCALL_BIT + 38;
+pub const SYS_getpid: ::c_long = __X32_SYSCALL_BIT + 39;
+pub const SYS_sendfile: ::c_long = __X32_SYSCALL_BIT + 40;
+pub const SYS_socket: ::c_long = __X32_SYSCALL_BIT + 41;
+pub const SYS_connect: ::c_long = __X32_SYSCALL_BIT + 42;
+pub const SYS_accept: ::c_long = __X32_SYSCALL_BIT + 43;
+pub const SYS_sendto: ::c_long = __X32_SYSCALL_BIT + 44;
+pub const SYS_shutdown: ::c_long = __X32_SYSCALL_BIT + 48;
+pub const SYS_bind: ::c_long = __X32_SYSCALL_BIT + 49;
+pub const SYS_listen: ::c_long = __X32_SYSCALL_BIT + 50;
+pub const SYS_getsockname: ::c_long = __X32_SYSCALL_BIT + 51;
+pub const SYS_getpeername: ::c_long = __X32_SYSCALL_BIT + 52;
+pub const SYS_socketpair: ::c_long = __X32_SYSCALL_BIT + 53;
+pub const SYS_clone: ::c_long = __X32_SYSCALL_BIT + 56;
+pub const SYS_fork: ::c_long = __X32_SYSCALL_BIT + 57;
+pub const SYS_vfork: ::c_long = __X32_SYSCALL_BIT + 58;
+pub const SYS_exit: ::c_long = __X32_SYSCALL_BIT + 60;
+pub const SYS_wait4: ::c_long = __X32_SYSCALL_BIT + 61;
+pub const SYS_kill: ::c_long = __X32_SYSCALL_BIT + 62;
+pub const SYS_uname: ::c_long = __X32_SYSCALL_BIT + 63;
+pub const SYS_semget: ::c_long = __X32_SYSCALL_BIT + 64;
+pub const SYS_semop: ::c_long = __X32_SYSCALL_BIT + 65;
+pub const SYS_semctl: ::c_long = __X32_SYSCALL_BIT + 66;
+pub const SYS_shmdt: ::c_long = __X32_SYSCALL_BIT + 67;
+pub const SYS_msgget: ::c_long = __X32_SYSCALL_BIT + 68;
+pub const SYS_msgsnd: ::c_long = __X32_SYSCALL_BIT + 69;
+pub const SYS_msgrcv: ::c_long = __X32_SYSCALL_BIT + 70;
+pub const SYS_msgctl: ::c_long = __X32_SYSCALL_BIT + 71;
+pub const SYS_fcntl: ::c_long = __X32_SYSCALL_BIT + 72;
+pub const SYS_flock: ::c_long = __X32_SYSCALL_BIT + 73;
+pub const SYS_fsync: ::c_long = __X32_SYSCALL_BIT + 74;
+pub const SYS_fdatasync: ::c_long = __X32_SYSCALL_BIT + 75;
+pub const SYS_truncate: ::c_long = __X32_SYSCALL_BIT + 76;
+pub const SYS_ftruncate: ::c_long = __X32_SYSCALL_BIT + 77;
+pub const SYS_getdents: ::c_long = __X32_SYSCALL_BIT + 78;
+pub const SYS_getcwd: ::c_long = __X32_SYSCALL_BIT + 79;
+pub const SYS_chdir: ::c_long = __X32_SYSCALL_BIT + 80;
+pub const SYS_fchdir: ::c_long = __X32_SYSCALL_BIT + 81;
+pub const SYS_rename: ::c_long = __X32_SYSCALL_BIT + 82;
+pub const SYS_mkdir: ::c_long = __X32_SYSCALL_BIT + 83;
+pub const SYS_rmdir: ::c_long = __X32_SYSCALL_BIT + 84;
+pub const SYS_creat: ::c_long = __X32_SYSCALL_BIT + 85;
+pub const SYS_link: ::c_long = __X32_SYSCALL_BIT + 86;
+pub const SYS_unlink: ::c_long = __X32_SYSCALL_BIT + 87;
+pub const SYS_symlink: ::c_long = __X32_SYSCALL_BIT + 88;
+pub const SYS_readlink: ::c_long = __X32_SYSCALL_BIT + 89;
+pub const SYS_chmod: ::c_long = __X32_SYSCALL_BIT + 90;
+pub const SYS_fchmod: ::c_long = __X32_SYSCALL_BIT + 91;
+pub const SYS_chown: ::c_long = __X32_SYSCALL_BIT + 92;
+pub const SYS_fchown: ::c_long = __X32_SYSCALL_BIT + 93;
+pub const SYS_lchown: ::c_long = __X32_SYSCALL_BIT + 94;
+pub const SYS_umask: ::c_long = __X32_SYSCALL_BIT + 95;
+pub const SYS_gettimeofday: ::c_long = __X32_SYSCALL_BIT + 96;
+pub const SYS_getrlimit: ::c_long = __X32_SYSCALL_BIT + 97;
+pub const SYS_getrusage: ::c_long = __X32_SYSCALL_BIT + 98;
+pub const SYS_sysinfo: ::c_long = __X32_SYSCALL_BIT + 99;
+pub const SYS_times: ::c_long = __X32_SYSCALL_BIT + 100;
+pub const SYS_getuid: ::c_long = __X32_SYSCALL_BIT + 102;
+pub const SYS_syslog: ::c_long = __X32_SYSCALL_BIT + 103;
+pub const SYS_getgid: ::c_long = __X32_SYSCALL_BIT + 104;
+pub const SYS_setuid: ::c_long = __X32_SYSCALL_BIT + 105;
+pub const SYS_setgid: ::c_long = __X32_SYSCALL_BIT + 106;
+pub const SYS_geteuid: ::c_long = __X32_SYSCALL_BIT + 107;
+pub const SYS_getegid: ::c_long = __X32_SYSCALL_BIT + 108;
+pub const SYS_setpgid: ::c_long = __X32_SYSCALL_BIT + 109;
+pub const SYS_getppid: ::c_long = __X32_SYSCALL_BIT + 110;
+pub const SYS_getpgrp: ::c_long = __X32_SYSCALL_BIT + 111;
+pub const SYS_setsid: ::c_long = __X32_SYSCALL_BIT + 112;
+pub const SYS_setreuid: ::c_long = __X32_SYSCALL_BIT + 113;
+pub const SYS_setregid: ::c_long = __X32_SYSCALL_BIT + 114;
+pub const SYS_getgroups: ::c_long = __X32_SYSCALL_BIT + 115;
+pub const SYS_setgroups: ::c_long = __X32_SYSCALL_BIT + 116;
+pub const SYS_setresuid: ::c_long = __X32_SYSCALL_BIT + 117;
+pub const SYS_getresuid: ::c_long = __X32_SYSCALL_BIT + 118;
+pub const SYS_setresgid: ::c_long = __X32_SYSCALL_BIT + 119;
+pub const SYS_getresgid: ::c_long = __X32_SYSCALL_BIT + 120;
+pub const SYS_getpgid: ::c_long = __X32_SYSCALL_BIT + 121;
+pub const SYS_setfsuid: ::c_long = __X32_SYSCALL_BIT + 122;
+pub const SYS_setfsgid: ::c_long = __X32_SYSCALL_BIT + 123;
+pub const SYS_getsid: ::c_long = __X32_SYSCALL_BIT + 124;
+pub const SYS_capget: ::c_long = __X32_SYSCALL_BIT + 125;
+pub const SYS_capset: ::c_long = __X32_SYSCALL_BIT + 126;
+pub const SYS_rt_sigsuspend: ::c_long = __X32_SYSCALL_BIT + 130;
+pub const SYS_utime: ::c_long = __X32_SYSCALL_BIT + 132;
+pub const SYS_mknod: ::c_long = __X32_SYSCALL_BIT + 133;
+pub const SYS_personality: ::c_long = __X32_SYSCALL_BIT + 135;
+pub const SYS_ustat: ::c_long = __X32_SYSCALL_BIT + 136;
+pub const SYS_statfs: ::c_long = __X32_SYSCALL_BIT + 137;
+pub const SYS_fstatfs: ::c_long = __X32_SYSCALL_BIT + 138;
+pub const SYS_sysfs: ::c_long = __X32_SYSCALL_BIT + 139;
+pub const SYS_getpriority: ::c_long = __X32_SYSCALL_BIT + 140;
+pub const SYS_setpriority: ::c_long = __X32_SYSCALL_BIT + 141;
+pub const SYS_sched_setparam: ::c_long = __X32_SYSCALL_BIT + 142;
+pub const SYS_sched_getparam: ::c_long = __X32_SYSCALL_BIT + 143;
+pub const SYS_sched_setscheduler: ::c_long = __X32_SYSCALL_BIT + 144;
+pub const SYS_sched_getscheduler: ::c_long = __X32_SYSCALL_BIT + 145;
+pub const SYS_sched_get_priority_max: ::c_long = __X32_SYSCALL_BIT + 146;
+pub const SYS_sched_get_priority_min: ::c_long = __X32_SYSCALL_BIT + 147;
+pub const SYS_sched_rr_get_interval: ::c_long = __X32_SYSCALL_BIT + 148;
+pub const SYS_mlock: ::c_long = __X32_SYSCALL_BIT + 149;
+pub const SYS_munlock: ::c_long = __X32_SYSCALL_BIT + 150;
+pub const SYS_mlockall: ::c_long = __X32_SYSCALL_BIT + 151;
+pub const SYS_munlockall: ::c_long = __X32_SYSCALL_BIT + 152;
+pub const SYS_vhangup: ::c_long = __X32_SYSCALL_BIT + 153;
+pub const SYS_modify_ldt: ::c_long = __X32_SYSCALL_BIT + 154;
+pub const SYS_pivot_root: ::c_long = __X32_SYSCALL_BIT + 155;
+pub const SYS_prctl: ::c_long = __X32_SYSCALL_BIT + 157;
+pub const SYS_arch_prctl: ::c_long = __X32_SYSCALL_BIT + 158;
+pub const SYS_adjtimex: ::c_long = __X32_SYSCALL_BIT + 159;
+pub const SYS_setrlimit: ::c_long = __X32_SYSCALL_BIT + 160;
+pub const SYS_chroot: ::c_long = __X32_SYSCALL_BIT + 161;
+pub const SYS_sync: ::c_long = __X32_SYSCALL_BIT + 162;
+pub const SYS_acct: ::c_long = __X32_SYSCALL_BIT + 163;
+pub const SYS_settimeofday: ::c_long = __X32_SYSCALL_BIT + 164;
+pub const SYS_mount: ::c_long = __X32_SYSCALL_BIT + 165;
+pub const SYS_umount2: ::c_long = __X32_SYSCALL_BIT + 166;
+pub const SYS_swapon: ::c_long = __X32_SYSCALL_BIT + 167;
+pub const SYS_swapoff: ::c_long = __X32_SYSCALL_BIT + 168;
+pub const SYS_reboot: ::c_long = __X32_SYSCALL_BIT + 169;
+pub const SYS_sethostname: ::c_long = __X32_SYSCALL_BIT + 170;
+pub const SYS_setdomainname: ::c_long = __X32_SYSCALL_BIT + 171;
+pub const SYS_iopl: ::c_long = __X32_SYSCALL_BIT + 172;
+pub const SYS_ioperm: ::c_long = __X32_SYSCALL_BIT + 173;
+pub const SYS_init_module: ::c_long = __X32_SYSCALL_BIT + 175;
+pub const SYS_delete_module: ::c_long = __X32_SYSCALL_BIT + 176;
+pub const SYS_quotactl: ::c_long = __X32_SYSCALL_BIT + 179;
+pub const SYS_getpmsg: ::c_long = __X32_SYSCALL_BIT + 181;
+pub const SYS_putpmsg: ::c_long = __X32_SYSCALL_BIT + 182;
+pub const SYS_afs_syscall: ::c_long = __X32_SYSCALL_BIT + 183;
+pub const SYS_tuxcall: ::c_long = __X32_SYSCALL_BIT + 184;
+pub const SYS_security: ::c_long = __X32_SYSCALL_BIT + 185;
+pub const SYS_gettid: ::c_long = __X32_SYSCALL_BIT + 186;
+pub const SYS_readahead: ::c_long = __X32_SYSCALL_BIT + 187;
+pub const SYS_setxattr: ::c_long = __X32_SYSCALL_BIT + 188;
+pub const SYS_lsetxattr: ::c_long = __X32_SYSCALL_BIT + 189;
+pub const SYS_fsetxattr: ::c_long = __X32_SYSCALL_BIT + 190;
+pub const SYS_getxattr: ::c_long = __X32_SYSCALL_BIT + 191;
+pub const SYS_lgetxattr: ::c_long = __X32_SYSCALL_BIT + 192;
+pub const SYS_fgetxattr: ::c_long = __X32_SYSCALL_BIT + 193;
+pub const SYS_listxattr: ::c_long = __X32_SYSCALL_BIT + 194;
+pub const SYS_llistxattr: ::c_long = __X32_SYSCALL_BIT + 195;
+pub const SYS_flistxattr: ::c_long = __X32_SYSCALL_BIT + 196;
+pub const SYS_removexattr: ::c_long = __X32_SYSCALL_BIT + 197;
+pub const SYS_lremovexattr: ::c_long = __X32_SYSCALL_BIT + 198;
+pub const SYS_fremovexattr: ::c_long = __X32_SYSCALL_BIT + 199;
+pub const SYS_tkill: ::c_long = __X32_SYSCALL_BIT + 200;
+pub const SYS_time: ::c_long = __X32_SYSCALL_BIT + 201;
+pub const SYS_futex: ::c_long = __X32_SYSCALL_BIT + 202;
+pub const SYS_sched_setaffinity: ::c_long = __X32_SYSCALL_BIT + 203;
+pub const SYS_sched_getaffinity: ::c_long = __X32_SYSCALL_BIT + 204;
+pub const SYS_io_destroy: ::c_long = __X32_SYSCALL_BIT + 207;
+pub const SYS_io_getevents: ::c_long = __X32_SYSCALL_BIT + 208;
+pub const SYS_io_cancel: ::c_long = __X32_SYSCALL_BIT + 210;
+pub const SYS_lookup_dcookie: ::c_long = __X32_SYSCALL_BIT + 212;
+pub const SYS_epoll_create: ::c_long = __X32_SYSCALL_BIT + 213;
+pub const SYS_remap_file_pages: ::c_long = __X32_SYSCALL_BIT + 216;
+pub const SYS_getdents64: ::c_long = __X32_SYSCALL_BIT + 217;
+pub const SYS_set_tid_address: ::c_long = __X32_SYSCALL_BIT + 218;
+pub const SYS_restart_syscall: ::c_long = __X32_SYSCALL_BIT + 219;
+pub const SYS_semtimedop: ::c_long = __X32_SYSCALL_BIT + 220;
+pub const SYS_fadvise64: ::c_long = __X32_SYSCALL_BIT + 221;
+pub const SYS_timer_settime: ::c_long = __X32_SYSCALL_BIT + 223;
+pub const SYS_timer_gettime: ::c_long = __X32_SYSCALL_BIT + 224;
+pub const SYS_timer_getoverrun: ::c_long = __X32_SYSCALL_BIT + 225;
+pub const SYS_timer_delete: ::c_long = __X32_SYSCALL_BIT + 226;
+pub const SYS_clock_settime: ::c_long = __X32_SYSCALL_BIT + 227;
+pub const SYS_clock_gettime: ::c_long = __X32_SYSCALL_BIT + 228;
+pub const SYS_clock_getres: ::c_long = __X32_SYSCALL_BIT + 229;
+pub const SYS_clock_nanosleep: ::c_long = __X32_SYSCALL_BIT + 230;
+pub const SYS_exit_group: ::c_long = __X32_SYSCALL_BIT + 231;
+pub const SYS_epoll_wait: ::c_long = __X32_SYSCALL_BIT + 232;
+pub const SYS_epoll_ctl: ::c_long = __X32_SYSCALL_BIT + 233;
+pub const SYS_tgkill: ::c_long = __X32_SYSCALL_BIT + 234;
+pub const SYS_utimes: ::c_long = __X32_SYSCALL_BIT + 235;
+pub const SYS_mbind: ::c_long = __X32_SYSCALL_BIT + 237;
+pub const SYS_set_mempolicy: ::c_long = __X32_SYSCALL_BIT + 238;
+pub const SYS_get_mempolicy: ::c_long = __X32_SYSCALL_BIT + 239;
+pub const SYS_mq_open: ::c_long = __X32_SYSCALL_BIT + 240;
+pub const SYS_mq_unlink: ::c_long = __X32_SYSCALL_BIT + 241;
+pub const SYS_mq_timedsend: ::c_long = __X32_SYSCALL_BIT + 242;
+pub const SYS_mq_timedreceive: ::c_long = __X32_SYSCALL_BIT + 243;
+pub const SYS_mq_getsetattr: ::c_long = __X32_SYSCALL_BIT + 245;
+pub const SYS_add_key: ::c_long = __X32_SYSCALL_BIT + 248;
+pub const SYS_request_key: ::c_long = __X32_SYSCALL_BIT + 249;
+pub const SYS_keyctl: ::c_long = __X32_SYSCALL_BIT + 250;
+pub const SYS_ioprio_set: ::c_long = __X32_SYSCALL_BIT + 251;
+pub const SYS_ioprio_get: ::c_long = __X32_SYSCALL_BIT + 252;
+pub const SYS_inotify_init: ::c_long = __X32_SYSCALL_BIT + 253;
+pub const SYS_inotify_add_watch: ::c_long = __X32_SYSCALL_BIT + 254;
+pub const SYS_inotify_rm_watch: ::c_long = __X32_SYSCALL_BIT + 255;
+pub const SYS_migrate_pages: ::c_long = __X32_SYSCALL_BIT + 256;
+pub const SYS_openat: ::c_long = __X32_SYSCALL_BIT + 257;
+pub const SYS_mkdirat: ::c_long = __X32_SYSCALL_BIT + 258;
+pub const SYS_mknodat: ::c_long = __X32_SYSCALL_BIT + 259;
+pub const SYS_fchownat: ::c_long = __X32_SYSCALL_BIT + 260;
+pub const SYS_futimesat: ::c_long = __X32_SYSCALL_BIT + 261;
+pub const SYS_newfstatat: ::c_long = __X32_SYSCALL_BIT + 262;
+pub const SYS_unlinkat: ::c_long = __X32_SYSCALL_BIT + 263;
+pub const SYS_renameat: ::c_long = __X32_SYSCALL_BIT + 264;
+pub const SYS_linkat: ::c_long = __X32_SYSCALL_BIT + 265;
+pub const SYS_symlinkat: ::c_long = __X32_SYSCALL_BIT + 266;
+pub const SYS_readlinkat: ::c_long = __X32_SYSCALL_BIT + 267;
+pub const SYS_fchmodat: ::c_long = __X32_SYSCALL_BIT + 268;
+pub const SYS_faccessat: ::c_long = __X32_SYSCALL_BIT + 269;
+pub const SYS_pselect6: ::c_long = __X32_SYSCALL_BIT + 270;
+pub const SYS_ppoll: ::c_long = __X32_SYSCALL_BIT + 271;
+pub const SYS_unshare: ::c_long = __X32_SYSCALL_BIT + 272;
+pub const SYS_splice: ::c_long = __X32_SYSCALL_BIT + 275;
+pub const SYS_tee: ::c_long = __X32_SYSCALL_BIT + 276;
+pub const SYS_sync_file_range: ::c_long = __X32_SYSCALL_BIT + 277;
+pub const SYS_utimensat: ::c_long = __X32_SYSCALL_BIT + 280;
+pub const SYS_epoll_pwait: ::c_long = __X32_SYSCALL_BIT + 281;
+pub const SYS_signalfd: ::c_long = __X32_SYSCALL_BIT + 282;
+pub const SYS_timerfd_create: ::c_long = __X32_SYSCALL_BIT + 283;
+pub const SYS_eventfd: ::c_long = __X32_SYSCALL_BIT + 284;
+pub const SYS_fallocate: ::c_long = __X32_SYSCALL_BIT + 285;
+pub const SYS_timerfd_settime: ::c_long = __X32_SYSCALL_BIT + 286;
+pub const SYS_timerfd_gettime: ::c_long = __X32_SYSCALL_BIT + 287;
+pub const SYS_accept4: ::c_long = __X32_SYSCALL_BIT + 288;
+pub const SYS_signalfd4: ::c_long = __X32_SYSCALL_BIT + 289;
+pub const SYS_eventfd2: ::c_long = __X32_SYSCALL_BIT + 290;
+pub const SYS_epoll_create1: ::c_long = __X32_SYSCALL_BIT + 291;
+pub const SYS_dup3: ::c_long = __X32_SYSCALL_BIT + 292;
+pub const SYS_pipe2: ::c_long = __X32_SYSCALL_BIT + 293;
+pub const SYS_inotify_init1: ::c_long = __X32_SYSCALL_BIT + 294;
+pub const SYS_perf_event_open: ::c_long = __X32_SYSCALL_BIT + 298;
+pub const SYS_fanotify_init: ::c_long = __X32_SYSCALL_BIT + 300;
+pub const SYS_fanotify_mark: ::c_long = __X32_SYSCALL_BIT + 301;
+pub const SYS_prlimit64: ::c_long = __X32_SYSCALL_BIT + 302;
+pub const SYS_name_to_handle_at: ::c_long = __X32_SYSCALL_BIT + 303;
+pub const SYS_open_by_handle_at: ::c_long = __X32_SYSCALL_BIT + 304;
+pub const SYS_clock_adjtime: ::c_long = __X32_SYSCALL_BIT + 305;
+pub const SYS_syncfs: ::c_long = __X32_SYSCALL_BIT + 306;
+pub const SYS_setns: ::c_long = __X32_SYSCALL_BIT + 308;
+pub const SYS_getcpu: ::c_long = __X32_SYSCALL_BIT + 309;
+pub const SYS_kcmp: ::c_long = __X32_SYSCALL_BIT + 312;
+pub const SYS_finit_module: ::c_long = __X32_SYSCALL_BIT + 313;
+pub const SYS_sched_setattr: ::c_long = __X32_SYSCALL_BIT + 314;
+pub const SYS_sched_getattr: ::c_long = __X32_SYSCALL_BIT + 315;
+pub const SYS_renameat2: ::c_long = __X32_SYSCALL_BIT + 316;
+pub const SYS_seccomp: ::c_long = __X32_SYSCALL_BIT + 317;
+pub const SYS_getrandom: ::c_long = __X32_SYSCALL_BIT + 318;
+pub const SYS_memfd_create: ::c_long = __X32_SYSCALL_BIT + 319;
+pub const SYS_kexec_file_load: ::c_long = __X32_SYSCALL_BIT + 320;
+pub const SYS_bpf: ::c_long = __X32_SYSCALL_BIT + 321;
+pub const SYS_userfaultfd: ::c_long = __X32_SYSCALL_BIT + 323;
+pub const SYS_membarrier: ::c_long = __X32_SYSCALL_BIT + 324;
+pub const SYS_mlock2: ::c_long = __X32_SYSCALL_BIT + 325;
+pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326;
+pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
+pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
+pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
+pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
+pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
+pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
+pub const SYS_readv: ::c_long = __X32_SYSCALL_BIT + 515;
+pub const SYS_writev: ::c_long = __X32_SYSCALL_BIT + 516;
+pub const SYS_recvfrom: ::c_long = __X32_SYSCALL_BIT + 517;
+pub const SYS_sendmsg: ::c_long = __X32_SYSCALL_BIT + 518;
+pub const SYS_recvmsg: ::c_long = __X32_SYSCALL_BIT + 519;
+pub const SYS_execve: ::c_long = __X32_SYSCALL_BIT + 520;
+pub const SYS_ptrace: ::c_long = __X32_SYSCALL_BIT + 521;
+pub const SYS_rt_sigpending: ::c_long = __X32_SYSCALL_BIT + 522;
+pub const SYS_rt_sigtimedwait: ::c_long = __X32_SYSCALL_BIT + 523;
+pub const SYS_rt_sigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 524;
+pub const SYS_sigaltstack: ::c_long = __X32_SYSCALL_BIT + 525;
+pub const SYS_timer_create: ::c_long = __X32_SYSCALL_BIT + 526;
+pub const SYS_mq_notify: ::c_long = __X32_SYSCALL_BIT + 527;
+pub const SYS_kexec_load: ::c_long = __X32_SYSCALL_BIT + 528;
+pub const SYS_waitid: ::c_long = __X32_SYSCALL_BIT + 529;
+pub const SYS_set_robust_list: ::c_long = __X32_SYSCALL_BIT + 530;
+pub const SYS_get_robust_list: ::c_long = __X32_SYSCALL_BIT + 531;
+pub const SYS_vmsplice: ::c_long = __X32_SYSCALL_BIT + 532;
+pub const SYS_move_pages: ::c_long = __X32_SYSCALL_BIT + 533;
+pub const SYS_preadv: ::c_long = __X32_SYSCALL_BIT + 534;
+pub const SYS_pwritev: ::c_long = __X32_SYSCALL_BIT + 535;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 536;
+pub const SYS_recvmmsg: ::c_long = __X32_SYSCALL_BIT + 537;
+pub const SYS_sendmmsg: ::c_long = __X32_SYSCALL_BIT + 538;
+pub const SYS_process_vm_readv: ::c_long = __X32_SYSCALL_BIT + 539;
+pub const SYS_process_vm_writev: ::c_long = __X32_SYSCALL_BIT + 540;
+pub const SYS_setsockopt: ::c_long = __X32_SYSCALL_BIT + 541;
+pub const SYS_getsockopt: ::c_long = __X32_SYSCALL_BIT + 542;
+pub const SYS_io_setup: ::c_long = __X32_SYSCALL_BIT + 543;
+pub const SYS_io_submit: ::c_long = __X32_SYSCALL_BIT + 544;
+pub const SYS_execveat: ::c_long = __X32_SYSCALL_BIT + 545;
+pub const SYS_preadv2: ::c_long = __X32_SYSCALL_BIT + 546;
+pub const SYS_pwritev2: ::c_long = __X32_SYSCALL_BIT + 547;
diff --git a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
index 81b2384..5689aaa 100644
--- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -22,12 +22,12 @@ s! {
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_long,
+ pub st_atime_nsec: i64,
pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_long,
+ pub st_mtime_nsec: i64,
pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_long,
- __unused: [::c_long; 3],
+ pub st_ctime_nsec: i64,
+ __unused: [i64; 3],
}
pub struct stat64 {
@@ -43,12 +43,12 @@ s! {
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_long,
+ pub st_atime_nsec: i64,
pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_long,
+ pub st_mtime_nsec: i64,
pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_long,
- __reserved: [::c_long; 3],
+ pub st_ctime_nsec: i64,
+ __reserved: [i64; 3],
}
pub struct statfs64 {
@@ -82,6 +82,9 @@ s! {
}
pub struct pthread_attr_t {
+ #[cfg(target_pointer_width = "32")]
+ __size: [u32; 8],
+ #[cfg(target_pointer_width = "64")]
__size: [u64; 7]
}
@@ -164,7 +167,11 @@ s! {
pub start_stack: ::c_ulonglong,
pub signal: ::c_longlong,
__reserved: ::c_int,
+ #[cfg(target_pointer_width = "32")]
+ __pad1: u32,
pub u_ar0: *mut user_regs_struct,
+ #[cfg(target_pointer_width = "32")]
+ __pad2: u32,
pub u_fpstate: *mut user_fpregs_struct,
pub magic: ::c_ulonglong,
pub u_comm: [::c_char; 32],
@@ -196,8 +203,8 @@ s! {
__pad1: ::c_ushort,
pub __seq: ::c_ushort,
__pad2: ::c_ushort,
- __unused1: ::c_ulong,
- __unused2: ::c_ulong
+ __unused1: u64,
+ __unused2: u64
}
pub struct shmid_ds {
@@ -209,8 +216,19 @@ s! {
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
- __unused4: ::c_ulong,
- __unused5: ::c_ulong
+ __unused4: u64,
+ __unused5: u64
+ }
+
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
}
}
@@ -231,6 +249,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
@@ -453,7 +472,6 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 0x4000;
@@ -552,6 +570,7 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -594,341 +613,6 @@ pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
pub const FIONREAD: ::c_ulong = 0x541B;
-// Syscall table
-
-pub const SYS_read: ::c_long = 0;
-pub const SYS_write: ::c_long = 1;
-pub const SYS_open: ::c_long = 2;
-pub const SYS_close: ::c_long = 3;
-pub const SYS_stat: ::c_long = 4;
-pub const SYS_fstat: ::c_long = 5;
-pub const SYS_lstat: ::c_long = 6;
-pub const SYS_poll: ::c_long = 7;
-pub const SYS_lseek: ::c_long = 8;
-pub const SYS_mmap: ::c_long = 9;
-pub const SYS_mprotect: ::c_long = 10;
-pub const SYS_munmap: ::c_long = 11;
-pub const SYS_brk: ::c_long = 12;
-pub const SYS_rt_sigaction: ::c_long = 13;
-pub const SYS_rt_sigprocmask: ::c_long = 14;
-pub const SYS_rt_sigreturn: ::c_long = 15;
-pub const SYS_ioctl: ::c_long = 16;
-pub const SYS_pread64: ::c_long = 17;
-pub const SYS_pwrite64: ::c_long = 18;
-pub const SYS_readv: ::c_long = 19;
-pub const SYS_writev: ::c_long = 20;
-pub const SYS_access: ::c_long = 21;
-pub const SYS_pipe: ::c_long = 22;
-pub const SYS_select: ::c_long = 23;
-pub const SYS_sched_yield: ::c_long = 24;
-pub const SYS_mremap: ::c_long = 25;
-pub const SYS_msync: ::c_long = 26;
-pub const SYS_mincore: ::c_long = 27;
-pub const SYS_madvise: ::c_long = 28;
-pub const SYS_shmget: ::c_long = 29;
-pub const SYS_shmat: ::c_long = 30;
-pub const SYS_shmctl: ::c_long = 31;
-pub const SYS_dup: ::c_long = 32;
-pub const SYS_dup2: ::c_long = 33;
-pub const SYS_pause: ::c_long = 34;
-pub const SYS_nanosleep: ::c_long = 35;
-pub const SYS_getitimer: ::c_long = 36;
-pub const SYS_alarm: ::c_long = 37;
-pub const SYS_setitimer: ::c_long = 38;
-pub const SYS_getpid: ::c_long = 39;
-pub const SYS_sendfile: ::c_long = 40;
-pub const SYS_socket: ::c_long = 41;
-pub const SYS_connect: ::c_long = 42;
-pub const SYS_accept: ::c_long = 43;
-pub const SYS_sendto: ::c_long = 44;
-pub const SYS_recvfrom: ::c_long = 45;
-pub const SYS_sendmsg: ::c_long = 46;
-pub const SYS_recvmsg: ::c_long = 47;
-pub const SYS_shutdown: ::c_long = 48;
-pub const SYS_bind: ::c_long = 49;
-pub const SYS_listen: ::c_long = 50;
-pub const SYS_getsockname: ::c_long = 51;
-pub const SYS_getpeername: ::c_long = 52;
-pub const SYS_socketpair: ::c_long = 53;
-pub const SYS_setsockopt: ::c_long = 54;
-pub const SYS_getsockopt: ::c_long = 55;
-pub const SYS_clone: ::c_long = 56;
-pub const SYS_fork: ::c_long = 57;
-pub const SYS_vfork: ::c_long = 58;
-pub const SYS_execve: ::c_long = 59;
-pub const SYS_exit: ::c_long = 60;
-pub const SYS_wait4: ::c_long = 61;
-pub const SYS_kill: ::c_long = 62;
-pub const SYS_uname: ::c_long = 63;
-pub const SYS_semget: ::c_long = 64;
-pub const SYS_semop: ::c_long = 65;
-pub const SYS_semctl: ::c_long = 66;
-pub const SYS_shmdt: ::c_long = 67;
-pub const SYS_msgget: ::c_long = 68;
-pub const SYS_msgsnd: ::c_long = 69;
-pub const SYS_msgrcv: ::c_long = 70;
-pub const SYS_msgctl: ::c_long = 71;
-pub const SYS_fcntl: ::c_long = 72;
-pub const SYS_flock: ::c_long = 73;
-pub const SYS_fsync: ::c_long = 74;
-pub const SYS_fdatasync: ::c_long = 75;
-pub const SYS_truncate: ::c_long = 76;
-pub const SYS_ftruncate: ::c_long = 77;
-pub const SYS_getdents: ::c_long = 78;
-pub const SYS_getcwd: ::c_long = 79;
-pub const SYS_chdir: ::c_long = 80;
-pub const SYS_fchdir: ::c_long = 81;
-pub const SYS_rename: ::c_long = 82;
-pub const SYS_mkdir: ::c_long = 83;
-pub const SYS_rmdir: ::c_long = 84;
-pub const SYS_creat: ::c_long = 85;
-pub const SYS_link: ::c_long = 86;
-pub const SYS_unlink: ::c_long = 87;
-pub const SYS_symlink: ::c_long = 88;
-pub const SYS_readlink: ::c_long = 89;
-pub const SYS_chmod: ::c_long = 90;
-pub const SYS_fchmod: ::c_long = 91;
-pub const SYS_chown: ::c_long = 92;
-pub const SYS_fchown: ::c_long = 93;
-pub const SYS_lchown: ::c_long = 94;
-pub const SYS_umask: ::c_long = 95;
-pub const SYS_gettimeofday: ::c_long = 96;
-pub const SYS_getrlimit: ::c_long = 97;
-pub const SYS_getrusage: ::c_long = 98;
-pub const SYS_sysinfo: ::c_long = 99;
-pub const SYS_times: ::c_long = 100;
-pub const SYS_ptrace: ::c_long = 101;
-pub const SYS_getuid: ::c_long = 102;
-pub const SYS_syslog: ::c_long = 103;
-pub const SYS_getgid: ::c_long = 104;
-pub const SYS_setuid: ::c_long = 105;
-pub const SYS_setgid: ::c_long = 106;
-pub const SYS_geteuid: ::c_long = 107;
-pub const SYS_getegid: ::c_long = 108;
-pub const SYS_setpgid: ::c_long = 109;
-pub const SYS_getppid: ::c_long = 110;
-pub const SYS_getpgrp: ::c_long = 111;
-pub const SYS_setsid: ::c_long = 112;
-pub const SYS_setreuid: ::c_long = 113;
-pub const SYS_setregid: ::c_long = 114;
-pub const SYS_getgroups: ::c_long = 115;
-pub const SYS_setgroups: ::c_long = 116;
-pub const SYS_setresuid: ::c_long = 117;
-pub const SYS_getresuid: ::c_long = 118;
-pub const SYS_setresgid: ::c_long = 119;
-pub const SYS_getresgid: ::c_long = 120;
-pub const SYS_getpgid: ::c_long = 121;
-pub const SYS_setfsuid: ::c_long = 122;
-pub const SYS_setfsgid: ::c_long = 123;
-pub const SYS_getsid: ::c_long = 124;
-pub const SYS_capget: ::c_long = 125;
-pub const SYS_capset: ::c_long = 126;
-pub const SYS_rt_sigpending: ::c_long = 127;
-pub const SYS_rt_sigtimedwait: ::c_long = 128;
-pub const SYS_rt_sigqueueinfo: ::c_long = 129;
-pub const SYS_rt_sigsuspend: ::c_long = 130;
-pub const SYS_sigaltstack: ::c_long = 131;
-pub const SYS_utime: ::c_long = 132;
-pub const SYS_mknod: ::c_long = 133;
-pub const SYS_uselib: ::c_long = 134;
-pub const SYS_personality: ::c_long = 135;
-pub const SYS_ustat: ::c_long = 136;
-pub const SYS_statfs: ::c_long = 137;
-pub const SYS_fstatfs: ::c_long = 138;
-pub const SYS_sysfs: ::c_long = 139;
-pub const SYS_getpriority: ::c_long = 140;
-pub const SYS_setpriority: ::c_long = 141;
-pub const SYS_sched_setparam: ::c_long = 142;
-pub const SYS_sched_getparam: ::c_long = 143;
-pub const SYS_sched_setscheduler: ::c_long = 144;
-pub const SYS_sched_getscheduler: ::c_long = 145;
-pub const SYS_sched_get_priority_max: ::c_long = 146;
-pub const SYS_sched_get_priority_min: ::c_long = 147;
-pub const SYS_sched_rr_get_interval: ::c_long = 148;
-pub const SYS_mlock: ::c_long = 149;
-pub const SYS_munlock: ::c_long = 150;
-pub const SYS_mlockall: ::c_long = 151;
-pub const SYS_munlockall: ::c_long = 152;
-pub const SYS_vhangup: ::c_long = 153;
-pub const SYS_modify_ldt: ::c_long = 154;
-pub const SYS_pivot_root: ::c_long = 155;
-pub const SYS__sysctl: ::c_long = 156;
-pub const SYS_prctl: ::c_long = 157;
-pub const SYS_arch_prctl: ::c_long = 158;
-pub const SYS_adjtimex: ::c_long = 159;
-pub const SYS_setrlimit: ::c_long = 160;
-pub const SYS_chroot: ::c_long = 161;
-pub const SYS_sync: ::c_long = 162;
-pub const SYS_acct: ::c_long = 163;
-pub const SYS_settimeofday: ::c_long = 164;
-pub const SYS_mount: ::c_long = 165;
-pub const SYS_umount2: ::c_long = 166;
-pub const SYS_swapon: ::c_long = 167;
-pub const SYS_swapoff: ::c_long = 168;
-pub const SYS_reboot: ::c_long = 169;
-pub const SYS_sethostname: ::c_long = 170;
-pub const SYS_setdomainname: ::c_long = 171;
-pub const SYS_iopl: ::c_long = 172;
-pub const SYS_ioperm: ::c_long = 173;
-pub const SYS_create_module: ::c_long = 174;
-pub const SYS_init_module: ::c_long = 175;
-pub const SYS_delete_module: ::c_long = 176;
-pub const SYS_get_kernel_syms: ::c_long = 177;
-pub const SYS_query_module: ::c_long = 178;
-pub const SYS_quotactl: ::c_long = 179;
-pub const SYS_nfsservctl: ::c_long = 180;
-pub const SYS_getpmsg: ::c_long = 181;
-pub const SYS_putpmsg: ::c_long = 182;
-pub const SYS_afs_syscall: ::c_long = 183;
-pub const SYS_tuxcall: ::c_long = 184;
-pub const SYS_security: ::c_long = 185;
-pub const SYS_gettid: ::c_long = 186;
-pub const SYS_readahead: ::c_long = 187;
-pub const SYS_setxattr: ::c_long = 188;
-pub const SYS_lsetxattr: ::c_long = 189;
-pub const SYS_fsetxattr: ::c_long = 190;
-pub const SYS_getxattr: ::c_long = 191;
-pub const SYS_lgetxattr: ::c_long = 192;
-pub const SYS_fgetxattr: ::c_long = 193;
-pub const SYS_listxattr: ::c_long = 194;
-pub const SYS_llistxattr: ::c_long = 195;
-pub const SYS_flistxattr: ::c_long = 196;
-pub const SYS_removexattr: ::c_long = 197;
-pub const SYS_lremovexattr: ::c_long = 198;
-pub const SYS_fremovexattr: ::c_long = 199;
-pub const SYS_tkill: ::c_long = 200;
-pub const SYS_time: ::c_long = 201;
-pub const SYS_futex: ::c_long = 202;
-pub const SYS_sched_setaffinity: ::c_long = 203;
-pub const SYS_sched_getaffinity: ::c_long = 204;
-pub const SYS_set_thread_area: ::c_long = 205;
-pub const SYS_io_setup: ::c_long = 206;
-pub const SYS_io_destroy: ::c_long = 207;
-pub const SYS_io_getevents: ::c_long = 208;
-pub const SYS_io_submit: ::c_long = 209;
-pub const SYS_io_cancel: ::c_long = 210;
-pub const SYS_get_thread_area: ::c_long = 211;
-pub const SYS_lookup_dcookie: ::c_long = 212;
-pub const SYS_epoll_create: ::c_long = 213;
-pub const SYS_epoll_ctl_old: ::c_long = 214;
-pub const SYS_epoll_wait_old: ::c_long = 215;
-pub const SYS_remap_file_pages: ::c_long = 216;
-pub const SYS_getdents64: ::c_long = 217;
-pub const SYS_set_tid_address: ::c_long = 218;
-pub const SYS_restart_syscall: ::c_long = 219;
-pub const SYS_semtimedop: ::c_long = 220;
-pub const SYS_fadvise64: ::c_long = 221;
-pub const SYS_timer_create: ::c_long = 222;
-pub const SYS_timer_settime: ::c_long = 223;
-pub const SYS_timer_gettime: ::c_long = 224;
-pub const SYS_timer_getoverrun: ::c_long = 225;
-pub const SYS_timer_delete: ::c_long = 226;
-pub const SYS_clock_settime: ::c_long = 227;
-pub const SYS_clock_gettime: ::c_long = 228;
-pub const SYS_clock_getres: ::c_long = 229;
-pub const SYS_clock_nanosleep: ::c_long = 230;
-pub const SYS_exit_group: ::c_long = 231;
-pub const SYS_epoll_wait: ::c_long = 232;
-pub const SYS_epoll_ctl: ::c_long = 233;
-pub const SYS_tgkill: ::c_long = 234;
-pub const SYS_utimes: ::c_long = 235;
-pub const SYS_vserver: ::c_long = 236;
-pub const SYS_mbind: ::c_long = 237;
-pub const SYS_set_mempolicy: ::c_long = 238;
-pub const SYS_get_mempolicy: ::c_long = 239;
-pub const SYS_mq_open: ::c_long = 240;
-pub const SYS_mq_unlink: ::c_long = 241;
-pub const SYS_mq_timedsend: ::c_long = 242;
-pub const SYS_mq_timedreceive: ::c_long = 243;
-pub const SYS_mq_notify: ::c_long = 244;
-pub const SYS_mq_getsetattr: ::c_long = 245;
-pub const SYS_kexec_load: ::c_long = 246;
-pub const SYS_waitid: ::c_long = 247;
-pub const SYS_add_key: ::c_long = 248;
-pub const SYS_request_key: ::c_long = 249;
-pub const SYS_keyctl: ::c_long = 250;
-pub const SYS_ioprio_set: ::c_long = 251;
-pub const SYS_ioprio_get: ::c_long = 252;
-pub const SYS_inotify_init: ::c_long = 253;
-pub const SYS_inotify_add_watch: ::c_long = 254;
-pub const SYS_inotify_rm_watch: ::c_long = 255;
-pub const SYS_migrate_pages: ::c_long = 256;
-pub const SYS_openat: ::c_long = 257;
-pub const SYS_mkdirat: ::c_long = 258;
-pub const SYS_mknodat: ::c_long = 259;
-pub const SYS_fchownat: ::c_long = 260;
-pub const SYS_futimesat: ::c_long = 261;
-pub const SYS_newfstatat: ::c_long = 262;
-pub const SYS_unlinkat: ::c_long = 263;
-pub const SYS_renameat: ::c_long = 264;
-pub const SYS_linkat: ::c_long = 265;
-pub const SYS_symlinkat: ::c_long = 266;
-pub const SYS_readlinkat: ::c_long = 267;
-pub const SYS_fchmodat: ::c_long = 268;
-pub const SYS_faccessat: ::c_long = 269;
-pub const SYS_pselect6: ::c_long = 270;
-pub const SYS_ppoll: ::c_long = 271;
-pub const SYS_unshare: ::c_long = 272;
-pub const SYS_set_robust_list: ::c_long = 273;
-pub const SYS_get_robust_list: ::c_long = 274;
-pub const SYS_splice: ::c_long = 275;
-pub const SYS_tee: ::c_long = 276;
-pub const SYS_sync_file_range: ::c_long = 277;
-pub const SYS_vmsplice: ::c_long = 278;
-pub const SYS_move_pages: ::c_long = 279;
-pub const SYS_utimensat: ::c_long = 280;
-pub const SYS_epoll_pwait: ::c_long = 281;
-pub const SYS_signalfd: ::c_long = 282;
-pub const SYS_timerfd_create: ::c_long = 283;
-pub const SYS_eventfd: ::c_long = 284;
-pub const SYS_fallocate: ::c_long = 285;
-pub const SYS_timerfd_settime: ::c_long = 286;
-pub const SYS_timerfd_gettime: ::c_long = 287;
-pub const SYS_accept4: ::c_long = 288;
-pub const SYS_signalfd4: ::c_long = 289;
-pub const SYS_eventfd2: ::c_long = 290;
-pub const SYS_epoll_create1: ::c_long = 291;
-pub const SYS_dup3: ::c_long = 292;
-pub const SYS_pipe2: ::c_long = 293;
-pub const SYS_inotify_init1: ::c_long = 294;
-pub const SYS_preadv: ::c_long = 295;
-pub const SYS_pwritev: ::c_long = 296;
-pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
-pub const SYS_perf_event_open: ::c_long = 298;
-pub const SYS_recvmmsg: ::c_long = 299;
-pub const SYS_fanotify_init: ::c_long = 300;
-pub const SYS_fanotify_mark: ::c_long = 301;
-pub const SYS_prlimit64: ::c_long = 302;
-pub const SYS_name_to_handle_at: ::c_long = 303;
-pub const SYS_open_by_handle_at: ::c_long = 304;
-pub const SYS_clock_adjtime: ::c_long = 305;
-pub const SYS_syncfs: ::c_long = 306;
-pub const SYS_sendmmsg: ::c_long = 307;
-pub const SYS_setns: ::c_long = 308;
-pub const SYS_getcpu: ::c_long = 309;
-pub const SYS_process_vm_readv: ::c_long = 310;
-pub const SYS_process_vm_writev: ::c_long = 311;
-pub const SYS_kcmp: ::c_long = 312;
-pub const SYS_finit_module: ::c_long = 313;
-pub const SYS_sched_setattr: ::c_long = 314;
-pub const SYS_sched_getattr: ::c_long = 315;
-pub const SYS_renameat2: ::c_long = 316;
-pub const SYS_seccomp: ::c_long = 317;
-pub const SYS_getrandom: ::c_long = 318;
-pub const SYS_memfd_create: ::c_long = 319;
-pub const SYS_kexec_file_load: ::c_long = 320;
-pub const SYS_bpf: ::c_long = 321;
-pub const SYS_execveat: ::c_long = 322;
-pub const SYS_userfaultfd: ::c_long = 323;
-pub const SYS_membarrier: ::c_long = 324;
-pub const SYS_mlock2: ::c_long = 325;
-pub const SYS_copy_file_range: ::c_long = 326;
-pub const SYS_preadv2: ::c_long = 327;
-pub const SYS_pwritev2: ::c_long = 328;
-pub const SYS_pkey_mprotect: ::c_long = 329;
-pub const SYS_pkey_alloc: ::c_long = 330;
-pub const SYS_pkey_free: ::c_long = 331;
-
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
pub const R14: ::c_int = 1;
diff --git a/libc/src/unix/notbsd/linux/other/mod.rs b/libc/src/unix/notbsd/linux/other/mod.rs
index 8b78d32..c256d5f 100644
--- a/libc/src/unix/notbsd/linux/other/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/mod.rs
@@ -1,6 +1,3 @@
-pub type fsblkcnt_t = ::c_ulong;
-pub type fsfilcnt_t = ::c_ulong;
-pub type rlim_t = c_ulong;
pub type __priority_which_t = ::c_uint;
s! {
@@ -17,7 +14,7 @@ s! {
__error_code: ::c_int,
__return_value: ::ssize_t,
pub aio_offset: off_t,
- #[cfg(target_pointer_width = "32")]
+ #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
__unused1: [::c_char; 4],
__glibc_reserved: [::c_char; 32]
}
@@ -44,20 +41,24 @@ s! {
#[cfg(any(target_arch = "aarch64",
target_arch = "sparc64",
- target_pointer_width = "32"))]
+ all(target_pointer_width = "32",
+ not(target_arch = "x86_64"))))]
pub ut_session: ::c_long,
#[cfg(any(target_arch = "aarch64",
target_arch = "sparc64",
- target_pointer_width = "32"))]
+ all(target_pointer_width = "32",
+ not(target_arch = "x86_64"))))]
pub ut_tv: ::timeval,
#[cfg(not(any(target_arch = "aarch64",
target_arch = "sparc64",
- target_pointer_width = "32")))]
+ all(target_pointer_width = "32",
+ not(target_arch = "x86_64")))))]
pub ut_session: ::int32_t,
#[cfg(not(any(target_arch = "aarch64",
target_arch = "sparc64",
- target_pointer_width = "32")))]
+ all(target_pointer_width = "32",
+ not(target_arch = "x86_64")))))]
pub ut_tv: __timeval,
pub ut_addr_v6: [::int32_t; 4],
@@ -84,6 +85,9 @@ s! {
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub _pad: [::c_int; 29],
+ #[cfg(target_arch = "x86_64")]
+ _align: [u64; 0],
+ #[cfg(not(target_arch = "x86_64"))]
_align: [usize; 0],
}
@@ -100,12 +104,6 @@ s! {
__unused5: *mut ::c_void,
}
- pub struct ucred {
- pub pid: ::pid_t,
- pub uid: ::uid_t,
- pub gid: ::gid_t,
- }
-
pub struct statfs {
pub f_type: __fsword_t,
pub f_bsize: __fsword_t,
@@ -247,6 +245,8 @@ pub const EREMOTEIO: ::c_int = 121;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
@@ -259,6 +259,27 @@ pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
pub const TCP_FASTOPEN: ::c_int = 23;
pub const TCP_TIMESTAMP: ::c_int = 24;
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
@@ -385,8 +406,6 @@ pub const VEOF: usize = 4;
pub const CPU_SETSIZE: ::c_int = 0x400;
-pub const QFMT_VFS_V1: ::c_int = 4;
-
pub const PTRACE_TRACEME: ::c_uint = 0;
pub const PTRACE_PEEKTEXT: ::c_uint = 1;
pub const PTRACE_PEEKDATA: ::c_uint = 2;
@@ -518,6 +537,11 @@ pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+#[doc(hidden)]
+pub const AF_MAX: ::c_int = 42;
+#[doc(hidden)]
+pub const PF_MAX: ::c_int = AF_MAX;
+
cfg_if! {
if #[cfg(any(target_arch = "arm", target_arch = "x86",
target_arch = "x86_64"))] {
@@ -542,13 +566,6 @@ extern {
#[link(name = "util")]
extern {
- pub fn sysctl(name: *mut ::c_int,
- namelen: ::c_int,
- oldp: *mut ::c_void,
- oldlenp: *mut ::size_t,
- newp: *mut ::c_void,
- newlen: ::size_t)
- -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void,
sz: ::c_int) -> ::c_int;
diff --git a/libc/src/unix/notbsd/linux/s390x.rs b/libc/src/unix/notbsd/linux/s390x.rs
index 4f8318a..d7ed383 100644
--- a/libc/src/unix/notbsd/linux/s390x.rs
+++ b/libc/src/unix/notbsd/linux/s390x.rs
@@ -14,6 +14,9 @@ pub type time_t = i64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type clock_t = i64;
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
pub type __fsword_t = ::c_long;
pub type __priority_which_t = ::c_uint;
pub type __u64 = u64;
@@ -177,6 +180,17 @@ s! {
pub c_ospeed: ::speed_t,
}
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+
pub struct sysinfo {
pub uptime: ::c_long,
pub loads: [::c_ulong; 3],
@@ -207,12 +221,6 @@ s! {
__unused5: *mut ::c_void,
}
- pub struct ucred {
- pub pid: ::pid_t,
- pub uid: ::uid_t,
- pub gid: ::gid_t,
- }
-
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
@@ -309,10 +317,11 @@ pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 512;
-pub const O_LARGEFILE: ::c_int = 0o0100000;
+pub const O_LARGEFILE: ::c_int = 0;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
@@ -698,8 +707,6 @@ pub const CPU_SETSIZE: ::c_int = 0x400;
pub const EXTPROC: ::tcflag_t = 0x00010000;
-pub const QFMT_VFS_V1: ::c_int = 4;
-
pub const PTRACE_TRACEME: ::c_uint = 0;
pub const PTRACE_PEEKTEXT: ::c_uint = 1;
pub const PTRACE_PEEKDATA: ::c_uint = 2;
@@ -800,11 +807,6 @@ pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
-pub const SYS_pivot_root: ::c_long = 217;
-pub const SYS_gettid: ::c_long = 236;
-pub const SYS_perf_event_open: ::c_long = 331;
-pub const SYS_memfd_create: ::c_long = 350;
-
pub const VTIME: usize = 5;
pub const VSWTC: usize = 7;
pub const VSTART: usize = 8;
@@ -876,6 +878,7 @@ pub const PARODD: ::tcflag_t = 0o001000;
pub const HUPCL: ::tcflag_t = 0o002000;
pub const CLOCAL: ::tcflag_t = 0o004000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -905,12 +908,335 @@ pub const ECHOPRT: ::tcflag_t = 0o002000;
pub const ECHOKE: ::tcflag_t = 0o004000;
pub const PENDIN: ::tcflag_t = 0o040000;
-pub const POLLWRNORM: ::c_short = 0x004;
-pub const POLLWRBAND: ::c_short = 0x100;
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
pub const IXON: ::tcflag_t = 0o002000;
pub const IXOFF: ::tcflag_t = 0o010000;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_restart_syscall: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_lookup_dcookie: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_readahead: ::c_long = 222;
+pub const SYS_setxattr: ::c_long = 224;
+pub const SYS_lsetxattr: ::c_long = 225;
+pub const SYS_fsetxattr: ::c_long = 226;
+pub const SYS_getxattr: ::c_long = 227;
+pub const SYS_lgetxattr: ::c_long = 228;
+pub const SYS_fgetxattr: ::c_long = 229;
+pub const SYS_listxattr: ::c_long = 230;
+pub const SYS_llistxattr: ::c_long = 231;
+pub const SYS_flistxattr: ::c_long = 232;
+pub const SYS_removexattr: ::c_long = 233;
+pub const SYS_lremovexattr: ::c_long = 234;
+pub const SYS_fremovexattr: ::c_long = 235;
+pub const SYS_gettid: ::c_long = 236;
+pub const SYS_tkill: ::c_long = 237;
+pub const SYS_futex: ::c_long = 238;
+pub const SYS_sched_setaffinity: ::c_long = 239;
+pub const SYS_sched_getaffinity: ::c_long = 240;
+pub const SYS_tgkill: ::c_long = 241;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_epoll_create: ::c_long = 249;
+pub const SYS_epoll_ctl: ::c_long = 250;
+pub const SYS_epoll_wait: ::c_long = 251;
+pub const SYS_set_tid_address: ::c_long = 252;
+pub const SYS_fadvise64: ::c_long = 253;
+pub const SYS_timer_create: ::c_long = 254;
+pub const SYS_timer_settime: ::c_long = 255;
+pub const SYS_timer_gettime: ::c_long = 256;
+pub const SYS_timer_getoverrun: ::c_long = 257;
+pub const SYS_timer_delete: ::c_long = 258;
+pub const SYS_clock_settime: ::c_long = 259;
+pub const SYS_clock_gettime: ::c_long = 260;
+pub const SYS_clock_getres: ::c_long = 261;
+pub const SYS_clock_nanosleep: ::c_long = 262;
+pub const SYS_statfs64: ::c_long = 265;
+pub const SYS_fstatfs64: ::c_long = 266;
+pub const SYS_remap_file_pages: ::c_long = 267;
+pub const SYS_mbind: ::c_long = 268;
+pub const SYS_get_mempolicy: ::c_long = 269;
+pub const SYS_set_mempolicy: ::c_long = 270;
+pub const SYS_mq_open: ::c_long = 271;
+pub const SYS_mq_unlink: ::c_long = 272;
+pub const SYS_mq_timedsend: ::c_long = 273;
+pub const SYS_mq_timedreceive: ::c_long = 274;
+pub const SYS_mq_notify: ::c_long = 275;
+pub const SYS_mq_getsetattr: ::c_long = 276;
+pub const SYS_kexec_load: ::c_long = 277;
+pub const SYS_add_key: ::c_long = 278;
+pub const SYS_request_key: ::c_long = 279;
+pub const SYS_keyctl: ::c_long = 280;
+pub const SYS_waitid: ::c_long = 281;
+pub const SYS_ioprio_set: ::c_long = 282;
+pub const SYS_ioprio_get: ::c_long = 283;
+pub const SYS_inotify_init: ::c_long = 284;
+pub const SYS_inotify_add_watch: ::c_long = 285;
+pub const SYS_inotify_rm_watch: ::c_long = 286;
+pub const SYS_migrate_pages: ::c_long = 287;
+pub const SYS_openat: ::c_long = 288;
+pub const SYS_mkdirat: ::c_long = 289;
+pub const SYS_mknodat: ::c_long = 290;
+pub const SYS_fchownat: ::c_long = 291;
+pub const SYS_futimesat: ::c_long = 292;
+pub const SYS_unlinkat: ::c_long = 294;
+pub const SYS_renameat: ::c_long = 295;
+pub const SYS_linkat: ::c_long = 296;
+pub const SYS_symlinkat: ::c_long = 297;
+pub const SYS_readlinkat: ::c_long = 298;
+pub const SYS_fchmodat: ::c_long = 299;
+pub const SYS_faccessat: ::c_long = 300;
+pub const SYS_pselect6: ::c_long = 301;
+pub const SYS_ppoll: ::c_long = 302;
+pub const SYS_unshare: ::c_long = 303;
+pub const SYS_set_robust_list: ::c_long = 304;
+pub const SYS_get_robust_list: ::c_long = 305;
+pub const SYS_splice: ::c_long = 306;
+pub const SYS_sync_file_range: ::c_long = 307;
+pub const SYS_tee: ::c_long = 308;
+pub const SYS_vmsplice: ::c_long = 309;
+pub const SYS_move_pages: ::c_long = 310;
+pub const SYS_getcpu: ::c_long = 311;
+pub const SYS_epoll_pwait: ::c_long = 312;
+pub const SYS_utimes: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_utimensat: ::c_long = 315;
+pub const SYS_signalfd: ::c_long = 316;
+pub const SYS_timerfd: ::c_long = 317;
+pub const SYS_eventfd: ::c_long = 318;
+pub const SYS_timerfd_create: ::c_long = 319;
+pub const SYS_timerfd_settime: ::c_long = 320;
+pub const SYS_timerfd_gettime: ::c_long = 321;
+pub const SYS_signalfd4: ::c_long = 322;
+pub const SYS_eventfd2: ::c_long = 323;
+pub const SYS_inotify_init1: ::c_long = 324;
+pub const SYS_pipe2: ::c_long = 325;
+pub const SYS_dup3: ::c_long = 326;
+pub const SYS_epoll_create1: ::c_long = 327;
+pub const SYS_preadv: ::c_long = 328;
+pub const SYS_pwritev: ::c_long = 329;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 330;
+pub const SYS_perf_event_open: ::c_long = 331;
+pub const SYS_fanotify_init: ::c_long = 332;
+pub const SYS_fanotify_mark: ::c_long = 333;
+pub const SYS_prlimit64: ::c_long = 334;
+pub const SYS_name_to_handle_at: ::c_long = 335;
+pub const SYS_open_by_handle_at: ::c_long = 336;
+pub const SYS_clock_adjtime: ::c_long = 337;
+pub const SYS_syncfs: ::c_long = 338;
+pub const SYS_setns: ::c_long = 339;
+pub const SYS_process_vm_readv: ::c_long = 340;
+pub const SYS_process_vm_writev: ::c_long = 341;
+pub const SYS_s390_runtime_instr: ::c_long = 342;
+pub const SYS_kcmp: ::c_long = 343;
+pub const SYS_finit_module: ::c_long = 344;
+pub const SYS_sched_setattr: ::c_long = 345;
+pub const SYS_sched_getattr: ::c_long = 346;
+pub const SYS_renameat2: ::c_long = 347;
+pub const SYS_seccomp: ::c_long = 348;
+pub const SYS_getrandom: ::c_long = 349;
+pub const SYS_memfd_create: ::c_long = 350;
+pub const SYS_bpf: ::c_long = 351;
+pub const SYS_s390_pci_mmio_write: ::c_long = 352;
+pub const SYS_s390_pci_mmio_read: ::c_long = 353;
+pub const SYS_execveat: ::c_long = 354;
+pub const SYS_userfaultfd: ::c_long = 355;
+pub const SYS_membarrier: ::c_long = 356;
+pub const SYS_recvmmsg: ::c_long = 357;
+pub const SYS_sendmmsg: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_mlock2: ::c_long = 374;
+pub const SYS_copy_file_range: ::c_long = 375;
+pub const SYS_preadv2: ::c_long = 376;
+pub const SYS_pwritev2: ::c_long = 377;
+pub const SYS_lchown: ::c_long = 198;
+pub const SYS_setuid: ::c_long = 213;
+pub const SYS_getuid: ::c_long = 199;
+pub const SYS_setgid: ::c_long = 214;
+pub const SYS_getgid: ::c_long = 200;
+pub const SYS_geteuid: ::c_long = 201;
+pub const SYS_setreuid: ::c_long = 203;
+pub const SYS_setregid: ::c_long = 204;
+pub const SYS_getrlimit: ::c_long = 191;
+pub const SYS_getgroups: ::c_long = 205;
+pub const SYS_fchown: ::c_long = 207;
+pub const SYS_setresuid: ::c_long = 208;
+pub const SYS_setresgid: ::c_long = 210;
+pub const SYS_getresgid: ::c_long = 211;
+pub const SYS_select: ::c_long = 142;
+pub const SYS_getegid: ::c_long = 202;
+pub const SYS_setgroups: ::c_long = 206;
+pub const SYS_getresuid: ::c_long = 209;
+pub const SYS_chown: ::c_long = 212;
+pub const SYS_setfsuid: ::c_long = 215;
+pub const SYS_setfsgid: ::c_long = 216;
+pub const SYS_newfstatat: ::c_long = 293;
+
#[link(name = "util")]
extern {
pub fn sysctl(name: *mut ::c_int,
diff --git a/libc/src/unix/notbsd/mod.rs b/libc/src/unix/notbsd/mod.rs
index 66437de..07a6043 100644
--- a/libc/src/unix/notbsd/mod.rs
+++ b/libc/src/unix/notbsd/mod.rs
@@ -405,8 +405,6 @@ pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const SCM_CREDENTIALS: ::c_int = 0x02;
-pub const IPPROTO_RAW: ::c_int = 255;
-
pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
pub const PROT_GROWSUP: ::c_int = 0x2000000;
@@ -762,6 +760,7 @@ pub const SPLICE_F_MORE: ::c_uint = 0x04;
pub const SPLICE_F_GIFT: ::c_uint = 0x08;
pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_LAZY: ::c_int = 1;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -795,6 +794,12 @@ pub const P_PGID: idtype_t = 2;
pub const UTIME_OMIT: c_long = 1073741822;
pub const UTIME_NOW: c_long = 1073741823;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLRDBAND: ::c_short = 0x080;
@@ -856,6 +861,10 @@ f! {
pub fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0x80) != 0
}
+
+ pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+ (cmd << 8) | (type_ & 0x00ff)
+ }
}
extern {
@@ -899,6 +908,8 @@ extern {
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
+ pub fn fstatat64(dirfd: ::c_int, pathname: *const c_char,
+ buf: *mut stat64, flags: ::c_int) -> ::c_int;
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
@@ -916,8 +927,16 @@ extern {
oflag: ::c_int, ...) -> ::c_int;
pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
offset: off64_t) -> ::ssize_t;
+ pub fn preadv64(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off64_t) -> ::ssize_t;
pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
offset: off64_t) -> ::ssize_t;
+ pub fn pwritev64(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off64_t) -> ::ssize_t;
pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
result: *mut *mut ::dirent64) -> ::c_int;
@@ -993,4 +1012,3 @@ cfg_if! {
// name: *mut ::c_char,
// termp: *const termios,
// winp: *const ::winsize) -> ::pid_t;
- // pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
diff --git a/libc/src/unix/solaris/mod.rs b/libc/src/unix/solaris/mod.rs
index 4461a79..63bd59a 100644
--- a/libc/src/unix/solaris/mod.rs
+++ b/libc/src/unix/solaris/mod.rs
@@ -32,7 +32,6 @@ pub type sa_family_t = u16;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
pub type blksize_t = ::c_int;
-pub type fflags_t = ::c_int;
pub type nl_item = ::c_int;
pub type id_t = ::c_int;
pub type idtype_t = ::c_uint;
@@ -119,7 +118,7 @@ s! {
}
pub struct cmsghdr {
- pub cmsg_len: ::size_t,
+ pub cmsg_len: ::socklen_t,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
@@ -177,7 +176,7 @@ s! {
pub d_ino: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
- pub d_name: [::c_char; 1]
+ pub d_name: [::c_char; 3]
}
pub struct glob_t {
@@ -352,7 +351,7 @@ s! {
pub portev_source: ::c_ushort,
pub portev_pad: ::c_ushort,
pub portev_object: ::uintptr_t,
- pub portev_user: ::uintptr_t,
+ pub portev_user: *mut ::c_void,
}
}
@@ -591,6 +590,9 @@ pub const WSTOPPED: ::c_int = WUNTRACED;
pub const WCONTINUED: ::c_int = 0x08;
pub const WNOWAIT: ::c_int = 0x80;
+pub const AT_FDCWD: ::c_int = 0xffd19553;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000;
+
// Solaris defines a great many more of these; we only expose the
// standardized ones.
pub const P_PID: idtype_t = 0;
@@ -744,7 +746,17 @@ pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const EALREADY: ::c_int = 149;
pub const EINPROGRESS: ::c_int = 150;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 12;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
@@ -766,6 +778,13 @@ pub const GLOB_NOSPACE : ::c_int = -2;
pub const GLOB_ABORTED : ::c_int = -1;
pub const GLOB_NOMATCH : ::c_int = -3;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
@@ -857,7 +876,48 @@ pub const SO_TYPE: ::c_int = 0x1008;
pub const MSG_PEEK: ::c_int = 0x2;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
+// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html
+pub const IFF_UP: ::c_int = 0x0000000001; // Address is up
+pub const IFF_BROADCAST: ::c_int = 0x0000000002; // Broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x0000000004; // Turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x0000000008; // Loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x0000000010; // Interface is p-to-p
+pub const IFF_NOTRAILERS: ::c_int = 0x0000000020; // Avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x0000000040; // Resources allocated
+pub const IFF_NOARP: ::c_int = 0x0000000080; // No address res. protocol
+pub const IFF_PROMISC: ::c_int = 0x0000000100; // Receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0000000200; // Receive all multicast pkts
+pub const IFF_INTELLIGENT: ::c_int = 0x0000000400; // Protocol code on board
+pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
+// Multicast using broadcst. add.
+pub const IFF_MULTI_BCAST: ::c_int = 0x0000001000;
+pub const IFF_UNNUMBERED: ::c_int = 0x0000002000; // Non-unique address
+pub const IFF_DHCPRUNNING: ::c_int = 0x0000004000; // DHCP controls interface
+pub const IFF_PRIVATE: ::c_int = 0x0000008000; // Do not advertise
+pub const IFF_NOXMIT: ::c_int = 0x0000010000; // Do not transmit pkts
+// No address - just on-link subnet
+pub const IFF_NOLOCAL: ::c_int = 0x0000020000;
+pub const IFF_DEPRECATED: ::c_int = 0x0000040000; // Address is deprecated
+pub const IFF_ADDRCONF: ::c_int = 0x0000080000; // Addr. from stateless addrconf
+pub const IFF_ROUTER: ::c_int = 0x0000100000; // Router on interface
+pub const IFF_NONUD: ::c_int = 0x0000200000; // No NUD on interface
+pub const IFF_ANYCAST: ::c_int = 0x0000400000; // Anycast address
+pub const IFF_NORTEXCH: ::c_int = 0x0000800000; // Don't xchange rout. info
+pub const IFF_IPV4: ::c_int = 0x0001000000; // IPv4 interface
+pub const IFF_IPV6: ::c_int = 0x0002000000; // IPv6 interface
+pub const IFF_NOFAILOVER: ::c_int = 0x0008000000; // in.mpathd test address
+pub const IFF_FAILED: ::c_int = 0x0010000000; // Interface has failed
+pub const IFF_STANDBY: ::c_int = 0x0020000000; // Interface is a hot-spare
+pub const IFF_INACTIVE: ::c_int = 0x0040000000; // Functioning but not used
+pub const IFF_OFFLINE: ::c_int = 0x0080000000; // Interface is offline
+// If CoS marking is supported
+pub const IFF_COS_ENABLED: ::c_longlong = 0x0200000000;
+pub const IFF_PREFERRED: ::c_longlong = 0x0400000000; // Prefer as source addr.
+pub const IFF_TEMPORARY: ::c_longlong = 0x0800000000; // RFC3041
+pub const IFF_FIXEDMTU: ::c_longlong = 0x1000000000; // MTU set with SIOCSLIFMTU
+pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts
+pub const IFF_DUPLICATE: ::c_longlong = 0x4000000000; // Local address in use
+pub const IFF_IPMP: ::c_longlong = 0x8000000000; // IPMP IP interface
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -1100,6 +1160,7 @@ pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void;
+pub const RTLD_LAZY: ::c_int = 0x1;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const RTLD_GLOBAL: ::c_int = 0x100;
@@ -1210,9 +1271,13 @@ extern {
mode: ::mode_t, dev: dev_t) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
mode: ::mode_t) -> ::c_int;
- pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+ pub fn sethostname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
+ pub fn pthread_create(native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void) -> ::c_int;
pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
clock_id: *mut clockid_t) -> ::c_int;
pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
@@ -1245,11 +1310,16 @@ extern {
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
flags: ::c_int, addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
- pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn futimesat(fd: ::c_int, path: *const ::c_char,
+ times: *const ::timeval) -> ::c_int;
+ pub fn utimensat(dirfd: ::c_int, path: *const ::c_char,
+ times: *const ::timespec, flag: ::c_int) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr,
@@ -1270,13 +1340,13 @@ extern {
pub fn port_create() -> ::c_int;
pub fn port_associate(port: ::c_int, source: ::c_int, object: ::uintptr_t,
- events: ::c_int, user: ::uintptr_t) -> ::c_int;
+ events: ::c_int, user: *mut ::c_void) -> ::c_int;
pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t)
-> ::c_int;
pub fn port_get(port: ::c_int, pe: *mut port_event,
- timeout: *const ::timespec) -> ::c_int;
+ timeout: *mut ::timespec) -> ::c_int;
pub fn port_getn(port: ::c_int, pe_list: *mut port_event, max: ::c_uint,
- nget: *mut ::c_uint, timeout: *const ::timespec)
+ nget: *mut ::c_uint, timeout: *mut ::timespec)
-> ::c_int;
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
envp: *const *const ::c_char)
@@ -1287,9 +1357,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "sigaltstack$UNIX2003")]
- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
pub fn sigaltstack(ss: *const stack_t,
oss: *mut stack_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
@@ -1300,8 +1367,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "pthread_sigmask$UNIX2003")]
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
@@ -1309,22 +1374,18 @@ extern {
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
pub fn getpwnam_r(name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
pub fn getpwuid_r(uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch ="x86"),
- link_name = "sigwait$UNIX2003")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
pub fn sigwait(set: *const sigset_t,
sig: *mut ::c_int) -> ::c_int;
@@ -1332,8 +1393,6 @@ extern {
parent: Option<unsafe extern fn()>,
child: Option<unsafe extern fn()>) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "popen$UNIX2003")]
pub fn popen(command: *const c_char,
mode: *const c_char) -> *mut ::FILE;
}
diff --git a/libc/src/unix/uclibc/mips/mips32.rs b/libc/src/unix/uclibc/mips/mips32.rs
index a81e884..70d26e7 100644
--- a/libc/src/unix/uclibc/mips/mips32.rs
+++ b/libc/src/unix/uclibc/mips/mips32.rs
@@ -66,7 +66,7 @@ s! {
}
pub struct sigaction {
- pub sa_flags: ::c_uint,
+ pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: sigset_t,
_restorer: *mut ::c_void,
diff --git a/libc/src/unix/uclibc/mod.rs b/libc/src/unix/uclibc/mod.rs
index 6d32127..3f3a2ba 100644
--- a/libc/src/unix/uclibc/mod.rs
+++ b/libc/src/unix/uclibc/mod.rs
@@ -578,7 +578,63 @@ pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const SCM_CREDENTIALS: ::c_int = 0x02;
+// netinet/in.h
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_MTP: ::c_int = 92;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_COMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_MH: ::c_int = 135;
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// raw IP packet
pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
pub const PROT_GROWSUP: ::c_int = 0x2000000;
@@ -597,21 +653,24 @@ pub const MADV_MERGEABLE: ::c_int = 12;
pub const MADV_UNMERGEABLE: ::c_int = 13;
pub const MADV_HWPOISON: ::c_int = 100;
-pub const IFF_UP: ::c_int = 0x1;
-pub const IFF_BROADCAST: ::c_int = 0x2;
-pub const IFF_DEBUG: ::c_int = 0x4;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
-pub const IFF_POINTOPOINT: ::c_int = 0x10;
-pub const IFF_NOTRAILERS: ::c_int = 0x20;
-pub const IFF_RUNNING: ::c_int = 0x40;
-pub const IFF_NOARP: ::c_int = 0x80;
-pub const IFF_PROMISC: ::c_int = 0x100;
-pub const IFF_ALLMULTI: ::c_int = 0x200;
-pub const IFF_MASTER: ::c_int = 0x400;
-pub const IFF_SLAVE: ::c_int = 0x800;
-pub const IFF_MULTICAST: ::c_int = 0x1000;
-pub const IFF_PORTSEL: ::c_int = 0x2000;
-pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
+// https://github.com/kraj/uClibc/blob/master/include/net/if.h#L44
+pub const IFF_UP: ::c_int = 0x1; // Interface is up.
+pub const IFF_BROADCAST: ::c_int = 0x2; // Broadcast address valid.
+pub const IFF_DEBUG: ::c_int = 0x4; // Turn on debugging.
+pub const IFF_LOOPBACK: ::c_int = 0x8; // Is a loopback net.
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // Interface is point-to-point link.
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // Avoid use of trailers.
+pub const IFF_RUNNING: ::c_int = 0x40; // Resources allocated.
+pub const IFF_NOARP: ::c_int = 0x80; // No address resolution protocol.
+pub const IFF_PROMISC: ::c_int = 0x100; // Receive all packets.
+// Not supported
+pub const IFF_ALLMULTI: ::c_int = 0x200; // Receive all multicast packets.
+pub const IFF_MASTER: ::c_int = 0x400; // Master of a load balancer.
+pub const IFF_SLAVE: ::c_int = 0x800; // Slave of a load balancer.
+pub const IFF_MULTICAST: ::c_int = 0x1000; // Supports multicast.
+pub const IFF_PORTSEL: ::c_int = 0x2000; // Can set media type.
+pub const IFF_AUTOMEDIA: ::c_int = 0x4000; // Auto media select active.
+// Dialup device with changing addresses.
pub const IFF_DYNAMIC: ::c_int = 0x8000;
pub const SOL_IP: ::c_int = 0;
@@ -731,6 +790,8 @@ pub const IP_TTL: ::c_int = 2;
pub const IP_HDRINCL: ::c_int = 3;
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
pub const IPV6_JOIN_GROUP: ::c_int = 20;
pub const IPV6_LEAVE_GROUP: ::c_int = 21;
@@ -872,6 +933,7 @@ pub const SPLICE_F_MORE: ::c_uint = 0x04;
pub const SPLICE_F_GIFT: ::c_uint = 0x08;
pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_LAZY: ::c_int = 1;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -888,6 +950,13 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_FTP: ::c_int = 11 << 3;
pub const LOG_PERROR: ::c_int = 0x20;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
pub const PIPE_BUF: usize = 4096;
pub const SI_LOAD_SHIFT: ::c_uint = 16;
@@ -1419,6 +1488,10 @@ f! {
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
set1.bits == set2.bits
}
+
+ pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+ (cmd << 8) | (type_ & 0x00ff)
+ }
}
extern {
@@ -1805,6 +1878,10 @@ extern {
pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
parent: Option<unsafe extern fn()>,
child: Option<unsafe extern fn()>) -> ::c_int;
+ pub fn pthread_create(native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "popen$UNIX2003")]
@@ -1823,3 +1900,4 @@ cfg_if! {
pub use unsupported_target;
}
}
+
diff --git a/libc/src/unix/uclibc/x86_64/mod.rs b/libc/src/unix/uclibc/x86_64/mod.rs
index 29cefca..7d08258 100644
--- a/libc/src/unix/uclibc/x86_64/mod.rs
+++ b/libc/src/unix/uclibc/x86_64/mod.rs
@@ -327,6 +327,14 @@ pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals
pub const PTHREAD_STACK_MIN: usize = 16384;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams
+pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h
+pub const SO_ERROR: ::c_int = 4;
+pub const SOL_SOCKET: ::c_int = 1;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_SNDTIMEO: ::c_int = 21;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;