forked from mirrors/gecko-dev
No bug - Revendor rust dependencies on a CLOSED TREE. r=me
MozReview-Commit-ID: K6GlYzYjLRu --HG-- rename : third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs => third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs rename : third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs => third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs
This commit is contained in:
parent
9961471184
commit
db6c5d7e43
104 changed files with 9092 additions and 619 deletions
117
Cargo.lock
generated
117
Cargo.lock
generated
|
|
@ -44,7 +44,7 @@ version = "0.2.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ dependencies = [
|
|||
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -78,7 +78,7 @@ dependencies = [
|
|||
"foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -94,7 +94,7 @@ dependencies = [
|
|||
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -126,12 +126,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.33.1"
|
||||
version = "0.33.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clang-sys 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -185,7 +185,7 @@ version = "0.3.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -194,7 +194,7 @@ version = "0.1.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -226,12 +226,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "0.21.1"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libloading 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -271,7 +271,7 @@ version = "0.5.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -279,7 +279,7 @@ name = "core-foundation-sys"
|
|||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -290,7 +290,7 @@ dependencies = [
|
|||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -301,7 +301,7 @@ dependencies = [
|
|||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -507,7 +507,7 @@ dependencies = [
|
|||
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.27 (git+https://github.com/gankro/serde?branch=deserialize_from_enums4)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -579,7 +579,7 @@ name = "flate2"
|
|||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"miniz_oxide_c_api 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ name = "freetype"
|
|||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -607,7 +607,7 @@ version = "0.4.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -690,7 +690,7 @@ dependencies = [
|
|||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"nsstring 0.1.0",
|
||||
|
|
@ -773,7 +773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "hashglobe"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -819,7 +819,7 @@ name = "iovec"
|
|||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -840,12 +840,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "js"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"bindgen 0.33.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.33.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mozjs_sys 0.0.0",
|
||||
"num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -887,17 +887,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.33"
|
||||
version = "0.2.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -905,7 +904,7 @@ name = "libudev"
|
|||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libudev-sys 0.1.3",
|
||||
]
|
||||
|
||||
|
|
@ -914,7 +913,7 @@ name = "libudev-sys"
|
|||
version = "0.1.3"
|
||||
dependencies = [
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -923,7 +922,7 @@ version = "1.0.16"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -978,7 +977,7 @@ name = "memchr"
|
|||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -988,7 +987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -1011,7 +1010,7 @@ version = "0.1.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1021,7 +1020,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"miniz_oxide 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -1033,7 +1032,7 @@ dependencies = [
|
|||
"iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1046,7 +1045,7 @@ name = "mio-uds"
|
|||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -1070,7 +1069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "mozjs_sys"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -1147,7 +1146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -1233,7 +1232,7 @@ name = "num_cpus"
|
|||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1269,7 +1268,7 @@ version = "0.2.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1374,7 +1373,7 @@ dependencies = [
|
|||
name = "pulse-ffi"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1396,7 +1395,7 @@ version = "0.3.18"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1415,7 +1414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -1467,7 +1466,7 @@ dependencies = [
|
|||
name = "rust_url_capi"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nserror 0.1.0",
|
||||
"nsstring 0.1.0",
|
||||
"url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1612,7 +1611,7 @@ dependencies = [
|
|||
"app_units 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.33.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.33.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1689,7 +1688,7 @@ dependencies = [
|
|||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"geckoservo 0.0.1",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1753,7 +1752,7 @@ version = "0.3.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -1772,7 +1771,7 @@ version = "3.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1795,7 +1794,7 @@ version = "0.1.38"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -1833,7 +1832,7 @@ dependencies = [
|
|||
"bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -1866,7 +1865,7 @@ dependencies = [
|
|||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"boxfnonce 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -2075,7 +2074,7 @@ name = "which"
|
|||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2136,7 +2135,7 @@ dependencies = [
|
|||
name = "xpcom"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nserror 0.1.0",
|
||||
"nsstring 0.1.0",
|
||||
"xpcom_macros 0.1.0",
|
||||
|
|
@ -2183,7 +2182,7 @@ dependencies = [
|
|||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
|
||||
"checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff"
|
||||
"checksum bincode 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3fb369af639822830328794eba2501b3479652fcd021b2aeb1ed4984202afd"
|
||||
"checksum bindgen 0.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1657d607dd7a8e10b3181149f60f3b27ea0eac81058c09a1c791b8f6ead91f19"
|
||||
"checksum bindgen 0.33.2 (registry+https://github.com/rust-lang/crates.io-index)" = "603ed8d8392ace9581e834e26bd09799bf1e989a79bd1aedbb893e72962bdc6e"
|
||||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
|
||||
"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
|
||||
"checksum bitreader 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "80b13e2ab064ff3aa0bdbf1eff533f9822dc37899821f5f98c67f263eab51707"
|
||||
|
|
@ -2197,7 +2196,7 @@ dependencies = [
|
|||
"checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d"
|
||||
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
|
||||
"checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00"
|
||||
"checksum clang-sys 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00048189ee171715296dfe3b2fcfd439563c7bfec0d98d3976ce3402d62c8f07"
|
||||
"checksum clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"
|
||||
"checksum clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "110d43e343eb29f4f51c1db31beb879d546db27998577e5715270a54bcf41d3f"
|
||||
"checksum cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "56d741ea7a69e577f6d06b36b7dff4738f680593dc27a701ffa8506b73ce28bb"
|
||||
"checksum cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "746858cae4eae40fff37e1998320068df317bc247dc91a67c6cfa053afdc2abb"
|
||||
|
|
@ -2260,8 +2259,8 @@ dependencies = [
|
|||
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
|
||||
"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
|
||||
"checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b"
|
||||
"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"
|
||||
"checksum libloading 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be99f814beb3e9503a786a592c909692bb6d4fc5a695f6ed7987223acfbd5194"
|
||||
"checksum libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "f54263ad99207254cf58b5f701ecb432c717445ea2ee8af387334bdd1a03fdff"
|
||||
"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
|
||||
"checksum libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe"
|
||||
"checksum libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd64ef8ee652185674455c1d450b83cbc8ad895625d543b5324d923f82e4d8"
|
||||
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"88154517e146758d019c015d3f194f364be77e927686c8018f0ff766cff9a756","build.rs":"032a1c51963894a421b0535f9227796d88768ac5f665a81d2edced69dc6d106a","src/callbacks.rs":"a8b6c8cc227d5a01406a431109520c0a0467777bae430c4b769a1305b820926c","src/clang.rs":"c816d5291ccdc1d4ba028ae817ef385048e1fb8443911d026af5c721a6d57854","src/codegen/bitfield_unit.rs":"bd1a19701f1766d0bae3bcb97d7c3cb3881d4b182c56b8f4dfd24b7cc87b5338","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"bcb951f320fd0948e341d8eabdb58567296d77bf1ae5040c05d967e6435a15d5","src/codegen/impl_debug.rs":"e2ffd5b6ed936698aa4b9e7e3459d353383792707ad51f829a18a822f69cab0e","src/codegen/impl_partialeq.rs":"e86050b98f57fa4496dbde0beea319a89e46290309d274f626361779549b95bd","src/codegen/mod.rs":"e154f6e30b29ce8fd075813a0052de363157a975446013b4032d4080dfd65cf3","src/codegen/struct_layout.rs":"3c4b2b4543c6aa1da03f7522ad7f831e95dc146cf5edd08ebd5facb1305daddb","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/features.rs":"8c2148a6f922ca9cb0de2dd3ad77c4dd5734c4c219a5bea9d6b22c4367acb187","src/ir/analysis/derive_copy.rs":"14b53c53b337be00d59424371c07c6712d7cfc9a6735f9d913cda043fddce797","src/ir/analysis/derive_debug.rs":"1d6621c0fa5d899310cc175cb99703606ed34fd7f7ad77bb60f012f25ba504af","src/ir/analysis/derive_default.rs":"4fac04fc3019562cd213586680ecdcf8a3b3544ca3a5c5117f68e5c26e7ee0d9","src/ir/analysis/derive_hash.rs":"a50e849b4388115264c2d6afef5ab07e309d2469f4c3342fb683c799451e9e19","src/ir/analysis/derive_partialeq_or_partialord.rs":"46611c7f3caa0fe78243187742c4a36003dbc266de4c4390642e136bb889c43f","src/ir/analysis/has_destructor.rs":"d9aaaceba580b48eb0df4e5537b34b417c51ccdfeb8f6b72484f3bf4992317fe","src/ir/analysis/has_float.rs":"2a0465503d2c8247eaf916bd6a03594f3dc0370533d9a7c58cc5afb86693816c","src/ir/analysis/has_type_param_in_array.rs":"fcb1c78b6000f1f5eb8d8147e2afdaba9eb0e3a81b61e72537048dfdbeea7bcd","src/ir/analysis/has_vtable.rs":"37765e954ef792e369a58ccfe1d827a00fe9bce680466da1d6523671b94b6c92","src/ir/analysis/mod.rs":"ea5ace45c77e855674bb565ba0fef556f60e3293b0ddcf11d3a5a6ec15ab0648","src/ir/analysis/sizedness.rs":"3d3c8bde40604d53bb64273a3cbd8c55936a7dfe1de9b2ba92fc2c45572624b4","src/ir/analysis/template_params.rs":"5c6ee7a251a321ef5733e2e7ac3264621b4181268babcc008b69dbfc37691fb1","src/ir/annotations.rs":"ef106afcbe6084c18bd13a37ee3c1cdc9596bfb055db8c773d81f8f15fec3208","src/ir/comment.rs":"36f2a1d3970fdbf3d72c1f094043902747cde395215bdf7e9103926d9df011fd","src/ir/comp.rs":"d6811204a5cf68b4e9f1ef1dac80c7178394a18bc5165765e479925921671fa4","src/ir/context.rs":"7d28388430ad0587fab282ba50d3c536e58c53d84746ab557fe6d9dc0e917a01","src/ir/derive.rs":"1fd6ad621e3c60b950acbd51fbe386d1f0fadb7c1889c723245afff45e42e143","src/ir/dot.rs":"eca03a493a7fe48044b832c37c71d51f1bd4e8689feb6f1cb8bc0422541c7284","src/ir/enum_ty.rs":"05bfe0bc9abfee0f9692a443a9493b45b20ebf8275d15b1b4cba5c9cb63182b9","src/ir/function.rs":"a3ecac28cc75a61926a62f2082999c0ffe6ffeef2beb157367ade865cd899a9a","src/ir/int.rs":"1f61a472288afe489d9320bc8b13920333ece57891ae8570b4c4f25ab50688e6","src/ir/item.rs":"527b9a006dd1865cb77bac7e0e3826904c71b3b77679bcf7cd4ea63791dfa5ec","src/ir/item_kind.rs":"13048962657436a757ff9483d96f2ce351ec5f827ecab4921ed643f6f115c497","src/ir/layout.rs":"e3d1adf1ad2fa5bd96530cdd5097db3d9cc7b44d33ec23a04fcfccecd9cf4469","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"05068c4fbf42429c4ac2a233c874f18ffcf7dc1744398e400a5a48d0e7a972f2","src/ir/template.rs":"bcd750450a4df0200a6e7958f9c96a09b91e3ccd29c60712f2b9d3458f1234aa","src/ir/traversal.rs":"a108f2b2a1b3d2e679274eead8cf6f8fc78454e88943527d56bb30b5f071f104","src/ir/ty.rs":"4d5f1b2e11f6fb7df3348bdab7775cdfa209e136afe84a7b0e862068e53e7183","src/ir/var.rs":"96cca085d33d75493ae2b4465272a044d96a0e98f7732f13456313af3cf5beb8","src/lib.rs":"8a2a28797d2c7a014082a48a91361ed8090941de204e786ac107f2adae5d9cda","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"54b9fb74c8a998e3b3272f282493214371fbf42a9af6a54455824ef8b76d2445","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"a55241f2117f15729d174790f386e255fcb224b692325bbe6716dbb1d6874881","src/time.rs":"a02befb48d10dcc31e3f9571b2fa1c40f97fafe6f6ae7d7fc4f8fd01f1a169ba"},"package":"1657d607dd7a8e10b3181149f60f3b27ea0eac81058c09a1c791b8f6ead91f19"}
|
||||
{"files":{"Cargo.toml":"d2d15d8518f87e50143184b13e14139095b0a6aa627d4d5d3a2d12893e765f50","build.rs":"032a1c51963894a421b0535f9227796d88768ac5f665a81d2edced69dc6d106a","src/callbacks.rs":"49f382ebdb94c8f0aba5496f5283ae3cdcf6666a5c41c604e6356e674f9a072b","src/clang.rs":"33d94fa699f052b52a2804b85f49fa5de3a2404ae05801ef9eae16016bc841f1","src/codegen/bitfield_unit.rs":"bd1a19701f1766d0bae3bcb97d7c3cb3881d4b182c56b8f4dfd24b7cc87b5338","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"bcb951f320fd0948e341d8eabdb58567296d77bf1ae5040c05d967e6435a15d5","src/codegen/impl_debug.rs":"e2ffd5b6ed936698aa4b9e7e3459d353383792707ad51f829a18a822f69cab0e","src/codegen/impl_partialeq.rs":"e86050b98f57fa4496dbde0beea319a89e46290309d274f626361779549b95bd","src/codegen/mod.rs":"74e818d857fb5147f623e9287632d23c4bd0cf87de840034809992b74ff88bdc","src/codegen/struct_layout.rs":"698ed7340242d1cbedd38d400c7c83c32e2fa043c35dbc9a2eea4022251ffdb0","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/features.rs":"8c2148a6f922ca9cb0de2dd3ad77c4dd5734c4c219a5bea9d6b22c4367acb187","src/ir/analysis/derive_copy.rs":"14b53c53b337be00d59424371c07c6712d7cfc9a6735f9d913cda043fddce797","src/ir/analysis/derive_debug.rs":"1d6621c0fa5d899310cc175cb99703606ed34fd7f7ad77bb60f012f25ba504af","src/ir/analysis/derive_default.rs":"4fac04fc3019562cd213586680ecdcf8a3b3544ca3a5c5117f68e5c26e7ee0d9","src/ir/analysis/derive_hash.rs":"a50e849b4388115264c2d6afef5ab07e309d2469f4c3342fb683c799451e9e19","src/ir/analysis/derive_partialeq_or_partialord.rs":"46611c7f3caa0fe78243187742c4a36003dbc266de4c4390642e136bb889c43f","src/ir/analysis/has_destructor.rs":"d9aaaceba580b48eb0df4e5537b34b417c51ccdfeb8f6b72484f3bf4992317fe","src/ir/analysis/has_float.rs":"2a0465503d2c8247eaf916bd6a03594f3dc0370533d9a7c58cc5afb86693816c","src/ir/analysis/has_type_param_in_array.rs":"fcb1c78b6000f1f5eb8d8147e2afdaba9eb0e3a81b61e72537048dfdbeea7bcd","src/ir/analysis/has_vtable.rs":"37765e954ef792e369a58ccfe1d827a00fe9bce680466da1d6523671b94b6c92","src/ir/analysis/mod.rs":"ea5ace45c77e855674bb565ba0fef556f60e3293b0ddcf11d3a5a6ec15ab0648","src/ir/analysis/sizedness.rs":"3d3c8bde40604d53bb64273a3cbd8c55936a7dfe1de9b2ba92fc2c45572624b4","src/ir/analysis/template_params.rs":"5c6ee7a251a321ef5733e2e7ac3264621b4181268babcc008b69dbfc37691fb1","src/ir/annotations.rs":"ef106afcbe6084c18bd13a37ee3c1cdc9596bfb055db8c773d81f8f15fec3208","src/ir/comment.rs":"36f2a1d3970fdbf3d72c1f094043902747cde395215bdf7e9103926d9df011fd","src/ir/comp.rs":"b24e6ab76235b46bb5a262e3a3f2fc685c26bd7482aea113231a942eeffd0cf5","src/ir/context.rs":"ccd99c814f1a8ba1f3a30667a8d90db13a50adc26620be08f907283d1c5f08a3","src/ir/derive.rs":"1fd6ad621e3c60b950acbd51fbe386d1f0fadb7c1889c723245afff45e42e143","src/ir/dot.rs":"d01f1621ab67e368d854a82bd6bb0b8dd52f3c2c733de8eaf81aece9543818cb","src/ir/enum_ty.rs":"98a4aa58e598b31e4dc2c052c90029f37b53b5c5cfcbd216d4b0e8c73454813f","src/ir/function.rs":"cce97e7cd6ffb7d5ae40e6be1b82e7ae899d9ea9cf7c8f97380486ac7cc120e6","src/ir/int.rs":"1f61a472288afe489d9320bc8b13920333ece57891ae8570b4c4f25ab50688e6","src/ir/item.rs":"03477f4f4abfebc92ce4c9a202e33c86615dfffe3e6d1e0a201d2e85eecb9917","src/ir/item_kind.rs":"dbeae8c4fd0e5c9485d325aea040e056a1f2cd6d43fc927dee8fe1c0c59a7197","src/ir/layout.rs":"e3d1adf1ad2fa5bd96530cdd5097db3d9cc7b44d33ec23a04fcfccecd9cf4469","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"05068c4fbf42429c4ac2a233c874f18ffcf7dc1744398e400a5a48d0e7a972f2","src/ir/template.rs":"bcd750450a4df0200a6e7958f9c96a09b91e3ccd29c60712f2b9d3458f1234aa","src/ir/traversal.rs":"da73d3fafa594fb12c13136f5c9d6e6ee0d6c7fa4b6e57863638d4ba5ef55dfa","src/ir/ty.rs":"7d16711a053f1b4e9d11d3c5665062a58278a869b196a24b7b2a62227eb3a38f","src/ir/var.rs":"57c8aa9f834c6f06418f7d471b1771bbb915821ef0d194b383be60092edca5f7","src/lib.rs":"99ed57a26e794ce724e434af0bf4f72b199bd0e1c42833324beb939acda9af33","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"3df0214f428c221604420f8eb511b1c1e6d9326d1c6d3d2dea48278f833f9b77","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"a55241f2117f15729d174790f386e255fcb224b692325bbe6716dbb1d6874881","src/time.rs":"a02befb48d10dcc31e3f9571b2fa1c40f97fafe6f6ae7d7fc4f8fd01f1a169ba"},"package":"603ed8d8392ace9581e834e26bd09799bf1e989a79bd1aedbb893e72962bdc6e"}
|
||||
4
third_party/rust/bindgen/Cargo.toml
vendored
4
third_party/rust/bindgen/Cargo.toml
vendored
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
[package]
|
||||
name = "bindgen"
|
||||
version = "0.33.1"
|
||||
version = "0.33.2"
|
||||
authors = ["Jyun-Yan You <jyyou.tw@gmail.com>", "Emilio Cobos Álvarez <emilio@crisal.io>", "Nick Fitzgerald <fitzgen@gmail.com>", "The Servo project developers"]
|
||||
build = "build.rs"
|
||||
include = ["Cargo.toml", "build.rs", "src/*.rs", "src/**/*.rs"]
|
||||
|
|
@ -38,7 +38,7 @@ version = "0.2"
|
|||
version = "0.1.0"
|
||||
|
||||
[dependencies.clang-sys]
|
||||
version = "0.21.0"
|
||||
version = "0.22.0"
|
||||
features = ["runtime", "clang_3_9"]
|
||||
|
||||
[dependencies.clap]
|
||||
|
|
|
|||
15
third_party/rust/bindgen/src/callbacks.rs
vendored
15
third_party/rust/bindgen/src/callbacks.rs
vendored
|
|
@ -36,14 +36,23 @@ pub trait ParseCallbacks: fmt::Debug + UnwindSafe {
|
|||
}
|
||||
|
||||
/// This function should return whether, given the a given enum variant
|
||||
/// name, and value, returns whether this enum variant will forcibly be a
|
||||
/// constant.
|
||||
/// name, and value, this enum variant will forcibly be a constant.
|
||||
fn enum_variant_behavior(
|
||||
&self,
|
||||
_enum_name: Option<&str>,
|
||||
_variant_name: &str,
|
||||
_original_variant_name: &str,
|
||||
_variant_value: EnumVariantValue,
|
||||
) -> Option<EnumVariantCustomBehavior> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Allows to rename an enum variant, replacing `_original_variant_name`.
|
||||
fn enum_variant_name(
|
||||
&self,
|
||||
_enum_name: Option<&str>,
|
||||
_original_variant_name: &str,
|
||||
_variant_value: EnumVariantValue,
|
||||
) -> Option<String> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
third_party/rust/bindgen/src/clang.rs
vendored
4
third_party/rust/bindgen/src/clang.rs
vendored
|
|
@ -903,8 +903,8 @@ impl Type {
|
|||
/// have a valid layout.
|
||||
pub fn fallible_layout(&self) -> Result<::ir::layout::Layout, LayoutError> {
|
||||
use ir::layout::Layout;
|
||||
let size = try!(self.fallible_size());
|
||||
let align = try!(self.fallible_align());
|
||||
let size = self.fallible_size()?;
|
||||
let align = self.fallible_align()?;
|
||||
Ok(Layout::new(size, align))
|
||||
}
|
||||
|
||||
|
|
|
|||
6
third_party/rust/bindgen/src/codegen/mod.rs
vendored
6
third_party/rust/bindgen/src/codegen/mod.rs
vendored
|
|
@ -2228,7 +2228,7 @@ impl<'a> EnumBuilder<'a> {
|
|||
self,
|
||||
ctx: &BindgenContext,
|
||||
variant: &EnumVariant,
|
||||
mangling_prefix: Option<&String>,
|
||||
mangling_prefix: Option<&str>,
|
||||
rust_ty: quote::Tokens,
|
||||
result: &mut CodegenResult<'b>,
|
||||
) -> Self {
|
||||
|
|
@ -2548,9 +2548,9 @@ impl CodeGenerator for Enum {
|
|||
|
||||
let constant_mangling_prefix = if ctx.options().prepend_enum_name {
|
||||
if enum_ty.name().is_none() {
|
||||
parent_canonical_name.as_ref().map(|n| &*n)
|
||||
parent_canonical_name.as_ref().map(|n| &**n)
|
||||
} else {
|
||||
Some(&name)
|
||||
Some(&*name)
|
||||
}
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
|
|
@ -155,10 +155,7 @@ impl<'a> StructLayoutTracker<'a> {
|
|||
field_ty: &Type,
|
||||
field_offset: Option<usize>,
|
||||
) -> Option<quote::Tokens> {
|
||||
let mut field_layout = match field_ty.layout(self.ctx) {
|
||||
Some(l) => l,
|
||||
None => return None,
|
||||
};
|
||||
let mut field_layout = field_ty.layout(self.ctx)?;
|
||||
|
||||
if let TypeKind::Array(inner, len) =
|
||||
*field_ty.canonical_type(self.ctx).kind()
|
||||
|
|
|
|||
2
third_party/rust/bindgen/src/ir/comp.rs
vendored
2
third_party/rust/bindgen/src/ir/comp.rs
vendored
|
|
@ -1169,7 +1169,7 @@ impl CompInfo {
|
|||
}
|
||||
}
|
||||
|
||||
let kind = try!(kind);
|
||||
let kind = kind?;
|
||||
|
||||
debug!("CompInfo::from_ty({:?}, {:?})", kind, cursor);
|
||||
|
||||
|
|
|
|||
26
third_party/rust/bindgen/src/ir/context.rs
vendored
26
third_party/rust/bindgen/src/ir/context.rs
vendored
|
|
@ -475,13 +475,13 @@ impl<'ctx> Iterator for WhitelistedItemsTraversal<'ctx> {
|
|||
|
||||
fn next(&mut self) -> Option<ItemId> {
|
||||
loop {
|
||||
match self.traversal.next() {
|
||||
None => return None,
|
||||
Some(id) if self.ctx.resolve_item(id).is_blacklisted(self.ctx) => {
|
||||
continue
|
||||
}
|
||||
Some(id) => return Some(id),
|
||||
let id = self.traversal.next()?;
|
||||
|
||||
if self.ctx.resolve_item(id).is_blacklisted(self.ctx) {
|
||||
continue
|
||||
}
|
||||
|
||||
return Some(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1009,10 +1009,8 @@ impl BindgenContext {
|
|||
let comp_item_ids: Vec<ItemId> = self.items
|
||||
.iter()
|
||||
.filter_map(|(id, item)| {
|
||||
if let Some(ty) = item.kind().as_type() {
|
||||
if let Some(_comp) = ty.as_comp() {
|
||||
return Some(id);
|
||||
}
|
||||
if item.kind().as_type()?.is_comp() {
|
||||
return Some(id);
|
||||
}
|
||||
None
|
||||
})
|
||||
|
|
@ -1062,6 +1060,7 @@ impl BindgenContext {
|
|||
match *ty.kind() {
|
||||
TypeKind::Comp(..) |
|
||||
TypeKind::TemplateAlias(..) |
|
||||
TypeKind::Enum(..) |
|
||||
TypeKind::Alias(..) => {}
|
||||
_ => continue,
|
||||
}
|
||||
|
|
@ -1673,10 +1672,7 @@ impl BindgenContext {
|
|||
}
|
||||
clang_sys::CXCursor_TemplateRef => {
|
||||
let (template_decl_cursor, template_decl_id, num_expected_template_args) =
|
||||
match self.get_declaration_info_for_template_instantiation(child) {
|
||||
Some(info) => info,
|
||||
None => return None,
|
||||
};
|
||||
self.get_declaration_info_for_template_instantiation(child)?;
|
||||
|
||||
if num_expected_template_args == 0 ||
|
||||
child.has_at_least_num_children(
|
||||
|
|
@ -2065,7 +2061,7 @@ impl BindgenContext {
|
|||
|
||||
/// Has the item with the given `name` and `id` been replaced by another
|
||||
/// type?
|
||||
pub fn is_replaced_type<Id: Into<ItemId>>(&self, path: &[String], id: Id) -> bool {
|
||||
fn is_replaced_type<Id: Into<ItemId>>(&self, path: &[String], id: Id) -> bool {
|
||||
let id = id.into();
|
||||
match self.replacements.get(path) {
|
||||
Some(replaced_by) if *replaced_by != id => true,
|
||||
|
|
|
|||
18
third_party/rust/bindgen/src/ir/dot.rs
vendored
18
third_party/rust/bindgen/src/ir/dot.rs
vendored
|
|
@ -25,16 +25,16 @@ pub fn write_dot_file<P>(ctx: &BindgenContext, path: P) -> io::Result<()>
|
|||
where
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let file = try!(File::create(path));
|
||||
let file = File::create(path)?;
|
||||
let mut dot_file = io::BufWriter::new(file);
|
||||
try!(writeln!(&mut dot_file, "digraph {{"));
|
||||
writeln!(&mut dot_file, "digraph {{")?;
|
||||
|
||||
let mut err: Option<io::Result<_>> = None;
|
||||
|
||||
for (id, item) in ctx.items() {
|
||||
let is_whitelisted = ctx.whitelisted_items().contains(id);
|
||||
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
&mut dot_file,
|
||||
r#"{} [fontname="courier", color={}, label=< <table border="0" align="left">"#,
|
||||
id.as_usize(),
|
||||
|
|
@ -43,9 +43,9 @@ where
|
|||
} else {
|
||||
"gray"
|
||||
}
|
||||
));
|
||||
try!(item.dot_attributes(ctx, &mut dot_file));
|
||||
try!(writeln!(&mut dot_file, r#"</table> >];"#));
|
||||
)?;
|
||||
item.dot_attributes(ctx, &mut dot_file)?;
|
||||
writeln!(&mut dot_file, r#"</table> >];"#)?;
|
||||
|
||||
item.trace(
|
||||
ctx,
|
||||
|
|
@ -79,16 +79,16 @@ where
|
|||
|
||||
if let Some(module) = item.as_module() {
|
||||
for child in module.children() {
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
&mut dot_file,
|
||||
"{} -> {} [style=dotted, color=gray]",
|
||||
item.id().as_usize(),
|
||||
child.as_usize()
|
||||
));
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try!(writeln!(&mut dot_file, "}}"));
|
||||
writeln!(&mut dot_file, "}}")?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
33
third_party/rust/bindgen/src/ir/enum_ty.rs
vendored
33
third_party/rust/bindgen/src/ir/enum_ty.rs
vendored
|
|
@ -98,22 +98,31 @@ impl Enum {
|
|||
};
|
||||
if let Some(val) = value {
|
||||
let name = cursor.spelling();
|
||||
let annotations = Annotations::new(&cursor);
|
||||
let custom_behavior = ctx.parse_callbacks()
|
||||
.and_then(
|
||||
|t| t.enum_variant_behavior(type_name, &name, val),
|
||||
)
|
||||
.and_then(|callbacks| {
|
||||
callbacks.enum_variant_behavior(type_name, &name, val)
|
||||
})
|
||||
.or_else(|| {
|
||||
Annotations::new(&cursor).and_then(
|
||||
|anno| if anno.hide() {
|
||||
Some(EnumVariantCustomBehavior::Hide)
|
||||
} else if anno.constify_enum_variant() {
|
||||
Some(EnumVariantCustomBehavior::Constify)
|
||||
} else {
|
||||
None
|
||||
},
|
||||
)
|
||||
let annotations = annotations.as_ref()?;
|
||||
if annotations.hide() {
|
||||
Some(EnumVariantCustomBehavior::Hide)
|
||||
} else if annotations.constify_enum_variant() {
|
||||
Some(EnumVariantCustomBehavior::Constify)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
|
||||
let name = ctx.parse_callbacks()
|
||||
.and_then(|callbacks| {
|
||||
callbacks.enum_variant_name(type_name, &name, val)
|
||||
})
|
||||
.or_else(|| {
|
||||
annotations.as_ref()?.use_instead_of()?.last().cloned()
|
||||
})
|
||||
.unwrap_or(name);
|
||||
|
||||
let comment = cursor.raw_comment();
|
||||
variants.push(EnumVariant::new(
|
||||
name,
|
||||
|
|
|
|||
12
third_party/rust/bindgen/src/ir/function.rs
vendored
12
third_party/rust/bindgen/src/ir/function.rs
vendored
|
|
@ -151,11 +151,11 @@ impl DotAttributes for Function {
|
|||
if let Some(ref mangled) = self.mangled_name {
|
||||
let mangled: String =
|
||||
mangled.chars().flat_map(|c| c.escape_default()).collect();
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
out,
|
||||
"<tr><td>mangled name</td><td>{}</td></tr>",
|
||||
mangled
|
||||
));
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
@ -422,11 +422,11 @@ impl FunctionSig {
|
|||
let ty_ret_type = if cursor.kind() == CXCursor_ObjCInstanceMethodDecl ||
|
||||
cursor.kind() == CXCursor_ObjCClassMethodDecl
|
||||
{
|
||||
try!(ty.ret_type().or_else(|| cursor.ret_type()).ok_or(
|
||||
ty.ret_type().or_else(|| cursor.ret_type()).ok_or(
|
||||
ParseError::Continue,
|
||||
))
|
||||
)?
|
||||
} else {
|
||||
try!(ty.ret_type().ok_or(ParseError::Continue))
|
||||
ty.ret_type().ok_or(ParseError::Continue)?
|
||||
};
|
||||
let ret = Item::from_ty_or_ref(ty_ret_type, cursor, None, ctx);
|
||||
let call_conv = ty.call_conv();
|
||||
|
|
@ -521,7 +521,7 @@ impl ClangSubItemParser for Function {
|
|||
|
||||
// Grab the signature using Item::from_ty.
|
||||
let sig =
|
||||
try!(Item::from_ty(&cursor.cur_type(), cursor, None, context));
|
||||
Item::from_ty(&cursor.cur_type(), cursor, None, context)?;
|
||||
|
||||
let mut name = cursor.spelling();
|
||||
assert!(!name.is_empty(), "Empty function name?");
|
||||
|
|
|
|||
4
third_party/rust/bindgen/src/ir/item.rs
vendored
4
third_party/rust/bindgen/src/ir/item.rs
vendored
|
|
@ -1089,13 +1089,13 @@ impl DotAttributes for Item {
|
|||
where
|
||||
W: io::Write,
|
||||
{
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
out,
|
||||
"<tr><td>{:?}</td></tr>
|
||||
<tr><td>name</td><td>{}</td></tr>",
|
||||
self.id,
|
||||
self.name(ctx).get()
|
||||
));
|
||||
)?;
|
||||
|
||||
if self.is_opaque(ctx, &()) {
|
||||
writeln!(out, "<tr><td>opaque</td><td>true</td></tr>")?;
|
||||
|
|
|
|||
4
third_party/rust/bindgen/src/ir/item_kind.rs
vendored
4
third_party/rust/bindgen/src/ir/item_kind.rs
vendored
|
|
@ -135,11 +135,11 @@ impl DotAttributes for ItemKind {
|
|||
where
|
||||
W: io::Write,
|
||||
{
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
out,
|
||||
"<tr><td>kind</td><td>{}</td></tr>",
|
||||
self.kind_name()
|
||||
));
|
||||
)?;
|
||||
|
||||
match *self {
|
||||
ItemKind::Module(ref module) => module.dot_attributes(ctx, out),
|
||||
|
|
|
|||
5
third_party/rust/bindgen/src/ir/traversal.rs
vendored
5
third_party/rust/bindgen/src/ir/traversal.rs
vendored
|
|
@ -469,10 +469,7 @@ where
|
|||
type Item = ItemId;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let id = match self.queue.next() {
|
||||
None => return None,
|
||||
Some(id) => id,
|
||||
};
|
||||
let id = self.queue.next()?;
|
||||
|
||||
let newly_discovered = self.seen.add(None, id);
|
||||
debug_assert!(
|
||||
|
|
|
|||
12
third_party/rust/bindgen/src/ir/ty.rs
vendored
12
third_party/rust/bindgen/src/ir/ty.rs
vendored
|
|
@ -423,20 +423,20 @@ impl DotAttributes for Type {
|
|||
W: io::Write,
|
||||
{
|
||||
if let Some(ref layout) = self.layout {
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
out,
|
||||
"<tr><td>size</td><td>{}</td></tr>
|
||||
<tr><td>align</td><td>{}</td></tr>",
|
||||
layout.size,
|
||||
layout.align
|
||||
));
|
||||
)?;
|
||||
if layout.packed {
|
||||
try!(writeln!(out, "<tr><td>packed</td><td>true</td></tr>"));
|
||||
writeln!(out, "<tr><td>packed</td><td>true</td></tr>")?;
|
||||
}
|
||||
}
|
||||
|
||||
if self.is_const {
|
||||
try!(writeln!(out, "<tr><td>const</td><td>true</td></tr>"));
|
||||
writeln!(out, "<tr><td>const</td><td>true</td></tr>")?;
|
||||
}
|
||||
|
||||
self.kind.dot_attributes(ctx, out)
|
||||
|
|
@ -818,7 +818,7 @@ impl Type {
|
|||
// trying to see if it has a valid return type.
|
||||
if ty.ret_type().is_some() {
|
||||
let signature =
|
||||
try!(FunctionSig::from_ty(ty, &location, ctx));
|
||||
FunctionSig::from_ty(ty, &location, ctx)?;
|
||||
TypeKind::Function(signature)
|
||||
// Same here, with template specialisations we can safely
|
||||
// assume this is a Comp(..)
|
||||
|
|
@ -1122,7 +1122,7 @@ impl Type {
|
|||
CXType_FunctionNoProto |
|
||||
CXType_FunctionProto => {
|
||||
let signature =
|
||||
try!(FunctionSig::from_ty(ty, &location, ctx));
|
||||
FunctionSig::from_ty(ty, &location, ctx)?;
|
||||
TypeKind::Function(signature)
|
||||
}
|
||||
CXType_Typedef => {
|
||||
|
|
|
|||
20
third_party/rust/bindgen/src/ir/var.rs
vendored
20
third_party/rust/bindgen/src/ir/var.rs
vendored
|
|
@ -98,15 +98,15 @@ impl DotAttributes for Var {
|
|||
W: io::Write,
|
||||
{
|
||||
if self.is_const {
|
||||
try!(writeln!(out, "<tr><td>const</td><td>true</td></tr>"));
|
||||
writeln!(out, "<tr><td>const</td><td>true</td></tr>")?;
|
||||
}
|
||||
|
||||
if let Some(ref mangled) = self.mangled_name {
|
||||
try!(writeln!(
|
||||
writeln!(
|
||||
out,
|
||||
"<tr><td>mangled name</td><td>{}</td></tr>",
|
||||
mangled
|
||||
));
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
@ -307,10 +307,7 @@ fn parse_macro(
|
|||
) -> Option<(Vec<u8>, cexpr::expr::EvalResult)> {
|
||||
use cexpr::{expr, nom};
|
||||
|
||||
let mut cexpr_tokens = match cursor.cexpr_tokens() {
|
||||
None => return None,
|
||||
Some(tokens) => tokens,
|
||||
};
|
||||
let mut cexpr_tokens = cursor.cexpr_tokens()?;
|
||||
|
||||
let parser = expr::IdentifierParser::new(ctx.parsed_macros());
|
||||
|
||||
|
|
@ -327,9 +324,7 @@ fn parse_macro(
|
|||
// See:
|
||||
// https://bugs.llvm.org//show_bug.cgi?id=9069
|
||||
// https://reviews.llvm.org/D26446
|
||||
if cexpr_tokens.pop().is_none() {
|
||||
return None;
|
||||
}
|
||||
cexpr_tokens.pop()?;
|
||||
|
||||
match parser.macro_definition(&cexpr_tokens) {
|
||||
nom::IResult::Done(_, (id, val)) => Some((id.into(), val)),
|
||||
|
|
@ -341,10 +336,7 @@ fn parse_int_literal_tokens(cursor: &clang::Cursor) -> Option<i64> {
|
|||
use cexpr::{expr, nom};
|
||||
use cexpr::expr::EvalResult;
|
||||
|
||||
let cexpr_tokens = match cursor.cexpr_tokens() {
|
||||
None => return None,
|
||||
Some(tokens) => tokens,
|
||||
};
|
||||
let cexpr_tokens = cursor.cexpr_tokens()?;
|
||||
|
||||
// TODO(emilio): We can try to parse other kinds of literals.
|
||||
match expr::expr(&cexpr_tokens) {
|
||||
|
|
|
|||
20
third_party/rust/bindgen/src/lib.rs
vendored
20
third_party/rust/bindgen/src/lib.rs
vendored
|
|
@ -147,13 +147,13 @@ impl Default for CodegenConfig {
|
|||
/// use bindgen::builder;
|
||||
///
|
||||
/// // Configure and generate bindings.
|
||||
/// let bindings = try!(builder().header("path/to/input/header")
|
||||
/// .whitelisted_type("SomeCoolClass")
|
||||
/// .whitelisted_function("do_some_cool_thing")
|
||||
/// .generate());
|
||||
/// let bindings = builder().header("path/to/input/header")
|
||||
/// .whitelisted_type("SomeCoolClass")
|
||||
/// .whitelisted_function("do_some_cool_thing")
|
||||
/// .generate()?;
|
||||
///
|
||||
/// // Write the generated bindings to an output file.
|
||||
/// try!(bindings.write_to_file("path/to/output.rs"));
|
||||
/// bindings.write_to_file("path/to/output.rs")?;
|
||||
/// ```
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Builder {
|
||||
|
|
@ -673,7 +673,7 @@ impl Builder {
|
|||
|
||||
/// Hide the given type from the generated bindings. Regular expressions are
|
||||
/// supported.
|
||||
#[deprecated = "Use blacklist_type instead"]
|
||||
#[deprecated(note = "Use blacklist_type instead")]
|
||||
pub fn hide_type<T: AsRef<str>>(self, arg: T) -> Builder {
|
||||
self.blacklist_type(arg)
|
||||
}
|
||||
|
|
@ -695,7 +695,7 @@ impl Builder {
|
|||
/// Whitelist the given type so that it (and all types that it transitively
|
||||
/// refers to) appears in the generated bindings. Regular expressions are
|
||||
/// supported.
|
||||
#[deprecated = "use whitelist_type instead"]
|
||||
#[deprecated(note = "use whitelist_type instead")]
|
||||
pub fn whitelisted_type<T: AsRef<str>>(self, arg: T) -> Builder {
|
||||
self.whitelist_type(arg)
|
||||
}
|
||||
|
|
@ -719,7 +719,7 @@ impl Builder {
|
|||
/// Whitelist the given function.
|
||||
///
|
||||
/// Deprecated: use whitelist_function instead.
|
||||
#[deprecated = "use whitelist_function instead"]
|
||||
#[deprecated(note = "use whitelist_function instead")]
|
||||
pub fn whitelisted_function<T: AsRef<str>>(self, arg: T) -> Builder {
|
||||
self.whitelist_function(arg)
|
||||
}
|
||||
|
|
@ -735,7 +735,7 @@ impl Builder {
|
|||
/// Whitelist the given variable.
|
||||
///
|
||||
/// Deprecated: use whitelist_var instead.
|
||||
#[deprecated = "use whitelist_var instead"]
|
||||
#[deprecated(note = "use whitelist_var instead")]
|
||||
pub fn whitelisted_var<T: AsRef<str>>(self, arg: T) -> Builder {
|
||||
self.whitelist_var(arg)
|
||||
}
|
||||
|
|
@ -1648,7 +1648,7 @@ impl Bindings {
|
|||
{
|
||||
let _t = time::Timer::new("parse")
|
||||
.with_output(time_phases);
|
||||
try!(parse(&mut context));
|
||||
parse(&mut context)?;
|
||||
}
|
||||
|
||||
let (items, options) = codegen::codegen(context);
|
||||
|
|
|
|||
2
third_party/rust/bindgen/src/options.rs
vendored
2
third_party/rust/bindgen/src/options.rs
vendored
|
|
@ -545,7 +545,7 @@ where
|
|||
}
|
||||
|
||||
let output = if let Some(path) = matches.value_of("output") {
|
||||
let file = try!(File::create(path));
|
||||
let file = File::create(path)?;
|
||||
Box::new(io::BufWriter::new(file)) as Box<io::Write>
|
||||
} else {
|
||||
Box::new(io::BufWriter::new(io::stdout())) as Box<io::Write>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"files":{".travis.yml":"136bc7c0b31a2317ca827c49b25aac46ae685e0c401a783a9b0505bb1405b30b","CHANGELOG.md":"ceef7978611ef048a460d1f0adf7d0691c79b5633896f119b7a772141805a0c4","CONTRIBUTING.md":"4e2a45992604f07a37030bb1fc598c6f54a1785747c4f37a15a37481bbdecce8","Cargo.toml":"4bc5eb5d8417ec3803017855be3b927844c998fbd1ad38e336a1ea0f79dd939e","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"3f0af7f23c53b744eb9725149c5619fdac5d2cd127baec23dc7ec9bbea6bd541","appveyor.yml":"c9ab8ab1ab028b27d2be176e994a0d6a255cf8bcc36e15868472b6b8abf33fac","build.rs":"acc5929fb75a7a84f18c8beb804dfe7c5c585a3be492e988938df07c54a1b37b","ci/before_install.sh":"711c9d0539fa0372980c3a288d9482a0e46d3ba0fb8f7c7c110d6488a8ec4de5","ci/install.bat":"828b814fbbda1c0df09de728913f2cd438f3006f2574dc79a857459ab49d38c2","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"73462f51aaa9a1c14ce9f55c41dc3672df64faa9789725384ae4f28d8ba3c90b","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"8cb04fe36afba7bff961e18bbfd228c3253af8683949237b563f8f9125313706","src/link.rs":"9ba06ee65e445ca30b43844e654302565f023afb310e8a37f08a5150451ce76e","src/support.rs":"9929cdf5ad0896248938282d0e621be34855bca9a1eb6b7a02a174ace58a9d86","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"e5e8a60bcaec3b5d043fde4a993d397adb56454d0b2a6adaa15df0535246f909"},"package":"00048189ee171715296dfe3b2fcfd439563c7bfec0d98d3976ce3402d62c8f07"}
|
||||
{"files":{".travis.yml":"d5c89494c836e00ec8c3c02c9e228bf5dc34aabff203c37662a248e2da4bda05","CHANGELOG.md":"2d6ade5cd80d388392915d24f4712e8fd604579c7b26d48aa99908499e08817d","CONTRIBUTING.md":"4e2a45992604f07a37030bb1fc598c6f54a1785747c4f37a15a37481bbdecce8","Cargo.toml":"c2256b278d66bf80e6b62e58efa62a5fb98665c8c23dec68829b2c9fc2191962","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"dff1b472fe1edbc6059ff5a96e595fa8dab9e9e133d10fd761cf5dfdcc80f4c6","appveyor.yml":"c9ab8ab1ab028b27d2be176e994a0d6a255cf8bcc36e15868472b6b8abf33fac","build.rs":"e6cf2ec64466b21f3e6eb8aaf7327ccdfcc77a2067e0e19ee5e2a6f57117c09b","ci/before_install.sh":"711c9d0539fa0372980c3a288d9482a0e46d3ba0fb8f7c7c110d6488a8ec4de5","ci/install.bat":"fb636c3511ba038ccf805755ef6542237cc595e905edcd61d56abd7163321f76","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"73462f51aaa9a1c14ce9f55c41dc3672df64faa9789725384ae4f28d8ba3c90b","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"a0410d2e23f808ba441e7bebe84785e85582c8130613e49c7b3b98e0aaf55b66","src/link.rs":"7323c3ddcd8038b899c21f7087666628f88e9cb430900549855ea78717824e6f","src/support.rs":"ecd0489662caad0a13ea468cbbbec3ca62ba9796a6e24aabb392978a3455ebfd","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"e5e8a60bcaec3b5d043fde4a993d397adb56454d0b2a6adaa15df0535246f909"},"package":"939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"}
|
||||
7
third_party/rust/clang-sys/.travis.yml
vendored
7
third_party/rust/clang-sys/.travis.yml
vendored
|
|
@ -9,7 +9,6 @@ addons:
|
|||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
rust: stable
|
||||
|
||||
|
|
@ -17,12 +16,6 @@ env:
|
|||
- LLVM_VERSION=3.5 CLANG_VERSION=clang_3_5
|
||||
- LLVM_VERSION=5.0 CLANG_VERSION=clang_5_0
|
||||
|
||||
# FIXME: I have no idea why this build is failing.
|
||||
matrix:
|
||||
allow_failures:
|
||||
- os: osx
|
||||
env: LLVM_VERSION=5.0 CLANG_VERSION=clang_5_0
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cargo
|
||||
|
|
|
|||
13
third_party/rust/clang-sys/CHANGELOG.md
vendored
13
third_party/rust/clang-sys/CHANGELOG.md
vendored
|
|
@ -1,3 +1,16 @@
|
|||
## [0.22.0] - 2018-03-11
|
||||
|
||||
### Added
|
||||
- Added support for `clang` 6.0.x
|
||||
- Bumped `libc` version to `0.2.39`
|
||||
- Bumped `libloading` version to `0.5.0`
|
||||
|
||||
## [0.21.2] - 2018-02-17
|
||||
|
||||
### Changed
|
||||
- Added original errors to error messages
|
||||
- Added support for searching for libraries in `LD_LIBRARY_PATH` directories
|
||||
|
||||
## [0.21.1] - 2017-11-24
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
8
third_party/rust/clang-sys/Cargo.toml
vendored
8
third_party/rust/clang-sys/Cargo.toml
vendored
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
[package]
|
||||
name = "clang-sys"
|
||||
version = "0.21.1"
|
||||
version = "0.22.0"
|
||||
authors = ["Kyle Mayes <kyle@mayeses.com>"]
|
||||
build = "build.rs"
|
||||
links = "clang"
|
||||
|
|
@ -29,10 +29,10 @@ optional = true
|
|||
version = "0.2.11"
|
||||
|
||||
[dependencies.libc]
|
||||
version = "0.2.14"
|
||||
version = "0.2.39"
|
||||
|
||||
[dependencies.libloading]
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
optional = true
|
||||
[build-dependencies.clippy]
|
||||
version = "0.0.*"
|
||||
|
|
@ -49,11 +49,13 @@ clang_3_8 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8"]
|
|||
clang_3_9 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9"]
|
||||
clang_4_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0"]
|
||||
clang_5_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0", "gte_clang_5_0"]
|
||||
clang_6_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0", "gte_clang_5_0", "gte_clang_6_0"]
|
||||
gte_clang_3_6 = []
|
||||
gte_clang_3_7 = []
|
||||
gte_clang_3_8 = []
|
||||
gte_clang_3_9 = []
|
||||
gte_clang_4_0 = []
|
||||
gte_clang_5_0 = []
|
||||
gte_clang_6_0 = []
|
||||
runtime = ["libloading"]
|
||||
static = []
|
||||
|
|
|
|||
15
third_party/rust/clang-sys/README.md
vendored
15
third_party/rust/clang-sys/README.md
vendored
|
|
@ -33,6 +33,8 @@ To target a version of `libclang`, enable one of the following Cargo features:
|
|||
([Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys))
|
||||
* `clang_5_0` - requires `libclang` 5.0 or later
|
||||
([Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys))
|
||||
* `clang_6_0` - requires `libclang` 6.0 or later
|
||||
([Documentation](https://kylemayes.github.io/clang-sys/6_0/clang_sys))
|
||||
|
||||
If you do not enable one of these features, the API provided by `libclang` 3.5 will be available by
|
||||
default.
|
||||
|
|
@ -70,12 +72,12 @@ build it from source.
|
|||
The following environment variables, if set, are used by this crate to find the required libraries
|
||||
and executables:
|
||||
|
||||
* `LLVM_CONFIG_PATH` **(compile time)** - provides a path to an `llvm-config` executable
|
||||
* `LIBCLANG_PATH` **(compile time)** - provides a path to a directory containing a `libclang` shared
|
||||
* `LLVM_CONFIG_PATH` **(compiletime)** - provides a path to an `llvm-config` executable
|
||||
* `LIBCLANG_PATH` **(compiletime)** - provides a path to a directory containing a `libclang` shared
|
||||
library
|
||||
* `LIBCLANG_STATIC_PATH` **(compile time)** - provides a path to a directory containing LLVM and
|
||||
* `LIBCLANG_STATIC_PATH` **(compiletime)** - provides a path to a directory containing LLVM and
|
||||
Clang static libraries
|
||||
* `CLANG_PATH` **(run time)** - provides a path to a `clang` executable
|
||||
* `CLANG_PATH` **(runtime)** - provides a path to a `clang` executable
|
||||
|
||||
## Linking
|
||||
|
||||
|
|
@ -83,8 +85,9 @@ and executables:
|
|||
|
||||
First, the `libclang` shared library will be searched for in the directory provided by the
|
||||
`LIBCLANG_PATH` environment variable if it was set. If this fails, the directory returned by
|
||||
`llvm-config --libdir` will be searched. If neither of these approaches is successful, a list of
|
||||
likely directories will be searched (e.g., `/usr/local/lib` on Linux).
|
||||
`llvm-config --libdir` will be searched. Failing that, the directories in the `LD_LIBRARY_PATH`
|
||||
environment variable will be searched. If none of these approaches is successful, a list of likely
|
||||
directories will be searched (e.g., `/usr/local/lib` on Linux).
|
||||
|
||||
On Linux, running an executable that has been dynamically linked to `libclang` may require you to
|
||||
add a path to `libclang.so` to the `LD_LIBRARY_PATH` environment variable. The same is true on OS
|
||||
|
|
|
|||
7
third_party/rust/clang-sys/build.rs
vendored
7
third_party/rust/clang-sys/build.rs
vendored
|
|
@ -214,6 +214,13 @@ fn find(library: Library, files: &[String], env: &str) -> Result<PathBuf, String
|
|||
}
|
||||
}
|
||||
|
||||
// Search the `LD_LIBRARY_PATH` directories.
|
||||
if let Ok(path) = env::var("LD_LIBRARY_PATH") {
|
||||
for directory in path.split(":").map(Path::new) {
|
||||
search_directory!(directory);
|
||||
}
|
||||
}
|
||||
|
||||
// Search the backup directories.
|
||||
let search = if cfg!(any(target_os="freebsd", target_os="linux")) {
|
||||
SEARCH_LINUX
|
||||
|
|
|
|||
2
third_party/rust/clang-sys/ci/install.bat
vendored
2
third_party/rust/clang-sys/ci/install.bat
vendored
|
|
@ -1,4 +1,4 @@
|
|||
curl -sSf https://static.rust-lang.org/dist/rust-1.22.1-i686-pc-windows-msvc.exe -o rust.exe
|
||||
curl -sSf https://static.rust-lang.org/dist/rust-1.24.0-i686-pc-windows-msvc.exe -o rust.exe
|
||||
rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
|
||||
set PATH=%PATH%;C:\Rust\bin
|
||||
|
||||
|
|
|
|||
24
third_party/rust/clang-sys/src/lib.rs
vendored
24
third_party/rust/clang-sys/src/lib.rs
vendored
|
|
@ -23,6 +23,7 @@
|
|||
//! * 3.9 - [Documentation](https://kylemayes.github.io/clang-sys/3_9/clang_sys)
|
||||
//! * 4.0 - [Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys)
|
||||
//! * 5.0 - [Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys)
|
||||
//! * 6.0 - [Documentation](https://kylemayes.github.io/clang-sys/6_0/clang_sys)
|
||||
|
||||
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
|
||||
|
||||
|
|
@ -44,6 +45,8 @@ mod link;
|
|||
use std::mem;
|
||||
|
||||
use libc::{c_char, c_int, c_longlong, c_uint, c_ulong, c_ulonglong, c_void, time_t};
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
use libc::{size_t};
|
||||
|
||||
pub type CXClientData = *mut c_void;
|
||||
pub type CXCursorVisitor = extern fn(CXCursor, CXCursor, CXClientData) -> CXChildVisitResult;
|
||||
|
|
@ -653,6 +656,15 @@ cenum! {
|
|||
}
|
||||
}
|
||||
|
||||
cenum! {
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
enum CXTLSKind {
|
||||
const CXTLS_None = 0,
|
||||
const CXTLS_Dynamic = 1,
|
||||
const CXTLS_Static = 2,
|
||||
}
|
||||
}
|
||||
|
||||
cenum! {
|
||||
enum CXTUResourceUsageKind {
|
||||
const CXTUResourceUsage_AST = 1,
|
||||
|
|
@ -734,6 +746,8 @@ cenum! {
|
|||
const CXType_Float128 = 30,
|
||||
/// Only produced by `libclang` 5.0 and later.
|
||||
const CXType_Half = 31,
|
||||
/// Only produced by `libclang` 6.0 and later.
|
||||
const CXType_Float16 = 32,
|
||||
const CXType_Complex = 100,
|
||||
const CXType_Pointer = 101,
|
||||
const CXType_BlockPointer = 102,
|
||||
|
|
@ -1458,6 +1472,8 @@ link! {
|
|||
pub fn clang_CXCursorSet_insert(set: CXCursorSet, cursor: CXCursor) -> c_uint;
|
||||
pub fn clang_CXIndex_getGlobalOptions(index: CXIndex) -> CXGlobalOptFlags;
|
||||
pub fn clang_CXIndex_setGlobalOptions(index: CXIndex, flags: CXGlobalOptFlags);
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
pub fn clang_CXIndex_setInvocationEmissionPathOption(index: CXIndex, path: *const c_char);
|
||||
#[cfg(feature="gte_clang_3_9")]
|
||||
pub fn clang_CXXConstructor_isConvertingConstructor(cursor: CXCursor) -> c_uint;
|
||||
#[cfg(feature="gte_clang_3_9")]
|
||||
|
|
@ -1474,6 +1490,8 @@ link! {
|
|||
pub fn clang_CXXMethod_isPureVirtual(cursor: CXCursor) -> c_uint;
|
||||
pub fn clang_CXXMethod_isStatic(cursor: CXCursor) -> c_uint;
|
||||
pub fn clang_CXXMethod_isVirtual(cursor: CXCursor) -> c_uint;
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
pub fn clang_CXXRecord_isAbstract(cursor: CXCursor) -> c_uint;
|
||||
pub fn clang_CompilationDatabase_dispose(database: CXCompilationDatabase);
|
||||
pub fn clang_CompilationDatabase_fromDirectory(directory: *const c_char, error: *mut CXCompilationDatabase_Error) -> CXCompilationDatabase;
|
||||
pub fn clang_CompilationDatabase_getAllCompileCommands(database: CXCompilationDatabase) -> CXCompileCommands;
|
||||
|
|
@ -1504,6 +1522,8 @@ link! {
|
|||
#[cfg(feature="gte_clang_3_6")]
|
||||
pub fn clang_Cursor_getNumTemplateArguments(cursor: CXCursor) -> c_int;
|
||||
pub fn clang_Cursor_getObjCDeclQualifiers(cursor: CXCursor) -> CXObjCDeclQualifierKind;
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
pub fn clang_Cursor_getObjCManglings(cursor: CXCursor) -> *mut CXStringSet;
|
||||
pub fn clang_Cursor_getObjCPropertyAttributes(cursor: CXCursor, reserved: c_uint) -> CXObjCPropertyAttrKind;
|
||||
pub fn clang_Cursor_getObjCSelectorIndex(cursor: CXCursor) -> c_int;
|
||||
#[cfg(feature="gte_clang_3_7")]
|
||||
|
|
@ -1684,6 +1704,8 @@ link! {
|
|||
pub fn clang_getCursorResultType(cursor: CXCursor) -> CXType;
|
||||
pub fn clang_getCursorSemanticParent(cursor: CXCursor) -> CXCursor;
|
||||
pub fn clang_getCursorSpelling(cursor: CXCursor) -> CXString;
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
pub fn clang_getCursorTLSKind(cursor: CXCursor) -> CXTLSKind;
|
||||
pub fn clang_getCursorType(cursor: CXCursor) -> CXType;
|
||||
pub fn clang_getCursorUSR(cursor: CXCursor) -> CXString;
|
||||
#[cfg(feature="gte_clang_3_8")]
|
||||
|
|
@ -1713,6 +1735,8 @@ link! {
|
|||
pub fn clang_getExpansionLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
|
||||
pub fn clang_getFieldDeclBitWidth(cursor: CXCursor) -> c_int;
|
||||
pub fn clang_getFile(tu: CXTranslationUnit, file: *const c_char) -> CXFile;
|
||||
#[cfg(feature="gte_clang_6_0")]
|
||||
pub fn clang_getFileContents(tu: CXTranslationUnit, file: CXFile, size: *mut size_t) -> *const c_char;
|
||||
pub fn clang_getFileLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
|
||||
pub fn clang_getFileName(file: CXFile) -> CXString;
|
||||
pub fn clang_getFileTime(file: CXFile) -> time_t;
|
||||
|
|
|
|||
4
third_party/rust/clang-sys/src/link.rs
vendored
4
third_party/rust/clang-sys/src/link.rs
vendored
|
|
@ -118,8 +118,8 @@ macro_rules! link {
|
|||
mod build;
|
||||
|
||||
let file = try!(build::find_shared_library());
|
||||
let library = libloading::Library::new(&file).map_err(|_| {
|
||||
format!("the `libclang` shared library could not be opened: {}", file.display())
|
||||
let library = libloading::Library::new(&file).map_err(|e| {
|
||||
format!("the `libclang` shared library at {} could not be opened: {}", file.display(), e)
|
||||
});
|
||||
let mut library = SharedLibrary::new(try!(library));
|
||||
$(load::$name(&mut library);)+
|
||||
|
|
|
|||
2
third_party/rust/clang-sys/src/support.rs
vendored
2
third_party/rust/clang-sys/src/support.rs
vendored
|
|
@ -148,7 +148,7 @@ fn run(executable: &str, arguments: &[&str]) -> Result<(String, String), String>
|
|||
let stdout = String::from_utf8_lossy(&o.stdout).into_owned();
|
||||
let stderr = String::from_utf8_lossy(&o.stderr).into_owned();
|
||||
(stdout, stderr)
|
||||
}).map_err(|_| format!("could not run executable: `{}`", executable))
|
||||
}).map_err(|e| format!("could not run executable `{}`: {}", executable, e))
|
||||
}
|
||||
|
||||
/// Runs `clang`, returning the `stdout` and `stderr` output.
|
||||
|
|
|
|||
2
third_party/rust/libc/.cargo-checksum.json
vendored
2
third_party/rust/libc/.cargo-checksum.json
vendored
File diff suppressed because one or more lines are too long
3
third_party/rust/libc/.travis.yml
vendored
3
third_party/rust/libc/.travis.yml
vendored
|
|
@ -53,7 +53,8 @@ matrix:
|
|||
- env: TARGET=arm-unknown-linux-musleabihf
|
||||
- env: TARGET=aarch64-unknown-linux-gnu
|
||||
- env: TARGET=aarch64-unknown-linux-musl
|
||||
rust: beta
|
||||
# FIXME(#856)
|
||||
rust: 1.22.1
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
env: TARGET=i386-apple-ios
|
||||
|
|
|
|||
4
third_party/rust/libc/Cargo.toml
vendored
4
third_party/rust/libc/Cargo.toml
vendored
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
[package]
|
||||
name = "libc"
|
||||
version = "0.2.33"
|
||||
version = "0.2.39"
|
||||
authors = ["The Rust Project Developers"]
|
||||
description = "A library for types and bindings to native C functions often found in libc or\nother common platform libraries.\n"
|
||||
homepage = "https://github.com/rust-lang/libc"
|
||||
|
|
@ -25,8 +25,8 @@ repository = "https://github.com/rust-lang/libc"
|
|||
default = ["use_std"]
|
||||
use_std = []
|
||||
[badges.appveyor]
|
||||
repository = "rust-lang/libc"
|
||||
project_name = "rust-lang-libs/libc"
|
||||
repository = "rust-lang/libc"
|
||||
|
||||
[badges.travis-ci]
|
||||
repository = "rust-lang/libc"
|
||||
|
|
|
|||
1
third_party/rust/libc/appveyor.yml
vendored
1
third_party/rust/libc/appveyor.yml
vendored
|
|
@ -24,4 +24,5 @@ build: false
|
|||
|
||||
test_script:
|
||||
- cargo test --target %TARGET%
|
||||
- cargo test --no-default-features --target %TARGET%
|
||||
- cargo test --manifest-path libc-test/Cargo.toml --target %TARGET%
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:17.04
|
||||
FROM ubuntu:18.04
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
gcc-multilib libc6-dev ca-certificates
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
FROM ubuntu:17.10
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc libc6-dev qemu-user ca-certificates \
|
||||
gcc-s390x-linux-gnu libc6-dev-s390x-cross
|
||||
curl ca-certificates \
|
||||
gcc libc6-dev \
|
||||
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
|
||||
qemu-system-s390x \
|
||||
cpio
|
||||
|
||||
COPY linux-s390x.sh /
|
||||
RUN bash /linux-s390x.sh
|
||||
|
||||
COPY test-runner-linux /
|
||||
|
||||
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
|
||||
# TODO: in theory we should execute this, but qemu segfaults immediately :(
|
||||
# CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
|
||||
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER=true \
|
||||
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
|
||||
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
|
||||
PATH=$PATH:/rust/bin
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
# link fails on 17.10
|
||||
FROM ubuntu:17.04
|
||||
FROM debian:stretch
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc libc6-dev qemu-user ca-certificates \
|
||||
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross
|
||||
curl ca-certificates \
|
||||
gcc libc6-dev \
|
||||
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
|
||||
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
|
||||
p7zip-full cpio
|
||||
|
||||
COPY linux-sparc64.sh /
|
||||
RUN bash /linux-sparc64.sh
|
||||
|
||||
COPY test-runner-linux /
|
||||
|
||||
ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \
|
||||
# TODO: in theory we should execute this, but qemu segfaults immediately
|
||||
# see https://github.com/rust-lang/libc/issues/822
|
||||
# CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-sparc64 -L /usr/sparc64-linux-gnu" \
|
||||
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER=true \
|
||||
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \
|
||||
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
|
||||
PATH=$PATH:/rust/bin
|
||||
|
|
|
|||
|
|
@ -7,5 +7,9 @@ shift
|
|||
dir=$(dirname $me)
|
||||
file=$(basename $me)
|
||||
|
||||
if echo $file | grep -q wasm; then
|
||||
exit 0 # FIXME(rust-lang/cargo#4750)
|
||||
fi
|
||||
|
||||
cd $dir
|
||||
exec node $file "$@"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:17.04
|
||||
FROM ubuntu:18.04
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
gcc libc6-dev ca-certificates
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:17.04
|
||||
FROM ubuntu:18.04
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
gcc-multilib libc6-dev ca-certificates
|
||||
|
|
|
|||
2
third_party/rust/libc/ci/emscripten-entry.sh
vendored
2
third_party/rust/libc/ci/emscripten-entry.sh
vendored
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
# file at the top-level directory of this distribution and at
|
||||
# http://rust-lang.org/COPYRIGHT.
|
||||
|
|
|
|||
18
third_party/rust/libc/ci/linux-s390x.sh
vendored
Normal file
18
third_party/rust/libc/ci/linux-s390x.sh
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
set -ex
|
||||
|
||||
mkdir -m 777 /qemu
|
||||
cd /qemu
|
||||
|
||||
curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
|
||||
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
|
||||
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
|
||||
|
||||
mv kernel.debian kernel
|
||||
mv initrd.debian initrd.gz
|
||||
|
||||
mkdir init
|
||||
cd init
|
||||
gunzip -c ../initrd.gz | cpio -id
|
||||
rm ../initrd.gz
|
||||
cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
|
||||
chmod a+w .
|
||||
17
third_party/rust/libc/ci/linux-sparc64.sh
vendored
Normal file
17
third_party/rust/libc/ci/linux-sparc64.sh
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
set -ex
|
||||
|
||||
mkdir -m 777 /qemu
|
||||
cd /qemu
|
||||
|
||||
curl -LO https://cdimage.debian.org/cdimage/ports/debian-9.0-sparc64-NETINST-1.iso
|
||||
7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
|
||||
7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
|
||||
mv sparc64 kernel
|
||||
rm debian-9.0-sparc64-NETINST-1.iso
|
||||
|
||||
mkdir init
|
||||
cd init
|
||||
gunzip -c ../initrd.gz | cpio -id
|
||||
rm ../initrd.gz
|
||||
cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/
|
||||
chmod a+w .
|
||||
7
third_party/rust/libc/ci/run.sh
vendored
7
third_party/rust/libc/ci/run.sh
vendored
|
|
@ -41,7 +41,11 @@ if [ "$QEMU" != "" ]; then
|
|||
|
||||
# Do the standard rigamarole of cross-compiling an executable and then the
|
||||
# script to run just executes the binary.
|
||||
cargo build --manifest-path libc-test/Cargo.toml --target $TARGET --tests
|
||||
cargo build \
|
||||
--manifest-path libc-test/Cargo.toml \
|
||||
--target $TARGET \
|
||||
--test main
|
||||
rm $CARGO_TARGET_DIR/$TARGET/debug/main-*.d
|
||||
cp $CARGO_TARGET_DIR/$TARGET/debug/main-* $tmpdir/mount/libc-test
|
||||
echo 'exec $1/libc-test' > $tmpdir/mount/run.sh
|
||||
|
||||
|
|
@ -75,4 +79,5 @@ if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
|
|||
opt="--release"
|
||||
fi
|
||||
|
||||
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
|
||||
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET
|
||||
|
|
|
|||
23
third_party/rust/libc/ci/test-runner-linux
vendored
Executable file
23
third_party/rust/libc/ci/test-runner-linux
vendored
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
arch=$1
|
||||
prog=$2
|
||||
|
||||
cd /qemu/init
|
||||
cp -f $2 prog
|
||||
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
|
||||
cd ..
|
||||
|
||||
timeout 30s qemu-system-$arch \
|
||||
-m 1024 \
|
||||
-nographic \
|
||||
-kernel kernel \
|
||||
-initrd initrd.gz \
|
||||
-append init=/prog > output || true
|
||||
|
||||
# remove kernel messages
|
||||
tr -d '\r' < output | egrep -v '^\['
|
||||
|
||||
grep PASSED output > /dev/null
|
||||
4
third_party/rust/libc/src/cloudabi/aarch64.rs
vendored
Normal file
4
third_party/rust/libc/src/cloudabi/aarch64.rs
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
pub type wchar_t = u32;
|
||||
4
third_party/rust/libc/src/cloudabi/arm.rs
vendored
Normal file
4
third_party/rust/libc/src/cloudabi/arm.rs
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
||||
pub type wchar_t = u32;
|
||||
166
third_party/rust/libc/src/cloudabi/mod.rs
vendored
Normal file
166
third_party/rust/libc/src/cloudabi/mod.rs
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
pub type in_addr_t = u32;
|
||||
pub type in_port_t = u16;
|
||||
pub type pthread_key_t = usize;
|
||||
pub type pthread_t = usize;
|
||||
pub type sa_family_t = u8;
|
||||
pub type socklen_t = usize;
|
||||
pub type time_t = i64;
|
||||
|
||||
s! {
|
||||
pub struct addrinfo {
|
||||
pub ai_flags: ::c_int,
|
||||
pub ai_family: ::c_int,
|
||||
pub ai_socktype: ::c_int,
|
||||
pub ai_protocol: ::c_int,
|
||||
pub ai_addrlen: ::socklen_t,
|
||||
pub ai_addr: *mut ::sockaddr,
|
||||
pub ai_canonname: *mut ::c_char,
|
||||
pub ai_next: *mut addrinfo,
|
||||
}
|
||||
|
||||
pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
|
||||
pub struct in6_addr {
|
||||
pub s6_addr: [u8; 16],
|
||||
}
|
||||
|
||||
pub struct pthread_attr_t {
|
||||
__detachstate: ::c_int,
|
||||
__stacksize: usize,
|
||||
}
|
||||
|
||||
pub struct sockaddr {
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [::c_char; 0],
|
||||
}
|
||||
|
||||
pub struct sockaddr_in {
|
||||
pub sin_family: ::sa_family_t,
|
||||
pub sin_port: ::in_port_t,
|
||||
pub sin_addr: ::in_addr,
|
||||
}
|
||||
|
||||
pub struct sockaddr_in6 {
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: ::in_port_t,
|
||||
pub sin6_flowinfo: u32,
|
||||
pub sin6_addr: ::in6_addr,
|
||||
pub sin6_scope_id: u32,
|
||||
}
|
||||
|
||||
pub struct sockaddr_storage {
|
||||
pub ss_family: ::sa_family_t,
|
||||
__ss_data: [u8; 32],
|
||||
}
|
||||
}
|
||||
|
||||
pub const _SC_NPROCESSORS_ONLN: ::c_int = 52;
|
||||
pub const _SC_PAGESIZE: ::c_int = 54;
|
||||
|
||||
pub const AF_INET: ::c_int = 1;
|
||||
pub const AF_INET6: ::c_int = 2;
|
||||
|
||||
pub const EACCES: ::c_int = 2;
|
||||
pub const EADDRINUSE: ::c_int = 3;
|
||||
pub const EADDRNOTAVAIL: ::c_int = 4;
|
||||
pub const EAGAIN: ::c_int = 6;
|
||||
pub const ECONNABORTED: ::c_int = 13;
|
||||
pub const ECONNREFUSED: ::c_int = 14;
|
||||
pub const ECONNRESET: ::c_int = 15;
|
||||
pub const EEXIST: ::c_int = 20;
|
||||
pub const EINTR: ::c_int = 27;
|
||||
pub const EINVAL: ::c_int = 28;
|
||||
pub const ENOENT: ::c_int = 44;
|
||||
pub const ENOTCONN: ::c_int = 53;
|
||||
pub const EPERM: ::c_int = 63;
|
||||
pub const EPIPE: ::c_int = 64;
|
||||
pub const ETIMEDOUT: ::c_int = 73;
|
||||
pub const EWOULDBLOCK: ::c_int = EAGAIN;
|
||||
|
||||
pub const EAI_SYSTEM: ::c_int = 9;
|
||||
|
||||
pub const EXIT_FAILURE: ::c_int = 1;
|
||||
pub const EXIT_SUCCESS: ::c_int = 0;
|
||||
|
||||
pub const PTHREAD_STACK_MIN: ::size_t = 1024;
|
||||
|
||||
pub const SOCK_DGRAM: ::c_int = 128;
|
||||
pub const SOCK_STREAM: ::c_int = 130;
|
||||
|
||||
extern {
|
||||
pub fn arc4random_buf(buf: *const ::c_void, len: ::size_t);
|
||||
pub fn freeaddrinfo(res: *mut addrinfo);
|
||||
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
|
||||
pub fn getaddrinfo(
|
||||
node: *const c_char,
|
||||
service: *const c_char,
|
||||
hints: *const addrinfo,
|
||||
res: *mut *mut addrinfo,
|
||||
) -> ::c_int;
|
||||
pub fn getsockopt(
|
||||
sockfd: ::c_int,
|
||||
level: ::c_int,
|
||||
optname: ::c_int,
|
||||
optval: *mut ::c_void,
|
||||
optlen: *mut ::socklen_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_memalign(
|
||||
memptr: *mut *mut ::c_void,
|
||||
align: ::size_t,
|
||||
size: ::size_t,
|
||||
) -> ::c_int;
|
||||
pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
|
||||
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
|
||||
pub fn pthread_attr_setstacksize(
|
||||
attr: *mut ::pthread_attr_t,
|
||||
stack_size: ::size_t,
|
||||
) -> ::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 pthread_detach(thread: ::pthread_t) -> ::c_int;
|
||||
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
|
||||
pub fn pthread_join(
|
||||
native: ::pthread_t,
|
||||
value: *mut *mut ::c_void,
|
||||
) -> ::c_int;
|
||||
pub fn pthread_key_create(
|
||||
key: *mut pthread_key_t,
|
||||
dtor: Option<unsafe extern fn(*mut ::c_void)>,
|
||||
) -> ::c_int;
|
||||
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
|
||||
pub fn pthread_setspecific(
|
||||
key: pthread_key_t,
|
||||
value: *const ::c_void,
|
||||
) -> ::c_int;
|
||||
pub fn send(
|
||||
socket: ::c_int,
|
||||
buf: *const ::c_void,
|
||||
len: ::size_t,
|
||||
flags: ::c_int,
|
||||
) -> ::ssize_t;
|
||||
pub fn sysconf(name: ::c_int) -> ::c_long;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(target_arch = "aarch64")] {
|
||||
mod aarch64;
|
||||
pub use self::aarch64::*;
|
||||
} else if #[cfg(any(target_arch = "arm"))] {
|
||||
mod arm;
|
||||
pub use self::arm::*;
|
||||
} else if #[cfg(any(target_arch = "x86"))] {
|
||||
mod x86;
|
||||
pub use self::x86::*;
|
||||
} else if #[cfg(any(target_arch = "x86_64"))] {
|
||||
mod x86_64;
|
||||
pub use self::x86_64::*;
|
||||
} else {
|
||||
// Unknown target_arch
|
||||
}
|
||||
}
|
||||
4
third_party/rust/libc/src/cloudabi/x86.rs
vendored
Normal file
4
third_party/rust/libc/src/cloudabi/x86.rs
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub type c_char = i8;
|
||||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
||||
pub type wchar_t = i32;
|
||||
4
third_party/rust/libc/src/cloudabi/x86_64.rs
vendored
Normal file
4
third_party/rust/libc/src/cloudabi/x86_64.rs
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub type c_char = i8;
|
||||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
pub type wchar_t = i32;
|
||||
1
third_party/rust/libc/src/dox.rs
vendored
1
third_party/rust/libc/src/dox.rs
vendored
|
|
@ -146,5 +146,6 @@ mod imp {
|
|||
|
||||
pub mod mem {
|
||||
pub fn size_of_val<T>(_: &T) -> usize { 4 }
|
||||
pub fn size_of<T>(_: &T) -> usize { 4 }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
336
third_party/rust/libc/src/fuchsia/aarch64.rs
vendored
Normal file
336
third_party/rust/libc/src/fuchsia/aarch64.rs
vendored
Normal file
|
|
@ -0,0 +1,336 @@
|
|||
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 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;
|
||||
3925
third_party/rust/libc/src/fuchsia/mod.rs
vendored
Normal file
3925
third_party/rust/libc/src/fuchsia/mod.rs
vendored
Normal file
File diff suppressed because it is too large
Load diff
79
third_party/rust/libc/src/fuchsia/powerpc64.rs
vendored
Normal file
79
third_party/rust/libc/src/fuchsia/powerpc64.rs
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
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 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;
|
||||
447
third_party/rust/libc/src/fuchsia/x86_64.rs
vendored
Normal file
447
third_party/rust/libc/src/fuchsia/x86_64.rs
vendored
Normal file
|
|
@ -0,0 +1,447 @@
|
|||
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],
|
||||
}
|
||||
|
||||
pub struct ucontext_t {
|
||||
pub uc_flags: ::c_ulong,
|
||||
pub uc_link: *mut ucontext_t,
|
||||
pub uc_stack: ::stack_t,
|
||||
pub uc_mcontext: mcontext_t,
|
||||
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
|
||||
|
||||
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;
|
||||
// FIXME syscalls 329-331 have been added in musl 1.16
|
||||
// See discussion https://github.com/rust-lang/libc/pull/699
|
||||
|
||||
// offsets in user_regs_structs, from sys/reg.h
|
||||
pub const R15: ::c_int = 0;
|
||||
pub const R14: ::c_int = 1;
|
||||
pub const R13: ::c_int = 2;
|
||||
pub const R12: ::c_int = 3;
|
||||
pub const RBP: ::c_int = 4;
|
||||
pub const RBX: ::c_int = 5;
|
||||
pub const R11: ::c_int = 6;
|
||||
pub const R10: ::c_int = 7;
|
||||
pub const R9: ::c_int = 8;
|
||||
pub const R8: ::c_int = 9;
|
||||
pub const RAX: ::c_int = 10;
|
||||
pub const RCX: ::c_int = 11;
|
||||
pub const RDX: ::c_int = 12;
|
||||
pub const RSI: ::c_int = 13;
|
||||
pub const RDI: ::c_int = 14;
|
||||
pub const ORIG_RAX: ::c_int = 15;
|
||||
pub const RIP: ::c_int = 16;
|
||||
pub const CS: ::c_int = 17;
|
||||
pub const EFLAGS: ::c_int = 18;
|
||||
pub const RSP: ::c_int = 19;
|
||||
pub const SS: ::c_int = 20;
|
||||
pub const FS_BASE: ::c_int = 21;
|
||||
pub const GS_BASE: ::c_int = 22;
|
||||
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 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;
|
||||
338
third_party/rust/libc/src/lib.rs
vendored
338
third_party/rust/libc/src/lib.rs
vendored
|
|
@ -100,176 +100,186 @@ extern crate std as core;
|
|||
#[macro_use] mod macros;
|
||||
mod dox;
|
||||
|
||||
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
|
||||
// more optimization opportunities around it recognizing things like
|
||||
// malloc/free.
|
||||
#[repr(u8)]
|
||||
pub enum c_void {
|
||||
// Two dummy variants so the #[repr] attribute can be used.
|
||||
#[doc(hidden)]
|
||||
__variant1,
|
||||
#[doc(hidden)]
|
||||
__variant2,
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] {
|
||||
// empty ...
|
||||
} else {
|
||||
|
||||
pub type int8_t = i8;
|
||||
pub type int16_t = i16;
|
||||
pub type int32_t = i32;
|
||||
pub type int64_t = i64;
|
||||
pub type uint8_t = u8;
|
||||
pub type uint16_t = u16;
|
||||
pub type uint32_t = u32;
|
||||
pub type uint64_t = u64;
|
||||
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
|
||||
// more optimization opportunities around it recognizing things like
|
||||
// malloc/free.
|
||||
#[repr(u8)]
|
||||
pub enum c_void {
|
||||
// Two dummy variants so the #[repr] attribute can be used.
|
||||
#[doc(hidden)]
|
||||
__variant1,
|
||||
#[doc(hidden)]
|
||||
__variant2,
|
||||
}
|
||||
|
||||
pub type c_schar = i8;
|
||||
pub type c_uchar = u8;
|
||||
pub type c_short = i16;
|
||||
pub type c_ushort = u16;
|
||||
pub type c_int = i32;
|
||||
pub type c_uint = u32;
|
||||
pub type c_float = f32;
|
||||
pub type c_double = f64;
|
||||
pub type c_longlong = i64;
|
||||
pub type c_ulonglong = u64;
|
||||
pub type intmax_t = i64;
|
||||
pub type uintmax_t = u64;
|
||||
pub type int8_t = i8;
|
||||
pub type int16_t = i16;
|
||||
pub type int32_t = i32;
|
||||
pub type int64_t = i64;
|
||||
pub type uint8_t = u8;
|
||||
pub type uint16_t = u16;
|
||||
pub type uint32_t = u32;
|
||||
pub type uint64_t = u64;
|
||||
|
||||
pub type size_t = usize;
|
||||
pub type ptrdiff_t = isize;
|
||||
pub type intptr_t = isize;
|
||||
pub type uintptr_t = usize;
|
||||
pub type ssize_t = isize;
|
||||
pub type c_schar = i8;
|
||||
pub type c_uchar = u8;
|
||||
pub type c_short = i16;
|
||||
pub type c_ushort = u16;
|
||||
pub type c_int = i32;
|
||||
pub type c_uint = u32;
|
||||
pub type c_float = f32;
|
||||
pub type c_double = f64;
|
||||
pub type c_longlong = i64;
|
||||
pub type c_ulonglong = u64;
|
||||
pub type intmax_t = i64;
|
||||
pub type uintmax_t = u64;
|
||||
|
||||
pub enum FILE {}
|
||||
pub enum fpos_t {} // TODO: fill this out with a struct
|
||||
pub type size_t = usize;
|
||||
pub type ptrdiff_t = isize;
|
||||
pub type intptr_t = isize;
|
||||
pub type uintptr_t = usize;
|
||||
pub type ssize_t = isize;
|
||||
|
||||
extern {
|
||||
pub fn isalnum(c: c_int) -> c_int;
|
||||
pub fn isalpha(c: c_int) -> c_int;
|
||||
pub fn iscntrl(c: c_int) -> c_int;
|
||||
pub fn isdigit(c: c_int) -> c_int;
|
||||
pub fn isgraph(c: c_int) -> c_int;
|
||||
pub fn islower(c: c_int) -> c_int;
|
||||
pub fn isprint(c: c_int) -> c_int;
|
||||
pub fn ispunct(c: c_int) -> c_int;
|
||||
pub fn isspace(c: c_int) -> c_int;
|
||||
pub fn isupper(c: c_int) -> c_int;
|
||||
pub fn isxdigit(c: c_int) -> c_int;
|
||||
pub fn tolower(c: c_int) -> c_int;
|
||||
pub fn toupper(c: c_int) -> c_int;
|
||||
pub enum FILE {}
|
||||
pub enum fpos_t {} // TODO: fill this out with a struct
|
||||
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fopen$UNIX2003")]
|
||||
pub fn fopen(filename: *const c_char,
|
||||
mode: *const c_char) -> *mut FILE;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "freopen$UNIX2003")]
|
||||
pub fn freopen(filename: *const c_char, mode: *const c_char,
|
||||
file: *mut FILE) -> *mut FILE;
|
||||
pub fn fflush(file: *mut FILE) -> c_int;
|
||||
pub fn fclose(file: *mut FILE) -> c_int;
|
||||
pub fn remove(filename: *const c_char) -> c_int;
|
||||
pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
|
||||
pub fn tmpfile() -> *mut FILE;
|
||||
pub fn setvbuf(stream: *mut FILE,
|
||||
buffer: *mut c_char,
|
||||
mode: c_int,
|
||||
size: size_t) -> c_int;
|
||||
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
|
||||
pub fn getchar() -> c_int;
|
||||
pub fn putchar(c: c_int) -> c_int;
|
||||
pub fn fgetc(stream: *mut FILE) -> c_int;
|
||||
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
|
||||
pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fputs$UNIX2003")]
|
||||
pub fn fputs(s: *const c_char, stream: *mut FILE)-> c_int;
|
||||
pub fn puts(s: *const c_char) -> c_int;
|
||||
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
|
||||
pub fn fread(ptr: *mut c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *mut FILE)
|
||||
-> size_t;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fwrite$UNIX2003")]
|
||||
pub fn fwrite(ptr: *const c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *mut FILE)
|
||||
-> size_t;
|
||||
pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
|
||||
pub fn ftell(stream: *mut FILE) -> c_long;
|
||||
pub fn rewind(stream: *mut FILE);
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
|
||||
pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
|
||||
pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
|
||||
pub fn feof(stream: *mut FILE) -> c_int;
|
||||
pub fn ferror(stream: *mut FILE) -> c_int;
|
||||
pub fn perror(s: *const c_char);
|
||||
pub fn atoi(s: *const c_char) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "strtod$UNIX2003")]
|
||||
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
|
||||
pub fn strtol(s: *const c_char,
|
||||
endp: *mut *mut c_char, base: c_int) -> c_long;
|
||||
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
|
||||
base: c_int) -> c_ulong;
|
||||
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
|
||||
pub fn malloc(size: size_t) -> *mut c_void;
|
||||
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
|
||||
pub fn free(p: *mut c_void);
|
||||
pub fn abort() -> !;
|
||||
pub fn exit(status: c_int) -> !;
|
||||
pub fn _exit(status: c_int) -> !;
|
||||
pub fn atexit(cb: extern fn()) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "system$UNIX2003")]
|
||||
pub fn system(s: *const c_char) -> c_int;
|
||||
pub fn getenv(s: *const c_char) -> *mut c_char;
|
||||
pub const INT_MIN: c_int = -2147483648;
|
||||
pub const INT_MAX: c_int = 2147483647;
|
||||
|
||||
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
|
||||
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t)
|
||||
-> *mut c_char;
|
||||
pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
|
||||
pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
|
||||
pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
|
||||
pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
|
||||
pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
|
||||
pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
|
||||
pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
|
||||
pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
|
||||
pub fn strdup(cs: *const c_char) -> *mut c_char;
|
||||
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strlen(cs: *const c_char) -> size_t;
|
||||
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "strerror$UNIX2003")]
|
||||
pub fn strerror(n: c_int) -> *mut c_char;
|
||||
pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
|
||||
pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
|
||||
pub fn wcslen(buf: *const wchar_t) -> size_t;
|
||||
pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
|
||||
extern {
|
||||
pub fn isalnum(c: c_int) -> c_int;
|
||||
pub fn isalpha(c: c_int) -> c_int;
|
||||
pub fn iscntrl(c: c_int) -> c_int;
|
||||
pub fn isdigit(c: c_int) -> c_int;
|
||||
pub fn isgraph(c: c_int) -> c_int;
|
||||
pub fn islower(c: c_int) -> c_int;
|
||||
pub fn isprint(c: c_int) -> c_int;
|
||||
pub fn ispunct(c: c_int) -> c_int;
|
||||
pub fn isspace(c: c_int) -> c_int;
|
||||
pub fn isupper(c: c_int) -> c_int;
|
||||
pub fn isxdigit(c: c_int) -> c_int;
|
||||
pub fn tolower(c: c_int) -> c_int;
|
||||
pub fn toupper(c: c_int) -> c_int;
|
||||
|
||||
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
|
||||
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
|
||||
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
|
||||
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
|
||||
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
|
||||
}
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fopen$UNIX2003")]
|
||||
pub fn fopen(filename: *const c_char,
|
||||
mode: *const c_char) -> *mut FILE;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "freopen$UNIX2003")]
|
||||
pub fn freopen(filename: *const c_char, mode: *const c_char,
|
||||
file: *mut FILE) -> *mut FILE;
|
||||
pub fn fflush(file: *mut FILE) -> c_int;
|
||||
pub fn fclose(file: *mut FILE) -> c_int;
|
||||
pub fn remove(filename: *const c_char) -> c_int;
|
||||
pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
|
||||
pub fn tmpfile() -> *mut FILE;
|
||||
pub fn setvbuf(stream: *mut FILE,
|
||||
buffer: *mut c_char,
|
||||
mode: c_int,
|
||||
size: size_t) -> c_int;
|
||||
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
|
||||
pub fn getchar() -> c_int;
|
||||
pub fn putchar(c: c_int) -> c_int;
|
||||
pub fn fgetc(stream: *mut FILE) -> c_int;
|
||||
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
|
||||
pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fputs$UNIX2003")]
|
||||
pub fn fputs(s: *const c_char, stream: *mut FILE)-> c_int;
|
||||
pub fn puts(s: *const c_char) -> c_int;
|
||||
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
|
||||
pub fn fread(ptr: *mut c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *mut FILE)
|
||||
-> size_t;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "fwrite$UNIX2003")]
|
||||
pub fn fwrite(ptr: *const c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *mut FILE)
|
||||
-> size_t;
|
||||
pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
|
||||
pub fn ftell(stream: *mut FILE) -> c_long;
|
||||
pub fn rewind(stream: *mut FILE);
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
|
||||
pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
|
||||
pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
|
||||
pub fn feof(stream: *mut FILE) -> c_int;
|
||||
pub fn ferror(stream: *mut FILE) -> c_int;
|
||||
pub fn perror(s: *const c_char);
|
||||
pub fn atoi(s: *const c_char) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "strtod$UNIX2003")]
|
||||
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
|
||||
pub fn strtol(s: *const c_char,
|
||||
endp: *mut *mut c_char, base: c_int) -> c_long;
|
||||
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
|
||||
base: c_int) -> c_ulong;
|
||||
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
|
||||
pub fn malloc(size: size_t) -> *mut c_void;
|
||||
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
|
||||
pub fn free(p: *mut c_void);
|
||||
pub fn abort() -> !;
|
||||
pub fn exit(status: c_int) -> !;
|
||||
pub fn _exit(status: c_int) -> !;
|
||||
pub fn atexit(cb: extern fn()) -> c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "system$UNIX2003")]
|
||||
pub fn system(s: *const c_char) -> c_int;
|
||||
pub fn getenv(s: *const c_char) -> *mut c_char;
|
||||
|
||||
// These are all inline functions on android, so they end up just being entirely
|
||||
// missing on that platform.
|
||||
#[cfg(not(target_os = "android"))]
|
||||
extern {
|
||||
pub fn abs(i: c_int) -> c_int;
|
||||
pub fn atof(s: *const c_char) -> c_double;
|
||||
pub fn labs(i: c_long) -> c_long;
|
||||
pub fn rand() -> c_int;
|
||||
pub fn srand(seed: c_uint);
|
||||
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
|
||||
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t)
|
||||
-> *mut c_char;
|
||||
pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
|
||||
pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
|
||||
pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
|
||||
pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
|
||||
pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
|
||||
pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
|
||||
pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
|
||||
pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
|
||||
pub fn strdup(cs: *const c_char) -> *mut c_char;
|
||||
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
|
||||
pub fn strlen(cs: *const c_char) -> size_t;
|
||||
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "strerror$UNIX2003")]
|
||||
pub fn strerror(n: c_int) -> *mut c_char;
|
||||
pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
|
||||
pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
|
||||
pub fn wcslen(buf: *const wchar_t) -> size_t;
|
||||
pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
|
||||
|
||||
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
|
||||
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
|
||||
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
|
||||
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
|
||||
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
|
||||
}
|
||||
|
||||
// These are all inline functions on android, so they end up just being entirely
|
||||
// missing on that platform.
|
||||
#[cfg(not(target_os = "android"))]
|
||||
extern {
|
||||
pub fn abs(i: c_int) -> c_int;
|
||||
pub fn atof(s: *const c_char) -> c_double;
|
||||
pub fn labs(i: c_long) -> c_long;
|
||||
pub fn rand() -> c_int;
|
||||
pub fn srand(seed: c_uint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
@ -279,6 +289,12 @@ cfg_if! {
|
|||
} else if #[cfg(target_os = "redox")] {
|
||||
mod redox;
|
||||
pub use redox::*;
|
||||
} else if #[cfg(target_os = "cloudabi")] {
|
||||
mod cloudabi;
|
||||
pub use cloudabi::*;
|
||||
} else if #[cfg(target_os = "fuchsia")] {
|
||||
mod fuchsia;
|
||||
pub use fuchsia::*;
|
||||
} else if #[cfg(unix)] {
|
||||
mod unix;
|
||||
pub use unix::*;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
361
third_party/rust/libc/src/unix/bsd/apple/mod.rs
vendored
361
third_party/rust/libc/src/unix/bsd/apple/mod.rs
vendored
|
|
@ -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;
|
||||
|
|
@ -23,6 +24,14 @@ 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 type posix_spawnattr_t = *mut ::c_void;
|
||||
pub type posix_spawn_file_actions_t = *mut ::c_void;
|
||||
pub type key_t = ::c_int;
|
||||
pub type shmatt_t = ::c_ushort;
|
||||
|
||||
pub enum timezone {}
|
||||
|
||||
|
|
@ -418,6 +427,117 @@ s! {
|
|||
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 struct sockaddr_ctl {
|
||||
pub sc_len: ::c_uchar,
|
||||
pub sc_family: ::c_uchar,
|
||||
pub ss_sysaddr: ::uint16_t,
|
||||
pub sc_id: ::uint32_t,
|
||||
pub sc_unit: ::uint32_t,
|
||||
pub sc_reserved: [::uint32_t; 5],
|
||||
}
|
||||
|
||||
// sys/ipc.h:
|
||||
|
||||
pub struct ipc_perm {
|
||||
pub uid: ::uid_t,
|
||||
pub gid: ::gid_t,
|
||||
pub cuid: ::uid_t,
|
||||
pub cgid: ::gid_t,
|
||||
pub mode: ::mode_t,
|
||||
pub _seq: ::c_ushort,
|
||||
pub _key: ::key_t,
|
||||
}
|
||||
|
||||
// FIXME: this should have align 4 but it's got align 8 on 64-bit
|
||||
pub struct shmid_ds {
|
||||
pub shm_perm: ipc_perm,
|
||||
pub shm_segsz: ::size_t,
|
||||
pub shm_lpid: ::pid_t,
|
||||
pub shm_cpid: ::pid_t,
|
||||
pub shm_nattch: ::shmatt_t,
|
||||
pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
|
||||
pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
|
||||
pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
|
||||
// FIXME: 64-bit wrong align => wrong offset:
|
||||
pub shm_internal: *mut ::c_void,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pub const _UTX_USERSIZE: usize = 256;
|
||||
|
|
@ -841,7 +961,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;
|
||||
|
|
@ -1063,7 +1193,7 @@ 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)
|
||||
/// gateway<sup>2</sup> (deprecated)
|
||||
pub const IPPROTO_GGP: ::c_int = 3;
|
||||
/// for compatibility
|
||||
pub const IPPROTO_IPIP: ::c_int = 4;
|
||||
|
|
@ -1443,7 +1573,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;
|
||||
|
|
@ -1955,7 +2102,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;
|
||||
|
||||
|
|
@ -1967,6 +2197,62 @@ 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;
|
||||
|
||||
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
|
||||
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
|
||||
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
|
||||
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
|
||||
|
||||
// sys/ipc.h:
|
||||
pub const IPC_CREAT: ::c_int = 0x200;
|
||||
pub const IPC_EXCL: ::c_int = 0x400;
|
||||
pub const IPC_NOWAIT: ::c_int = 0x800;
|
||||
pub const IPC_PRIVATE: key_t = 0;
|
||||
|
||||
pub const IPC_RMID: ::c_int = 0;
|
||||
pub const IPC_SET: ::c_int = 1;
|
||||
pub const IPC_STAT: ::c_int = 2;
|
||||
|
||||
pub const IPC_R: ::c_int = 0x100;
|
||||
pub const IPC_W: ::c_int = 0x80;
|
||||
pub const IPC_M: ::c_int = 0x1000;
|
||||
|
||||
// sys/shm.h
|
||||
pub const SHM_RDONLY: ::c_int = 0x1000;
|
||||
pub const SHM_RND: ::c_int = 0x2000;
|
||||
pub const SHMLBA: ::c_int = 4096;
|
||||
pub const SHM_R: ::c_int = IPC_R;
|
||||
pub const SHM_W: ::c_int = IPC_W;
|
||||
|
||||
f! {
|
||||
pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
|
||||
status >> 8
|
||||
|
|
@ -2035,6 +2321,14 @@ extern {
|
|||
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
|
||||
-> ::c_int;
|
||||
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
|
||||
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void,
|
||||
shmflg: ::c_int) -> *mut ::c_void;
|
||||
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "shmctl$UNIX2003")]
|
||||
pub fn shmctl(shmid: ::c_int, cmd: ::c_int,
|
||||
buf: *mut ::shmid_ds) -> ::c_int;
|
||||
pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
|
||||
pub fn sysctl(name: *mut ::c_int,
|
||||
namelen: ::c_uint,
|
||||
oldp: *mut ::c_void,
|
||||
|
|
@ -2123,7 +2417,8 @@ extern {
|
|||
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
|
||||
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
|
||||
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
|
||||
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
|
||||
pub fn getxattr(path: *const ::c_char, name: *const ::c_char,
|
||||
value: *mut ::c_void, size: ::size_t, position: u32,
|
||||
flags: ::c_int) -> ::ssize_t;
|
||||
|
|
@ -2158,6 +2453,64 @@ 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;
|
||||
|
||||
pub fn posix_spawn(pid: *mut ::pid_t,
|
||||
path: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnp(pid: *mut ::pid_t,
|
||||
file: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t,
|
||||
flags: ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::pid_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t,
|
||||
flags: ::pid_t) -> ::c_int;
|
||||
|
||||
pub fn posix_spawn_file_actions_init(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_destroy(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addopen(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
path: *const ::c_char,
|
||||
oflag: ::c_int,
|
||||
mode: ::mode_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addclose(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_adddup2(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
newfd: ::c_int,
|
||||
) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
pub type clock_t = u64;
|
||||
pub type ino_t = u64;
|
||||
pub type lwpid_t = i32;
|
||||
pub type nlink_t = u32;
|
||||
pub type blksize_t = i64;
|
||||
pub type clockid_t = ::c_ulong;
|
||||
|
|
@ -72,6 +73,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 +176,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 +408,32 @@ 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)
|
||||
|
|
@ -687,6 +735,15 @@ 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;
|
||||
|
||||
// Values for struct rtprio (type_ field)
|
||||
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
|
||||
pub const RTP_PRIO_NORMAL: ::c_ushort = 1;
|
||||
pub const RTP_PRIO_IDLE: ::c_ushort = 2;
|
||||
pub const RTP_PRIO_THREAD: ::c_ushort = 3;
|
||||
|
||||
extern {
|
||||
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
|
||||
-> ::c_int;
|
||||
|
|
@ -700,4 +757,7 @@ extern {
|
|||
timeout: *mut ::timespec) -> ::c_int;
|
||||
|
||||
pub fn freelocale(loc: ::locale_t);
|
||||
|
||||
pub fn lwp_rtprio(function: ::c_int, pid: ::pid_t, lwpid: lwpid_t,
|
||||
rtp: *mut super::rtprio) -> ::c_int;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ pub type key_t = ::c_long;
|
|||
pub type msglen_t = ::c_ulong;
|
||||
pub type msgqnum_t = ::c_ulong;
|
||||
|
||||
pub type posix_spawnattr_t = *mut ::c_void;
|
||||
pub type posix_spawn_file_actions_t = *mut ::c_void;
|
||||
|
||||
s! {
|
||||
pub struct utmpx {
|
||||
pub ut_type: ::c_short,
|
||||
|
|
@ -62,6 +65,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,
|
||||
|
|
@ -135,6 +146,17 @@ s! {
|
|||
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;
|
||||
|
|
@ -153,6 +175,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;
|
||||
|
|
@ -177,9 +203,12 @@ pub const EVFILT_VNODE: ::int16_t = -4;
|
|||
pub const EVFILT_PROC: ::int16_t = -5;
|
||||
pub const EVFILT_SIGNAL: ::int16_t = -6;
|
||||
pub const EVFILT_TIMER: ::int16_t = -7;
|
||||
pub const EVFILT_PROCDESC: ::int16_t = -8;
|
||||
pub const EVFILT_FS: ::int16_t = -9;
|
||||
pub const EVFILT_LIO: ::int16_t = -10;
|
||||
pub const EVFILT_USER: ::int16_t = -11;
|
||||
pub const EVFILT_SENDFILE: ::int16_t = -12;
|
||||
pub const EVFILT_EMPTY: ::int16_t = -13;
|
||||
|
||||
pub const EV_ADD: ::uint16_t = 0x1;
|
||||
pub const EV_DELETE: ::uint16_t = 0x2;
|
||||
|
|
@ -425,6 +454,38 @@ 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
|
||||
|
|
@ -703,6 +764,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,
|
||||
|
|
@ -782,6 +844,23 @@ pub const _SC_CPUSET_SIZE: ::c_int = 122;
|
|||
pub const XU_NGROUPS: ::c_int = 16;
|
||||
pub const XUCRED_VERSION: ::c_uint = 0;
|
||||
|
||||
// Flags which can be passed to pdfork(2)
|
||||
pub const PD_DAEMON: ::c_int = 0x00000001;
|
||||
pub const PD_CLOEXEC: ::c_int = 0x00000002;
|
||||
pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
|
||||
|
||||
// Values for struct rtprio (type_ field)
|
||||
pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
|
||||
pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
|
||||
pub const RTP_PRIO_IDLE: ::c_ushort = 4;
|
||||
|
||||
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
|
||||
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
|
||||
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
|
||||
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
|
||||
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
|
||||
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
|
||||
|
||||
extern {
|
||||
pub fn __error() -> *mut ::c_int;
|
||||
|
||||
|
|
@ -834,6 +913,82 @@ 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;
|
||||
|
||||
pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
|
||||
pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
|
||||
pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t,
|
||||
rtp: *mut super::rtprio) -> ::c_int;
|
||||
|
||||
pub fn posix_spawn(pid: *mut ::pid_t,
|
||||
path: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnp(pid: *mut ::pid_t,
|
||||
file: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t,
|
||||
flags: ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::pid_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t,
|
||||
flags: ::pid_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::c_int) -> ::c_int;
|
||||
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t,
|
||||
flags: ::c_int) -> ::c_int;
|
||||
pub fn posix_spawnattr_getschedparam(
|
||||
attr: *const posix_spawnattr_t,
|
||||
param: *mut ::sched_param,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawnattr_setschedparam(
|
||||
attr: *mut posix_spawnattr_t,
|
||||
param: *const ::sched_param,
|
||||
) -> ::c_int;
|
||||
|
||||
pub fn posix_spawn_file_actions_init(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_destroy(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addopen(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
path: *const ::c_char,
|
||||
oflag: ::c_int,
|
||||
mode: ::mode_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addclose(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_adddup2(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
newfd: ::c_int,
|
||||
) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -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,20 @@ 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 struct rtprio {
|
||||
pub type_: ::c_ushort,
|
||||
pub prio: ::c_ushort,
|
||||
}
|
||||
}
|
||||
|
||||
pub const AIO_LISTIO_MAX: ::c_int = 16;
|
||||
|
|
@ -446,7 +462,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 +665,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 +959,18 @@ 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;
|
||||
|
||||
// Values for rtprio struct (prio field) and syscall (function argument)
|
||||
pub const RTP_PRIO_MIN: ::c_ushort = 0;
|
||||
pub const RTP_PRIO_MAX: ::c_ushort = 31;
|
||||
pub const RTP_LOOKUP: ::c_int = 0;
|
||||
pub const RTP_SET: ::c_int = 1;
|
||||
|
||||
f! {
|
||||
pub fn WIFCONTINUED(status: ::c_int) -> bool {
|
||||
status == 0x13
|
||||
|
|
@ -969,6 +1004,41 @@ extern {
|
|||
groups: *mut ::gid_t,
|
||||
ngroups: *mut ::c_int) -> ::c_int;
|
||||
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
|
||||
pub fn getpwent_r(pwd: *mut ::passwd,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::passwd) -> ::c_int;
|
||||
pub fn getgrent_r(grp: *mut ::group,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::group) -> ::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")]
|
||||
|
|
@ -991,6 +1061,7 @@ extern {
|
|||
serv: *mut ::c_char,
|
||||
servlen: ::size_t,
|
||||
flags: ::c_int) -> ::c_int;
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "kevent@FBSD_1.0")]
|
||||
pub fn kevent(kq: ::c_int,
|
||||
changelist: *const ::kevent,
|
||||
nchanges: ::c_int,
|
||||
|
|
@ -1085,9 +1156,11 @@ extern {
|
|||
val: ::c_int) -> ::c_int;
|
||||
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
|
||||
pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
|
||||
pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
|
||||
|
||||
pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
|
||||
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "mknodat@FBSD_1.1")]
|
||||
pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
|
||||
mode: ::mode_t, dev: dev_t) -> ::c_int;
|
||||
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
|
||||
|
|
@ -1107,9 +1180,8 @@ 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;
|
||||
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
|
||||
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
10
third_party/rust/libc/src/unix/bsd/mod.rs
vendored
10
third_party/rust/libc/src/unix/bsd/mod.rs
vendored
|
|
@ -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;
|
||||
|
|
@ -184,6 +183,9 @@ pub const IP_MULTICAST_IF: ::c_int = 9;
|
|||
pub const IP_MULTICAST_TTL: ::c_int = 10;
|
||||
pub const IP_MULTICAST_LOOP: ::c_int = 11;
|
||||
|
||||
pub const IPV6_UNICAST_HOPS: ::c_int = 4;
|
||||
pub const IPV6_MULTICAST_IF: ::c_int = 9;
|
||||
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
|
||||
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
|
||||
pub const IPV6_V6ONLY: ::c_int = 27;
|
||||
|
||||
|
|
@ -386,6 +388,10 @@ extern {
|
|||
pub fn getpwent() -> *mut passwd;
|
||||
pub fn setpwent();
|
||||
pub fn endpwent();
|
||||
pub fn setgrent();
|
||||
pub fn endgrent();
|
||||
pub fn getgrent() -> *mut ::group;
|
||||
|
||||
pub fn getprogname() -> *const ::c_char;
|
||||
pub fn setprogname(name: *const ::c_char);
|
||||
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
|
||||
|
|
@ -398,12 +404,14 @@ extern {
|
|||
|
||||
#[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "glob@FBSD_1.0")]
|
||||
pub fn glob(pattern: *const ::c_char,
|
||||
flags: ::c_int,
|
||||
errfunc: Option<extern fn(epath: *const ::c_char,
|
||||
errno: ::c_int) -> ::c_int>,
|
||||
pglob: *mut ::glob_t) -> ::c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "globfree@FBSD_1.0")]
|
||||
pub fn globfree(pglob: *mut ::glob_t);
|
||||
|
||||
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -534,6 +532,21 @@ pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
|
|||
pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
|
||||
pub const OCRNL: ::tcflag_t = 0x10;
|
||||
|
||||
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
|
||||
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
|
||||
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
|
||||
pub const TIOCGETA: ::c_ulong = 0x402c7413;
|
||||
pub const TIOCSETA: ::c_ulong = 0x802c7414;
|
||||
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
|
||||
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
|
||||
pub const TIOCGETD: ::c_ulong = 0x4004741a;
|
||||
pub const TIOCSETD: ::c_ulong = 0x8004741b;
|
||||
pub const TIOCMGET: ::c_ulong = 0x4004746a;
|
||||
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
|
||||
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
|
||||
pub const TIOCMSET: ::c_ulong = 0x8004746d;
|
||||
pub const TIOCSTART: ::c_ulong = 0x2000746e;
|
||||
pub const TIOCSTOP: ::c_ulong = 0x2000746f;
|
||||
pub const TIOCM_LE: ::c_int = 0o0001;
|
||||
pub const TIOCM_DTR: ::c_int = 0o0002;
|
||||
pub const TIOCM_RTS: ::c_int = 0o0004;
|
||||
|
|
@ -624,9 +637,20 @@ extern {
|
|||
groups: *mut ::gid_t,
|
||||
ngroups: *mut ::c_int) -> ::c_int;
|
||||
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
|
||||
pub fn getpwent_r(pwd: *mut ::passwd,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::passwd) -> ::c_int;
|
||||
pub fn getgrent_r(grp: *mut ::group,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::group) -> ::c_int;
|
||||
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
|
||||
envp: *const *const ::c_char)
|
||||
-> ::c_int;
|
||||
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
|
||||
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -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,24 @@ 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
|
||||
|
|
@ -844,7 +902,17 @@ 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;
|
||||
|
|
@ -884,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 {
|
||||
|
|
@ -941,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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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,24 @@ 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
|
||||
|
|
@ -339,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;
|
||||
|
||||
|
|
@ -651,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
|
||||
|
|
@ -703,6 +748,3 @@ cfg_if! {
|
|||
// Unknown target_os
|
||||
}
|
||||
}
|
||||
|
||||
mod other;
|
||||
pub use self::other::*;
|
||||
|
|
|
|||
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs
vendored
Normal file
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
pub type c_char = u8;
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs
vendored
Normal file
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
||||
pub type c_char = i8;
|
||||
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs
vendored
Normal file
3
third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
pub type c_char = i8;
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
24
third_party/rust/libc/src/unix/haiku/mod.rs
vendored
24
third_party/rust/libc/src/unix/haiku/mod.rs
vendored
|
|
@ -478,7 +478,17 @@ 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;
|
||||
|
|
@ -606,7 +616,20 @@ 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 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;
|
||||
|
|
@ -1099,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,
|
||||
|
|
|
|||
26
third_party/rust/libc/src/unix/mod.rs
vendored
26
third_party/rust/libc/src/unix/mod.rs
vendored
|
|
@ -190,6 +190,7 @@ pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
|
|||
pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
|
||||
pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
|
||||
|
||||
pub const DT_UNKNOWN: u8 = 0;
|
||||
pub const DT_FIFO: u8 = 1;
|
||||
pub const DT_CHR: u8 = 2;
|
||||
pub const DT_DIR: u8 = 4;
|
||||
|
|
@ -210,6 +211,7 @@ pub const S_ISGID: ::c_int = 0x400;
|
|||
pub const S_ISVTX: ::c_int = 0x200;
|
||||
|
||||
pub const IF_NAMESIZE: ::size_t = 16;
|
||||
pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
|
||||
|
||||
pub const LOG_EMERG: ::c_int = 0;
|
||||
pub const LOG_ALERT: ::c_int = 1;
|
||||
|
|
@ -274,17 +276,21 @@ cfg_if! {
|
|||
} 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"))]
|
||||
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
|
||||
} else if #[cfg(target_env = "musl")] {
|
||||
#[cfg_attr(feature = "stdbuild",
|
||||
link(name = "c", kind = "static",
|
||||
cfg(target_feature = "crt-static")))]
|
||||
#[cfg_attr(feature = "stdbuild",
|
||||
link(name = "c", cfg(not(target_feature = "crt-static"))))]
|
||||
extern {}
|
||||
} else if #[cfg(target_os = "emscripten")] {
|
||||
#[link(name = "c")]
|
||||
extern {}
|
||||
} else if #[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))] {
|
||||
} else if #[cfg(all(target_os = "netbsd"))] {
|
||||
// Since we don't use -nodefaultlibs on Rumprun, libc is always pulled
|
||||
// in automatically by the linker. We avoid passing it explicitly, as it
|
||||
// causes some versions of binutils to crash with an assertion failure.
|
||||
#[cfg_attr(feature = "stdbuild", target_vendor = "rumprun")]
|
||||
#[link(name = "m")]
|
||||
extern {}
|
||||
} else if #[cfg(any(target_os = "macos",
|
||||
|
|
@ -378,12 +384,14 @@ extern {
|
|||
|
||||
#[cfg_attr(target_os = "macos", link_name = "fstat$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__fstat50")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "fstat@FBSD_1.0")]
|
||||
pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
|
||||
|
||||
pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
|
||||
|
||||
#[cfg_attr(target_os = "macos", link_name = "stat$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__stat50")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "stat@FBSD_1.0")]
|
||||
pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
|
||||
|
||||
pub fn pclose(stream: *mut ::FILE) -> ::c_int;
|
||||
|
|
@ -410,10 +418,12 @@ extern {
|
|||
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
|
||||
#[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "readdir@FBSD_1.0")]
|
||||
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
|
||||
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_readdir_r")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "readdir_r@FBSD_1.0")]
|
||||
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
|
||||
result: *mut *mut ::dirent) -> ::c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
|
|
@ -436,6 +446,7 @@ extern {
|
|||
owner: ::uid_t, group: ::gid_t,
|
||||
flags: ::c_int) -> ::c_int;
|
||||
#[cfg_attr(target_os = "macos", link_name = "fstatat$INODE64")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "fstatat@FBSD_1.1")]
|
||||
pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
|
||||
buf: *mut stat, flags: ::c_int) -> ::c_int;
|
||||
pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
|
||||
|
|
@ -561,6 +572,9 @@ extern {
|
|||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "kill$UNIX2003")]
|
||||
pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
link_name = "killpg$UNIX2003")]
|
||||
pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
|
||||
pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
|
||||
|
|
@ -586,6 +600,7 @@ extern {
|
|||
|
||||
#[cfg_attr(target_os = "macos", link_name = "lstat$INODE64")]
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__lstat50")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "lstat@FBSD_1.0")]
|
||||
pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
|
||||
|
||||
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
||||
|
|
@ -766,8 +781,11 @@ 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")]
|
||||
#[cfg_attr(target_os = "freebsd", link_name = "mknod@FBSD_1.0")]
|
||||
pub fn mknod(pathname: *const ::c_char, mode: ::mode_t,
|
||||
dev: ::dev_t) -> ::c_int;
|
||||
pub fn uname(buf: *mut ::utsname) -> ::c_int;
|
||||
|
|
|
|||
5
third_party/rust/libc/src/unix/newlib/aarch64/mod.rs
vendored
Normal file
5
third_party/rust/libc/src/unix/newlib/aarch64/mod.rs
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
pub type c_char = u8;
|
||||
pub type wchar_t = u32;
|
||||
|
||||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
23
third_party/rust/libc/src/unix/newlib/mod.rs
vendored
23
third_party/rust/libc/src/unix/newlib/mod.rs
vendored
|
|
@ -517,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;
|
||||
|
|
@ -659,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.
|
||||
|
|
|
|||
495
third_party/rust/libc/src/unix/notbsd/android/mod.rs
vendored
495
third_party/rust/libc/src/unix/notbsd/android/mod.rs
vendored
|
|
@ -185,6 +185,50 @@ s! {
|
|||
pub uid: ::uid_t,
|
||||
pub gid: ::gid_t,
|
||||
}
|
||||
|
||||
pub struct genlmsghdr {
|
||||
cmd: u8,
|
||||
version: u8,
|
||||
reserved: u16,
|
||||
}
|
||||
|
||||
pub struct nlmsghdr {
|
||||
nlmsg_len: u32,
|
||||
nlmsg_type: u16,
|
||||
nlmsg_flags: u16,
|
||||
nlmsg_seq: u32,
|
||||
nlmsg_pid: u32,
|
||||
}
|
||||
|
||||
pub struct nlmsgerr {
|
||||
error: ::c_int,
|
||||
msg: nlmsghdr,
|
||||
}
|
||||
|
||||
pub struct nl_pktinfo {
|
||||
group: u32,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_req {
|
||||
nm_block_size: ::c_uint,
|
||||
nm_block_nr: ::c_uint,
|
||||
nm_frame_size: ::c_uint,
|
||||
nm_frame_nr: ::c_uint,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_hdr {
|
||||
nm_status: ::c_uint,
|
||||
nm_len: ::c_uint,
|
||||
nm_group: u32,
|
||||
nm_pid: u32,
|
||||
nm_uid: u32,
|
||||
nm_gid: u32,
|
||||
}
|
||||
|
||||
pub struct nlattr {
|
||||
nla_len: u16,
|
||||
nla_type: u16,
|
||||
}
|
||||
}
|
||||
|
||||
pub const O_TRUNC: ::c_int = 512;
|
||||
|
|
@ -684,6 +728,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;
|
||||
|
|
@ -791,7 +845,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;
|
||||
|
|
@ -840,6 +904,49 @@ pub const NLMSG_DONE: ::c_int = 0x3;
|
|||
pub const NLMSG_OVERRUN: ::c_int = 0x4;
|
||||
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
|
||||
|
||||
pub const GENL_NAMSIZ: ::c_int = 16;
|
||||
|
||||
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
|
||||
pub const GENL_MAX_ID: ::c_int = 1023;
|
||||
|
||||
pub const GENL_ADMIN_PERM: ::c_int = 0x01;
|
||||
pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
|
||||
pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
|
||||
pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
|
||||
pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
|
||||
|
||||
pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
|
||||
pub const GENL_ID_VFS_DQUOT: ::c_int = NLMSG_MIN_TYPE + 1;
|
||||
pub const GENL_ID_PMCRAID: ::c_int = NLMSG_MIN_TYPE + 2;
|
||||
|
||||
pub const CTRL_CMD_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
|
||||
pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
|
||||
pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
|
||||
pub const CTRL_CMD_NEWOPS: ::c_int = 4;
|
||||
pub const CTRL_CMD_DELOPS: ::c_int = 5;
|
||||
pub const CTRL_CMD_GETOPS: ::c_int = 6;
|
||||
pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
|
||||
pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
|
||||
pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
|
||||
|
||||
pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
|
||||
pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
|
||||
pub const CTRL_ATTR_VERSION: ::c_int = 3;
|
||||
pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
|
||||
pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
|
||||
pub const CTRL_ATTR_OPS: ::c_int = 6;
|
||||
pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
|
||||
|
||||
pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_OP_ID: ::c_int = 1;
|
||||
pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
|
||||
|
||||
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
|
||||
pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
|
||||
|
||||
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
|
||||
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
|
||||
pub const NETLINK_PKTINFO: ::c_int = 3;
|
||||
|
|
@ -848,10 +955,19 @@ 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);
|
||||
|
||||
pub const NLA_ALIGNTO: ::c_int = 4;
|
||||
|
||||
pub const SIGEV_THREAD_ID: ::c_int = 4;
|
||||
|
||||
pub const CIBAUD: ::tcflag_t = 0o02003600000;
|
||||
|
|
@ -882,6 +998,380 @@ 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;
|
||||
|
||||
// linux/netfilter.h
|
||||
pub const NF_DROP: ::c_int = 0;
|
||||
pub const NF_ACCEPT: ::c_int = 1;
|
||||
pub const NF_STOLEN: ::c_int = 2;
|
||||
pub const NF_QUEUE: ::c_int = 3;
|
||||
pub const NF_REPEAT: ::c_int = 4;
|
||||
pub const NF_STOP: ::c_int = 5;
|
||||
pub const NF_MAX_VERDICT: ::c_int = NF_STOP;
|
||||
|
||||
pub const NF_VERDICT_MASK: ::c_int = 0x000000ff;
|
||||
pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000;
|
||||
|
||||
pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000;
|
||||
pub const NF_VERDICT_QBITS: ::c_int = 16;
|
||||
|
||||
pub const NF_VERDICT_BITS: ::c_int = 16;
|
||||
|
||||
pub const NF_INET_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_INET_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_INET_FORWARD: ::c_int = 2;
|
||||
pub const NF_INET_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_INET_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_INET_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
pub const NF_NETDEV_INGRESS: ::c_int = 0;
|
||||
pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
|
||||
|
||||
pub const NFPROTO_UNSPEC: ::c_int = 0;
|
||||
pub const NFPROTO_INET: ::c_int = 1;
|
||||
pub const NFPROTO_IPV4: ::c_int = 2;
|
||||
pub const NFPROTO_ARP: ::c_int = 3;
|
||||
pub const NFPROTO_NETDEV: ::c_int = 5;
|
||||
pub const NFPROTO_BRIDGE: ::c_int = 7;
|
||||
pub const NFPROTO_IPV6: ::c_int = 10;
|
||||
pub const NFPROTO_DECNET: ::c_int = 12;
|
||||
pub const NFPROTO_NUMPROTO: ::c_int = 13;
|
||||
|
||||
// linux/netfilter_ipv4.h
|
||||
pub const NF_IP_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_IP_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_IP_FORWARD: ::c_int = 2;
|
||||
pub const NF_IP_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_IP_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_IP_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
|
||||
pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
|
||||
pub const NF_IP_PRI_RAW: ::c_int = -300;
|
||||
pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
|
||||
pub const NF_IP_PRI_CONNTRACK: ::c_int = -200;
|
||||
pub const NF_IP_PRI_MANGLE: ::c_int = -150;
|
||||
pub const NF_IP_PRI_NAT_DST: ::c_int = -100;
|
||||
pub const NF_IP_PRI_FILTER: ::c_int = 0;
|
||||
pub const NF_IP_PRI_SECURITY: ::c_int = 50;
|
||||
pub const NF_IP_PRI_NAT_SRC: ::c_int = 100;
|
||||
pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225;
|
||||
pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300;
|
||||
pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX;
|
||||
pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX;
|
||||
|
||||
// linux/netfilter_ipv6.h
|
||||
pub const NF_IP6_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_IP6_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_IP6_FORWARD: ::c_int = 2;
|
||||
pub const NF_IP6_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_IP6_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_IP6_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
|
||||
pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
|
||||
pub const NF_IP6_PRI_RAW: ::c_int = -300;
|
||||
pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
|
||||
pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200;
|
||||
pub const NF_IP6_PRI_MANGLE: ::c_int = -150;
|
||||
pub const NF_IP6_PRI_NAT_DST: ::c_int = -100;
|
||||
pub const NF_IP6_PRI_FILTER: ::c_int = 0;
|
||||
pub const NF_IP6_PRI_SECURITY: ::c_int = 50;
|
||||
pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100;
|
||||
pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
|
||||
pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
|
||||
pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
|
||||
|
||||
// linux/netfilter/nf_tables.h
|
||||
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
|
||||
|
||||
pub const NFT_REG_VERDICT: ::c_int = 0;
|
||||
pub const NFT_REG_1: ::c_int = 1;
|
||||
pub const NFT_REG_2: ::c_int = 2;
|
||||
pub const NFT_REG_3: ::c_int = 3;
|
||||
pub const NFT_REG_4: ::c_int = 4;
|
||||
pub const __NFT_REG_MAX: ::c_int = 5;
|
||||
pub const NFT_REG32_00: ::c_int = 8;
|
||||
pub const NFT_REG32_01: ::c_int = 9;
|
||||
pub const NFT_REG32_02: ::c_int = 10;
|
||||
pub const NFT_REG32_03: ::c_int = 11;
|
||||
pub const NFT_REG32_04: ::c_int = 12;
|
||||
pub const NFT_REG32_05: ::c_int = 13;
|
||||
pub const NFT_REG32_06: ::c_int = 14;
|
||||
pub const NFT_REG32_07: ::c_int = 15;
|
||||
pub const NFT_REG32_08: ::c_int = 16;
|
||||
pub const NFT_REG32_09: ::c_int = 17;
|
||||
pub const NFT_REG32_10: ::c_int = 18;
|
||||
pub const NFT_REG32_11: ::c_int = 19;
|
||||
pub const NFT_REG32_12: ::c_int = 20;
|
||||
pub const NFT_REG32_13: ::c_int = 21;
|
||||
pub const NFT_REG32_14: ::c_int = 22;
|
||||
pub const NFT_REG32_15: ::c_int = 23;
|
||||
|
||||
pub const NFT_REG_SIZE: ::c_int = 16;
|
||||
pub const NFT_REG32_SIZE: ::c_int = 4;
|
||||
|
||||
pub const NFT_CONTINUE: ::c_int = -1;
|
||||
pub const NFT_BREAK: ::c_int = -2;
|
||||
pub const NFT_JUMP: ::c_int = -3;
|
||||
pub const NFT_GOTO: ::c_int = -4;
|
||||
pub const NFT_RETURN: ::c_int = -5;
|
||||
|
||||
pub const NFT_MSG_NEWTABLE: ::c_int = 0;
|
||||
pub const NFT_MSG_GETTABLE: ::c_int = 1;
|
||||
pub const NFT_MSG_DELTABLE: ::c_int = 2;
|
||||
pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
|
||||
pub const NFT_MSG_GETCHAIN: ::c_int = 4;
|
||||
pub const NFT_MSG_DELCHAIN: ::c_int = 5;
|
||||
pub const NFT_MSG_NEWRULE: ::c_int = 6;
|
||||
pub const NFT_MSG_GETRULE: ::c_int = 7;
|
||||
pub const NFT_MSG_DELRULE: ::c_int = 8;
|
||||
pub const NFT_MSG_NEWSET: ::c_int = 9;
|
||||
pub const NFT_MSG_GETSET: ::c_int = 10;
|
||||
pub const NFT_MSG_DELSET: ::c_int = 11;
|
||||
pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
|
||||
pub const NFT_MSG_GETSETELEM: ::c_int = 13;
|
||||
pub const NFT_MSG_DELSETELEM: ::c_int = 14;
|
||||
pub const NFT_MSG_NEWGEN: ::c_int = 15;
|
||||
pub const NFT_MSG_GETGEN: ::c_int = 16;
|
||||
pub const NFT_MSG_TRACE: ::c_int = 17;
|
||||
pub const NFT_MSG_NEWOBJ: ::c_int = 18;
|
||||
pub const NFT_MSG_GETOBJ: ::c_int = 19;
|
||||
pub const NFT_MSG_DELOBJ: ::c_int = 20;
|
||||
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
|
||||
pub const NFT_MSG_MAX: ::c_int = 22;
|
||||
|
||||
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
|
||||
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
|
||||
pub const NFT_SET_INTERVAL: ::c_int = 0x4;
|
||||
pub const NFT_SET_MAP: ::c_int = 0x8;
|
||||
pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
|
||||
pub const NFT_SET_EVAL: ::c_int = 0x20;
|
||||
|
||||
pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
|
||||
pub const NFT_SET_POL_MEMORY: ::c_int = 1;
|
||||
|
||||
pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
|
||||
|
||||
pub const NFT_DATA_VALUE: ::c_uint = 0;
|
||||
pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
|
||||
|
||||
pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
|
||||
pub const NFT_BYTEORDER_HTON: ::c_int = 1;
|
||||
|
||||
pub const NFT_CMP_EQ: ::c_int = 0;
|
||||
pub const NFT_CMP_NEQ: ::c_int = 1;
|
||||
pub const NFT_CMP_LT: ::c_int = 2;
|
||||
pub const NFT_CMP_LTE: ::c_int = 3;
|
||||
pub const NFT_CMP_GT: ::c_int = 4;
|
||||
pub const NFT_CMP_GTE: ::c_int = 5;
|
||||
|
||||
pub const NFT_RANGE_EQ: ::c_int = 0;
|
||||
pub const NFT_RANGE_NEQ: ::c_int = 1;
|
||||
|
||||
pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
|
||||
pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
|
||||
|
||||
pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
|
||||
pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
|
||||
|
||||
pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
|
||||
|
||||
pub const NFT_META_LEN: ::c_int = 0;
|
||||
pub const NFT_META_PROTOCOL: ::c_int = 1;
|
||||
pub const NFT_META_PRIORITY: ::c_int = 2;
|
||||
pub const NFT_META_MARK: ::c_int = 3;
|
||||
pub const NFT_META_IIF: ::c_int = 4;
|
||||
pub const NFT_META_OIF: ::c_int = 5;
|
||||
pub const NFT_META_IIFNAME: ::c_int = 6;
|
||||
pub const NFT_META_OIFNAME: ::c_int = 7;
|
||||
pub const NFT_META_IIFTYPE: ::c_int = 8;
|
||||
pub const NFT_META_OIFTYPE: ::c_int = 9;
|
||||
pub const NFT_META_SKUID: ::c_int = 10;
|
||||
pub const NFT_META_SKGID: ::c_int = 11;
|
||||
pub const NFT_META_NFTRACE: ::c_int = 12;
|
||||
pub const NFT_META_RTCLASSID: ::c_int = 13;
|
||||
pub const NFT_META_SECMARK: ::c_int = 14;
|
||||
pub const NFT_META_NFPROTO: ::c_int = 15;
|
||||
pub const NFT_META_L4PROTO: ::c_int = 16;
|
||||
pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
|
||||
pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
|
||||
pub const NFT_META_PKTTYPE: ::c_int = 19;
|
||||
pub const NFT_META_CPU: ::c_int = 20;
|
||||
pub const NFT_META_IIFGROUP: ::c_int = 21;
|
||||
pub const NFT_META_OIFGROUP: ::c_int = 22;
|
||||
pub const NFT_META_CGROUP: ::c_int = 23;
|
||||
pub const NFT_META_PRANDOM: ::c_int = 24;
|
||||
|
||||
pub const NFT_CT_STATE: ::c_int = 0;
|
||||
pub const NFT_CT_DIRECTION: ::c_int = 1;
|
||||
pub const NFT_CT_STATUS: ::c_int = 2;
|
||||
pub const NFT_CT_MARK: ::c_int = 3;
|
||||
pub const NFT_CT_SECMARK: ::c_int = 4;
|
||||
pub const NFT_CT_EXPIRATION: ::c_int = 5;
|
||||
pub const NFT_CT_HELPER: ::c_int = 6;
|
||||
pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
|
||||
pub const NFT_CT_SRC: ::c_int = 8;
|
||||
pub const NFT_CT_DST: ::c_int = 9;
|
||||
pub const NFT_CT_PROTOCOL: ::c_int = 10;
|
||||
pub const NFT_CT_PROTO_SRC: ::c_int = 11;
|
||||
pub const NFT_CT_PROTO_DST: ::c_int = 12;
|
||||
pub const NFT_CT_LABELS: ::c_int = 13;
|
||||
pub const NFT_CT_PKTS: ::c_int = 14;
|
||||
pub const NFT_CT_BYTES: ::c_int = 15;
|
||||
|
||||
pub const NFT_LIMIT_PKTS: ::c_int = 0;
|
||||
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
|
||||
|
||||
pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
|
||||
pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
|
||||
pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
|
||||
|
||||
pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
|
||||
pub const NFT_REJECT_TCP_RST: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
|
||||
|
||||
pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
|
||||
pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
|
||||
pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
|
||||
|
||||
pub const NFT_NAT_SNAT: ::c_int = 0;
|
||||
pub const NFT_NAT_DNAT: ::c_int = 1;
|
||||
|
||||
pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
|
||||
pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
|
||||
pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
|
||||
pub const NFT_TRACETYPE_RULE: ::c_int = 3;
|
||||
|
||||
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
|
||||
pub const NFT_NG_RANDOM: ::c_int = 1;
|
||||
|
||||
pub const IFF_TUN: ::c_int = 0x0001;
|
||||
pub const IFF_TAP: ::c_int = 0x0002;
|
||||
pub const IFF_NO_PI: ::c_int = 0x1000;
|
||||
|
||||
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
|
||||
// from https://android.googlesource.com/
|
||||
// platform/bionic/+/master/libc/kernel/uapi/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;
|
||||
pub const ETH_MIN_MTU: ::c_int = 68;
|
||||
pub const ETH_MAX_MTU: ::c_int = 0xFFFF;
|
||||
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_TSN: ::c_int = 0x22F0;
|
||||
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;
|
||||
/* see rust-lang/libc#924 pub const ETH_P_ERSPAN: ::c_int = 0x88BE;*/
|
||||
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_NCSI: ::c_int = 0x88F8;
|
||||
pub const ETH_P_PRP: ::c_int = 0x88FB;
|
||||
pub const ETH_P_FCOE: ::c_int = 0x8906;
|
||||
/* see rust-lang/libc#924 pub const ETH_P_IBOE: ::c_int = 0x8915;*/
|
||||
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_HSR: ::c_int = 0x892F;
|
||||
/* see rust-lang/libc#924 pub const ETH_P_NSH: ::c_int = 0x894F;*/
|
||||
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;
|
||||
/* see rust-lang/libc#924 pub const ETH_P_IFE: ::c_int = 0xED3E;*/
|
||||
pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
|
||||
pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
|
||||
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_CAN: ::c_int = 0x000C;
|
||||
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;
|
||||
pub const ETH_P_XDSA: ::c_int = 0x00F8;
|
||||
/* see rust-lang/libc#924 pub const ETH_P_MAP: ::c_int = 0x00F9;*/
|
||||
// end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
|
||||
|
||||
f! {
|
||||
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
|
||||
for slot in cpuset.__bits.iter_mut() {
|
||||
|
|
@ -923,6 +1413,10 @@ f! {
|
|||
let mi = mi as ::dev_t;
|
||||
((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
|
||||
}
|
||||
|
||||
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
|
||||
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
|
||||
}
|
||||
}
|
||||
|
||||
extern {
|
||||
|
|
@ -1121,6 +1615,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! {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,44 @@ s! {
|
|||
pub c_ispeed: ::speed_t,
|
||||
pub c_ospeed: ::speed_t,
|
||||
}
|
||||
|
||||
pub struct nlmsghdr {
|
||||
nlmsg_len: u32,
|
||||
nlmsg_type: u16,
|
||||
nlmsg_flags: u16,
|
||||
nlmsg_seq: u32,
|
||||
nlmsg_pid: u32,
|
||||
}
|
||||
|
||||
pub struct nlmsgerr {
|
||||
error: ::c_int,
|
||||
msg: nlmsghdr,
|
||||
}
|
||||
|
||||
pub struct nl_pktinfo {
|
||||
group: u32,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_req {
|
||||
nm_block_size: ::c_uint,
|
||||
nm_block_nr: ::c_uint,
|
||||
nm_frame_size: ::c_uint,
|
||||
nm_frame_nr: ::c_uint,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_hdr {
|
||||
nm_status: ::c_uint,
|
||||
nm_len: ::c_uint,
|
||||
nm_group: u32,
|
||||
nm_pid: u32,
|
||||
nm_uid: u32,
|
||||
nm_gid: u32,
|
||||
}
|
||||
|
||||
pub struct nlattr {
|
||||
nla_len: u16,
|
||||
nla_type: u16,
|
||||
}
|
||||
}
|
||||
|
||||
pub const SFD_CLOEXEC: ::c_int = 0x080000;
|
||||
|
|
@ -50,6 +88,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;
|
||||
|
|
@ -661,11 +700,212 @@ pub const EHWPOISON: ::c_int = 168;
|
|||
pub const SIGEV_THREAD_ID: ::c_int = 4;
|
||||
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
|
||||
|
||||
pub const NF_NETDEV_INGRESS: ::c_int = 0;
|
||||
pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
|
||||
|
||||
pub const NFPROTO_INET: ::c_int = 1;
|
||||
pub const NFPROTO_NETDEV: ::c_int = 5;
|
||||
|
||||
pub const NLA_ALIGNTO: ::c_int = 4;
|
||||
|
||||
pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
|
||||
|
||||
pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
|
||||
pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
|
||||
|
||||
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
|
||||
|
||||
pub const NFT_REG_VERDICT: ::c_int = 0;
|
||||
pub const NFT_REG_1: ::c_int = 1;
|
||||
pub const NFT_REG_2: ::c_int = 2;
|
||||
pub const NFT_REG_3: ::c_int = 3;
|
||||
pub const NFT_REG_4: ::c_int = 4;
|
||||
pub const __NFT_REG_MAX: ::c_int = 5;
|
||||
pub const NFT_REG32_00: ::c_int = 8;
|
||||
pub const NFT_REG32_01: ::c_int = 9;
|
||||
pub const NFT_REG32_02: ::c_int = 10;
|
||||
pub const NFT_REG32_03: ::c_int = 11;
|
||||
pub const NFT_REG32_04: ::c_int = 12;
|
||||
pub const NFT_REG32_05: ::c_int = 13;
|
||||
pub const NFT_REG32_06: ::c_int = 14;
|
||||
pub const NFT_REG32_07: ::c_int = 15;
|
||||
pub const NFT_REG32_08: ::c_int = 16;
|
||||
pub const NFT_REG32_09: ::c_int = 17;
|
||||
pub const NFT_REG32_10: ::c_int = 18;
|
||||
pub const NFT_REG32_11: ::c_int = 19;
|
||||
pub const NFT_REG32_12: ::c_int = 20;
|
||||
pub const NFT_REG32_13: ::c_int = 21;
|
||||
pub const NFT_REG32_14: ::c_int = 22;
|
||||
pub const NFT_REG32_15: ::c_int = 23;
|
||||
|
||||
pub const NFT_REG_SIZE: ::c_int = 16;
|
||||
pub const NFT_REG32_SIZE: ::c_int = 4;
|
||||
|
||||
pub const NFT_CONTINUE: ::c_int = -1;
|
||||
pub const NFT_BREAK: ::c_int = -2;
|
||||
pub const NFT_JUMP: ::c_int = -3;
|
||||
pub const NFT_GOTO: ::c_int = -4;
|
||||
pub const NFT_RETURN: ::c_int = -5;
|
||||
|
||||
pub const NFT_MSG_NEWTABLE: ::c_int = 0;
|
||||
pub const NFT_MSG_GETTABLE: ::c_int = 1;
|
||||
pub const NFT_MSG_DELTABLE: ::c_int = 2;
|
||||
pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
|
||||
pub const NFT_MSG_GETCHAIN: ::c_int = 4;
|
||||
pub const NFT_MSG_DELCHAIN: ::c_int = 5;
|
||||
pub const NFT_MSG_NEWRULE: ::c_int = 6;
|
||||
pub const NFT_MSG_GETRULE: ::c_int = 7;
|
||||
pub const NFT_MSG_DELRULE: ::c_int = 8;
|
||||
pub const NFT_MSG_NEWSET: ::c_int = 9;
|
||||
pub const NFT_MSG_GETSET: ::c_int = 10;
|
||||
pub const NFT_MSG_DELSET: ::c_int = 11;
|
||||
pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
|
||||
pub const NFT_MSG_GETSETELEM: ::c_int = 13;
|
||||
pub const NFT_MSG_DELSETELEM: ::c_int = 14;
|
||||
pub const NFT_MSG_NEWGEN: ::c_int = 15;
|
||||
pub const NFT_MSG_GETGEN: ::c_int = 16;
|
||||
pub const NFT_MSG_TRACE: ::c_int = 17;
|
||||
pub const NFT_MSG_NEWOBJ: ::c_int = 18;
|
||||
pub const NFT_MSG_GETOBJ: ::c_int = 19;
|
||||
pub const NFT_MSG_DELOBJ: ::c_int = 20;
|
||||
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
|
||||
pub const NFT_MSG_MAX: ::c_int = 22;
|
||||
|
||||
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
|
||||
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
|
||||
pub const NFT_SET_INTERVAL: ::c_int = 0x4;
|
||||
pub const NFT_SET_MAP: ::c_int = 0x8;
|
||||
pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
|
||||
pub const NFT_SET_EVAL: ::c_int = 0x20;
|
||||
|
||||
pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
|
||||
pub const NFT_SET_POL_MEMORY: ::c_int = 1;
|
||||
|
||||
pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
|
||||
|
||||
pub const NFT_DATA_VALUE: ::c_uint = 0;
|
||||
pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
|
||||
|
||||
pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
|
||||
pub const NFT_BYTEORDER_HTON: ::c_int = 1;
|
||||
|
||||
pub const NFT_CMP_EQ: ::c_int = 0;
|
||||
pub const NFT_CMP_NEQ: ::c_int = 1;
|
||||
pub const NFT_CMP_LT: ::c_int = 2;
|
||||
pub const NFT_CMP_LTE: ::c_int = 3;
|
||||
pub const NFT_CMP_GT: ::c_int = 4;
|
||||
pub const NFT_CMP_GTE: ::c_int = 5;
|
||||
|
||||
pub const NFT_RANGE_EQ: ::c_int = 0;
|
||||
pub const NFT_RANGE_NEQ: ::c_int = 1;
|
||||
|
||||
pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
|
||||
pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
|
||||
|
||||
pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
|
||||
pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
|
||||
|
||||
pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
|
||||
|
||||
pub const NFT_META_LEN: ::c_int = 0;
|
||||
pub const NFT_META_PROTOCOL: ::c_int = 1;
|
||||
pub const NFT_META_PRIORITY: ::c_int = 2;
|
||||
pub const NFT_META_MARK: ::c_int = 3;
|
||||
pub const NFT_META_IIF: ::c_int = 4;
|
||||
pub const NFT_META_OIF: ::c_int = 5;
|
||||
pub const NFT_META_IIFNAME: ::c_int = 6;
|
||||
pub const NFT_META_OIFNAME: ::c_int = 7;
|
||||
pub const NFT_META_IIFTYPE: ::c_int = 8;
|
||||
pub const NFT_META_OIFTYPE: ::c_int = 9;
|
||||
pub const NFT_META_SKUID: ::c_int = 10;
|
||||
pub const NFT_META_SKGID: ::c_int = 11;
|
||||
pub const NFT_META_NFTRACE: ::c_int = 12;
|
||||
pub const NFT_META_RTCLASSID: ::c_int = 13;
|
||||
pub const NFT_META_SECMARK: ::c_int = 14;
|
||||
pub const NFT_META_NFPROTO: ::c_int = 15;
|
||||
pub const NFT_META_L4PROTO: ::c_int = 16;
|
||||
pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
|
||||
pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
|
||||
pub const NFT_META_PKTTYPE: ::c_int = 19;
|
||||
pub const NFT_META_CPU: ::c_int = 20;
|
||||
pub const NFT_META_IIFGROUP: ::c_int = 21;
|
||||
pub const NFT_META_OIFGROUP: ::c_int = 22;
|
||||
pub const NFT_META_CGROUP: ::c_int = 23;
|
||||
pub const NFT_META_PRANDOM: ::c_int = 24;
|
||||
|
||||
pub const NFT_CT_STATE: ::c_int = 0;
|
||||
pub const NFT_CT_DIRECTION: ::c_int = 1;
|
||||
pub const NFT_CT_STATUS: ::c_int = 2;
|
||||
pub const NFT_CT_MARK: ::c_int = 3;
|
||||
pub const NFT_CT_SECMARK: ::c_int = 4;
|
||||
pub const NFT_CT_EXPIRATION: ::c_int = 5;
|
||||
pub const NFT_CT_HELPER: ::c_int = 6;
|
||||
pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
|
||||
pub const NFT_CT_SRC: ::c_int = 8;
|
||||
pub const NFT_CT_DST: ::c_int = 9;
|
||||
pub const NFT_CT_PROTOCOL: ::c_int = 10;
|
||||
pub const NFT_CT_PROTO_SRC: ::c_int = 11;
|
||||
pub const NFT_CT_PROTO_DST: ::c_int = 12;
|
||||
pub const NFT_CT_LABELS: ::c_int = 13;
|
||||
pub const NFT_CT_PKTS: ::c_int = 14;
|
||||
pub const NFT_CT_BYTES: ::c_int = 15;
|
||||
|
||||
pub const NFT_LIMIT_PKTS: ::c_int = 0;
|
||||
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
|
||||
|
||||
pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
|
||||
pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
|
||||
pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
|
||||
|
||||
pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
|
||||
pub const NFT_REJECT_TCP_RST: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
|
||||
|
||||
pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
|
||||
pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
|
||||
pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
|
||||
|
||||
pub const NFT_NAT_SNAT: ::c_int = 0;
|
||||
pub const NFT_NAT_DNAT: ::c_int = 1;
|
||||
|
||||
pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
|
||||
pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
|
||||
pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
|
||||
pub const NFT_TRACETYPE_RULE: ::c_int = 3;
|
||||
|
||||
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
|
||||
pub const NFT_NG_RANDOM: ::c_int = 1;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub const AF_MAX: ::c_int = 42;
|
||||
#[doc(hidden)]
|
||||
pub const PF_MAX: ::c_int = AF_MAX;
|
||||
|
||||
f! {
|
||||
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
|
||||
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
|
||||
}
|
||||
}
|
||||
|
||||
#[link(name = "util")]
|
||||
extern {
|
||||
pub fn sysctl(name: *mut ::c_int,
|
||||
|
|
|
|||
464
third_party/rust/libc/src/unix/notbsd/linux/mod.rs
vendored
464
third_party/rust/libc/src/unix/notbsd/linux/mod.rs
vendored
|
|
@ -23,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! {
|
||||
|
|
@ -391,6 +402,93 @@ 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 struct posix_spawn_file_actions_t {
|
||||
__allocated: ::c_int,
|
||||
__used: ::c_int,
|
||||
__actions: *mut ::c_int,
|
||||
__pad: [::c_int; 16],
|
||||
}
|
||||
|
||||
pub struct posix_spawnattr_t {
|
||||
__flags: ::c_short,
|
||||
__pgrp: ::pid_t,
|
||||
__sd: ::sigset_t,
|
||||
__ss: ::sigset_t,
|
||||
#[cfg(target_env = "musl")]
|
||||
__prio: ::c_int,
|
||||
#[cfg(not(target_env = "musl"))]
|
||||
__sp: ::sched_param,
|
||||
__policy: ::c_int,
|
||||
__pad: [::c_int; 16],
|
||||
}
|
||||
|
||||
pub struct genlmsghdr {
|
||||
cmd: u8,
|
||||
version: u8,
|
||||
reserved: u16,
|
||||
}
|
||||
}
|
||||
|
||||
pub const ABDAY_1: ::nl_item = 0x20000;
|
||||
|
|
@ -663,6 +761,27 @@ 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
|
||||
pub const IFF_TUN: ::c_short = 0x0001;
|
||||
pub const IFF_TAP: ::c_short = 0x0002;
|
||||
pub const IFF_NO_PI: ::c_short = 0x1000;
|
||||
// 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;
|
||||
// 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;
|
||||
|
|
@ -846,10 +965,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;
|
||||
|
|
@ -862,8 +983,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;
|
||||
|
|
@ -996,6 +1115,13 @@ 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;
|
||||
|
|
@ -1024,7 +1150,249 @@ 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;
|
||||
|
||||
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
|
||||
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
|
||||
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
|
||||
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
|
||||
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
|
||||
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20;
|
||||
|
||||
pub const NLMSG_NOOP: ::c_int = 0x1;
|
||||
pub const NLMSG_ERROR: ::c_int = 0x2;
|
||||
pub const NLMSG_DONE: ::c_int = 0x3;
|
||||
pub const NLMSG_OVERRUN: ::c_int = 0x4;
|
||||
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
|
||||
|
||||
pub const GENL_NAMSIZ: ::c_int = 16;
|
||||
|
||||
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
|
||||
pub const GENL_MAX_ID: ::c_int = 1023;
|
||||
|
||||
pub const GENL_ADMIN_PERM: ::c_int = 0x01;
|
||||
pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
|
||||
pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
|
||||
pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
|
||||
|
||||
pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
|
||||
|
||||
pub const CTRL_CMD_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
|
||||
pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
|
||||
pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
|
||||
pub const CTRL_CMD_NEWOPS: ::c_int = 4;
|
||||
pub const CTRL_CMD_DELOPS: ::c_int = 5;
|
||||
pub const CTRL_CMD_GETOPS: ::c_int = 6;
|
||||
pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
|
||||
pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
|
||||
pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
|
||||
|
||||
pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
|
||||
pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
|
||||
pub const CTRL_ATTR_VERSION: ::c_int = 3;
|
||||
pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
|
||||
pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
|
||||
pub const CTRL_ATTR_OPS: ::c_int = 6;
|
||||
pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
|
||||
|
||||
pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_OP_ID: ::c_int = 1;
|
||||
pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
|
||||
|
||||
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
|
||||
pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
|
||||
pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
|
||||
|
||||
// linux/netfilter.h
|
||||
pub const NF_DROP: ::c_int = 0;
|
||||
pub const NF_ACCEPT: ::c_int = 1;
|
||||
pub const NF_STOLEN: ::c_int = 2;
|
||||
pub const NF_QUEUE: ::c_int = 3;
|
||||
pub const NF_REPEAT: ::c_int = 4;
|
||||
pub const NF_STOP: ::c_int = 5;
|
||||
pub const NF_MAX_VERDICT: ::c_int = NF_STOP;
|
||||
|
||||
pub const NF_VERDICT_MASK: ::c_int = 0x000000ff;
|
||||
pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000;
|
||||
|
||||
pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000;
|
||||
pub const NF_VERDICT_QBITS: ::c_int = 16;
|
||||
|
||||
pub const NF_VERDICT_BITS: ::c_int = 16;
|
||||
|
||||
pub const NF_INET_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_INET_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_INET_FORWARD: ::c_int = 2;
|
||||
pub const NF_INET_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_INET_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_INET_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
// Some NFPROTO are not compatible with musl and are defined in submodules.
|
||||
pub const NFPROTO_UNSPEC: ::c_int = 0;
|
||||
pub const NFPROTO_IPV4: ::c_int = 2;
|
||||
pub const NFPROTO_ARP: ::c_int = 3;
|
||||
pub const NFPROTO_BRIDGE: ::c_int = 7;
|
||||
pub const NFPROTO_IPV6: ::c_int = 10;
|
||||
pub const NFPROTO_DECNET: ::c_int = 12;
|
||||
pub const NFPROTO_NUMPROTO: ::c_int = 13;
|
||||
|
||||
// linux/netfilter_ipv4.h
|
||||
pub const NF_IP_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_IP_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_IP_FORWARD: ::c_int = 2;
|
||||
pub const NF_IP_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_IP_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_IP_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
|
||||
pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
|
||||
pub const NF_IP_PRI_RAW: ::c_int = -300;
|
||||
pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
|
||||
pub const NF_IP_PRI_CONNTRACK: ::c_int = -200;
|
||||
pub const NF_IP_PRI_MANGLE: ::c_int = -150;
|
||||
pub const NF_IP_PRI_NAT_DST: ::c_int = -100;
|
||||
pub const NF_IP_PRI_FILTER: ::c_int = 0;
|
||||
pub const NF_IP_PRI_SECURITY: ::c_int = 50;
|
||||
pub const NF_IP_PRI_NAT_SRC: ::c_int = 100;
|
||||
pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225;
|
||||
pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300;
|
||||
pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX;
|
||||
pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX;
|
||||
|
||||
// linux/netfilter_ipv6.h
|
||||
pub const NF_IP6_PRE_ROUTING: ::c_int = 0;
|
||||
pub const NF_IP6_LOCAL_IN: ::c_int = 1;
|
||||
pub const NF_IP6_FORWARD: ::c_int = 2;
|
||||
pub const NF_IP6_LOCAL_OUT: ::c_int = 3;
|
||||
pub const NF_IP6_POST_ROUTING: ::c_int = 4;
|
||||
pub const NF_IP6_NUMHOOKS: ::c_int = 5;
|
||||
|
||||
pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
|
||||
pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
|
||||
pub const NF_IP6_PRI_RAW: ::c_int = -300;
|
||||
pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
|
||||
pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200;
|
||||
pub const NF_IP6_PRI_MANGLE: ::c_int = -150;
|
||||
pub const NF_IP6_PRI_NAT_DST: ::c_int = -100;
|
||||
pub const NF_IP6_PRI_FILTER: ::c_int = 0;
|
||||
pub const NF_IP6_PRI_SECURITY: ::c_int = 50;
|
||||
pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100;
|
||||
pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
|
||||
pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
|
||||
pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
|
||||
|
||||
f! {
|
||||
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
|
||||
|
|
@ -1100,9 +1468,13 @@ extern {
|
|||
pub fn setpwent();
|
||||
pub fn endpwent();
|
||||
pub fn getpwent() -> *mut passwd;
|
||||
pub fn setgrent();
|
||||
pub fn endgrent();
|
||||
pub fn getgrent() -> *mut ::group;
|
||||
pub fn setspent();
|
||||
pub fn endspent();
|
||||
pub fn getspent() -> *mut spwd;
|
||||
|
||||
pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
|
||||
|
||||
pub fn shm_open(name: *const c_char, oflag: ::c_int,
|
||||
|
|
@ -1269,7 +1641,6 @@ extern {
|
|||
nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
|
||||
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
|
||||
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
|
||||
|
||||
pub fn mremap(addr: *mut ::c_void,
|
||||
len: ::size_t,
|
||||
new_len: ::size_t,
|
||||
|
|
@ -1295,7 +1666,8 @@ extern {
|
|||
-> ::c_int;
|
||||
|
||||
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn remap_file_pages(addr: *mut ::c_void, size: ::size_t, prot: ::c_int,
|
||||
pgoff: ::size_t, flags: ::c_int) -> ::c_int;
|
||||
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;
|
||||
|
|
@ -1483,6 +1855,88 @@ 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;
|
||||
|
||||
pub fn posix_spawn(pid: *mut ::pid_t,
|
||||
path: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnp(pid: *mut ::pid_t,
|
||||
file: *const ::c_char,
|
||||
file_actions: *const ::posix_spawn_file_actions_t,
|
||||
attrp: *const ::posix_spawnattr_t,
|
||||
argv: *const *mut ::c_char,
|
||||
envp: *const *mut ::c_char) -> ::c_int;
|
||||
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t,
|
||||
default: *mut ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t,
|
||||
default: *const ::sigset_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t,
|
||||
flags: ::c_short) -> ::c_int;
|
||||
pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::pid_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t,
|
||||
flags: ::pid_t) -> ::c_int;
|
||||
pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t,
|
||||
flags: *mut ::c_int) -> ::c_int;
|
||||
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t,
|
||||
flags: ::c_int) -> ::c_int;
|
||||
pub fn posix_spawnattr_getschedparam(
|
||||
attr: *const posix_spawnattr_t,
|
||||
param: *mut ::sched_param,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawnattr_setschedparam(
|
||||
attr: *mut posix_spawnattr_t,
|
||||
param: *const ::sched_param,
|
||||
) -> ::c_int;
|
||||
|
||||
pub fn posix_spawn_file_actions_init(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_destroy(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addopen(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
path: *const ::c_char,
|
||||
oflag: ::c_int,
|
||||
mode: ::mode_t,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_addclose(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
) -> ::c_int;
|
||||
pub fn posix_spawn_file_actions_adddup2(
|
||||
actions: *mut posix_spawn_file_actions_t,
|
||||
fd: ::c_int,
|
||||
newfd: ::c_int,
|
||||
) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -80,4 +80,362 @@ pub const AF_MAX: ::c_int = 42;
|
|||
pub const PF_MAX: ::c_int = AF_MAX;
|
||||
|
||||
// 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;
|
||||
|
|
|
|||
|
|
@ -75,12 +75,6 @@ s! {
|
|||
pub mem_unit: ::c_uint,
|
||||
pub __reserved: [::c_char; 256],
|
||||
}
|
||||
|
||||
pub struct ucred {
|
||||
pub pid: ::pid_t,
|
||||
pub uid: ::uid_t,
|
||||
pub gid: ::gid_t,
|
||||
}
|
||||
}
|
||||
|
||||
pub const SFD_CLOEXEC: ::c_int = 0x080000;
|
||||
|
|
@ -90,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;
|
||||
|
|
|
|||
|
|
@ -87,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -145,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;
|
||||
|
||||
|
|
@ -526,6 +527,7 @@ 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;
|
||||
|
|
@ -558,6 +560,7 @@ 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;
|
||||
|
|
@ -573,6 +576,8 @@ 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;
|
||||
|
|
@ -714,6 +719,7 @@ 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;
|
||||
|
|
|
|||
|
|
@ -132,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -145,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 = 0x2000000 | O_DIRECTORY;
|
||||
|
||||
pub const MAP_GROWSDOWN: ::c_int = 0x0200;
|
||||
|
||||
|
|
@ -349,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;
|
||||
|
||||
|
|
@ -435,6 +433,346 @@ 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,
|
||||
|
|
|
|||
|
|
@ -249,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,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,
|
||||
|
|
@ -171,6 +165,57 @@ s! {
|
|||
__size: [::c_char; 32],
|
||||
__align: [::c_long; 0],
|
||||
}
|
||||
|
||||
pub struct mallinfo {
|
||||
pub arena: ::c_int,
|
||||
pub ordblks: ::c_int,
|
||||
pub smblks: ::c_int,
|
||||
pub hblks: ::c_int,
|
||||
pub hblkhd: ::c_int,
|
||||
pub usmblks: ::c_int,
|
||||
pub fsmblks: ::c_int,
|
||||
pub uordblks: ::c_int,
|
||||
pub fordblks: ::c_int,
|
||||
pub keepcost: ::c_int,
|
||||
}
|
||||
|
||||
pub struct nlmsghdr {
|
||||
nlmsg_len: u32,
|
||||
nlmsg_type: u16,
|
||||
nlmsg_flags: u16,
|
||||
nlmsg_seq: u32,
|
||||
nlmsg_pid: u32,
|
||||
}
|
||||
|
||||
pub struct nlmsgerr {
|
||||
error: ::c_int,
|
||||
msg: nlmsghdr,
|
||||
}
|
||||
|
||||
pub struct nl_pktinfo {
|
||||
group: u32,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_req {
|
||||
nm_block_size: ::c_uint,
|
||||
nm_block_nr: ::c_uint,
|
||||
nm_frame_size: ::c_uint,
|
||||
nm_frame_nr: ::c_uint,
|
||||
}
|
||||
|
||||
pub struct nl_mmap_hdr {
|
||||
nm_status: ::c_uint,
|
||||
nm_len: ::c_uint,
|
||||
nm_group: u32,
|
||||
nm_pid: u32,
|
||||
nm_uid: u32,
|
||||
nm_gid: u32,
|
||||
}
|
||||
|
||||
pub struct nlattr {
|
||||
nla_len: u16,
|
||||
nla_type: u16,
|
||||
}
|
||||
}
|
||||
|
||||
pub const __UT_LINESIZE: usize = 32;
|
||||
|
|
@ -510,12 +555,6 @@ pub const NLM_F_EXCL: ::c_int = 0x200;
|
|||
pub const NLM_F_CREATE: ::c_int = 0x400;
|
||||
pub const NLM_F_APPEND: ::c_int = 0x800;
|
||||
|
||||
pub const NLMSG_NOOP: ::c_int = 0x1;
|
||||
pub const NLMSG_ERROR: ::c_int = 0x2;
|
||||
pub const NLMSG_DONE: ::c_int = 0x3;
|
||||
pub const NLMSG_OVERRUN: ::c_int = 0x4;
|
||||
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
|
||||
|
||||
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
|
||||
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
|
||||
pub const NETLINK_PKTINFO: ::c_int = 3;
|
||||
|
|
@ -531,6 +570,13 @@ 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);
|
||||
|
||||
pub const NLA_ALIGNTO: ::c_int = 4;
|
||||
|
||||
pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
|
||||
|
||||
pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
|
||||
pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
|
||||
|
||||
pub const TIOCM_LE: ::c_int = 0x001;
|
||||
pub const TIOCM_DTR: ::c_int = 0x002;
|
||||
pub const TIOCM_RTS: ::c_int = 0x004;
|
||||
|
|
@ -543,6 +589,215 @@ pub const TIOCM_DSR: ::c_int = 0x100;
|
|||
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
|
||||
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
|
||||
|
||||
pub const NF_NETDEV_INGRESS: ::c_int = 0;
|
||||
pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
|
||||
|
||||
pub const NFPROTO_INET: ::c_int = 1;
|
||||
pub const NFPROTO_NETDEV: ::c_int = 5;
|
||||
|
||||
// linux/netfilter/nf_tables.h
|
||||
cfg_if!{
|
||||
if #[cfg(any(target_arch = "arm", target_arch = "powerpc",
|
||||
target_arch = "powerpc64", target_arch = "aarch64"))] {
|
||||
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
|
||||
} else if #[cfg(target_arch = "sparc64")] {
|
||||
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
|
||||
pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
|
||||
} else {
|
||||
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
|
||||
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
|
||||
pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
|
||||
pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
|
||||
}
|
||||
}
|
||||
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
|
||||
|
||||
pub const NFT_REG_VERDICT: ::c_int = 0;
|
||||
pub const NFT_REG_1: ::c_int = 1;
|
||||
pub const NFT_REG_2: ::c_int = 2;
|
||||
pub const NFT_REG_3: ::c_int = 3;
|
||||
pub const NFT_REG_4: ::c_int = 4;
|
||||
pub const __NFT_REG_MAX: ::c_int = 5;
|
||||
pub const NFT_REG32_00: ::c_int = 8;
|
||||
pub const NFT_REG32_01: ::c_int = 9;
|
||||
pub const NFT_REG32_02: ::c_int = 10;
|
||||
pub const NFT_REG32_03: ::c_int = 11;
|
||||
pub const NFT_REG32_04: ::c_int = 12;
|
||||
pub const NFT_REG32_05: ::c_int = 13;
|
||||
pub const NFT_REG32_06: ::c_int = 14;
|
||||
pub const NFT_REG32_07: ::c_int = 15;
|
||||
pub const NFT_REG32_08: ::c_int = 16;
|
||||
pub const NFT_REG32_09: ::c_int = 17;
|
||||
pub const NFT_REG32_10: ::c_int = 18;
|
||||
pub const NFT_REG32_11: ::c_int = 19;
|
||||
pub const NFT_REG32_12: ::c_int = 20;
|
||||
pub const NFT_REG32_13: ::c_int = 21;
|
||||
pub const NFT_REG32_14: ::c_int = 22;
|
||||
pub const NFT_REG32_15: ::c_int = 23;
|
||||
|
||||
pub const NFT_REG_SIZE: ::c_int = 16;
|
||||
pub const NFT_REG32_SIZE: ::c_int = 4;
|
||||
|
||||
pub const NFT_CONTINUE: ::c_int = -1;
|
||||
pub const NFT_BREAK: ::c_int = -2;
|
||||
pub const NFT_JUMP: ::c_int = -3;
|
||||
pub const NFT_GOTO: ::c_int = -4;
|
||||
pub const NFT_RETURN: ::c_int = -5;
|
||||
|
||||
pub const NFT_MSG_NEWTABLE: ::c_int = 0;
|
||||
pub const NFT_MSG_GETTABLE: ::c_int = 1;
|
||||
pub const NFT_MSG_DELTABLE: ::c_int = 2;
|
||||
pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
|
||||
pub const NFT_MSG_GETCHAIN: ::c_int = 4;
|
||||
pub const NFT_MSG_DELCHAIN: ::c_int = 5;
|
||||
pub const NFT_MSG_NEWRULE: ::c_int = 6;
|
||||
pub const NFT_MSG_GETRULE: ::c_int = 7;
|
||||
pub const NFT_MSG_DELRULE: ::c_int = 8;
|
||||
pub const NFT_MSG_NEWSET: ::c_int = 9;
|
||||
pub const NFT_MSG_GETSET: ::c_int = 10;
|
||||
pub const NFT_MSG_DELSET: ::c_int = 11;
|
||||
pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
|
||||
pub const NFT_MSG_GETSETELEM: ::c_int = 13;
|
||||
pub const NFT_MSG_DELSETELEM: ::c_int = 14;
|
||||
pub const NFT_MSG_NEWGEN: ::c_int = 15;
|
||||
pub const NFT_MSG_GETGEN: ::c_int = 16;
|
||||
pub const NFT_MSG_TRACE: ::c_int = 17;
|
||||
cfg_if! {
|
||||
if #[cfg(not(target_arch = "sparc64"))] {
|
||||
pub const NFT_MSG_NEWOBJ: ::c_int = 18;
|
||||
pub const NFT_MSG_GETOBJ: ::c_int = 19;
|
||||
pub const NFT_MSG_DELOBJ: ::c_int = 20;
|
||||
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
|
||||
pub const NFT_MSG_MAX: ::c_int = 22;
|
||||
} else {
|
||||
pub const NFT_MSG_MAX: ::c_int = 18;
|
||||
}
|
||||
}
|
||||
|
||||
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
|
||||
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
|
||||
pub const NFT_SET_INTERVAL: ::c_int = 0x4;
|
||||
pub const NFT_SET_MAP: ::c_int = 0x8;
|
||||
pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
|
||||
pub const NFT_SET_EVAL: ::c_int = 0x20;
|
||||
|
||||
pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
|
||||
pub const NFT_SET_POL_MEMORY: ::c_int = 1;
|
||||
|
||||
pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
|
||||
|
||||
pub const NFT_DATA_VALUE: ::c_uint = 0;
|
||||
pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
|
||||
|
||||
pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
|
||||
|
||||
pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
|
||||
pub const NFT_BYTEORDER_HTON: ::c_int = 1;
|
||||
|
||||
pub const NFT_CMP_EQ: ::c_int = 0;
|
||||
pub const NFT_CMP_NEQ: ::c_int = 1;
|
||||
pub const NFT_CMP_LT: ::c_int = 2;
|
||||
pub const NFT_CMP_LTE: ::c_int = 3;
|
||||
pub const NFT_CMP_GT: ::c_int = 4;
|
||||
pub const NFT_CMP_GTE: ::c_int = 5;
|
||||
|
||||
pub const NFT_RANGE_EQ: ::c_int = 0;
|
||||
pub const NFT_RANGE_NEQ: ::c_int = 1;
|
||||
|
||||
pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
|
||||
pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
|
||||
|
||||
pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
|
||||
pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
|
||||
|
||||
pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
|
||||
pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
|
||||
|
||||
pub const NFT_META_LEN: ::c_int = 0;
|
||||
pub const NFT_META_PROTOCOL: ::c_int = 1;
|
||||
pub const NFT_META_PRIORITY: ::c_int = 2;
|
||||
pub const NFT_META_MARK: ::c_int = 3;
|
||||
pub const NFT_META_IIF: ::c_int = 4;
|
||||
pub const NFT_META_OIF: ::c_int = 5;
|
||||
pub const NFT_META_IIFNAME: ::c_int = 6;
|
||||
pub const NFT_META_OIFNAME: ::c_int = 7;
|
||||
pub const NFT_META_IIFTYPE: ::c_int = 8;
|
||||
pub const NFT_META_OIFTYPE: ::c_int = 9;
|
||||
pub const NFT_META_SKUID: ::c_int = 10;
|
||||
pub const NFT_META_SKGID: ::c_int = 11;
|
||||
pub const NFT_META_NFTRACE: ::c_int = 12;
|
||||
pub const NFT_META_RTCLASSID: ::c_int = 13;
|
||||
pub const NFT_META_SECMARK: ::c_int = 14;
|
||||
pub const NFT_META_NFPROTO: ::c_int = 15;
|
||||
pub const NFT_META_L4PROTO: ::c_int = 16;
|
||||
pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
|
||||
pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
|
||||
pub const NFT_META_PKTTYPE: ::c_int = 19;
|
||||
pub const NFT_META_CPU: ::c_int = 20;
|
||||
pub const NFT_META_IIFGROUP: ::c_int = 21;
|
||||
pub const NFT_META_OIFGROUP: ::c_int = 22;
|
||||
pub const NFT_META_CGROUP: ::c_int = 23;
|
||||
pub const NFT_META_PRANDOM: ::c_int = 24;
|
||||
|
||||
pub const NFT_CT_STATE: ::c_int = 0;
|
||||
pub const NFT_CT_DIRECTION: ::c_int = 1;
|
||||
pub const NFT_CT_STATUS: ::c_int = 2;
|
||||
pub const NFT_CT_MARK: ::c_int = 3;
|
||||
pub const NFT_CT_SECMARK: ::c_int = 4;
|
||||
pub const NFT_CT_EXPIRATION: ::c_int = 5;
|
||||
pub const NFT_CT_HELPER: ::c_int = 6;
|
||||
pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
|
||||
pub const NFT_CT_SRC: ::c_int = 8;
|
||||
pub const NFT_CT_DST: ::c_int = 9;
|
||||
pub const NFT_CT_PROTOCOL: ::c_int = 10;
|
||||
pub const NFT_CT_PROTO_SRC: ::c_int = 11;
|
||||
pub const NFT_CT_PROTO_DST: ::c_int = 12;
|
||||
pub const NFT_CT_LABELS: ::c_int = 13;
|
||||
pub const NFT_CT_PKTS: ::c_int = 14;
|
||||
pub const NFT_CT_BYTES: ::c_int = 15;
|
||||
|
||||
pub const NFT_LIMIT_PKTS: ::c_int = 0;
|
||||
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
|
||||
|
||||
pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
|
||||
pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
|
||||
pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
|
||||
|
||||
pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0);
|
||||
|
||||
pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
|
||||
pub const NFT_REJECT_TCP_RST: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
|
||||
|
||||
pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
|
||||
pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
|
||||
pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
|
||||
pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
|
||||
|
||||
pub const NFT_NAT_SNAT: ::c_int = 0;
|
||||
pub const NFT_NAT_DNAT: ::c_int = 1;
|
||||
|
||||
pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
|
||||
pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
|
||||
pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
|
||||
pub const NFT_TRACETYPE_RULE: ::c_int = 3;
|
||||
|
||||
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
|
||||
pub const NFT_NG_RANDOM: ::c_int = 1;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub const AF_MAX: ::c_int = 42;
|
||||
#[doc(hidden)]
|
||||
|
|
@ -559,6 +814,12 @@ cfg_if! {
|
|||
}
|
||||
}
|
||||
|
||||
f! {
|
||||
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
|
||||
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
|
||||
}
|
||||
}
|
||||
|
||||
extern {
|
||||
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
|
||||
pub fn getutxent() -> *mut utmpx;
|
||||
|
|
@ -603,6 +864,22 @@ extern {
|
|||
pub fn pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t,
|
||||
val: ::c_int) -> ::c_int;
|
||||
pub fn sched_getcpu() -> ::c_int;
|
||||
pub fn mallinfo() -> ::mallinfo;
|
||||
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
|
||||
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
|
||||
pub fn getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::unix::notbsd
|
||||
::linux::passwd) -> ::c_int;
|
||||
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
|
||||
pub fn getgrent_r(grp: *mut ::group,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::group) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -221,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,
|
||||
|
|
@ -323,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;
|
||||
|
|
@ -913,8 +908,8 @@ 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;
|
||||
|
|
@ -1219,20 +1214,20 @@ 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 = 16;
|
||||
pub const SYS_setuid: ::c_long = 23;
|
||||
pub const SYS_getuid: ::c_long = 24;
|
||||
pub const SYS_setgid: ::c_long = 46;
|
||||
pub const SYS_getgid: ::c_long = 47;
|
||||
pub const SYS_geteuid: ::c_long = 49;
|
||||
pub const SYS_setreuid: ::c_long = 70;
|
||||
pub const SYS_setregid: ::c_long = 71;
|
||||
pub const SYS_getrlimit: ::c_long = 76;
|
||||
pub const SYS_getgroups: ::c_long = 80;
|
||||
pub const SYS_fchown: ::c_long = 95;
|
||||
pub const SYS_setresuid: ::c_long = 164;
|
||||
pub const SYS_setresgid: ::c_long = 170;
|
||||
pub const SYS_getresgid: ::c_long = 171;
|
||||
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;
|
||||
|
|
|
|||
8
third_party/rust/libc/src/unix/notbsd/mod.rs
vendored
8
third_party/rust/libc/src/unix/notbsd/mod.rs
vendored
|
|
@ -576,8 +576,13 @@ 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 IP_TRANSPARENT: ::c_int = 19;
|
||||
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
|
||||
pub const IPV6_MULTICAST_IF: ::c_int = 17;
|
||||
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
|
||||
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
|
||||
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
|
||||
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
|
||||
pub const IPV6_V6ONLY: ::c_int = 26;
|
||||
|
||||
pub const TCP_NODELAY: ::c_int = 1;
|
||||
pub const TCP_MAXSEG: ::c_int = 2;
|
||||
|
|
@ -593,9 +598,6 @@ pub const TCP_INFO: ::c_int = 11;
|
|||
pub const TCP_QUICKACK: ::c_int = 12;
|
||||
pub const TCP_CONGESTION: ::c_int = 13;
|
||||
|
||||
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
|
||||
pub const IPV6_V6ONLY: ::c_int = 26;
|
||||
|
||||
pub const SO_DEBUG: ::c_int = 1;
|
||||
|
||||
pub const SHUT_RD: ::c_int = 0;
|
||||
|
|
|
|||
140
third_party/rust/libc/src/unix/solaris/mod.rs
vendored
140
third_party/rust/libc/src/unix/solaris/mod.rs
vendored
|
|
@ -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,12 @@ 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,
|
||||
}
|
||||
|
||||
pub struct epoll_event {
|
||||
pub events: ::uint32_t,
|
||||
pub u64: ::uint64_t,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -470,6 +474,9 @@ pub const SIG_BLOCK: ::c_int = 1;
|
|||
pub const SIG_UNBLOCK: ::c_int = 2;
|
||||
pub const SIG_SETMASK: ::c_int = 3;
|
||||
|
||||
pub const IPV6_UNICAST_HOPS: ::c_int = 0x5;
|
||||
pub const IPV6_MULTICAST_IF: ::c_int = 0x6;
|
||||
pub const IPV6_MULTICAST_HOPS: ::c_int = 0x7;
|
||||
pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8;
|
||||
pub const IPV6_V6ONLY: ::c_int = 0x27;
|
||||
|
||||
|
|
@ -747,7 +754,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;
|
||||
|
|
@ -835,6 +852,7 @@ pub const SOCK_STREAM: ::c_int = 2;
|
|||
pub const SOCK_RAW: ::c_int = 4;
|
||||
pub const SOCK_RDM: ::c_int = 5;
|
||||
pub const SOCK_SEQPACKET: ::c_int = 6;
|
||||
pub const IP_MULTICAST_IF: ::c_int = 16;
|
||||
pub const IP_MULTICAST_TTL: ::c_int = 17;
|
||||
pub const IP_MULTICAST_LOOP: ::c_int = 18;
|
||||
pub const IP_TTL: ::c_int = 4;
|
||||
|
|
@ -867,7 +885,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;
|
||||
|
|
@ -1077,6 +1136,9 @@ pub const NCCS: usize = 19;
|
|||
|
||||
pub const LOG_CRON: ::c_int = 15 << 3;
|
||||
|
||||
pub const SYS_epoll_create: ::c_long = 213;
|
||||
pub const SYS_epoll_create1: ::c_long = 291;
|
||||
|
||||
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
|
||||
__pthread_mutex_flag1: 0,
|
||||
__pthread_mutex_flag2: 0,
|
||||
|
|
@ -1132,6 +1194,25 @@ pub const PORT_SOURCE_FILE: ::c_int = 7;
|
|||
pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
|
||||
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
|
||||
|
||||
pub const EPOLLIN: ::c_int = 0x1;
|
||||
pub const EPOLLPRI: ::c_int = 0x2;
|
||||
pub const EPOLLOUT: ::c_int = 0x4;
|
||||
pub const EPOLLRDNORM: ::c_int = 0x40;
|
||||
pub const EPOLLRDBAND: ::c_int = 0x80;
|
||||
pub const EPOLLWRNORM: ::c_int = 0x100;
|
||||
pub const EPOLLWRBAND: ::c_int = 0x200;
|
||||
pub const EPOLLMSG: ::c_int = 0x400;
|
||||
pub const EPOLLERR: ::c_int = 0x8;
|
||||
pub const EPOLLHUP: ::c_int = 0x10;
|
||||
pub const EPOLLET: ::c_int = 0x80000000;
|
||||
pub const EPOLLRDHUP: ::c_int = 0x2000;
|
||||
pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
|
||||
pub const EPOLLONESHOT: ::c_int = 0x40000000;
|
||||
pub const EPOLL_CLOEXEC: ::c_int = 0x02000000;
|
||||
pub const EPOLL_CTL_ADD: ::c_int = 1;
|
||||
pub const EPOLL_CTL_MOD: ::c_int = 3;
|
||||
pub const EPOLL_CTL_DEL: ::c_int = 2;
|
||||
|
||||
f! {
|
||||
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
|
||||
let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
|
||||
|
|
@ -1221,7 +1302,7 @@ 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,
|
||||
|
|
@ -1266,7 +1347,8 @@ extern {
|
|||
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;
|
||||
|
|
@ -1289,13 +1371,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)
|
||||
|
|
@ -1306,21 +1388,33 @@ 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;
|
||||
pub fn getdtablesize() -> ::c_int;
|
||||
|
||||
pub fn epoll_pwait(epfd: ::c_int,
|
||||
events: *mut ::epoll_event,
|
||||
maxevents: ::c_int,
|
||||
timeout: ::c_int,
|
||||
sigmask: *const ::sigset_t) -> ::c_int;
|
||||
pub fn epoll_create(size: ::c_int) -> ::c_int;
|
||||
pub fn epoll_create1(flags: ::c_int) -> ::c_int;
|
||||
pub fn epoll_wait(epfd: ::c_int,
|
||||
events: *mut ::epoll_event,
|
||||
maxevents: ::c_int,
|
||||
timeout: ::c_int) -> ::c_int;
|
||||
pub fn epoll_ctl(epfd: ::c_int,
|
||||
op: ::c_int,
|
||||
fd: ::c_int,
|
||||
event: *mut ::epoll_event) -> ::c_int;
|
||||
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
|
||||
pub fn getgrnam_r(name: *const ::c_char,
|
||||
grp: *mut ::group,
|
||||
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;
|
||||
|
|
@ -1328,22 +1422,28 @@ 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_getpwent_r")]
|
||||
pub fn getpwent_r(pwd: *mut passwd,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut passwd) -> ::c_int;
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
|
||||
pub fn getgrent_r(grp: *mut ::group,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::group) -> ::c_int;
|
||||
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
|
||||
pub fn sigwait(set: *const sigset_t,
|
||||
sig: *mut ::c_int) -> ::c_int;
|
||||
|
|
@ -1351,8 +1451,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
35
third_party/rust/libc/src/unix/uclibc/mod.rs
vendored
35
third_party/rust/libc/src/unix/uclibc/mod.rs
vendored
|
|
@ -653,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;
|
||||
|
|
@ -787,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;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"files":{".travis.yml":"3c9d7103068d644d68f5d0f9dd6a9ba00eb86bfb4cfc2c2c14c8a853144fcf09","Cargo.toml":"538efc8b4fd54f900e4706d6904b7696dbf071578d16fe76df1db8c82566635b","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"34dc610b01f8c3e56d95de1972120ca0d53cee787f636a3ce96526ab343878b5","appveyor.yml":"8382c7f1769f6cf78029a221058c4d73f35a48308b5dfc38d875facabec1c139","build.rs":"dd767f79832741a368fd46a846b7d53cdd05337becad6f7addad71e9618c2769","src/changelog.rs":"b1cbfc5b62c13693e06ca9b3196b359661a0c27d4bdc5eb093554ff86ce34a72","src/lib.rs":"665c5eeecdf77afc0dbe7de4232b2d5f5da5e19a5fd851ac433c89d600b801ee","src/os/mod.rs":"51d733e5522dacd6069642ad66aa6d7acf6c82950c934eb040e8dfd112e6d610","src/os/unix/mod.rs":"1cd2b6f51a34e492b7c88d054f25d89b825037bd81e62a2950ca13720e760061","src/os/windows/mod.rs":"2ed3564e9b88a601cd93b13affb286af7beee165b710279d55c953c74b783310","src/test_helpers.rs":"3a55052e8cd5231e97d9282b43398c2f144c57ced2d2df64bde7f482f5c778e7","src/util.rs":"0b0155448a26db4b00b2a6ca129e0e1f6f75870c56c9777d262941818c7581b7","tests/functions.rs":"dbed3ad32d6a31c8c0df5943f686ca328f020c5d49a9111281458971caa40e62","tests/markers.rs":"8e9c1b883404d9190e4f23ed39b3d6cbbccb3a07883f733b04aed4357b9c6aca","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/statics.rs":"8fd0955d38cdf3d56d1ece03ad159192702dbc049aa1af146f28fb10f1cf2fcc","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"be99f814beb3e9503a786a592c909692bb6d4fc5a695f6ed7987223acfbd5194"}
|
||||
{"files":{".travis.yml":"3c9d7103068d644d68f5d0f9dd6a9ba00eb86bfb4cfc2c2c14c8a853144fcf09","Cargo.toml":"5bc50b6714c71bebc3b616d276e3c73c34ebd375ec99fcaba76b29ac5685e696","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"b4cd83f110d01dc5aa8fcaf3da34bdbe1478efdba767d73abc14d4d87e4775fa","appveyor.yml":"8382c7f1769f6cf78029a221058c4d73f35a48308b5dfc38d875facabec1c139","build.rs":"dd60f6fc4cef3f02f56b74b6f03ed665ee8ce47e4040e2919282289affa1aca8","src/changelog.rs":"1ac991741280fdd9c5268d617ae7279d08146cfb3222b86e32315ff90b392598","src/lib.rs":"c17a20b5b9125b5a6d7b0913c35448ee688795f3e03f7bf1bf0aaf3e7e4e729e","src/os/mod.rs":"51d733e5522dacd6069642ad66aa6d7acf6c82950c934eb040e8dfd112e6d610","src/os/unix/global_static.c":"b1096dedf7d4aed5c28b658fc917f6603339ffd92390c84e25cb543bdc9460ac","src/os/unix/mod.rs":"717c09d09c20b14b8b8344899ffc3448ef23cf230ec61536a9fd53e8900d05ee","src/os/windows/mod.rs":"0b648941117a1573501ce1be5fcd11416361e1fe9c19a49f0826569a6cbc400a","src/test_helpers.rs":"3a55052e8cd5231e97d9282b43398c2f144c57ced2d2df64bde7f482f5c778e7","src/util.rs":"0b0155448a26db4b00b2a6ca129e0e1f6f75870c56c9777d262941818c7581b7","tests/functions.rs":"4633f3673db6a5b3623ea8927b13314c25502c9fbb63bb17a5a35650ea489012","tests/markers.rs":"8e9c1b883404d9190e4f23ed39b3d6cbbccb3a07883f733b04aed4357b9c6aca","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"}
|
||||
28
third_party/rust/libloading/Cargo.toml
vendored
28
third_party/rust/libloading/Cargo.toml
vendored
|
|
@ -1,17 +1,27 @@
|
|||
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
||||
#
|
||||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g. crates.io) dependencies
|
||||
#
|
||||
# If you believe there's an error in this file please file an
|
||||
# issue against the rust-lang/cargo repository. If you're
|
||||
# editing this file be aware that the upstream Cargo.toml
|
||||
# will likely look very different (and much more reasonable)
|
||||
|
||||
[package]
|
||||
name = "libloading"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
authors = ["Simonas Kazlauskas <libloading@kazlauskas.me>"]
|
||||
build = "build.rs"
|
||||
description = "A safer binding to platform’s dynamic library loading utilities"
|
||||
documentation = "https://docs.rs/libloading/"
|
||||
keywords = ["dlopen", "load", "shared", "dylib"]
|
||||
license = "ISC"
|
||||
repository = "https://github.com/nagisa/rust_libloading/"
|
||||
documentation = "https://docs.rs/libloading/"
|
||||
|
||||
[dependencies]
|
||||
lazy_static = "0.2"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.2"
|
||||
kernel32-sys = "0.2"
|
||||
[build-dependencies.cc]
|
||||
version = "1.0"
|
||||
[target."cfg(windows)".dependencies.winapi]
|
||||
version = "0.3"
|
||||
features = ["winerror", "errhandlingapi", "libloaderapi"]
|
||||
|
|
|
|||
6
third_party/rust/libloading/README.mkd
vendored
6
third_party/rust/libloading/README.mkd
vendored
|
|
@ -19,9 +19,3 @@ functions and static variables these libraries contain.
|
|||
[changelog]: https://docs.rs/libloading/*/libloading/changelog/index.html
|
||||
|
||||
libloading is distributed under ISC (MIT-like) license.
|
||||
|
||||
---
|
||||
|
||||
Note, that this library is not a drop-in replacement for the deprecated `dynamic_lib`. Many
|
||||
dubious APIs (notably, library search path modification) were prunned and string arguments
|
||||
take types that match conventions and system APIs better.
|
||||
|
|
|
|||
30
third_party/rust/libloading/build.rs
vendored
30
third_party/rust/libloading/build.rs
vendored
|
|
@ -1,8 +1,11 @@
|
|||
extern crate cc;
|
||||
|
||||
use std::io::Write;
|
||||
use std::env;
|
||||
|
||||
fn main(){
|
||||
let target_os = env::var("CARGO_CFG_TARGET_OS");
|
||||
let is_unix = env::var_os("CARGO_CFG_UNIX").is_some();
|
||||
match target_os.as_ref().map(|x| &**x) {
|
||||
Ok("linux") | Ok("android") => println!("cargo:rustc-link-lib=dl"),
|
||||
Ok("freebsd") | Ok("dragonfly") => println!("cargo:rustc-link-lib=c"),
|
||||
|
|
@ -10,6 +13,7 @@ fn main(){
|
|||
// found any libraries that have to be linked to on other platforms.
|
||||
// What happens if the executable is not linked up dynamically?
|
||||
Ok("openbsd") | Ok("bitrig") | Ok("netbsd") | Ok("macos") | Ok("ios") => {}
|
||||
Ok("solaris") => {}
|
||||
// dependencies come with winapi
|
||||
Ok("windows") => {}
|
||||
tos => {
|
||||
|
|
@ -19,27 +23,9 @@ fn main(){
|
|||
::std::process::exit(0xfc);
|
||||
}
|
||||
}
|
||||
maybe_test_helpers();
|
||||
}
|
||||
|
||||
fn maybe_test_helpers() {
|
||||
if env::var("OPT_LEVEL").ok().and_then(|v| v.parse().ok()).unwrap_or(0u64) != 0 {
|
||||
// certainly not for testing, just skip.
|
||||
return;
|
||||
if is_unix {
|
||||
cc::Build::new()
|
||||
.file("src/os/unix/global_static.c")
|
||||
.compile("global_static");
|
||||
}
|
||||
let mut outpath = if let Some(od) = env::var_os("OUT_DIR") { od } else { return };
|
||||
let target = if let Some(t) = env::var_os("TARGET") { t } else { return };
|
||||
let rustc = env::var_os("RUSTC").unwrap_or_else(|| { "rustc".into() });
|
||||
outpath.push("/libtest_helpers.dll"); // extension for windows required, POSIX does not care.
|
||||
let _ = ::std::process::Command::new(rustc)
|
||||
.arg("src/test_helpers.rs")
|
||||
.arg("-o")
|
||||
.arg(outpath)
|
||||
.arg("-O")
|
||||
.arg("--target")
|
||||
.arg(target)
|
||||
.output();
|
||||
// Ignore the failures here. We do not want failures of this thing to inhibit people from
|
||||
// building and using the library. Might make it hard to debug why tests fail in case this
|
||||
// library does not get built, though.
|
||||
}
|
||||
|
|
|
|||
34
third_party/rust/libloading/src/changelog.rs
vendored
34
third_party/rust/libloading/src/changelog.rs
vendored
|
|
@ -1,5 +1,39 @@
|
|||
//! Project changelog
|
||||
|
||||
/// Release 0.5.0 (2018-01-11)
|
||||
///
|
||||
/// * Update to `winapi = ^0.3`;
|
||||
///
|
||||
/// ## Breaking changes
|
||||
///
|
||||
/// * libloading now requires a C compiler to build on UNIX;
|
||||
/// * This is a temporary measure until the [`linkage`] attribute is stablised;
|
||||
/// * Necessary to resolve [#32].
|
||||
///
|
||||
/// [`linkage`]: https://github.com/rust-lang/rust/issues/29603
|
||||
/// [#32]: https://github.com/nagisa/rust_libloading/issues/32
|
||||
pub mod r0_5_0 {}
|
||||
|
||||
/// Release 0.4.3 (2017-12-07)
|
||||
///
|
||||
/// * Bump lazy-static dependency to `^1.0`;
|
||||
/// * `cargo test --release` now works when testing libloading.
|
||||
pub mod r0_4_3 {}
|
||||
|
||||
|
||||
/// Release 0.4.2 (2017-09-24)
|
||||
///
|
||||
/// * Improved error and race-condition handling on Windows;
|
||||
/// * Improved documentation about thread-safety of Library;
|
||||
/// * Added `Symbol::<Option<T>::lift_option() -> Option<Symbol<T>>` convenience method.
|
||||
pub mod r0_4_2 {}
|
||||
|
||||
|
||||
/// Release 0.4.1 (2017-08-29)
|
||||
///
|
||||
/// * Solaris support
|
||||
pub mod r0_4_1 {}
|
||||
|
||||
/// Release 0.4.0 (2017-05-01)
|
||||
///
|
||||
/// * Remove build-time dependency on target_build_utils (and by extension serde/phf);
|
||||
|
|
|
|||
49
third_party/rust/libloading/src/lib.rs
vendored
49
third_party/rust/libloading/src/lib.rs
vendored
|
|
@ -17,7 +17,7 @@
|
|||
//!
|
||||
//! ```toml
|
||||
//! [dependencies]
|
||||
//! libloading = "0.3"
|
||||
//! libloading = "0.5"
|
||||
//! ```
|
||||
//!
|
||||
//! Then inside your project
|
||||
|
|
@ -26,9 +26,9 @@
|
|||
//! extern crate libloading as lib;
|
||||
//!
|
||||
//! fn call_dynamic() -> lib::Result<u32> {
|
||||
//! let lib = try!(lib::Library::new("/path/to/liblibrary.so"));
|
||||
//! let lib = lib::Library::new("/path/to/liblibrary.so")?;
|
||||
//! unsafe {
|
||||
//! let func: lib::Symbol<unsafe extern fn() -> u32> = try!(lib.get(b"my_func"));
|
||||
//! let func: lib::Symbol<unsafe extern fn() -> u32> = lib.get(b"my_func")?;
|
||||
//! Ok(func())
|
||||
//! }
|
||||
//! }
|
||||
|
|
@ -41,10 +41,6 @@ use std::fmt;
|
|||
use std::ops;
|
||||
use std::marker;
|
||||
|
||||
#[cfg(unix)]
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
#[cfg(unix)]
|
||||
use self::os::unix as imp;
|
||||
#[cfg(windows)]
|
||||
|
|
@ -68,15 +64,27 @@ impl Library {
|
|||
/// * Absolute path to the library;
|
||||
/// * Relative (to the current working directory) path to the library.
|
||||
///
|
||||
/// ## Platform-specific behaviour
|
||||
/// ## Thread-safety
|
||||
///
|
||||
/// When a plain library filename is supplied, locations where library is searched for is
|
||||
/// platform specific and cannot be adjusted in a portable manner.
|
||||
/// The implementation strives to be as MT-safe as sanely possible, however due to certain
|
||||
/// error-handling related resources not always being safe, this library is not MT-safe either.
|
||||
///
|
||||
/// * On Windows Vista and earlier error handling falls back to [`SetErrorMode`], which is not
|
||||
/// MT-safe. MT-scenarios involving this function may cause a traditional data race;
|
||||
/// * On some UNIX targets `dlerror` might not be MT-safe, resulting in garbage error messages
|
||||
/// in certain MT-scenarios.
|
||||
///
|
||||
/// [`SetErrorMode`]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx
|
||||
///
|
||||
/// Calling this function from multiple threads is not safe if used in conjunction with
|
||||
/// path-less filename and library search path is modified (`SetDllDirectory` function on
|
||||
/// Windows, `{DY,}LD_LIBRARY_PATH` environment variable on UNIX).
|
||||
///
|
||||
/// ## Platform-specific behaviour
|
||||
///
|
||||
/// When a plain library filename is supplied, locations where library is searched for is
|
||||
/// platform specific and cannot be adjusted in a portable manner.
|
||||
///
|
||||
/// ### Windows
|
||||
///
|
||||
/// If the `filename` specifies a library filename without path and with extension omitted,
|
||||
|
|
@ -254,6 +262,27 @@ impl<'lib, T> Symbol<'lib, T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'lib, T> Symbol<'lib, Option<T>> {
|
||||
/// Lift Option out of the symbol.
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # use ::libloading::{Library, Symbol};
|
||||
/// let lib = Library::new("/path/to/awesome.module").unwrap();
|
||||
/// unsafe {
|
||||
/// let symbol: Symbol<Option<*mut u32>> = lib.get(b"symbol\0").unwrap();
|
||||
/// let symbol: Symbol<*mut u32> = symbol.lift_option().expect("static is not null");
|
||||
/// }
|
||||
/// ```
|
||||
pub fn lift_option(self) -> Option<Symbol<'lib, T>> {
|
||||
self.inner.lift_option().map(|is| Symbol {
|
||||
inner: is,
|
||||
pd: marker::PhantomData,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<'lib, T> Clone for Symbol<'lib, T> {
|
||||
fn clone(&self) -> Symbol<'lib, T> {
|
||||
Symbol {
|
||||
|
|
|
|||
20
third_party/rust/libloading/src/os/unix/global_static.c
vendored
Normal file
20
third_party/rust/libloading/src/os/unix/global_static.c
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
pthread_mutex_t __attribute__((weak)) rust_libloading_dlerror_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void __attribute__((weak))
|
||||
rust_libloading_dlerror_mutex_lock(void)
|
||||
{
|
||||
if (pthread_mutex_lock(&rust_libloading_dlerror_mutex) != 0) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__((weak))
|
||||
rust_libloading_dlerror_mutex_unlock(void)
|
||||
{
|
||||
if (pthread_mutex_unlock(&rust_libloading_dlerror_mutex) != 0) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue