diff --git a/.cirrus.yml b/.cirrus.yml
index 36690d7fa993b..f72dc82abf763 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,43 +1,40 @@
task:
- name: stable x86_64-unknown-freebsd-11
+ name: nightly x86_64-unknown-freebsd-12
freebsd_instance:
- image: freebsd-11-4-release-amd64
+ image: freebsd-12-4-release-amd64
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- - sh rustup.sh -y --profile=minimal
+ - sh rustup.sh --default-toolchain nightly -y --profile=minimal
- . $HOME/.cargo/env
- - rustup default stable
test_script:
- . $HOME/.cargo/env
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
- sh ci/run.sh x86_64-unknown-freebsd
task:
- name: nightly x86_64-unknown-freebsd-12
+ name: nightly x86_64-unknown-freebsd-13
freebsd_instance:
- image: freebsd-12-2-release-amd64
+ image: freebsd-13-1-release-amd64
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- - sh rustup.sh --default-toolchain nightly -y --profile=minimal
+ - sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
- - rustup default nightly
test_script:
- . $HOME/.cargo/env
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
- sh ci/run.sh x86_64-unknown-freebsd
task:
- name: nightly x86_64-unknown-freebsd-13
+ name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
- image: freebsd-13-0-alpha3-amd64
+ image: freebsd-14-0-current-amd64-v20220902
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- - sh rustup.sh -y --profile=minimal
+ - sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
- - rustup default nightly
test_script:
- . $HOME/.cargo/env
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000000..a4958ba8c5e64
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
+Thanks for considering submitting a PR!
+
+Here's a checklist for things that will be checked during review or continuous integration.
+
+- \[ ] Edit corresponding file(s) under `libc-test/semver` when you add/remove item(s)
+- \[ ] `rustc ci/style.rs && ./style src`
+- \[ ] `cd libc-test && cargo test` (This might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure.)
+- \[ ] Your PR that bumps up the crate version doesn't contain any other changes
+
+Delete this line and everything above before opening your PR.
diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml
index 5073de9993c11..fc9a5b6ec3cae 100644
--- a/.github/workflows/bors.yml
+++ b/.github/workflows/bors.yml
@@ -6,10 +6,15 @@ on:
- auto-libc
- try
+permissions: {}
jobs:
docker_linux_tier1:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Docker Linux Tier1
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
@@ -21,15 +26,19 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
macos:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: macOS
- runs-on: macos-10.15
+ runs-on: macos-12
strategy:
fail-fast: true
matrix:
@@ -40,15 +49,19 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
windows:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Windows
- runs-on: windows-2019
+ runs-on: windows-2022
env:
OS: windows
strategy:
@@ -71,7 +84,10 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
+ - name: Self-update rustup
+ run: rustup self update
+ shell: bash
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
shell: bash
@@ -80,24 +96,30 @@ jobs:
shell: bash
style_check:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Style check
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: true
+ runs-on: ubuntu-22.04
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
run: sh ci/style.sh
docker_linux_tier2:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Docker Linux Tier2
needs: [docker_linux_tier1, style_check]
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
strategy:
fail-fast: true
max-parallel: 12
@@ -126,7 +148,10 @@ jobs:
powerpc64le-unknown-linux-gnu,
s390x-unknown-linux-gnu,
riscv64gc-unknown-linux-gnu,
- # FIXME: Figure out why this is disabled.
+ # FIXME: A recent nightly causes a linker failure:
+ # https://github.com/rust-lang/rust/issues/76679
+ # See this comment for more details:
+ # https://github.com/rust-lang/libc/pull/2225#issuecomment-880696737
#wasm32-wasi,
sparc64-unknown-linux-gnu,
wasm32-unknown-emscripten,
@@ -141,33 +166,67 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
+ # These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
+ # Because of this, only the nightly compiler can be used on these targets.
+ docker_linux_build_std:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
+ if: ${{ false }} # This is currently broken
+ name: Docker Linux Build-Std Targets
+ needs: [docker_linux_tier1, style_check]
+ runs-on: ubuntu-22.04
+ strategy:
+ fail-fast: true
+ max-parallel: 12
+ matrix:
+ target: [
+ armv7-unknown-linux-uclibceabihf
+ ]
+ steps:
+ - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
+ with:
+ github_token: "${{ secrets.GITHUB_TOKEN }}"
+ - uses: actions/checkout@v3
+ - name: Setup Rust toolchain
+ run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
+ - name: Execute run-docker.sh
+ run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }}
+
# devkitpro's pacman needs to be connected from Docker.
docker_switch:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Docker Switch
needs: [docker_linux_tier1, style_check]
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: true
+ runs-on: ubuntu-22.04
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: LIBC_CI=1 sh ./ci/run-docker.sh switch
build_channels_linux:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Build Channels Linux
needs: docker_linux_tier2
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
env:
OS: linux
strategy:
@@ -188,16 +247,23 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
build_channels_macos:
+ permissions:
+ contents: read # to fetch code (actions/checkout)
+
name: Build Channels macOS
needs: macos
- runs-on: macos-10.15
+ # FIXME: Use macOS 11 for now as CI failed with a linker error on macOS 12 image:
+ # ld: in /.../x86_64-apple-darwin/lib/libstd-a4729905.rlib(rust.metadata.bin),
+ # archive member 'rust.metadata.bin' with length 2958149 is not mach-o or llvm bitcode file '/.../x86_64-apple-darwin/lib/libstd-a4729905.rlib'
+ # Possibly related: https://github.com/actions/runner-images/issues/6350
+ runs-on: macos-11
env:
OS: macos
strategy:
@@ -218,53 +284,78 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
+ build_channels_windows:
+ permissions:
+ contents: read # to fetch code (actions/checkout)
+
+ name: Build Channels Windows
+ runs-on: windows-2022
+ env:
+ OS: windows
+ strategy:
+ fail-fast: true
+ matrix:
+ toolchain: [
+ 1.19.0,
+ 1.24.0,
+ 1.25.0,
+ 1.30.0,
+ stable,
+ ]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Self-update rustup
+ run: rustup self update
+ shell: bash
+ - name: Execute build.sh
+ run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
+ shell: bash
+
semver_linux:
+ if: ${{ false }} # This is currently broken
name: Semver Linux
- needs: build_channels_linux
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
continue-on-error: true
- strategy:
- fail-fast: true
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
# Should update the semverver revision in semver.sh if we touch nightly ver.
- run: TOOLCHAIN=nightly-2020-11-19 sh ./ci/install-rust.sh
+ run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
- name: Check breaking changes
run: sh ci/semver.sh linux
semver_macos:
+ if: ${{ false }} # This is currently broken
name: Semver macOS
- needs: build_channels_macos
- runs-on: macos-10.15
+ runs-on: macos-12
continue-on-error: true
- strategy:
- fail-fast: true
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
- # FIXME: Pin nightly version to make semverver compilable.
- run: TOOLCHAIN=nightly-2020-11-19 sh ./ci/install-rust.sh
+ # Pin nightly version to make semverver compilable.
+ run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
- name: Check breaking changes
run: sh ci/semver.sh macos
docs:
+ permissions:
+ actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
+ contents: read # to fetch code (actions/checkout)
+
name: Generate documentation
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
needs: docker_linux_tier2
- strategy:
- fail-fast: true
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Generate documentation
@@ -279,16 +370,18 @@ jobs:
end_success:
name: bors build finished
if: github.event.pusher.name == 'bors' && success()
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
needs: [
docker_linux_tier1,
docker_linux_tier2,
+ #docker_linux_build_std,
macos,
windows,
style_check,
docker_switch,
build_channels_linux,
build_channels_macos,
+ build_channels_windows,
docs,
]
@@ -299,16 +392,18 @@ jobs:
end_failure:
name: bors build finished
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
needs: [
docker_linux_tier1,
docker_linux_tier2,
+ #docker_linux_build_std,
macos,
windows,
style_check,
docker_switch,
build_channels_linux,
build_channels_macos,
+ build_channels_windows,
docs,
]
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index b75448397f992..50102b83ec50a 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,25 +1,35 @@
-name: Upload documentation
+name: Upload documentation to GitHub Pages
on:
push:
branches:
- master
-jobs:
- upload_docs:
- name: Upload documentation
- runs-on: ubuntu-20.04
- if: github.repository == 'rust-lang/libc'
+# Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+jobs:
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v2
+ - name: Checkout
+ uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=x86_64-unknown-linux-gnu sh ./ci/install-rust.sh
- name: Generate documentation
run: LIBC_CI=1 sh ci/dox.sh
- - name: Upload documentation to GitHub Pages
- uses: rust-lang/simpleinfra/github-actions/static-websites@master
+ - name: Setup Pages
+ uses: actions/configure-pages@v2
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v1
with:
- deploy_dir: target/doc
- github_token: "${{ secrets.GITHUB_TOKEN }}"
- if: github.ref == 'refs/heads/master'
+ path: 'target/doc'
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v1
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6b5f5daf9769e..635d6121e69c4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,10 +7,13 @@ on:
branches:
- master
+permissions:
+ contents: read # to fetch code (actions/checkout)
+
jobs:
docker_linux_tier1:
name: Docker Linux Tier1
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
@@ -19,7 +22,7 @@ jobs:
x86_64-unknown-linux-gnu,
]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -27,7 +30,7 @@ jobs:
macos:
name: macOS
- runs-on: macos-10.15
+ runs-on: macos-12
strategy:
fail-fast: true
matrix:
@@ -35,7 +38,7 @@ jobs:
x86_64-apple-darwin,
]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
@@ -43,7 +46,7 @@ jobs:
windows:
name: Windows
- runs-on: windows-2019
+ runs-on: windows-2022
env:
OS: windows
strategy:
@@ -63,7 +66,10 @@ jobs:
# ARCH: i686
- target: i686-pc-windows-msvc
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
+ - name: Self-update rustup
+ run: rustup self update
+ shell: bash
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
shell: bash
@@ -73,11 +79,9 @@ jobs:
style_check:
name: Style check
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: true
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5d52cad7fc6b9..8c551dbdb576e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,14 +28,24 @@ at, fear not! This crate has CI support which tests any binding against all
platforms supported, so you'll see failures if an API is added at the wrong
level or has different signatures across platforms.
+New symbol(s) (i.e. functions, constants etc.) should also be added to the
+symbols list(s) found in the `libc-test/semver` directory. These lists keep
+track of what symbols are public in the libc crate and ensures they remain
+available between changes to the crate. If the new symbol(s) are available on
+all supported Unixes it should be added to `unix.txt` list1,
+otherwise they should be added to the OS specific list(s).
+
With that in mind, the steps for adding a new API are:
1. Determine where in the module hierarchy your API should be added.
-2. Add the API.
+2. Add the API, including adding new symbol(s) to the semver lists.
3. Send a PR to this repo.
4. Wait for CI to pass, fixing errors.
5. Wait for a merge!
+1: Note that this list has nothing to do with any Unix or Posix
+standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
+
## Test before you commit
We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
@@ -62,6 +72,10 @@ after a certain period. The steps are:
If you're using it, please comment on #XXX").
2. If we don't see any concerns for a while, do the change actually.
+## Supported target policy
+
+When Rust removes a support for a target, the libc crate also may remove the support anytime.
+
## Releasing your change to crates.io
Now that you've done the amazing job of landing your new API or your new
@@ -72,7 +86,7 @@ it. If you'd like to get a release out ASAP you can follow these steps:
1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`.
1. Send a PR to this repository. It should [look like this][example-pr], but it'd
also be nice to fill out the description with a small rationale for the
- release (any rationale is ok though!)
+ release (any rationale is ok though!).
1. Once merged, the release will be tagged and published by one of the libc crate
maintainers.
diff --git a/Cargo.toml b/Cargo.toml
index b2821b2c259f1..15c2b9bf53b8d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.92"
+version = "0.2.139"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
@@ -15,6 +15,9 @@ description = """
Raw FFI bindings to platform libraries like libc.
"""
+[package.metadata.docs.rs]
+features = ["const-extern-fn", "extra_traits"]
+
[dependencies]
rustc-std-workspace-core = { version = "1.0.0", optional = true }
diff --git a/LICENSE-APACHE b/LICENSE-APACHE
index 16fe87b06e802..1b5ec8b78e237 100644
--- a/LICENSE-APACHE
+++ b/LICENSE-APACHE
@@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/README.md b/README.md
index a8a3afd9f6cf2..bc5ad18f6b1b8 100644
--- a/README.md
+++ b/README.md
@@ -35,13 +35,16 @@ libc = "0.2"
This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`.
* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s.
- This feature requires a nightly rustc.
+ If you use Rust >= 1.62, this feature is implicitly enabled.
+ Otherwise it requires a nightly rustc.
* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
## Rust version support
-The minimum supported Rust toolchain version is **Rust 1.13.0** . APIs requiring
+The minimum supported Rust toolchain version is currently **Rust 1.13.0**.
+(libc does not currently have any policy regarding changes to the minimum
+supported Rust version; such policy is a work in progress.) APIs requiring
newer Rust features are only available on newer Rust toolchains:
| Feature | Version |
@@ -53,6 +56,7 @@ newer Rust features are only available on newer Rust toolchains:
| `core::ffi::c_void` | 1.30.0 |
| `repr(packed(N))` | 1.33.0 |
| `cfg(target_vendor)` | 1.33.0 |
+| `const-extern-fn` | 1.62.0 |
## Platform support
diff --git a/build.rs b/build.rs
index ef43dfb78843f..bbee2d28a1789 100644
--- a/build.rs
+++ b/build.rs
@@ -3,14 +3,14 @@ use std::process::Command;
use std::str;
fn main() {
- let (rustc_minor_ver, is_nightly) =
- rustc_minor_nightly().expect("Failed to get rustc version");
+ // Avoid unnecessary re-building.
+ println!("cargo:rerun-if-changed=build.rs");
+
+ let (rustc_minor_ver, is_nightly) = rustc_minor_nightly();
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
- let const_extern_fn_cargo_feature =
- env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
+ let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
let libc_ci = env::var("LIBC_CI").is_ok();
- let target = env::var("TARGET").unwrap();
if env::var("CARGO_FEATURE_USE_STD").is_ok() {
println!(
@@ -31,6 +31,7 @@ fn main() {
Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"),
Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"),
Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"),
+ Some(14) if libc_ci => println!("cargo:rustc-cfg=freebsd14"),
Some(_) | None => println!("cargo:rustc-cfg=freebsd11"),
}
@@ -59,6 +60,11 @@ fn main() {
println!("cargo:rustc-cfg=libc_align");
}
+ // Rust >= 1.26 supports i128 and u128:
+ if rustc_minor_ver >= 26 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_int128");
+ }
+
// Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
// Otherwise, it defines an incompatible type to retaining
// backwards-compatibility.
@@ -72,42 +78,61 @@ fn main() {
println!("cargo:rustc-cfg=libc_cfg_target_vendor");
}
+ // Rust >= 1.40 supports #[non_exhaustive].
+ if rustc_minor_ver >= 40 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_non_exhaustive");
+ }
+
+ if rustc_minor_ver >= 51 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_ptr_addr_of");
+ }
+
+ // Rust >= 1.37.0 allows underscores as anonymous constant names.
+ if rustc_minor_ver >= 37 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_underscore_const_names");
+ }
+
// #[thread_local] is currently unstable
if rustc_dep_of_std {
println!("cargo:rustc-cfg=libc_thread_local");
}
- if const_extern_fn_cargo_feature {
- if !is_nightly || rustc_minor_ver < 40 {
- panic!("const-extern-fn requires a nightly compiler >= 1.40")
- }
+ // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
+ if rustc_minor_ver >= 62 {
println!("cargo:rustc-cfg=libc_const_extern_fn");
- }
-
- // For unknown reason, libiconv can't be linked by adding #[link(name = iconv)] to
- // a macOS-specific struct, so we do the linking here.
- if target.contains("-apple-") {
- println!("cargo:rustc-link-lib=iconv");
+ } else {
+ // Rust < 1.62.0 requires a crate feature and feature gate.
+ if const_extern_fn_cargo_feature {
+ if !is_nightly || rustc_minor_ver < 40 {
+ panic!("const-extern-fn requires a nightly compiler >= 1.40");
+ }
+ println!("cargo:rustc-cfg=libc_const_extern_fn_unstable");
+ println!("cargo:rustc-cfg=libc_const_extern_fn");
+ }
}
}
-fn rustc_minor_nightly() -> Option<(u32, bool)> {
+fn rustc_minor_nightly() -> (u32, bool) {
macro_rules! otry {
($e:expr) => {
match $e {
Some(e) => e,
- None => return None,
+ None => panic!("Failed to get rustc version"),
}
};
}
let rustc = otry!(env::var_os("RUSTC"));
- let output = otry!(Command::new(rustc).arg("--version").output().ok());
+ let output = Command::new(rustc)
+ .arg("--version")
+ .output()
+ .ok()
+ .expect("Failed to get rustc version");
let version = otry!(str::from_utf8(&output.stdout).ok());
let mut pieces = version.split('.');
if pieces.next() != Some("rustc 1") {
- return None;
+ panic!("Failed to get rustc version");
}
let minor = pieces.next();
@@ -123,7 +148,7 @@ fn rustc_minor_nightly() -> Option<(u32, bool)> {
.unwrap_or(false);
let minor = otry!(otry!(minor).parse().ok());
- Some((minor, nightly))
+ (minor, nightly)
}
fn which_freebsd() -> Option {
@@ -147,6 +172,7 @@ fn which_freebsd() -> Option {
s if s.starts_with("11") => Some(11),
s if s.starts_with("12") => Some(12),
s if s.starts_with("13") => Some(13),
+ s if s.starts_with("14") => Some(14),
_ => None,
}
}
diff --git a/ci/README.md b/ci/README.md
index cfe3d53bc842f..c0de4f9edee96 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -39,9 +39,6 @@ The remaining architectures look like:
then otherwise runs tests normally.
* iOS builds need an extra linker flag currently, but beyond that they're built
as standard as everything else.
-* The rumprun target builds an entire kernel from the test suite and then runs
- it inside QEMU using the serial console to test whether it succeeded or
- failed.
* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system
and compile/run tests. More information on that below.
@@ -62,10 +59,6 @@ however. This strategy is used for all Linux architectures that aren't intel.
Note that one downside of this QEMU system is that threads are barely
implemented, so we're careful to not spawn many threads.
-For the rumprun target the only output is a kernel image, so we just use that
-plus the `rumpbake` command to create a full kernel image which is then run from
-within QEMU.
-
Finally, the fun part, the BSDs. Quite a few hoops are jumped through to get CI
working for these platforms, but the gist of it looks like:
diff --git a/ci/android-emulator-package.xml b/ci/android-emulator-package.xml
new file mode 100644
index 0000000000000..e61083c74a93a
--- /dev/null
+++ b/ci/android-emulator-package.xml
@@ -0,0 +1,141 @@
+Terms and Conditions
+
+This is the Android Software Development Kit License Agreement
+
+1. Introduction
+
+1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS).
+
+1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+
+2. Accepting the License Agreement
+
+2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement.
+
+2.2 By clicking to accept, you hereby agree to the terms of the License Agreement.
+
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK.
+
+2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
+
+
+3. SDK License from Google
+
+3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android.
+
+3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose.
+
+3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK.
+
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement.
+
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
+
+
+4. Use of the SDK by You
+
+4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+5. Your Developer Credentials
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+6. Privacy and Information
+
+6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
+
+
+7. Third Party Applications
+
+7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.
+
+
+8. Using Android APIs
+
+8.1 Google Data APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: https://developer.android.com/reference/android/speech/RecognitionService, as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/, as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.
+
+
+9. Terminating the License Agreement
+
+9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
+
+9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+
+9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
+
+
+10. DISCLAIMER OF WARRANTIES
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+
+11. LIMITATION OF LIABILITY
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+
+12. Indemnification
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.
+
+
+13. Changes to the License Agreement
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
+
+
+14. General Legal Terms
+
+14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party.
+
+14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+
+January 16, 201931311Android Emulator
diff --git a/ci/android-install-sdk.sh b/ci/android-install-sdk.sh
index 6f6aeb28e82b0..5e7037df044ef 100644
--- a/ci/android-install-sdk.sh
+++ b/ci/android-install-sdk.sh
@@ -53,12 +53,20 @@ echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
# which produces an insane amount of output.
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --no_https \
- "emulator" \
"platform-tools" \
"platforms;android-${api}" \
"${image}" | grep -v = || true
+# The newer emulator versions (31.3.12 or higher) fail to a valid AVD and the test gets stuck.
+# Until we figure out why, we use the older version (31.3.11).
+wget -q --tries=20 https://redirector.gvt1.com/edgedl/android/repository/emulator-linux_x64-9058569.zip
+unzip -q -d sdk emulator-linux_x64-9058569.zip
+
+cp /android/android-emulator-package.xml /android/sdk/emulator/package.xml
+
echo "no" |
./sdk/cmdline-tools/tools/bin/avdmanager create avd \
--name "${1}" \
--package "${image}" | grep -v = || true
+
+rm -rf commandlinetools-linux-${SDK}_latest.zip emulator-linux_x64-9058569.zip
diff --git a/ci/build.sh b/ci/build.sh
index 51ce8bc348b43..dba868fdd58e1 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -161,6 +161,13 @@ RUST_NIGHTLY_APPLE_TARGETS="\
aarch64-apple-darwin \
"
+# Must start with `x86_64-pc-windows-msvc` first.
+RUST_NIGHTLY_WINDOWS_TARGETS="\
+x86_64-pc-windows-msvc \
+x86_64-pc-windows-gnu \
+i686-pc-windows-msvc \
+"
+
# The targets are listed here alphabetically
TARGETS=""
case "${OS}" in
@@ -189,6 +196,10 @@ case "${OS}" in
TARGETS="${TARGETS} ${RUST_NIGHTLY_APPLE_TARGETS}"
fi
+ ;;
+ windows*)
+ TARGETS=${RUST_NIGHTLY_WINDOWS_TARGETS}
+
;;
*)
;;
@@ -196,10 +207,16 @@ esac
for TARGET in $TARGETS; do
if echo "$TARGET"|grep -q "$FILTER"; then
- test_target build "$TARGET"
+ if [ "${OS}" = "windows" ]; then
+ TARGET="$TARGET" sh ./ci/install-rust.sh
+ test_target build "$TARGET"
+ else
+ test_target build "$TARGET"
+ fi
fi
done
+# Targets which are not available via rustup and must be built with -Zbuild-std
RUST_LINUX_NO_CORE_TARGETS="\
aarch64-pc-windows-msvc \
aarch64-unknown-freebsd \
@@ -219,9 +236,7 @@ i686-unknown-haiku \
i686-unknown-netbsd \
i686-unknown-openbsd \
i686-wrs-vxworks \
-mips-unknown-linux-uclibc \
mipsel-sony-psp \
-mipsel-unknown-linux-uclibc \
mips64-unknown-linux-muslabi64 \
mips64el-unknown-linux-muslabi64 \
nvptx64-nvidia-cuda \
@@ -235,6 +250,8 @@ riscv32i-unknown-none-elf \
riscv32imac-unknown-none-elf \
riscv32imc-unknown-none-elf \
riscv32gc-unknown-linux-gnu \
+riscv64gc-unknown-freebsd \
+riscv64gc-unknown-linux-musl \
riscv64gc-unknown-none-elf \
riscv64imac-unknown-none-elf \
s390x-unknown-linux-musl \
@@ -265,7 +282,7 @@ if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then
done
fi
-RUST_OSX_NO_CORE_TARGETS="\
+RUST_APPLE_NO_CORE_TARGETS="\
armv7-apple-ios \
armv7s-apple-ios \
i686-apple-darwin \
@@ -273,7 +290,7 @@ i386-apple-ios \
"
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "macos" ]; then
- for TARGET in $RUST_OSX_NO_CORE_TARGETS; do
+ for TARGET in $RUST_APPLE_NO_CORE_TARGETS; do
if echo "$TARGET" | grep -q "$FILTER"; then
test_target build "$TARGET" 1
fi
diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile
index 0aa99eeea10ae..b009e95b0e71e 100644
--- a/ci/docker/aarch64-linux-android/Dockerfile
+++ b/ci/docker/aarch64-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN dpkg --add-architecture i386
RUN apt-get update
diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
index 0588b4643a9e4..a609d8a3b7a28 100644
--- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
diff --git a/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/ci/docker/aarch64-unknown-linux-musl/Dockerfile
index add8a6859bb12..2002879e8c9e0 100644
--- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
@@ -10,6 +10,6 @@ RUN sh /install-musl.sh aarch64
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
CC_aarch64_unknown_linux_musl=musl-gcc \
- RUSTFLAGS='-Clink-args=-lgcc' \
+ RUSTFLAGS='-Clink-args=-lgcc -L /musl-aarch64/lib' \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-aarch64 -L /musl-aarch64"
diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile
index e5cc79d87fd1b..93d850b38eb1f 100644
--- a/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/ci/docker/arm-linux-androideabi/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN dpkg --add-architecture i386
RUN apt-get update
diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
index 299ff9719fd57..57efe887b6292 100644
--- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
diff --git a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
index 6b171508fffc2..53228f46e6cef 100644
--- a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
@@ -10,4 +10,5 @@ RUN sh /install-musl.sh arm
ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
CC_arm_unknown_linux_musleabihf=musl-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \
- CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm"
+ CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm" \
+ RUSTFLAGS="-L /musl-arm/lib"
diff --git a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
new file mode 100644
index 0000000000000..e6be22c93c637
--- /dev/null
+++ b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
@@ -0,0 +1,17 @@
+FROM ubuntu:22.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \
+ xz-utils patch file
+
+RUN mkdir /toolchain
+
+RUN curl --retry 5 -L https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2 | \
+ tar xjf - -C /toolchain --strip-components=1
+RUN /toolchain/relocate-sdk.sh
+
+ENV PATH=$PATH:/rust/bin:/toolchain/bin \
+ STAGING_DIR=/toolchain/armv7-buildroot-linux-uclibceabihf/sysroot \
+ CC_armv7_unknown_linux_uclibceabihf=arm-buildroot-linux-uclibcgnueabihf-gcc \
+ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=arm-buildroot-linux-uclibcgnueabihf-gcc \
+ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/"
diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile
index bf41bfa9a3efb..65d1a949ec577 100644
--- a/ci/docker/asmjs-unknown-emscripten/Dockerfile
+++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
# This is a workaround to avoid the interaction with tzdata.
ENV DEBIAN_FRONTEND=noninteractive
@@ -15,7 +15,8 @@ RUN apt-get install -y --no-install-recommends \
libxml2 \
python3 \
python3-distutils \
- xz-utils
+ xz-utils \
+ bzip2
COPY emscripten.sh /
RUN bash /emscripten.sh
diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile
index 62a379b3cf8bc..ed1b2e9fbef0e 100644
--- a/ci/docker/i686-linux-android/Dockerfile
+++ b/ci/docker/i686-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN dpkg --add-architecture i386
RUN apt-get update
diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile
index 6bab1d0c64fab..bbe76a4c5c16c 100644
--- a/ci/docker/i686-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
diff --git a/ci/docker/i686-unknown-linux-musl/Dockerfile b/ci/docker/i686-unknown-linux-musl/Dockerfile
index 3cb7a1132fb5b..fd2ba4c63b166 100644
--- a/ci/docker/i686-unknown-linux-musl/Dockerfile
+++ b/ci/docker/i686-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN dpkg --add-architecture i386
RUN apt-get update
@@ -9,4 +9,5 @@ COPY install-musl.sh /
RUN sh /install-musl.sh i686
ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
- CC_i686_unknown_linux_musl=musl-gcc
+ CC_i686_unknown_linux_musl=musl-gcc \
+ RUSTFLAGS="-L /musl-i686/lib"
diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile
index 574f184673fdc..333a5bae32a9d 100644
--- a/ci/docker/mips-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mips-unknown-linux-musl/Dockerfile b/ci/docker/mips-unknown-linux-musl/Dockerfile
index a9b49ce74440d..6fbd284fb9ba3 100644
--- a/ci/docker/mips-unknown-linux-musl/Dockerfile
+++ b/ci/docker/mips-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
@@ -6,19 +6,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN mkdir /toolchain
-# Linux kernel version: 4.14.151
-# See build_dir/target-mips_24kc_musl/linux-ar71xx_generic/linux-4.14.151
+# Linux kernel version: 5.4.154
+# See build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.154
# Musl version: 1.1.24
-# See staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/info.mk
-RUN curl --retry 5 -L https://downloads.openwrt.org/releases/19.07.0-rc1/targets/ar71xx/generic/openwrt-sdk-19.07.0-rc1-ar71xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz | \
+# See staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/info.mk
+RUN curl --retry 5 -L https://downloads.openwrt.org/releases/21.02.1/targets/ath79/generic/openwrt-sdk-21.02.1-ath79-generic_gcc-8.4.0_musl.Linux-x86_64.tar.xz | \
tar xJf - -C /toolchain --strip-components=1
# See https://lkml.org/lkml/2014/3/14/269
COPY sysinfo_guard.patch /toolchain
-RUN patch /toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include/linux/kernel.h /dev/null
# emsdk-portable provides a node binary, but we need version 8 to run wasm
# NOTE: Do not forget to sync Node.js version with `emscripten.sh`!
-export PATH="/node-v12.18.3-linux-x64/bin:$PATH"
+export PATH="/node-v14.17.0-linux-x64/bin:$PATH"
exec "$@"
diff --git a/ci/emscripten.sh b/ci/emscripten.sh
index ea1083ae0ec02..967b586b5f199 100644
--- a/ci/emscripten.sh
+++ b/ci/emscripten.sh
@@ -2,34 +2,19 @@
set -ex
-EMSDK_VERSION=1.39.20
-
-hide_output() {
- set +x
- on_err="
-echo ERROR: An error was encountered with the build.
-cat /tmp/build.log
-exit 1
-"
- trap '$on_err' ERR
- bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
- PING_LOOP_PID=$!
- "${@}" &> /tmp/build.log
- trap - ERR
- kill $PING_LOOP_PID
- rm -f /tmp/build.log
- set -x
-}
+# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704).
+# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk.
+EMSDK_VERSION=3.1.20
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
-hide_output ./emsdk install "${EMSDK_VERSION}"
+./emsdk install "${EMSDK_VERSION}"
./emsdk activate "${EMSDK_VERSION}"
# Compile and cache libc
# shellcheck disable=SC1091
source ./emsdk_env.sh
-echo "main(){}" > a.c
+echo "int main() {return 0;}" > a.c
HOME=/emsdk-portable/ emcc a.c
rm -f a.*
@@ -39,5 +24,5 @@ chmod a+rxw -R /emsdk-portable
# node 8 is required to run wasm
# NOTE: Do not forget to sync Node.js version with `emscripten-entry.sh`!
cd /
-curl --retry 5 -L https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz | \
+curl --retry 5 -L https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz | \
tar -xJ
diff --git a/ci/install-musl.sh b/ci/install-musl.sh
index 54fd343f07b37..036a369631c0e 100644
--- a/ci/install-musl.sh
+++ b/ci/install-musl.sh
@@ -79,7 +79,7 @@ cd ..
rm -rf $MUSL
# Download, configure, build, and install musl-sanitized kernel headers:
-KERNEL_HEADER_VER="4.4.2-2"
+KERNEL_HEADER_VER="4.19.88"
curl --retry 5 -L \
"https://github.com/sabotage-linux/kernel-headers/archive/v${KERNEL_HEADER_VER}.tar.gz" | \
tar xzf -
diff --git a/ci/install-rust.sh b/ci/install-rust.sh
index b06ba8eddb105..5b50c624cbd66 100644
--- a/ci/install-rust.sh
+++ b/ci/install-rust.sh
@@ -8,13 +8,17 @@ toolchain=
if [ -n "$TOOLCHAIN" ]; then
toolchain=$TOOLCHAIN
else
- toolchain=nightly
+ # Pin the nightly version as newer nightly versions break CI,
+ # https://github.com/rust-lang/rust/issues/103673 contains related information.
+ case "$TARGET" in
+ *android*) toolchain=nightly-2022-10-09;;
+ *) toolchain=nightly;;
+ esac
fi
if [ "$OS" = "windows" ]; then
: "${TARGET?The TARGET environment variable must be set.}"
rustup set profile minimal
- # FIXME: Add `--no-self-update` to avoid CI failure.
- rustup update --force $toolchain-"$TARGET" --no-self-update
+ rustup update --force $toolchain-"$TARGET"
rustup default $toolchain-"$TARGET"
else
rustup set profile minimal
@@ -27,6 +31,11 @@ if [ -n "$TARGET" ]; then
rustup target add "$TARGET"
fi
+if [ -n "$INSTALL_RUST_SRC" ]; then
+ echo "Install rust-src"
+ rustup component add rust-src
+fi
+
if [ "$OS" = "windows" ]; then
if [ "$ARCH_BITS" = "i686" ]; then
echo "Install MinGW32"
diff --git a/ci/linux-s390x.sh b/ci/linux-s390x.sh
index 762ee7319d317..68324befb3f65 100644
--- a/ci/linux-s390x.sh
+++ b/ci/linux-s390x.sh
@@ -6,8 +6,8 @@ mkdir -m 777 /qemu
cd /qemu
curl --retry 5 -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
-curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20200314/images/generic/kernel.debian
-curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20200314/images/generic/initrd.debian
+curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20220914/images/generic/kernel.debian
+curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20220914/images/generic/initrd.debian
mv kernel.debian kernel
mv initrd.debian initrd.gz
diff --git a/ci/linux-sparc64.sh b/ci/linux-sparc64.sh
index 57aa3b5fb9db7..db215cabf6ea3 100644
--- a/ci/linux-sparc64.sh
+++ b/ci/linux-sparc64.sh
@@ -5,11 +5,11 @@ set -ex
mkdir -m 777 /qemu
cd /qemu
-curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2020-10-13/debian-10.0.0-sparc64-NETINST-1.iso
-7z e debian-10.0.0-sparc64-NETINST-1.iso install/initrd.gz
-7z e debian-10.0.0-sparc64-NETINST-1.iso install/vmlinux
+curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-03-28/debian-11.0.0-sparc64-NETINST-1.iso
+7z e debian-11.0.0-sparc64-NETINST-1.iso install/initrd.gz
+7z e debian-11.0.0-sparc64-NETINST-1.iso install/vmlinux
mv vmlinux kernel
-rm debian-10.0.0-sparc64-NETINST-1.iso
+rm debian-11.0.0-sparc64-NETINST-1.iso
mkdir init
cd init
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
index f1fa6656c44b9..c7d78bc8a1d29 100755
--- a/ci/run-docker.sh
+++ b/ci/run-docker.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env sh
+# Disable SC2086 as it confuses the docker command.
+# shellcheck disable=SC2086
+
# Small script to run tests for a target (or all targets) inside all the
# respective docker images.
@@ -37,6 +40,7 @@ run() {
--rm \
--user "$(id -u)":"$(id -g)" \
--env LIBC_CI \
+ --env LIBC_CI_ZBUILD_STD \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--volume "$CARGO_HOME":/cargo \
diff --git a/ci/run.sh b/ci/run.sh
index 314ea088c6724..4de8087699e24 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -53,7 +53,7 @@ if [ "$QEMU" != "" ]; then
cargo build \
--manifest-path libc-test/Cargo.toml \
--target "${TARGET}" \
- --test main
+ --test main ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
rm "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-*.d
cp "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-* "${tmpdir}"/mount/libc-test
# shellcheck disable=SC2016
@@ -79,14 +79,7 @@ if [ "$QEMU" != "" ]; then
-net user \
-nographic \
-vga none 2>&1 | tee "${CARGO_TARGET_DIR}/out.log"
- exec egrep "^(PASSED)|(test result: ok)" "${CARGO_TARGET_DIR}/out.log"
-fi
-
-# FIXME: x86_64-unknown-linux-gnux32 fails to compile without --release
-# See https://github.com/rust-lang/rust/issues/59220
-opt=
-if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
- opt="--release"
+ exec grep -E "^(PASSED)|(test result: ok)" "${CARGO_TARGET_DIR}/out.log"
fi
if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
@@ -98,17 +91,17 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
until [ $n -ge $N ]
do
if [ "$passed" = "0" ]; then
- if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}" ; then
+ if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"} ; then
passed=$((passed+1))
continue
fi
elif [ "$passed" = "1" ]; then
- if cargo test $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}" ; then
+ if cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"} ; then
passed=$((passed+1))
continue
fi
elif [ "$passed" = "2" ]; then
- if cargo test $opt --features extra_traits --manifest-path libc-test/Cargo.toml --target "${TARGET}"; then
+ if cargo test --features extra_traits --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}; then
break
fi
fi
@@ -116,11 +109,11 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
sleep 1
done
else
- cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml \
- --target "${TARGET}"
+ cargo test --no-default-features --manifest-path libc-test/Cargo.toml \
+ --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
- cargo test $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}"
+ cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
- RUST_BACKTRACE=1 cargo test $opt --features extra_traits --manifest-path libc-test/Cargo.toml \
- --target "${TARGET}"
+ RUST_BACKTRACE=1 cargo test --features extra_traits --manifest-path libc-test/Cargo.toml \
+ --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
fi
diff --git a/ci/runtest-android.rs b/ci/runtest-android.rs
index e14dba322cdf6..92bce79b0d714 100644
--- a/ci/runtest-android.rs
+++ b/ci/runtest-android.rs
@@ -22,7 +22,7 @@ fn main() {
.arg(&test)
.arg(&dst)
.status()
- .expect("failed to run: adb pushr");
+ .expect("failed to run: adb push");
assert!(status.success());
let output = Command::new("adb")
@@ -33,16 +33,17 @@ fn main() {
.expect("failed to run: adb shell");
assert!(status.success());
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ let stderr = String::from_utf8_lossy(&output.stderr);
+
println!("status: {}\nstdout ---\n{}\nstderr ---\n{}",
output.status,
- String::from_utf8_lossy(&output.stdout),
- String::from_utf8_lossy(&output.stderr));
+ stdout,
+ stderr);
- let stdout = String::from_utf8_lossy(&output.stdout);
- stdout.lines().find(|l|
- (l.starts_with("PASSED ") && l.contains(" tests")) ||
- l.starts_with("test result: ok")
- ).unwrap_or_else(|| {
+ if !stderr.lines().any(|l| (l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok"))
+ && !stdout.lines().any(|l| (l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok"))
+ {
panic!("failed to find successful test run");
- });
+ };
}
diff --git a/ci/semver.sh b/ci/semver.sh
index 4fe13a974d39f..1d814a01b5323 100644
--- a/ci/semver.sh
+++ b/ci/semver.sh
@@ -16,10 +16,8 @@ fi
rustup component add rustc-dev llvm-tools-preview
# Should update the nightly version in bors CI config if we touch this.
-cargo install --locked --git https://github.com/rust-lang/rust-semverver --rev 71c340ff867d2f79613cfe02c6714f1d2ef00bc4
+cargo install semverver --version=0.1.50
-# FIXME: Replace `x86_64-sun-solaris` with `x86_64-pc-solaris`
-# when we update the nightly date for semverver to nightly-2021-03-02 or later.
TARGETS=
case "${OS}" in
*linux*)
@@ -41,7 +39,7 @@ x86_64-unknown-freebsd \
x86_64-unknown-linux-gnu \
x86_64-unknown-linux-musl \
x86_64-unknown-netbsd \
-x86_64-sun-solaris \
+x86_64-pc-solaris \
x86_64-fuchsia \
x86_64-pc-windows-gnu \
x86_64-unknown-linux-gnux32 \
diff --git a/ci/style.rs b/ci/style.rs
index b0b6d124f4b9c..31adeae4fbde7 100644
--- a/ci/style.rs
+++ b/ci/style.rs
@@ -14,9 +14,6 @@
//!
//! The current style is:
//!
-//! * No trailing whitespace
-//! * No tabs
-//! * 80-character lines
//! * Specific module layout:
//! 1. use directives
//! 2. typedefs
@@ -29,7 +26,6 @@
//! Things not verified:
//!
//! * alignment
-//! * 4-space tabs
//! * leading colons on paths
use std::env;
@@ -38,10 +34,12 @@ use std::io::prelude::*;
use std::path::Path;
macro_rules! t {
- ($e:expr) => (match $e {
- Ok(e) => e,
- Err(e) => panic!("{} failed with {}", stringify!($e), e),
- })
+ ($e:expr) => {
+ match $e {
+ Ok(e) => e,
+ Err(e) => panic!("{} failed with {}", stringify!($e), e),
+ }
+ };
}
fn main() {
@@ -62,18 +60,14 @@ fn walk(path: &Path, err: &mut Errors) {
let path = entry.path();
if t!(entry.file_type()).is_dir() {
walk(&path, err);
- continue
+ continue;
}
let name = entry.file_name().into_string().unwrap();
match &name[..] {
n if !n.ends_with(".rs") => continue,
- "dox.rs" |
- "lib.rs" |
- "ctypes.rs" |
- "libc.rs" |
- "macros.rs" => continue,
+ "lib.rs" | "macros.rs" => continue,
_ => {}
}
@@ -105,44 +99,32 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
let mut state = State::Start;
let mut s_macros = 0;
let mut f_macros = 0;
- let mut prev_blank = false;
+ let mut in_impl = false;
for (i, line) in file.lines().enumerate() {
- if line == "" {
- if prev_blank {
- err.error(path, i, "double blank line");
- }
- prev_blank = true;
- } else {
- prev_blank = false;
- }
- if line != line.trim_end() {
- err.error(path, i, "trailing whitespace");
- }
- if line.contains("\t") {
- err.error(path, i, "tab character");
- }
- if line.len() > 80 {
- err.error(path, i, "line longer than 80 chars");
- }
- // This doesn't work any more due to rustfmt changes
- /*if line.contains("#[cfg(") && !line.contains(" if ")
- && !(line.contains("target_endian") ||
- line.contains("target_arch"))
+ if line.contains("#[cfg(")
+ && line.contains(']')
+ && !line.contains(" if ")
+ && !(line.contains("target_endian") || line.contains("target_arch"))
{
if state != State::Structs {
- err.error(path, i, "use cfg_if! and submodules \
- instead of #[cfg]");
+ err.error(path, i, "use cfg_if! and submodules instead of #[cfg]");
}
- }*/
+ }
if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) {
err.error(path, i, "impl ::Copy and ::Clone manually");
}
+ if line.contains("impl") {
+ in_impl = true;
+ }
+ if in_impl && line.starts_with('}') {
+ in_impl = false;
+ }
let orig_line = line;
let line = line.trim_start();
let is_pub = line.starts_with("pub ");
- let line = if is_pub {&line[4..]} else {line};
+ let line = if is_pub { &line[4..] } else { line };
let line_state = if line.starts_with("use ") {
if line.contains("c_void") {
@@ -155,11 +137,17 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
}
} else if line.starts_with("const ") {
State::Constants
- } else if line.starts_with("type ") {
+ } else if line.starts_with("type ") && !in_impl {
State::Typedefs
} else if line.starts_with("s! {") {
s_macros += 1;
State::Structs
+ } else if line.starts_with("s_no_extra_traits! {") {
+ // multiple macros of this type are allowed
+ State::Structs
+ } else if line.starts_with("s_paren! {") {
+ // multiple macros of this type are allowed
+ State::Structs
} else if line.starts_with("f! {") {
f_macros += 1;
State::FunctionDefinitions
@@ -168,13 +156,19 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
} else if line.starts_with("mod ") {
State::Modules
} else {
- continue
+ continue;
};
if state as usize > line_state as usize {
- err.error(path, i, &format!("{} found after {} when \
- it belongs before",
- line_state.desc(), state.desc()));
+ err.error(
+ path,
+ i,
+ &format!(
+ "{} found after {} when it belongs before",
+ line_state.desc(),
+ state.desc()
+ ),
+ );
}
if f_macros == 2 {
@@ -208,6 +202,6 @@ impl State {
impl Errors {
fn error(&mut self, path: &Path, line: usize, msg: &str) {
self.errs = true;
- println!("{}:{} - {}", path.display(), line + 1, msg);
+ println!("{}:{}: {}", path.display(), line + 1, msg);
}
}
diff --git a/ci/sysinfo_guard.patch b/ci/sysinfo_guard.patch
index 69fb795c0d393..7ca46db324063 100644
--- a/ci/sysinfo_guard.patch
+++ b/ci/sysinfo_guard.patch
@@ -5,6 +5,6 @@
+#ifdef __GLIBC__
#include
+#endif
+ #include
- /*
- * 'kernel.h' contains some often-used function prototypes etc
+ #endif /* _LINUX_KERNEL_H */
diff --git a/ci/test-runner-linux b/ci/test-runner-linux
index cad31ec4c0100..3ce551944d888 100755
--- a/ci/test-runner-linux
+++ b/ci/test-runner-linux
@@ -20,6 +20,6 @@ timeout 30s qemu-system-$arch \
-append init=/run_prog.sh > output || true
# remove kernel messages
-tr -d '\r' < output | egrep -v '^\['
+tr -d '\r' < output | grep -Ev '^\['
-egrep "(PASSED)|(test result: ok)" output > /dev/null
+grep -E "(PASSED)|(test result: ok)" output > /dev/null
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index d6b8336a13f53..e291270b05483 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.92"
+version = "0.2.139"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,13 +12,13 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.92"
+version = "0.2.139"
default-features = false
[build-dependencies]
cc = "1.0.61"
# FIXME: Use fork ctest until the maintainer gets back.
-ctest2 = "0.4"
+ctest2 = "0.4.3"
[features]
default = [ "std" ]
@@ -36,6 +36,11 @@ name = "linux-fcntl"
path = "test/linux_fcntl.rs"
harness = false
+[[test]]
+name = "linux-if-arp"
+path = "test/linux_if_arp.rs"
+harness = false
+
[[test]]
name = "linux-ipv6"
path = "test/linux_ipv6.rs"
@@ -61,7 +66,22 @@ name = "cmsg"
path = "test/cmsg.rs"
harness = true
+[[test]]
+name = "makedev"
+path = "test/makedev.rs"
+harness = true
+
[[test]]
name = "errqueue"
path = "test/errqueue.rs"
harness = true
+
+[[test]]
+name = "sigrt"
+path = "test/sigrt.rs"
+harness = true
+
+[[test]]
+name = "semver"
+path = "test/semver.rs"
+harness = false
diff --git a/libc-test/build.rs b/libc-test/build.rs
old mode 100755
new mode 100644
index 7333fa2e5bfdb..5a0b633a405bd
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3,7 +3,10 @@
extern crate cc;
extern crate ctest2 as ctest;
-use std::env;
+use std::fs::File;
+use std::io::{BufRead, BufReader, BufWriter, Write};
+use std::path::{Path, PathBuf};
+use std::{env, io};
fn do_cc() {
let target = env::var("TARGET").unwrap();
@@ -19,10 +22,26 @@ fn do_cc() {
}
cmsg.compile("cmsg");
}
+
+ if target.contains("linux")
+ || target.contains("android")
+ || target.contains("emscripten")
+ || target.contains("fuchsia")
+ || target.contains("bsd")
+ {
+ cc::Build::new().file("src/makedev.c").compile("makedev");
+ }
}
if target.contains("android") || target.contains("linux") {
cc::Build::new().file("src/errqueue.c").compile("errqueue");
}
+ if target.contains("linux")
+ || target.contains("l4re")
+ || target.contains("android")
+ || target.contains("emscripten")
+ {
+ cc::Build::new().file("src/sigrt.c").compile("sigrt");
+ }
}
fn do_ctest() {
@@ -42,6 +61,7 @@ fn do_ctest() {
t if t.contains("wasi") => return test_wasi(t),
t if t.contains("windows") => return test_windows(t),
t if t.contains("vxworks") => return test_vxworks(t),
+ t if t.contains("nto-qnx") => return test_neutrino(t),
t => panic!("unknown target {}", t),
}
}
@@ -63,9 +83,80 @@ fn ctest_cfg() -> ctest::TestGenerator {
cfg
}
+fn do_semver() {
+ let mut out = PathBuf::from(env::var("OUT_DIR").unwrap());
+ out.push("semver.rs");
+ let mut output = BufWriter::new(File::create(&out).unwrap());
+
+ let family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
+ let vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
+ let os = env::var("CARGO_CFG_TARGET_OS").unwrap();
+ let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
+ let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
+
+ // `libc-test/semver` dir.
+ let mut semver_root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
+ semver_root.push("semver");
+
+ // NOTE: Windows has the same `family` as `os`, no point in including it
+ // twice.
+ // NOTE: Android doesn't include the unix file (or the Linux file) because
+ // there are some many definitions missing it's actually easier just to
+ // maintain a file for Android.
+ if family != os && os != "android" {
+ process_semver_file(&mut output, &mut semver_root, &family);
+ }
+ process_semver_file(&mut output, &mut semver_root, &vendor);
+ process_semver_file(&mut output, &mut semver_root, &os);
+ let os_arch = format!("{}-{}", os, arch);
+ process_semver_file(&mut output, &mut semver_root, &os_arch);
+ if target_env != "" {
+ let os_env = format!("{}-{}", os, target_env);
+ process_semver_file(&mut output, &mut semver_root, &os_env);
+
+ let os_env_arch = format!("{}-{}-{}", os, target_env, arch);
+ process_semver_file(&mut output, &mut semver_root, &os_env_arch);
+ }
+}
+
+fn process_semver_file>(output: &mut W, path: &mut PathBuf, file: P) {
+ // NOTE: `path` is reused between calls, so always remove the file again.
+ path.push(file);
+ path.set_extension("txt");
+
+ println!("cargo:rerun-if-changed={}", path.display());
+ let input_file = match File::open(&*path) {
+ Ok(file) => file,
+ Err(ref err) if err.kind() == io::ErrorKind::NotFound => {
+ path.pop();
+ return;
+ }
+ Err(err) => panic!("unexpected error opening file: {}", err),
+ };
+ let input = BufReader::new(input_file);
+
+ write!(output, "// Source: {}.\n", path.display()).unwrap();
+ output.write(b"use libc::{\n").unwrap();
+ for line in input.lines() {
+ let line = line.unwrap().into_bytes();
+ match line.first() {
+ // Ignore comments and empty lines.
+ Some(b'#') | None => continue,
+ _ => {
+ output.write(b" ").unwrap();
+ output.write(&line).unwrap();
+ output.write(b",\n").unwrap();
+ }
+ }
+ }
+ output.write(b"};\n\n").unwrap();
+ path.pop();
+}
+
fn main() {
do_cc();
do_ctest();
+ do_semver();
}
macro_rules! headers {
@@ -99,38 +190,56 @@ fn test_apple(target: &str) {
headers! { cfg:
"aio.h",
+ "CommonCrypto/CommonCrypto.h",
+ "CommonCrypto/CommonRandom.h",
+ "copyfile.h",
+ "crt_externs.h",
"ctype.h",
"dirent.h",
"dlfcn.h",
"errno.h",
"execinfo.h",
"fcntl.h",
+ "getopt.h",
"glob.h",
"grp.h",
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
+ "libproc.h",
"limits.h",
"locale.h",
"mach-o/dyld.h",
+ "mach/mach_init.h",
+ "mach/mach.h",
"mach/mach_time.h",
+ "mach/mach_types.h",
+ "mach/mach_vm.h",
+ "mach/thread_act.h",
+ "mach/thread_policy.h",
"malloc/malloc.h",
"net/bpf.h",
+ "net/dlil.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
"net/if_utun.h",
- "net/route.h",
+ "net/if_var.h",
+ "net/ndrv.h",
"net/route.h",
"netdb.h",
"netinet/if_ether.h",
"netinet/in.h",
- "netinet/in.h",
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
+ "os/lock.h",
+ "os/signpost.h",
"poll.h",
"pthread.h",
+ "pthread_spis.h",
+ "pthread/introspection.h",
"pwd.h",
"regex.h",
"resolv.h",
@@ -143,6 +252,10 @@ fn test_apple(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
+ "sysdir.h",
+ "sys/appleapiopts.h",
+ "sys/attr.h",
+ "sys/clonefile.h",
"sys/event.h",
"sys/file.h",
"sys/ioctl.h",
@@ -191,17 +304,24 @@ fn test_apple(target: &str) {
}
});
+ cfg.skip_type(move |ty| match ty {
+ _ => false,
+ });
+
cfg.skip_const(move |name| {
+ // They're declared via `deprecated_mach` and we don't support it anymore.
+ if name.starts_with("VM_FLAGS_") {
+ return true;
+ }
match name {
// These OSX constants are removed in Sierra.
// https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html
"KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
// FIXME: the value has been changed since Catalina (0xffff0000 -> 0x3fff0000).
"SF_SETTABLE" => true,
- // FIXME: the value has been changed since Catalina (VM_FLAGS_RESILIENT_MEDIA is also contained now).
- "VM_FLAGS_USER_REMAP" => true,
- // FIXME: the values have been changed since Big Sur
- "HW_TARGET" | "HW_PRODUCT" | "HW_MAXID" => true,
+
+ // FIXME: XCode 13.1 doesn't have it.
+ "TIOCREMOTE" => true,
_ => false,
}
});
@@ -215,8 +335,11 @@ fn test_apple(target: &str) {
// close calls the close_nocancel system call
"close" => true,
- // these calls require macOS 11.0 or higher
- "preadv" | "pwritev" => true,
+ // FIXME: libstd removed libresolv support: https://github.com/rust-lang/rust/pull/102766
+ "res_init" => true,
+
+ // FIXME: remove once the target in CI is updated
+ "pthread_jit_write_freeze_callbacks_np" => true,
_ => false,
}
@@ -227,6 +350,8 @@ fn test_apple(target: &str) {
// FIXME: the array size has been changed since macOS 10.15 ([8] -> [7]).
("statfs", "f_reserved") => true,
("__darwin_arm_neon_state64", "__v") => true,
+ // MAXPATHLEN is too big for auto-derive traits on arrays.
+ ("vnode_info_path", "vip_path") => true,
_ => false,
}
});
@@ -242,9 +367,7 @@ fn test_apple(target: &str) {
cfg.volatile_item(|i| {
use ctest::VolatileItemKind::*;
match i {
- StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
- true
- }
+ StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => true,
_ => false,
}
});
@@ -272,9 +395,7 @@ fn test_apple(target: &str) {
// FIXME: sigaction actually contains a union with two variants:
// a sa_sigaction with type: (*)(int, struct __siginfo *, void *)
// a sa_handler with type sig_t
- "sa_sigaction" if struct_ == "sigaction" => {
- "sa_handler".to_string()
- }
+ "sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
s => s.to_string(),
}
});
@@ -282,6 +403,8 @@ fn test_apple(target: &str) {
cfg.skip_roundtrip(move |s| match s {
// FIXME: this type has the wrong ABI
"max_align_t" if i686 => true,
+ // Can't return an array from a C function.
+ "uuid_t" | "vol_capabilities_set_t" => true,
_ => false,
});
cfg.generate("../src/lib.rs", "main.rs");
@@ -293,10 +416,15 @@ fn test_openbsd(target: &str) {
let mut cfg = ctest_cfg();
cfg.flag("-Wno-deprecated-declarations");
+ let x86_64 = target.contains("x86_64");
+
headers! { cfg:
"elf.h",
"errno.h",
+ "execinfo.h",
"fcntl.h",
+ "getopt.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -311,6 +439,7 @@ fn test_openbsd(target: &str) {
"ctype.h",
"dirent.h",
"sys/socket.h",
+ [x86_64]:"machine/fpu.h",
"net/if.h",
"net/route.h",
"net/if_arp.h",
@@ -324,14 +453,21 @@ fn test_openbsd(target: &str) {
"resolv.h",
"pthread.h",
"dlfcn.h",
+ "search.h",
"signal.h",
"string.h",
"sys/file.h",
+ "sys/futex.h",
"sys/ioctl.h",
+ "sys/ipc.h",
"sys/mman.h",
+ "sys/param.h",
"sys/resource.h",
+ "sys/shm.h",
"sys/socket.h",
"sys/time.h",
+ "sys/uio.h",
+ "sys/ktrace.h",
"sys/un.h",
"sys/wait.h",
"unistd.h",
@@ -361,6 +497,7 @@ fn test_openbsd(target: &str) {
"pthread_np.h",
"sys/syscall.h",
"sys/shm.h",
+ "sys/param.h",
}
cfg.skip_struct(move |ty| {
@@ -376,6 +513,11 @@ fn test_openbsd(target: &str) {
match name {
// Removed in OpenBSD 6.0
"KERN_USERMOUNT" | "KERN_ARND" => true,
+ // Removed in OpenBSD 7.2
+ "KERN_NSELCOLL" => true,
+ // Good chance it's going to be wrong depending on the host release
+ "KERN_MAXID" | "NET_RT_MAXID" => true,
+ "EV_SYSFLAGS" => true,
_ => false,
}
});
@@ -389,6 +531,9 @@ fn test_openbsd(target: &str) {
// https://marc.info/?l=openbsd-cvs&m=154723400730318
"mincore" => true,
+ // futex() has volatile arguments, but that doesn't exist in Rust.
+ "futex" => true,
+
_ => false,
}
});
@@ -396,9 +541,7 @@ fn test_openbsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "DIR" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => {
- ty.to_string()
- }
+ "FILE" | "DIR" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => ty.to_string(),
// OSX calls this something else
"sighandler_t" => "sig_t".to_string(),
@@ -411,15 +554,9 @@ fn test_openbsd(target: &str) {
});
cfg.field_name(move |struct_, field| match field {
- "st_birthtime" if struct_.starts_with("stat") => {
- "__st_birthtime".to_string()
- }
- "st_birthtime_nsec" if struct_.starts_with("stat") => {
- "__st_birthtimensec".to_string()
- }
- s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- s.replace("e_nsec", ".tv_nsec")
- }
+ "st_birthtime" if struct_.starts_with("stat") => "__st_birthtime".to_string(),
+ "st_birthtime_nsec" if struct_.starts_with("stat") => "__st_birthtimensec".to_string(),
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => s.replace("e_nsec", ".tv_nsec"),
"sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
s => s.to_string(),
});
@@ -446,6 +583,9 @@ fn test_windows(target: &str) {
let gnu = target.contains("gnu");
let mut cfg = ctest_cfg();
+ if target.contains("msvc") {
+ cfg.flag("/wd4324");
+ }
cfg.define("_WIN32_WINNT", Some("0x8000"));
headers! { cfg:
@@ -510,15 +650,30 @@ fn test_windows(target: &str) {
_ => false,
});
+ cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
+ return false;
+ });
+
cfg.skip_const(move |name| {
match name {
// FIXME: API error:
// SIG_ERR type is "void (*)(int)", not "int"
- "SIG_ERR" => true,
+ "SIG_ERR" |
+ // Similar for SIG_DFL/IGN/GET/SGE/ACK
+ "SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true,
+ // FIXME: newer windows-gnu environment on CI?
+ "_O_OBTAIN_DIR" if gnu => true,
_ => false,
}
});
+ cfg.skip_field(move |s, field| match s {
+ "CONTEXT" if field == "Fp" => true,
+ _ => false,
+ });
// FIXME: All functions point to the wrong addresses?
cfg.skip_fn_ptrcheck(|_| true);
@@ -617,11 +772,13 @@ fn test_solarish(target: &str) {
"errno.h",
"execinfo.h",
"fcntl.h",
+ "getopt.h",
"glob.h",
"grp.h",
"ifaddrs.h",
"langinfo.h",
"limits.h",
+ "link.h",
"locale.h",
"mqueue.h",
"net/if.h",
@@ -645,20 +802,27 @@ fn test_solarish(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
+ "sys/auxv.h",
"sys/epoll.h",
"sys/eventfd.h",
"sys/file.h",
"sys/filio.h",
"sys/ioctl.h",
+ "sys/lgrp_user.h",
"sys/loadavg.h",
"sys/mman.h",
"sys/mount.h",
+ "sys/priv.h",
+ "sys/pset.h",
+ "sys/random.h",
"sys/resource.h",
+ "sys/sendfile.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
"sys/stropts.h",
"sys/shm.h",
+ "sys/systeminfo.h",
"sys/time.h",
"sys/times.h",
"sys/timex.h",
@@ -669,7 +833,9 @@ fn test_solarish(target: &str) {
"sys/wait.h",
"syslog.h",
"termios.h",
+ "thread.h",
"time.h",
+ "priv.h",
"ucontext.h",
"unistd.h",
"utime.h",
@@ -677,12 +843,9 @@ fn test_solarish(target: &str) {
"wchar.h",
}
- cfg.skip_type(move |ty| {
- match ty {
- // sighandler_t is not present here
- "sighandler_t" => true,
- _ => false,
- }
+ cfg.skip_type(move |ty| match ty {
+ "sighandler_t" => true,
+ _ => false,
});
cfg.type_name(move |ty, is_struct, is_union| match ty {
@@ -709,18 +872,17 @@ fn test_solarish(target: &str) {
});
cfg.skip_const(move |name| match name {
- "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK"
- | "DT_SOCK" | "USRQUOTA" | "GRPQUOTA" | "PRIO_MIN" | "PRIO_MAX" => {
- true
- }
+ "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK" | "DT_SOCK"
+ | "USRQUOTA" | "GRPQUOTA" | "PRIO_MIN" | "PRIO_MAX" => true,
// skip sighandler_t assignments
"SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true,
"DT_UNKNOWN" => true,
- "_UTX_LINESIZE" | "_UTX_USERSIZE" | "_UTX_PADSIZE" | "_UTX_IDSIZE"
- | "_UTX_HOSTSIZE" => true,
+ "_UTX_LINESIZE" | "_UTX_USERSIZE" | "_UTX_PADSIZE" | "_UTX_IDSIZE" | "_UTX_HOSTSIZE" => {
+ true
+ }
"EADI" | "EXTPROC" | "IPC_SEAT" => true,
@@ -736,6 +898,9 @@ fn test_solarish(target: &str) {
});
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
// the union handling is a mess
if ty.contains("door_desc_t_") {
return true;
@@ -768,6 +933,15 @@ fn test_solarish(target: &str) {
"door_arg_t" if field.ends_with("_ptr") => true,
"door_arg_t" if field.ends_with("rbuf") => true,
+ // anonymous union challenges
+ "fpregset_t" if field == "fp_reg_set" => true,
+
+ // The LX brand (integrated into some illumos distros) commandeered several of the
+ // `uc_filler` fields to use for brand-specific state.
+ "ucontext_t" if is_illumos && (field == "uc_filler" || field == "uc_brand_data") => {
+ true
+ }
+
_ => false,
}
});
@@ -793,15 +967,16 @@ fn test_solarish(target: &str) {
"cfmakeraw" | "cfsetspeed" => true,
// const-ness issues
- "execv" | "execve" | "execvp" | "settimeofday" | "sethostname" => {
- true
- }
+ "execv" | "execve" | "execvp" | "settimeofday" | "sethostname" => true,
// Solaris-different
"getpwent_r" | "getgrent_r" | "updwtmpx" if is_illumos => true,
"madvise" | "mprotect" if is_illumos => true,
"door_call" | "door_return" | "door_create" if is_illumos => true,
+ // Not visible when build with _XOPEN_SOURCE=700
+ "mmapobj" | "mmap64" | "meminfo" | "getpagesizes" | "getpagesizes2" => true,
+
// These functions may return int or void depending on the exact
// configuration of the compilation environment, but the return
// value is not useful (always 0) so we can ignore it:
@@ -816,7 +991,6 @@ fn test_solarish(target: &str) {
fn test_netbsd(target: &str) {
assert!(target.contains("netbsd"));
- let rumprun = target.contains("rumprun");
let mut cfg = ctest_cfg();
cfg.flag("-Wno-deprecated-declarations");
@@ -827,6 +1001,8 @@ fn test_netbsd(target: &str) {
"elf.h",
"errno.h",
"fcntl.h",
+ "getopt.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -846,6 +1022,7 @@ fn test_netbsd(target: &str) {
"grp.h",
"ifaddrs.h",
"langinfo.h",
+ "net/bpf.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
@@ -864,20 +1041,28 @@ fn test_netbsd(target: &str) {
"semaphore.h",
"signal.h",
"string.h",
+ "sys/endian.h",
+ "sys/exec_elf.h",
+ "sys/xattr.h",
"sys/extattr.h",
"sys/file.h",
"sys/ioctl.h",
"sys/ioctl_compat.h",
+ "sys/ipc.h",
+ "sys/ktrace.h",
"sys/mman.h",
"sys/mount.h",
"sys/ptrace.h",
"sys/resource.h",
+ "sys/shm.h",
"sys/socket.h",
"sys/statvfs.h",
"sys/sysctl.h",
"sys/time.h",
"sys/times.h",
"sys/timex.h",
+ "sys/ucontext.h",
+ "sys/ucred.h",
"sys/uio.h",
"sys/un.h",
"sys/utsname.h",
@@ -900,10 +1085,9 @@ fn test_netbsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
- | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
- | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
- | "Elf64_Chdr" => ty.to_string(),
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr" | "Elf32_Shdr"
+ | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
+ | "Elf32_Chdr" | "Elf64_Chdr" => ty.to_string(),
// OSX calls this something else
"sighandler_t" => "sig_t".to_string(),
@@ -932,6 +1116,9 @@ fn test_netbsd(target: &str) {
});
cfg.skip_type(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
// FIXME: sighandler_t is crazy across platforms
"sighandler_t" => true,
@@ -983,26 +1170,6 @@ fn test_netbsd(target: &str) {
"setrlimit" | "setrlimit64" | // non-int in 1st arg
"prlimit" | "prlimit64" | // non-int in 2nd arg
- // These functions presumably exist on netbsd but don't look like
- // they're implemented on rumprun yet, just let them slide for now.
- // Some of them look like they have headers but then don't have
- // corresponding actual definitions either...
- "shm_open" |
- "shm_unlink" |
- "syscall" |
- "mq_open" |
- "mq_close" |
- "mq_getattr" |
- "mq_notify" |
- "mq_receive" |
- "mq_send" |
- "mq_setattr" |
- "mq_timedreceive" |
- "mq_timedsend" |
- "mq_unlink" |
- "ptrace" |
- "sigaltstack" if rumprun => true,
-
_ => false,
}
});
@@ -1023,6 +1190,8 @@ fn test_netbsd(target: &str) {
// conflicting with `p_type` macro from .
("Elf32_Phdr", "p_type") => true,
("Elf64_Phdr", "p_type") => true,
+ // pthread_spin_t is a volatile uchar
+ ("pthread_spinlock_t", "pts_spin") => true,
_ => false,
}
});
@@ -1044,13 +1213,18 @@ fn test_dragonflybsd(target: &str) {
"errno.h",
"execinfo.h",
"fcntl.h",
+ "getopt.h",
"glob.h",
"grp.h",
"ifaddrs.h",
+ "kvm.h",
"langinfo.h",
+ "libgen.h",
"limits.h",
+ "link.h",
"locale.h",
"mqueue.h",
+ "net/bpf.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
@@ -1077,18 +1251,29 @@ fn test_dragonflybsd(target: &str) {
"sys/event.h",
"sys/file.h",
"sys/ioctl.h",
+ "sys/cpuctl.h",
+ "sys/eui64.h",
+ "sys/ipc.h",
+ "sys/kinfo.h",
+ "sys/ktrace.h",
+ "sys/malloc.h",
"sys/mman.h",
"sys/mount.h",
+ "sys/procctl.h",
"sys/ptrace.h",
"sys/resource.h",
"sys/rtprio.h",
+ "sys/sched.h",
+ "sys/shm.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
"sys/sysctl.h",
"sys/time.h",
"sys/times.h",
+ "sys/timex.h",
"sys/types.h",
+ "sys/checkpoint.h",
"sys/uio.h",
"sys/un.h",
"sys/utsname.h",
@@ -1096,11 +1281,13 @@ fn test_dragonflybsd(target: &str) {
"syslog.h",
"termios.h",
"time.h",
- "ufs/ufs/quota.h",
+ "ucontext.h",
"unistd.h",
"util.h",
"utime.h",
"utmpx.h",
+ "vfs/ufs/quota.h",
+ "vm/vm_map.h",
"wchar.h",
"iconv.h",
}
@@ -1108,10 +1295,9 @@ fn test_dragonflybsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
- | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
- | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
- | "Elf64_Chdr" => ty.to_string(),
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr" | "Elf32_Shdr"
+ | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
+ | "Elf32_Chdr" | "Elf64_Chdr" => ty.to_string(),
// FIXME: OSX calls this something else
"sighandler_t" => "sig_t".to_string(),
@@ -1120,6 +1306,9 @@ fn test_dragonflybsd(target: &str) {
t if t.ends_with("_t") => t.to_string(),
+ // sigval is a struct in Rust, but a union in C:
+ "sigval" => format!("union sigval"),
+
// put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),
@@ -1152,10 +1341,10 @@ fn test_dragonflybsd(target: &str) {
});
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
- // This is actually a union, not a struct
- "sigval" => true,
-
// FIXME: These are tested as part of the linux_fcntl tests since
// there are header conflicts when including them with all the other
// structs.
@@ -1190,10 +1379,7 @@ fn test_dragonflybsd(target: &str) {
// These are defined for Solaris 11, but the crate is tested on
// illumos, where they are currently not defined
- "EADI"
- | "PORT_SOURCE_POSTWAIT"
- | "PORT_SOURCE_SIGNAL"
- | "PTHREAD_STACK_MIN" => true,
+ "EADI" | "PORT_SOURCE_POSTWAIT" | "PORT_SOURCE_SIGNAL" | "PTHREAD_STACK_MIN" => true,
_ => false,
}
@@ -1203,7 +1389,7 @@ fn test_dragonflybsd(target: &str) {
// skip those that are manually verified
match name {
// FIXME: https://github.com/rust-lang/libc/issues/1272
- "execv" | "execve" | "execvp" => true,
+ "execv" | "execve" | "execvp" | "fexecve" => true,
"getrlimit" | "getrlimit64" | // non-int in 1st arg
"setrlimit" | "setrlimit64" | // non-int in 1st arg
@@ -1279,9 +1465,7 @@ fn test_wasi(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| match ty {
"FILE" | "fd_set" | "DIR" => ty.to_string(),
t if is_union => format!("union {}", t),
- t if t.starts_with("__wasi") && t.ends_with("_u") => {
- format!("union {}", t)
- }
+ t if t.starts_with("__wasi") && t.ends_with("_u") => format!("union {}", t),
t if t.starts_with("__wasi") && is_struct => format!("struct {}", t),
t if t.ends_with("_t") => t.to_string(),
t if is_struct => format!("struct {}", t),
@@ -1330,11 +1514,15 @@ fn test_android(target: &str) {
"ctype.h",
"dirent.h",
"dlfcn.h",
+ "elf.h",
"errno.h",
"fcntl.h",
+ "getopt.h",
"grp.h",
"ifaddrs.h",
+ "libgen.h",
"limits.h",
+ "link.h",
"locale.h",
"malloc.h",
"net/ethernet.h",
@@ -1384,6 +1572,7 @@ fn test_android(target: &str) {
"sys/swap.h",
"sys/syscall.h",
"sys/sysinfo.h",
+ "sys/system_properties.h",
"sys/time.h",
"sys/timerfd.h",
"sys/times.h",
@@ -1391,6 +1580,7 @@ fn test_android(target: &str) {
"sys/ucontext.h",
"sys/uio.h",
"sys/un.h",
+ "sys/user.h",
"sys/utsname.h",
"sys/vfs.h",
"sys/xattr.h",
@@ -1414,16 +1604,22 @@ fn test_android(target: &str) {
"asm/mman.h",
"linux/auxvec.h",
"linux/dccp.h",
+ "linux/elf.h",
"linux/errqueue.h",
"linux/falloc.h",
+ "linux/filter.h",
"linux/futex.h",
"linux/fs.h",
"linux/genetlink.h",
"linux/if_alg.h",
+ "linux/if_addr.h",
"linux/if_ether.h",
+ "linux/if_link.h",
+ "linux/rtnetlink.h",
"linux/if_tun.h",
"linux/magic.h",
"linux/memfd.h",
+ "linux/mempolicy.h",
"linux/module.h",
"linux/net_tstamp.h",
"linux/netfilter/nfnetlink.h",
@@ -1439,6 +1635,7 @@ fn test_android(target: &str) {
"linux/seccomp.h",
"linux/sched.h",
"linux/sockios.h",
+ "linux/uinput.h",
"linux/vm_sockets.h",
"linux/wait.h",
@@ -1452,7 +1649,7 @@ fn test_android(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" => ty.to_string(),
+ "FILE" | "fd_set" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => ty.to_string(),
t if is_union => format!("union {}", t),
@@ -1472,11 +1669,20 @@ fn test_android(target: &str) {
match field {
// Our stat *_nsec fields normally don't actually exist but are part
// of a timeval struct
- s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- s.to_string()
- }
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => s.to_string(),
// FIXME: appears that `epoll_event.data` is an union
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
+ // The following structs have a field called `type` in C,
+ // but `type` is a Rust keyword, so these fields are translated
+ // to `type_` in Rust.
+ "type_"
+ if struct_ == "input_event"
+ || struct_ == "input_mask"
+ || struct_ == "ff_effect" =>
+ {
+ "type".to_string()
+ }
+
s => s.to_string(),
}
});
@@ -1486,6 +1692,9 @@ fn test_android(target: &str) {
// FIXME: `sighandler_t` type is incorrect, see:
// https://github.com/rust-lang/libc/issues/1359
"sighandler_t" => true,
+
+ // These are tested in the `linux_elf.rs` file.
+ "Elf64_Phdr" | "Elf32_Phdr" => true,
_ => false,
}
});
@@ -1500,6 +1709,11 @@ fn test_android(target: &str) {
"termios2" => true,
// uc_sigmask and uc_sigmask64 of ucontext_t are an anonymous union
"ucontext_t" => true,
+ // 'private' type
+ "prop_info" => true,
+
+ // These are tested in the `linux_elf.rs` file.
+ "Elf64_Phdr" | "Elf32_Phdr" => true,
_ => false,
}
@@ -1507,6 +1721,24 @@ fn test_android(target: &str) {
cfg.skip_const(move |name| {
match name {
+ // The IPV6 constants are tested in the `linux_ipv6.rs` tests:
+ | "IPV6_FLOWINFO"
+ | "IPV6_FLOWLABEL_MGR"
+ | "IPV6_FLOWINFO_SEND"
+ | "IPV6_FLOWINFO_FLOWLABEL"
+ | "IPV6_FLOWINFO_PRIORITY"
+ // The F_ fnctl constants are tested in the `linux_fnctl.rs` tests:
+ | "F_CANCELLK"
+ | "F_ADD_SEALS"
+ | "F_GET_SEALS"
+ | "F_SEAL_SEAL"
+ | "F_SEAL_SHRINK"
+ | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => true,
+
+ // The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests:
+ "ARPHRD_CAN" => true,
+
// FIXME: deprecated: not available in any header
// See: https://github.com/rust-lang/libc/issues/1356
"ENOATTR" => true,
@@ -1522,6 +1754,20 @@ fn test_android(target: &str) {
// Requires Linux kernel 5.6
"VMADDR_CID_LOCAL" => true,
+ // FIXME: conflicts with standard C headers and is tested in
+ // `linux_termios.rs` below:
+ "BOTHER" => true,
+ "IBSHIFT" => true,
+ "TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => true,
+
+ // is a private value for kernel usage normally
+ "FUSE_SUPER_MAGIC" => true,
+ // linux 5.12 min
+ "MPOL_F_NUMA_BALANCING" => true,
+
+ // GRND_INSECURE was added in platform-tools-30.0.0
+ "GRND_INSECURE" => true,
+
_ => false,
}
});
@@ -1548,6 +1794,17 @@ fn test_android(target: &str) {
// We skip the test here since here _GNU_SOURCE is defined, and
// test the XSI version below.
"strerror_r" => true,
+ "reallocarray" => true,
+ "__system_property_wait" => true,
+
+ // Added in API level 30, but tests use level 28.
+ "mlock2" => true,
+
+ // Added in glibc 2.25.
+ "getentropy" => true,
+
+ // Added in API level 28, but some tests use level 24.
+ "getrandom" => true,
_ => false,
}
@@ -1557,7 +1814,14 @@ fn test_android(target: &str) {
// This is a weird union, don't check the type.
(struct_ == "ifaddrs" && field == "ifa_ifu") ||
// sigval is actually a union, but we pretend it's a struct
- (struct_ == "sigevent" && field == "sigev_value")
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // this one is an anonymous union
+ (struct_ == "ff_effect" && field == "u") ||
+ // FIXME: `sa_sigaction` has type `sighandler_t` but that type is
+ // incorrect, see: https://github.com/rust-lang/libc/issues/1359
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // signalfd had SIGSYS fields added in Android 4.19, but CI does not have that version yet.
+ (struct_ == "signalfd_siginfo" && field == "ssi_call_addr")
});
cfg.skip_field(move |struct_, field| {
@@ -1575,6 +1839,20 @@ fn test_android(target: &str) {
field == "ssi_arch"))
});
+ cfg.skip_field(|struct_, field| {
+ match (struct_, field) {
+ // conflicting with `p_type` macro from .
+ ("Elf32_Phdr", "p_type") => true,
+ ("Elf64_Phdr", "p_type") => true,
+
+ // this is actually a union on linux, so we can't represent it well and
+ // just insert some padding.
+ ("siginfo_t", "_pad") => true,
+
+ _ => false,
+ }
+ });
+
cfg.generate("../src/lib.rs", "main.rs");
test_linux_like_apis(target);
@@ -1587,45 +1865,56 @@ fn test_freebsd(target: &str) {
let freebsd_ver = which_freebsd();
match freebsd_ver {
- Some(10) => cfg.cfg("freebsd10", None),
- Some(11) => cfg.cfg("freebsd11", None),
Some(12) => cfg.cfg("freebsd12", None),
Some(13) => cfg.cfg("freebsd13", None),
+ Some(14) => cfg.cfg("freebsd14", None),
_ => &mut cfg,
};
+ // For sched linux compat fn
+ cfg.define("_WITH_CPU_SET_T", None);
// Required for `getline`:
cfg.define("_WITH_GETLINE", None);
// Required for making freebsd11_stat available in the headers
- match freebsd_ver {
- Some(10) => &mut cfg,
- _ => cfg.define("_WANT_FREEBSD11_STAT", None),
+ cfg.define("_WANT_FREEBSD11_STAT", None);
+
+ let freebsd13 = match freebsd_ver {
+ Some(n) if n >= 13 => true,
+ _ => false,
};
headers! { cfg:
"aio.h",
"arpa/inet.h",
+ "bsm/audit.h",
"ctype.h",
"dirent.h",
"dlfcn.h",
"elf.h",
"errno.h",
+ "execinfo.h",
"fcntl.h",
+ "getopt.h",
"glob.h",
"grp.h",
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
"libutil.h",
"limits.h",
"link.h",
"locale.h",
+ "machine/elf.h",
"machine/reg.h",
+ "malloc_np.h",
+ "memstat.h",
"mqueue.h",
"net/bpf.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
+ "net/if_mib.h",
"net/route.h",
"netdb.h",
"netinet/ip.h",
@@ -1647,7 +1936,13 @@ fn test_freebsd(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
+ "sys/capsicum.h",
+ "sys/auxv.h",
+ "sys/cpuset.h",
+ "sys/domainset.h",
+ "sys/eui64.h",
"sys/event.h",
+ [freebsd13]:"sys/eventfd.h",
"sys/extattr.h",
"sys/file.h",
"sys/ioctl.h",
@@ -1656,25 +1951,38 @@ fn test_freebsd(target: &str) {
"sys/mman.h",
"sys/mount.h",
"sys/msg.h",
+ "sys/procctl.h",
"sys/procdesc.h",
"sys/ptrace.h",
+ "sys/queue.h",
"sys/random.h",
"sys/resource.h",
"sys/rtprio.h",
+ "sys/sem.h",
"sys/shm.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
"sys/sysctl.h",
+ "sys/thr.h",
"sys/time.h",
"sys/times.h",
"sys/timex.h",
"sys/types.h",
+ "sys/proc.h",
+ "kvm.h", // must be after "sys/types.h"
"sys/ucontext.h",
"sys/uio.h",
+ "sys/ktrace.h",
+ "sys/umtx.h",
"sys/un.h",
+ "sys/user.h",
"sys/utsname.h",
+ "sys/uuid.h",
+ "sys/vmmeter.h",
"sys/wait.h",
+ "libprocstat.h",
+ "devstat.h",
"syslog.h",
"termios.h",
"time.h",
@@ -1688,8 +1996,19 @@ fn test_freebsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
- | "Elf64_Phdr" => ty.to_string(),
+ "FILE"
+ | "fd_set"
+ | "Dl_info"
+ | "DIR"
+ | "Elf32_Phdr"
+ | "Elf64_Phdr"
+ | "Elf32_Auxinfo"
+ | "Elf64_Auxinfo"
+ | "devstat_select_mode"
+ | "devstat_support_flags"
+ | "devstat_type_flags"
+ | "devstat_match_flags"
+ | "devstat_priority" => ty.to_string(),
// FIXME: https://github.com/rust-lang/libc/issues/1273
"sighandler_t" => "sig_t".to_string(),
@@ -1718,74 +2037,58 @@ fn test_freebsd(target: &str) {
// Field is named `type` in C but that is a Rust keyword,
// so these fields are translated to `type_` in the bindings.
"type_" if struct_ == "rtprio" => "type".to_string(),
+ "type_" if struct_ == "sockstat" => "type".to_string(),
+ "type_" if struct_ == "devstat_match_table" => "type".to_string(),
s => s.to_string(),
}
});
cfg.skip_const(move |name| {
match name {
- // These constants are to be introduced in yet-unreleased FreeBSD 12.2.
- "F_ADD_SEALS" | "F_GET_SEALS" | "F_SEAL_SEAL"
- | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE"
- if Some(12) <= freebsd_ver =>
- {
- true
- }
-
- // These constants were introduced in FreeBSD 12:
- "SF_USER_READAHEAD"
- | "EVFILT_EMPTY"
- | "SO_REUSEPORT_LB"
- | "IP_ORIGDSTADDR"
- | "IP_RECVORIGDSTADDR"
- | "IPV6_ORIGDSTADDR"
- | "IPV6_RECVORIGDSTADDR"
- | "NI_NUMERICSCOPE"
- if Some(11) == freebsd_ver =>
- {
- true
- }
-
- // These constants were introduced in FreeBSD 11:
- "SF_USER_READAHEAD"
- | "SF_NOCACHE"
- | "RLIMIT_KQUEUES"
- | "RLIMIT_UMTXP"
- | "EVFILT_PROCDESC"
- | "EVFILT_SENDFILE"
- | "EVFILT_EMPTY"
- | "SO_REUSEPORT_LB"
- | "TCP_CCALGOOPT"
- | "TCP_PCAP_OUT"
- | "TCP_PCAP_IN"
- | "IP_BINDMULTI"
- | "IP_ORIGDSTADDR"
- | "IP_RECVORIGDSTADDR"
- | "IPV6_ORIGDSTADDR"
- | "IPV6_RECVORIGDSTADDR"
- | "PD_CLOEXEC"
- | "PD_ALLOWED_AT_FORK"
- | "IP_RSS_LISTEN_BUCKET"
- | "NI_NUMERICSCOPE"
- if Some(10) == freebsd_ver =>
+ // These constants were introduced in FreeBSD 13:
+ "F_ADD_SEALS" | "F_GET_SEALS" | "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE"
+ if Some(13) > freebsd_ver =>
{
true
}
- // FIXME: This constant has a different value in FreeBSD 10:
- "RLIM_NLIMITS" if Some(10) == freebsd_ver => true,
+ // These constants were introduced in FreeBSD 13:
+ "EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some(13) > freebsd_ver => true,
- // FIXME: There are deprecated - remove in a couple of releases.
+ // FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r273250) but will
// still be accepted and ignored at runtime.
- "MAP_RENAME" | "MAP_NORESERVE" if Some(10) != freebsd_ver => true,
+ "MAP_RENAME" | "MAP_NORESERVE" => true,
- // FIXME: There are deprecated - remove in a couple of releases.
+ // FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r262489),
// and they've never had any legitimate use outside of the
// base system anyway.
"CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,
+ // FIXME: This is deprecated - remove in a couple of releases.
+ // This was removed in FreeBSD 14 (git 1b4701fe1e8) and never
+ // should've been used anywhere anyway.
+ "TDF_UNUSED23" => true,
+
+ // FIXME: These are deprecated - remove in a couple of releases.
+ // These symbols are not stable across OS-versions. They were
+ // changed for FreeBSD 14 in git revisions b62848b0c3f and
+ // 2cf7870864e.
+ "PRI_MAX_ITHD" | "PRI_MIN_REALTIME" | "PRI_MAX_REALTIME" | "PRI_MIN_KERN"
+ | "PRI_MAX_KERN" | "PSWP" | "PVM" | "PINOD" | "PRIBIO" | "PVFS" | "PZERO" | "PSOCK"
+ | "PWAIT" | "PLOCK" | "PPAUSE" | "PRI_MIN_TIMESHARE" | "PUSER" | "PI_AV" | "PI_NET"
+ | "PI_DISK" | "PI_TTY" | "PI_DULL" | "PI_SOFT" => true,
+
+ // This symbol changed in FreeBSD 14 (git 051e7d78b03), but the new
+ // version should be safe to use on older releases.
+ "IFCAP_CANTCHANGE" => true,
+
+ // These were removed in FreeBSD 14 (git c6d31b8306e)
+ "TDF_ASTPENDING" | "TDF_NEEDSUSPCHK" | "TDF_NEEDRESCHED" | "TDF_NEEDSIGCHK"
+ | "TDF_ALRMPEND" | "TDF_PROFPEND" | "TDF_MACPEND" => true,
+
// This constant was removed in FreeBSD 13 (svn r363622), and never
// had any legitimate use outside of the base system anyway.
"CTL_P1003_1B_MAXID" => true,
@@ -1793,28 +2096,154 @@ fn test_freebsd(target: &str) {
// This was renamed in FreeBSD 12.2 and 13 (r352486).
"CTL_UNSPEC" | "CTL_SYSCTL" => true,
- // These were added in FreeBSD 12.2 and 13 (r352486),
- // but they are just names for magic numbers that existed for ages.
- "CTL_SYSCTL_DEBUG"
- | "CTL_SYSCTL_NAME"
- | "CTL_SYSCTL_NEXT"
- | "CTL_SYSCTL_NAME2OID"
- | "CTL_SYSCTL_OIDFMT"
- | "CTL_SYSCTL_OIDDESCR"
- | "CTL_SYSCTL_OIDLABEL" => true,
-
// This was renamed in FreeBSD 12.2 and 13 (r350749).
"IPPROTO_SEP" | "IPPROTO_DCCP" => true,
// This was changed to 96(0x60) in FreeBSD 13:
// https://github.com/freebsd/freebsd/
// commit/06b00ceaa914a3907e4e27bad924f44612bae1d7
- "MINCORE_SUPER" if Some(13) == freebsd_ver => true,
+ "MINCORE_SUPER" if Some(13) <= freebsd_ver => true,
+
+ // Added in FreeBSD 13.0 (r356667)
+ "GRND_INSECURE" if Some(13) > freebsd_ver => true,
+
+ // Added in FreeBSD 13.0 (r349609)
+ "PROC_PROTMAX_CTL"
+ | "PROC_PROTMAX_STATUS"
+ | "PROC_PROTMAX_FORCE_ENABLE"
+ | "PROC_PROTMAX_FORCE_DISABLE"
+ | "PROC_PROTMAX_NOFORCE"
+ | "PROC_PROTMAX_ACTIVE"
+ | "PROC_NO_NEW_PRIVS_CTL"
+ | "PROC_NO_NEW_PRIVS_STATUS"
+ | "PROC_NO_NEW_PRIVS_ENABLE"
+ | "PROC_NO_NEW_PRIVS_DISABLE"
+ | "PROC_WXMAP_CTL"
+ | "PROC_WXMAP_STATUS"
+ | "PROC_WX_MAPPINGS_PERMIT"
+ | "PROC_WX_MAPPINGS_DISALLOW_EXEC"
+ | "PROC_WXORX_ENFORCE"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
- // This was increased to 97 in FreeBSD 12.2 and 13.
- // https://github.com/freebsd/freebsd/
- // commit/72a21ba0f62da5e86a1c0b462aeb3f5ff849a1b7
- "ELAST" if Some(12) == freebsd_ver => true,
+ // Added in in FreeBSD 13.0 (r367776 and r367287)
+ "SCM_CREDS2" | "LOCAL_CREDS_PERSISTENT" if Some(13) > freebsd_ver => true,
+
+ // Added in FreeBSD 14
+ "SPACECTL_DEALLOC" if Some(14) > freebsd_ver => true,
+
+ // Added in FreeBSD 13.
+ "KERN_PROC_SIGFASTBLK"
+ | "USER_LOCALBASE"
+ | "TDP_SIGFASTBLOCK"
+ | "TDP_UIOHELD"
+ | "TDP_SIGFASTPENDING"
+ | "TDP2_COMPAT32RB"
+ | "P2_PROTMAX_ENABLE"
+ | "P2_PROTMAX_DISABLE"
+ | "CTLFLAG_NEEDGIANT"
+ | "CTL_SYSCTL_NEXTNOSKIP"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
+
+ // Added in freebsd 14.
+ "IFCAP_MEXTPG" if Some(14) > freebsd_ver => true,
+ // Added in freebsd 13.
+ "IFF_KNOWSEPOCH" | "IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM"
+ | "IFCAP_VXLAN_HWTSO" | "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
+ // Added in FreeBSD 13.
+ "PS_FST_TYPE_EVENTFD" if Some(13) > freebsd_ver => true,
+
+ // Added in FreeBSD 14.
+ "MNT_RECURSE" | "MNT_DEFERRED" if Some(14) > freebsd_ver => true,
+
+ // Added in FreeBSD 13.
+ "MNT_EXTLS" | "MNT_EXTLSCERT" | "MNT_EXTLSCERTUSER" | "MNT_NOCOVER"
+ | "MNT_EMPTYDIR"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
+
+ // Added in FreeBSD 14.
+ "PT_COREDUMP" | "PC_ALL" | "PC_COMPRESS" | "PT_GETREGSET" | "PT_SETREGSET"
+ if Some(14) > freebsd_ver =>
+ {
+ true
+ }
+
+ // Added in FreeBSD 14.
+ "F_KINFO" => true, // FIXME: depends how frequent freebsd 14 is updated on CI, this addition went this week only.
+ "SHM_RENAME_NOREPLACE"
+ | "SHM_RENAME_EXCHANGE"
+ | "SHM_LARGEPAGE_ALLOC_DEFAULT"
+ | "SHM_LARGEPAGE_ALLOC_NOWAIT"
+ | "SHM_LARGEPAGE_ALLOC_HARD"
+ | "MFD_CLOEXEC"
+ | "MFD_ALLOW_SEALING"
+ | "MFD_HUGETLB"
+ | "MFD_HUGE_MASK"
+ | "MFD_HUGE_64KB"
+ | "MFD_HUGE_512KB"
+ | "MFD_HUGE_1MB"
+ | "MFD_HUGE_2MB"
+ | "MFD_HUGE_8MB"
+ | "MFD_HUGE_16MB"
+ | "MFD_HUGE_32MB"
+ | "MFD_HUGE_256MB"
+ | "MFD_HUGE_512MB"
+ | "MFD_HUGE_1GB"
+ | "MFD_HUGE_2GB"
+ | "MFD_HUGE_16GB"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
+
+ // Flags introduced in FreeBSD 14.
+ "TCP_MAXUNACKTIME"
+ | "TCP_MAXPEAKRATE"
+ | "TCP_IDLE_REDUCE"
+ | "TCP_REMOTE_UDP_ENCAPS_PORT"
+ | "TCP_DELACK"
+ | "TCP_FIN_IS_RST"
+ | "TCP_LOG_LIMIT"
+ | "TCP_SHARED_CWND_ALLOWED"
+ | "TCP_PROC_ACCOUNTING"
+ | "TCP_USE_CMP_ACKS"
+ | "TCP_PERF_INFO"
+ | "TCP_LRD"
+ if Some(14) > freebsd_ver =>
+ {
+ true
+ }
+
+ // Added in FreeBSD 14
+ "LIO_READV" | "LIO_WRITEV" | "LIO_VECTORED" if Some(14) > freebsd_ver => true,
+
+ // Added in FreeBSD 13
+ "FIOSSHMLPGCNF" if Some(13) > freebsd_ver => true,
+
+ // Added in FreeBSD 14
+ "IFCAP_NV" if Some(14) > freebsd_ver => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_type(move |ty| {
+ match ty {
+ // the struct "__kvm" is quite tricky to bind so since we only use a pointer to it
+ // for now, it doesn't matter too much...
+ "kvm_t" => true,
_ => false,
}
@@ -1825,11 +2254,23 @@ fn test_freebsd(target: &str) {
return true;
}
match ty {
- // `mmsghdr` is not available in FreeBSD 10
- "mmsghdr" if Some(10) == freebsd_ver => true,
+ // `procstat` is a private struct
+ "procstat" => true,
- // `max_align_t` is not available in FreeBSD 10
- "max_align_t" if Some(10) == freebsd_ver => true,
+ // `spacectl_range` was introduced in FreeBSD 14
+ "spacectl_range" if Some(14) > freebsd_ver => true,
+
+ // `ptrace_coredump` introduced in FreeBSD 14.
+ "ptrace_coredump" if Some(14) > freebsd_ver => true,
+
+ // `sockcred2` is not available in FreeBSD 12.
+ "sockcred2" if Some(13) > freebsd_ver => true,
+ // `shm_largepage_conf` was introduced in FreeBSD 13.
+ "shm_largepage_conf" if Some(13) > freebsd_ver => true,
+
+ // Those are private types
+ "memory_type" => true,
+ "memory_type_list" => true,
_ => false,
}
@@ -1841,16 +2282,8 @@ fn test_freebsd(target: &str) {
// FIXME: https://github.com/rust-lang/libc/issues/1272
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" => true,
- // These functions were added in FreeBSD 11:
- "fdatasync" | "mq_getfd_np" | "sendmmsg" | "recvmmsg"
- if Some(10) == freebsd_ver =>
- {
- true
- }
-
- // This function changed its return type from `int` in FreeBSD10 to
- // `ssize_t` in FreeBSD11:
- "aio_waitcomplete" if Some(10) == freebsd_ver => true,
+ // `fspacectl` was introduced in FreeBSD 14
+ "fspacectl" if Some(14) > freebsd_ver => true,
// The `uname` function in the `utsname.h` FreeBSD header is a C
// inline function (has no symbol) that calls the `__xuname` symbol.
@@ -1863,14 +2296,27 @@ fn test_freebsd(target: &str) {
// https://github.com/gnzlbg/ctest/issues/68
"lio_listio" => true,
- _ => false,
- }
- });
+ // Those are introduced in FreeBSD 14.
+ "sched_getaffinity" | "sched_setaffinity" | "sched_getcpu"
+ if Some(14) > freebsd_ver =>
+ {
+ true
+ }
+
+ // This is not available in FreeBSD 12.
+ "SOCKCRED2SIZE" if Some(13) > freebsd_ver => true,
+
+ // Those are not available in FreeBSD 12.
+ "memfd_create" | "shm_create_largepage" | "shm_rename" if Some(13) > freebsd_ver => {
+ true
+ }
+
+ // Added in FreeBSD 13.
+ "getlocalbase" if Some(13) > freebsd_ver => true,
+ "aio_readv" if Some(13) > freebsd_ver => true,
+ "aio_writev" if Some(13) > freebsd_ver => true,
+ "copy_file_range" if Some(13) > freebsd_ver => true,
- cfg.skip_signededness(move |c| {
- match c {
- // FIXME: has a different sign in FreeBSD10
- "blksize_t" if Some(10) == freebsd_ver => true,
_ => false,
}
});
@@ -1880,9 +2326,7 @@ fn test_freebsd(target: &str) {
match i {
// aio_buf is a volatile void** but since we cannot express that in
// Rust types, we have to explicitly tell the checker about it here:
- StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
- true
- }
+ StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => true,
_ => false,
}
});
@@ -1893,10 +2337,6 @@ fn test_freebsd(target: &str) {
// incorrect, see: https://github.com/rust-lang/libc/issues/1359
("sigaction", "sa_sigaction") => true,
- // FIXME: in FreeBSD10 this field has type `char*` instead of
- // `void*`:
- ("stack_t", "ss_sp") if Some(10) == freebsd_ver => true,
-
// conflicting with `p_type` macro from .
("Elf32_Phdr", "p_type") => true,
("Elf64_Phdr", "p_type") => true,
@@ -1904,6 +2344,51 @@ fn test_freebsd(target: &str) {
// not available until FreeBSD 12, and is an anonymous union there.
("xucred", "cr_pid__c_anonymous_union") => true,
+ // m_owner field is a volatile __lwpid_t
+ ("umutex", "m_owner") => true,
+ // c_has_waiters field is a volatile int32_t
+ ("ucond", "c_has_waiters") => true,
+ // is PATH_MAX long but tests can't accept multi array as equivalent.
+ ("kinfo_vmentry", "kve_path") => true,
+
+ // a_un field is a union
+ ("Elf32_Auxinfo", "a_un") => true,
+ ("Elf64_Auxinfo", "a_un") => true,
+
+ // union fields
+ ("if_data", "__ifi_epoch") => true,
+ ("if_data", "__ifi_lastchange") => true,
+ ("ifreq", "ifr_ifru") => true,
+ ("ifconf", "ifc_ifcu") => true,
+
+ // anonymous struct
+ ("devstat", "dev_links") => true,
+
+ // FIXME: structs too complicated to bind for now...
+ ("kinfo_proc", "ki_paddr") => true,
+ ("kinfo_proc", "ki_addr") => true,
+ ("kinfo_proc", "ki_tracep") => true,
+ ("kinfo_proc", "ki_textvp") => true,
+ ("kinfo_proc", "ki_fd") => true,
+ ("kinfo_proc", "ki_vmspace") => true,
+ ("kinfo_proc", "ki_pcb") => true,
+ ("kinfo_proc", "ki_tdaddr") => true,
+ ("kinfo_proc", "ki_pd") => true,
+
+ // Anonymous type.
+ ("filestat", "next") => true,
+
+ // We ignore this field because we needed to use a hack in order to make rust 1.19
+ // happy...
+ ("kinfo_proc", "ki_sparestrings") => true,
+
+ // `__sem_base` is a private struct field
+ ("semid_ds", "__sem_base") => true,
+
+ // `snap_time` is a `long double`, but it's a nightmare to bind correctly in rust
+ // for the moment, so it's a best effort thing...
+ ("statinfo", "snap_time") => true,
+
_ => false,
}
});
@@ -1973,7 +2458,6 @@ fn test_emscripten(target: &str) {
"sys/reboot.h",
"sys/resource.h",
"sys/sem.h",
- "sys/sendfile.h",
"sys/shm.h",
"sys/signalfd.h",
"sys/socket.h",
@@ -2010,6 +2494,8 @@ fn test_emscripten(target: &str) {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(),
+ "os_unfair_lock" => "struct os_unfair_lock_s".to_string(),
+
t if is_union => format!("union {}", t),
t if t.ends_with("_t") => t.to_string(),
@@ -2040,6 +2526,9 @@ fn test_emscripten(target: &str) {
// FIXME: is this necessary?
"sighandler_t" => true,
+ // FIXME: The size has been changed due to musl's time64
+ "time_t" => true,
+
_ => false,
}
});
@@ -2058,6 +2547,16 @@ fn test_emscripten(target: &str) {
// Skip for now to unblock CI.
"pthread_condattr_t" => true,
+ // FIXME: The size has been changed when upgraded to musl 1.2.2
+ "pthread_mutex_t" => true,
+
+ // FIXME: The size has been changed
+ "max_align_t" => true,
+
+ // FIXME: The size has been changed due to time64
+ "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
+ | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true,
+
_ => false,
}
});
@@ -2070,6 +2569,14 @@ fn test_emscripten(target: &str) {
// FIXME: Investigate why CI is missing it.
"clearenv" => true,
+ // FIXME: Somehow the ctest cannot find it on emscripten:
+ // = note: error: undefined symbol: wait4 (referenced by top-level compiled C/C++ code)
+ // warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols
+ // warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
+ // warning: _wait4 may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
+ // Error: Aborting compilation due to previous errors
+ "wait4" => true,
+
_ => false,
}
});
@@ -2087,6 +2594,18 @@ fn test_emscripten(target: &str) {
// emscripten-core/emscripten@6d6474e
"SYS_gettid" => true,
+ // FIXME: These values have been changed
+ | "POSIX_MADV_DONTNEED" // to 4
+ | "RLIMIT_NLIMITS" // to 16
+ | "RLIM_NLIMITS" // to 16
+ | "IPPROTO_MAX" // to 263
+ | "F_GETLK" // to 5
+ | "F_SETLK" // to 6
+ | "F_SETLKW" // to 7
+ | "O_TMPFILE" // to 65
+ | "SIG_IGN" // -1
+ => true,
+
_ => false,
}
});
@@ -2124,13 +2643,272 @@ fn test_emscripten(target: &str) {
field == "_pad2" ||
field == "ssi_syscall" ||
field == "ssi_call_addr" ||
- field == "ssi_arch"))
+ field == "ssi_arch")) ||
+ // FIXME: After musl 1.1.24, it have only one field `sched_priority`,
+ // while other fields become reserved.
+ (struct_ == "sched_param" && [
+ "sched_ss_low_priority",
+ "sched_ss_repl_period",
+ "sched_ss_init_budget",
+ "sched_ss_max_repl",
+ ].contains(&field))
});
// FIXME: test linux like
cfg.generate("../src/lib.rs", "main.rs");
}
+fn test_neutrino(target: &str) {
+ assert!(target.contains("nto-qnx"));
+
+ let mut cfg = ctest_cfg();
+
+ headers! { cfg:
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "sys/elf.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "iconv.h",
+ "ifaddrs.h",
+ "limits.h",
+ "sys/link.h",
+ "locale.h",
+ "sys/malloc.h",
+ "rcheck/malloc.h",
+ "malloc.h",
+ "mqueue.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "netinet/ip_var.h",
+ "sys/poll.h",
+ "pthread.h",
+ "pwd.h",
+ "regex.h",
+ "resolv.h",
+ "sys/sched.h",
+ "sched.h",
+ "semaphore.h",
+ "shadow.h",
+ "signal.h",
+ "spawn.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/sysctl.h",
+ "sys/file.h",
+ "sys/inotify.h",
+ "sys/ioctl.h",
+ "sys/ipc.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/msg.h",
+ "sys/resource.h",
+ "sys/sem.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/swap.h",
+ "sys/termio.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "sys/time.h",
+ "ucontext.h",
+ "unistd.h",
+ "utime.h",
+ "utmp.h",
+ "wchar.h",
+ "aio.h",
+ "nl_types.h",
+ "langinfo.h",
+ "unix.h",
+ "nbutil.h",
+ "aio.h",
+ "net/bpf.h",
+ "net/if_dl.h",
+ "sys/syspage.h",
+
+ // TODO: The following header file doesn't appear as part of the default headers
+ // found in a standard installation of Neutrino 7.1 SDP. The structures/
+ // functions dependent on it are currently commented out.
+ //"sys/asyncmsg.h",
+ }
+
+ // Create and include a header file containing
+ // items which are not included in any official
+ // header file.
+ let internal_header = "internal.h";
+ let out_dir = env::var("OUT_DIR").unwrap();
+ cfg.header(internal_header);
+ cfg.include(&out_dir);
+ std::fs::write(
+ out_dir.to_owned() + "/" + internal_header,
+ "#ifndef __internal_h__
+ #define __internal_h__
+ void __my_thread_exit(const void **);
+ #endif",
+ )
+ .unwrap();
+
+ cfg.type_name(move |ty, is_struct, is_union| {
+ match ty {
+ // Just pass all these through, no need for a "struct" prefix
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr" | "Elf32_Shdr"
+ | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
+ | "Elf32_Chdr" | "Elf64_Chdr" | "aarch64_qreg_t" | "syspage_entry_info"
+ | "syspage_array_info" => ty.to_string(),
+
+ "Ioctl" => "int".to_string(),
+
+ t if is_union => format!("union {}", t),
+
+ t if t.ends_with("_t") => t.to_string(),
+
+ // put `struct` in front of all structs:.
+ t if is_struct => format!("struct {}", t),
+
+ t => t.to_string(),
+ }
+ });
+
+ cfg.field_name(move |_struct_, field| match field {
+ "type_" => "type".to_string(),
+
+ s => s.to_string(),
+ });
+
+ cfg.volatile_item(|i| {
+ use ctest::VolatileItemKind::*;
+ match i {
+ // The following fields are volatie but since we cannot express that in
+ // Rust types, we have to explicitly tell the checker about it here:
+ StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => true,
+ StructField(ref n, ref f) if n == "qtime_entry" && f == "nsec_tod_adjust" => true,
+ StructField(ref n, ref f) if n == "qtime_entry" && f == "nsec" => true,
+ StructField(ref n, ref f) if n == "qtime_entry" && f == "nsec_stable" => true,
+ StructField(ref n, ref f) if n == "intrspin" && f == "value" => true,
+ _ => false,
+ }
+ });
+
+ cfg.skip_type(move |ty| {
+ match ty {
+ // FIXME: `sighandler_t` type is incorrect, see:
+ // https://github.com/rust-lang/libc/issues/1359
+ "sighandler_t" => true,
+
+ // Does not exist in Neutrino
+ "locale_t" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
+ match ty {
+ "Elf64_Phdr" | "Elf32_Phdr" => true,
+
+ // FIXME: This is actually a union, not a struct
+ "sigval" => true,
+
+ // union
+ "_channel_connect_attr" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_const(move |name| {
+ match name {
+ // These signal "functions" are actually integer values that are casted to a fn ptr
+ // This causes the compiler to err because of "illegal cast of int to ptr".
+ "SIG_DFL" => true,
+ "SIG_IGN" => true,
+ "SIG_ERR" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_fn(move |name| {
+ // skip those that are manually verified
+ match name {
+ // FIXME: https://github.com/rust-lang/libc/issues/1272
+ "execv" | "execve" | "execvp" | "execvpe" => true,
+
+ // wrong signature
+ "signal" => true,
+
+ // wrong signature of callback ptr
+ "__cxa_atexit" => true,
+
+ // FIXME: Our API is unsound. The Rust API allows aliasing
+ // pointers, but the C API requires pointers not to alias.
+ // We should probably be at least using `&`/`&mut` here, see:
+ // https://github.com/gnzlbg/ctest/issues/68
+ "lio_listio" => true,
+
+ // 2 fields are actually unions which we're simply representing
+ // as structures.
+ "ChannelConnectAttr" => true,
+
+ // fields contains unions
+ "SignalKillSigval" => true,
+ "SignalKillSigval_r" => true,
+
+ // Not defined in any headers. Defined to work around a
+ // stack unwinding bug.
+ "__my_thread_exit" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_field_type(move |struct_, field| {
+ // sigval is actually a union, but we pretend it's a struct
+ struct_ == "sigevent" && field == "sigev_value" ||
+ // Anonymous structures
+ struct_ == "_idle_hook" && field == "time"
+ });
+
+ cfg.skip_field(move |struct_, field| {
+ (struct_ == "__sched_param" && field == "reserved") ||
+ (struct_ == "sched_param" && field == "reserved") ||
+ (struct_ == "sigevent" && field == "__sigev_un1") || // union
+ (struct_ == "sigevent" && field == "__sigev_un2") || // union
+ // sighandler_t type is super weird
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // does not exist
+ (struct_ == "syspage_entry" && field == "__reserved") ||
+ false // keep me for smaller diffs when something is added above
+ });
+
+ cfg.skip_static(move |name| (name == "__dso_handle"));
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
fn test_vxworks(target: &str) {
assert!(target.contains("vxworks"));
@@ -2209,9 +2987,7 @@ fn test_vxworks(target: &str) {
});
cfg.skip_field_type(move |struct_, field| match (struct_, field) {
- ("siginfo_t", "si_value")
- | ("stat", "st_size")
- | ("sigaction", "sa_u") => true,
+ ("siginfo_t", "si_value") | ("stat", "st_size") | ("sigaction", "sa_u") => true,
_ => false,
});
@@ -2264,6 +3040,7 @@ fn test_linux(target: &str) {
let mips = target.contains("mips");
let mips32 = mips && !target.contains("64");
let mips64 = mips && target.contains("64");
+ let ppc = target.contains("powerpc");
let ppc64 = target.contains("powerpc64");
let s390x = target.contains("s390x");
let sparc64 = target.contains("sparc64");
@@ -2271,7 +3048,7 @@ fn test_linux(target: &str) {
let x86_32 = target.contains("i686");
let x86_64 = target.contains("x86_64");
let aarch64_musl = target.contains("aarch64") && musl;
- let gnuabihf = target.contains("gnueabihf");
+ let gnueabihf = target.contains("gnueabihf");
let x86_64_gnux32 = target.contains("gnux32") && x86_64;
let riscv64 = target.contains("riscv64");
let uclibc = target.contains("uclibc");
@@ -2289,11 +3066,14 @@ fn test_linux(target: &str) {
"dlfcn.h",
"elf.h",
"fcntl.h",
+ "getopt.h",
"glob.h",
+ [gnu]: "gnu/libc-version.h",
"grp.h",
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -2375,9 +3155,9 @@ fn test_linux(target: &str) {
"errno.h",
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit
// ARM: https://bugzilla.redhat.com/show_bug.cgi?id=1116162
- // Also unavailable on gnuabihf with glibc 2.30.
+ // Also unavailable on gnueabihf with glibc 2.30.
// https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6b33f373c7b9199e00ba5fbafd94ac9bfb4337b1
- [(x86_64 || x86_32 || arm) && !gnuabihf]: "sys/io.h",
+ [(x86_64 || x86_32 || arm) && !gnueabihf]: "sys/io.h",
// `sys/reg.h` is only available on x86 and x86_64
[x86_64 || x86_32]: "sys/reg.h",
// sysctl system call is deprecated and not available on musl
@@ -2394,9 +3174,13 @@ fn test_linux(target: &str) {
cfg:
"asm/mman.h",
"linux/can.h",
+ "linux/can/raw.h",
+ // FIXME: requires kernel headers >= 5.4.1.
+ [!musl]: "linux/can/j1939.h",
"linux/dccp.h",
"linux/errqueue.h",
"linux/falloc.h",
+ "linux/filter.h",
"linux/fs.h",
"linux/futex.h",
"linux/genetlink.h",
@@ -2406,9 +3190,11 @@ fn test_linux(target: &str) {
"linux/if_ether.h",
"linux/if_tun.h",
"linux/input.h",
+ "linux/ipv6.h",
"linux/keyctl.h",
"linux/magic.h",
"linux/memfd.h",
+ "linux/mempolicy.h",
"linux/mman.h",
"linux/module.h",
"linux/net_tstamp.h",
@@ -2420,11 +3206,17 @@ fn test_linux(target: &str) {
"linux/netfilter_ipv6.h",
"linux/netfilter_ipv6/ip6_tables.h",
"linux/netlink.h",
+ // FIXME: requires Linux >= 5.6:
+ [!musl && !sparc64]: "linux/openat2.h",
+ [!musl]: "linux/ptrace.h",
"linux/quota.h",
"linux/random.h",
"linux/reboot.h",
"linux/rtnetlink.h",
+ "linux/sched.h",
"linux/seccomp.h",
+ "linux/sched.h",
+ "linux/sock_diag.h",
"linux/sockios.h",
"linux/uinput.h",
"linux/vm_sockets.h",
@@ -2446,10 +3238,12 @@ fn test_linux(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
- | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
- | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
- | "Elf64_Chdr" => ty.to_string(),
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr" | "Elf32_Shdr"
+ | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
+ | "Elf32_Chdr" | "Elf64_Chdr" => ty.to_string(),
+
+ "Ioctl" if gnu => "unsigned long".to_string(),
+ "Ioctl" => "int".to_string(),
t if is_union => format!("union {}", t),
@@ -2472,7 +3266,7 @@ fn test_linux(target: &str) {
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
s.replace("e_nsec", ".tv_nsec")
}
- // FIXME: epoll_event.data is actuall a union in C, but in Rust
+ // FIXME: epoll_event.data is actually a union in C, but in Rust
// it is only a u64 because we only expose one field
// http://man7.org/linux/man-pages/man2/epoll_wait.2.html
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
@@ -2505,6 +3299,16 @@ fn test_linux(target: &str) {
// (`c_uint`) and this clashes with the type of the `rlimit` APIs
// which expect a `c_int` even though both are ABI compatible.
"__rlimit_resource_t" => true,
+ // on Linux, this is a volatile int
+ "pthread_spinlock_t" => true,
+
+ // For internal use only, to define architecture specific ioctl constants with a libc specific type.
+ "Ioctl" => true,
+
+ // FIXME: requires >= 5.4.1 kernel headers
+ "pgn_t" if musl => true,
+ "priority_t" if musl => true,
+ "name_t" if musl => true,
_ => false,
}
@@ -2518,6 +3322,11 @@ fn test_linux(target: &str) {
if (musl || sparc64) && ty.starts_with("uinput_") {
return true;
}
+ // FIXME(https://github.com/rust-lang/libc/issues/1558): passing by
+ // value corrupts the value for reasons not understood.
+ if (gnu && sparc64) && ty == "ip_mreqn" {
+ return true;
+ }
match ty {
// These cannot be tested when "resolv.h" is included and are tested
// in the `linux_elf.rs` file.
@@ -2553,8 +3362,21 @@ fn test_linux(target: &str) {
// which is absent in musl, has to be defined.
"__exit_status" if musl => true,
- // FIXME: CI's kernel header version is old.
- "sockaddr_can" => true,
+ // clone_args might differ b/w libc versions
+ "clone_args" => true,
+
+ // Might differ between kernel versions
+ "open_how" => true,
+
+ // FIXME: requires >= 5.4.1 kernel headers
+ "j1939_filter" if musl => true,
+
+ // FIXME: requires >= 5.4 kernel headers
+ "sockaddr_can" if musl => true,
+
+ // FIXME: Unignore once we update Ubuntu to 22.04
+ "mallinfo2" if sparc64 => true,
+ "ptrace_rseq_configuration" if sparc64 => true,
_ => false,
}
@@ -2594,6 +3416,15 @@ fn test_linux(target: &str) {
return true;
}
}
+ if musl || sparc64 {
+ // FIXME: Requires >= 5.4.1 kernel headers
+ if name.starts_with("J1939")
+ || name.starts_with("SO_J1939")
+ || name.starts_with("SCM_J1939")
+ {
+ return true;
+ }
+ }
match name {
// These constants are not available if gnu headers have been included
// and can therefore not be tested here
@@ -2612,9 +3443,9 @@ fn test_linux(target: &str) {
| "F_SEAL_SHRINK"
| "F_SEAL_GROW"
| "F_SEAL_WRITE" => true,
-
- // Require Linux kernel 5.1:
- "F_SEAL_FUTURE_WRITE" => true,
+ // The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests
+ // because including `linux/if_arp.h` causes some conflicts:
+ "ARPHRD_CAN" => true,
// FIXME: deprecated: not available in any header
// See: https://github.com/rust-lang/libc/issues/1356
@@ -2626,7 +3457,12 @@ fn test_linux(target: &str) {
// FIXME: conflicts with glibc headers and is tested in
// `linux_termios.rs` below:
- "BOTHER" => true,
+ | "BOTHER"
+ | "IBSHIFT"
+ | "TCGETS2"
+ | "TCSETS2"
+ | "TCSETSW2"
+ | "TCSETSF2" => true,
// FIXME: on musl the pthread types are defined a little differently
// - these constants are used by the glibc implementation.
@@ -2639,9 +3475,6 @@ fn test_linux(target: &str) {
// deprecated: not available from Linux kernel 5.6:
"VMADDR_CID_RESERVED" => true,
- // Require Linux kernel 5.6:
- "VMADDR_CID_LOCAL" => true,
-
// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
| "IPPROTO_MAX"
| "IPPROTO_MPTCP" => true,
@@ -2654,29 +3487,20 @@ fn test_linux(target: &str) {
// Not yet implemented on sparc64
"SYS_clone3" if mips | sparc64 => true,
- // FIXME: these syscalls were added in Linux 5.9 or later
- // and are currently not included in the glibc headers.
- | "SYS_close_range"
- | "SYS_openat2"
- | "SYS_pidfd_getfd"
- | "SYS_faccessat2"
- | "SYS_process_madvise"
- | "SYS_epoll_pwait2"
- | "SYS_mount_setattr" => true,
+ // FIXME: Not defined on ARM, gnueabihf, MIPS, musl, PowerPC, riscv64, s390x, and sparc64.
+ "SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true,
- // Requires more recent kernel headers:
- | "IFLA_PROP_LIST"
- | "IFLA_ALT_IFNAME"
- | "IFLA_PERM_ADDRESS"
- | "IFLA_PROTO_DOWN_REASON" => true,
+ // FIXME: Added in Linux 5.16
+ // https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49
+ "SYS_futex_waitv" => true,
- // FIXME: They require recent kernel header:
- | "CAN_J1939"
- | "CAN_RAW_FILTER_MAX"
- | "CAN_NPROTO" => true,
+ // FIXME: Added in Linux 5.17
+ // https://github.com/torvalds/linux/commit/c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0
+ "SYS_set_mempolicy_home_node" => true,
- // FIXME: Requires recent kernel headers (5.8):
- "STATX_MNT_ID" => true,
+ // FIXME: Added in Linux 5.18
+ // https://github.com/torvalds/linux/commit/8b5413647262dda8d8d0e07e14ea1de9ac7cf0b2
+ "NFQA_PRIORITY" => true,
// FIXME: requires more recent kernel headers on CI
| "UINPUT_VERSION"
@@ -2684,6 +3508,122 @@ fn test_linux(target: &str) {
| "SW_CNT"
if mips || ppc64 || riscv64 || sparc64 => true,
+ // FIXME: Not currently available in headers on ARM, MIPS and musl.
+ "NETLINK_GET_STRICT_CHK" if arm || mips || musl => true,
+
+ // kernel constants not available in uclibc 1.0.34
+ | "EXTPROC"
+ | "FAN_MARK_FILESYSTEM"
+ | "FAN_MARK_INODE"
+ | "IPPROTO_BEETPH"
+ | "IPPROTO_MPLS"
+ | "IPV6_HDRINCL"
+ | "IPV6_MULTICAST_ALL"
+ | "IPV6_PMTUDISC_INTERFACE"
+ | "IPV6_PMTUDISC_OMIT"
+ | "IPV6_ROUTER_ALERT_ISOLATE"
+ | "PACKET_MR_UNICAST"
+ | "RUSAGE_THREAD"
+ | "SHM_EXEC"
+ | "UDP_GRO"
+ | "UDP_SEGMENT"
+ if uclibc => true,
+
+ // headers conflicts with linux/pidfd.h
+ "PIDFD_NONBLOCK" => true,
+
+ // is a private value for kernel usage normally
+ "FUSE_SUPER_MAGIC" => true,
+
+ // linux 5.17 min
+ "PR_SET_VMA" | "PR_SET_VMA_ANON_NAME" => true,
+
+ // present in recent kernels only
+ "PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true,
+
+ // Added in Linux 5.14
+ "FUTEX_LOCK_PI2" => true,
+
+ // FIXME: Parts of netfilter/nfnetlink*.h require more recent kernel headers:
+ | "RTNLGRP_MCTP_IFADDR" // linux v5.17+
+ | "RTNLGRP_TUNNEL" // linux v5.18+
+ | "RTNLGRP_STATS" // linux v5.18+
+ => true,
+
+ // FIXME: The below is no longer const in glibc 2.34:
+ // https://github.com/bminor/glibc/commit/5d98a7dae955bafa6740c26eaba9c86060ae0344
+ | "PTHREAD_STACK_MIN"
+ | "SIGSTKSZ"
+ | "MINSIGSTKSZ"
+ if gnu => true,
+
+ // FIXME: Linux >= 5.16 changed its value:
+ // https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96
+ "NF_NETDEV_NUMHOOKS" => true,
+
+ // FIXME: requires Linux >= 5.6:
+ | "RESOLVE_BENEATH"
+ | "RESOLVE_CACHED"
+ | "RESOLVE_IN_ROOT"
+ | "RESOLVE_NO_MAGICLINKS"
+ | "RESOLVE_NO_SYMLINKS"
+ | "RESOLVE_NO_XDEV" if musl || sparc64 => true,
+
+ // FIXME: requires Linux >= 5.4:
+ | "CAN_J1939"
+ | "CAN_NPROTO" if musl || sparc64 => true,
+
+ // FIXME: requires Linux >= 5.6
+ "GRND_INSECURE" if musl || sparc64 => true,
+
+ // FIXME: requires Linux >= 5.7:
+ "MREMAP_DONTUNMAP" if musl || sparc64 => true,
+
+ // FIXME: Requires more recent kernel headers (5.9 / 5.11):
+ | "CLOSE_RANGE_UNSHARE"
+ | "CLOSE_RANGE_CLOEXEC" if musl || sparc64 => true,
+
+ // FIXME: requires Linux >= 5.12:
+ "MPOL_F_NUMA_BALANCING" if musl || sparc64 => true,
+
+ // FIXME: Requires more recent kernel headers
+ | "NFNL_SUBSYS_COUNT" // bumped in v5.14
+ | "NFNL_SUBSYS_HOOK" // v5.14+
+ | "NFULA_VLAN" // v5.4+
+ | "NFULA_L2HDR" // v5.4+
+ | "NFULA_VLAN_PROTO" // v5.4+
+ | "NFULA_VLAN_TCI" // v5.4+
+ | "NFULA_VLAN_UNSPEC" // v5.4+
+ | "RTNLGRP_NEXTHOP" // linux v5.3+
+ | "RTNLGRP_BRVLAN" // linux v5.6+
+ if musl || sparc64 => true,
+
+ // FIXME: Unignore once we update Ubuntu to 22.04
+ | "VMADDR_CID_LOCAL"
+ | "STATX_MNT_ID"
+ | "SYS_close_range"
+ | "SYS_openat2"
+ | "SYS_pidfd_getfd"
+ | "SYS_faccessat2"
+ | "SYS_process_madvise"
+ | "SYS_epoll_pwait2"
+ | "SYS_mount_setattr"
+ | "SYS_quotactl_fd"
+ | "SYS_landlock_create_ruleset"
+ | "SYS_landlock_add_rule"
+ | "SYS_landlock_restrict_self"
+ | "SYS_process_mrelease"
+ | "IFLA_PROP_LIST"
+ | "IFLA_ALT_IFNAME"
+ | "IFLA_PERM_ADDRESS"
+ | "IFLA_PROTO_DOWN_REASON"
+ | "STATX_ATTR_MOUNT_ROOT"
+ | "STATX_ATTR_VERITY"
+ | "STATX_ATTR_DAX"
+ if sparc64 => true,
+ // Added in Linux 5.13
+ "PTRACE_GET_RSEQ_CONFIGURATION" if sparc64 => true,
+
_ => false,
}
});
@@ -2756,6 +3696,39 @@ fn test_linux(target: &str) {
// FIXME: This needs musl 1.2.2 or later.
"gettid" if musl => true,
+ // Needs glibc 2.33 or later.
+ "mallinfo2" => true,
+
+ "reallocarray" if musl => true,
+
+ // Not defined in uclibc as of 1.0.34
+ "gettid" if uclibc => true,
+
+ // Needs musl 1.2.3 or later.
+ "pthread_getname_np" if musl => true,
+
+ // pthread_sigqueue uses sigval, which was initially declared
+ // as a struct but should be defined as a union. However due
+ // to the issues described here: https://github.com/rust-lang/libc/issues/2816
+ // it can't be changed from struct.
+ "pthread_sigqueue" => true,
+
+ // There are two versions of basename(3) on Linux with glibc, see
+ //
+ // https://man7.org/linux/man-pages/man3/basename.3.html
+ //
+ // If libgen.h is included, then the POSIX version will be available;
+ // If _GNU_SOURCE is defined and string.h is included, then the GNU one
+ // will be used.
+ //
+ // libc exposes both of them, providing a prefix to differentiate between
+ // them.
+ //
+ // Because the name with prefix is not a valid symbol in C, we have to
+ // skip the tests.
+ "posix_basename" if gnu => true,
+ "gnu_basename" if gnu => true,
+
_ => false,
}
});
@@ -2782,9 +3755,7 @@ fn test_linux(target: &str) {
match i {
// aio_buf is a volatile void** but since we cannot express that in
// Rust types, we have to explicitly tell the checker about it here:
- StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
- true
- }
+ StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => true,
_ => false,
}
});
@@ -2821,7 +3792,16 @@ fn test_linux(target: &str) {
// FIXME: It now takes mode_t since glibc 2.31 on some targets.
(struct_ == "ipc_perm" && field == "mode"
&& ((x86_64 || i686 || arm || riscv64) && gnu || x86_64_gnux32)
- )
+ ) ||
+ // the `u` field is in fact an anonymous union
+ (gnu && struct_ == "ptrace_syscall_info" && (field == "u" || field == "pad")) ||
+ // the vregs field is a `__uint128_t` C's type.
+ (struct_ == "user_fpsimd_struct" && field == "vregs") ||
+ // Linux >= 5.11 tweaked the `svm_zero` field of the `sockaddr_vm` struct.
+ // https://github.com/torvalds/linux/commit/dc8eeef73b63ed8988224ba6b5ed19a615163a7f
+ (struct_ == "sockaddr_vm" && field == "svm_zero") ||
+ // the `ifr_ifru` field is an anonymous union
+ (struct_ == "ifreq" && field == "ifr_ifru")
});
cfg.skip_roundtrip(move |s| match s {
@@ -2832,11 +3812,7 @@ fn test_linux(target: &str) {
// FIXME: This is actually a union.
"fpreg_t" if s390x => true,
- "sockaddr_un" | "sembuf" | "ff_constant_effect"
- if mips32 && (gnu || musl) =>
- {
- true
- }
+ "sockaddr_un" | "sembuf" | "ff_constant_effect" if mips32 && (gnu || musl) => true,
"ipv6_mreq"
| "ip_mreq_source"
| "sockaddr_in6"
@@ -2874,6 +3850,7 @@ fn test_linux(target: &str) {
// This function tests APIs that are incompatible to test when other APIs
// are included (e.g. because including both sets of headers clashes)
fn test_linux_like_apis(target: &str) {
+ let gnu = target.contains("gnu");
let musl = target.contains("musl");
let linux = target.contains("linux");
let emscripten = target.contains("emscripten");
@@ -2912,9 +3889,8 @@ fn test_linux_like_apis(target: &str) {
.skip_fn(|_| true)
.skip_const(move |name| match name {
// test fcntl constants:
- "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS"
- | "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
- | "F_SEAL_WRITE" => false,
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" | "F_SEAL_SEAL" | "F_SEAL_SHRINK"
+ | "F_SEAL_GROW" | "F_SEAL_WRITE" => false,
_ => true,
})
.type_name(move |ty, is_struct, is_union| match ty {
@@ -2930,12 +3906,19 @@ fn test_linux_like_apis(target: &str) {
// test termios
let mut cfg = ctest_cfg();
cfg.header("asm/termbits.h");
+ cfg.header("linux/termios.h");
cfg.skip_type(|_| true)
.skip_static(|_| true)
.skip_fn(|_| true)
- .skip_const(|c| c != "BOTHER")
+ .skip_const(|c| match c {
+ "BOTHER" | "IBSHIFT" => false,
+ "TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => false,
+ _ => true,
+ })
.skip_struct(|s| s != "termios2")
.type_name(move |ty, is_struct, is_union| match ty {
+ "Ioctl" if gnu => "unsigned long".to_string(),
+ "Ioctl" => "int".to_string(),
t if is_struct => format!("struct {}", t),
t if is_union => format!("union {}", t),
t => t.to_string(),
@@ -2980,7 +3963,6 @@ fn test_linux_like_apis(target: &str) {
cfg.header("elf.h");
cfg.skip_fn(|_| true)
.skip_static(|_| true)
- .skip_fn(|_| true)
.skip_const(|_| true)
.type_name(move |ty, _is_struct, _is_union| ty.to_string())
.skip_struct(move |ty| match ty {
@@ -2993,6 +3975,21 @@ fn test_linux_like_apis(target: &str) {
});
cfg.generate("../src/lib.rs", "linux_elf.rs");
}
+
+ if linux || android {
+ // Test `ARPHRD_CAN`.
+ let mut cfg = ctest_cfg();
+ cfg.header("linux/if_arp.h");
+ cfg.skip_fn(|_| true)
+ .skip_static(|_| true)
+ .skip_const(move |name| match name {
+ "ARPHRD_CAN" => false,
+ _ => true,
+ })
+ .skip_struct(|_| true)
+ .skip_type(|_| true);
+ cfg.generate("../src/lib.rs", "linux_if_arp.rs");
+ }
}
fn which_freebsd() -> Option {
@@ -3010,6 +4007,7 @@ fn which_freebsd() -> Option {
s if s.starts_with("11") => Some(11),
s if s.starts_with("12") => Some(12),
s if s.starts_with("13") => Some(13),
+ s if s.starts_with("14") => Some(14),
_ => None,
}
}
@@ -3020,6 +4018,8 @@ fn test_haiku(target: &str) {
let mut cfg = ctest_cfg();
cfg.flag("-Wno-deprecated-declarations");
cfg.define("__USE_GNU", Some("1"));
+ cfg.define("_GNU_SOURCE", None);
+ cfg.language(ctest::Lang::CXX);
// POSIX API
headers! { cfg:
@@ -3063,7 +4063,6 @@ fn test_haiku(target: &str) {
"net/if_types.h",
"net/route.h",
"netdb.h",
- "netinet/icmp6.h",
"netinet/in.h",
"netinet/ip.h",
"netinet/ip6.h",
@@ -3122,6 +4121,7 @@ fn test_haiku(target: &str) {
"uchar.h",
"unistd.h",
"utime.h",
+ "utmpx.h",
"wchar.h",
"wchar_t.h",
"wctype.h"
@@ -3129,6 +4129,9 @@ fn test_haiku(target: &str) {
// BSD Extensions
headers! { cfg:
+ "ifaddrs.h",
+ "libutil.h",
+ "link.h",
"pty.h",
}
@@ -3141,6 +4144,8 @@ fn test_haiku(target: &str) {
"kernel/fs_query.h",
"kernel/fs_volume.h",
"kernel/image.h",
+ "kernel/scheduler.h",
+ "storage/FindDirectory.h",
"storage/StorageDefs.h",
"support/Errors.h",
"support/SupportDefs.h",
@@ -3148,6 +4153,9 @@ fn test_haiku(target: &str) {
}
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
// FIXME: actually a union
"sigval" => true,
@@ -3165,6 +4173,14 @@ fn test_haiku(target: &str) {
// is sized as the _POSIX_MAX_PATH, so that path names will fit in
// newly allocated dirent objects. This breaks the automated tests.
"dirent" => true,
+ // The following structs contain function pointers, which cannot be initialized
+ // with mem::zeroed(), so skip the automated test
+ "image_info" | "thread_info" => true,
+
+ "Elf64_Phdr" => true,
+
+ // is an union
+ "cpuid_info" => true,
_ => false,
}
@@ -3198,6 +4214,14 @@ fn test_haiku(target: &str) {
"mlock" | "munlock" => true,
// returns const char * on Haiku
"strsignal" => true,
+ // uses an enum as a parameter argument, which is incorrectly
+ // translated into a struct argument
+ "find_path" => true,
+
+ "get_cpuid" => true,
+
+ // uses varargs parameter
+ "ioctl" => true,
_ => false,
}
@@ -3206,12 +4230,12 @@ fn test_haiku(target: &str) {
cfg.skip_const(move |name| {
match name {
// FIXME: these constants do not exist on Haiku
- "DT_UNKNOWN" | "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK"
- | "DT_REG" | "DT_LNK" | "DT_SOCK" => true,
+ "DT_UNKNOWN" | "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK"
+ | "DT_SOCK" => true,
"USRQUOTA" | "GRPQUOTA" => true,
"SIGIOT" => true,
- "ARPOP_REQUEST" | "ARPOP_REPLY" | "ATF_COM" | "ATF_PERM"
- | "ATF_PUBL" | "ATF_USETRAILERS" => true,
+ "ARPOP_REQUEST" | "ARPOP_REPLY" | "ATF_COM" | "ATF_PERM" | "ATF_PUBL"
+ | "ATF_USETRAILERS" => true,
// Haiku does not have MAP_FILE, but rustc requires it
"MAP_FILE" => true,
// The following does not exist on Haiku but is required by
@@ -3247,6 +4271,10 @@ fn test_haiku(target: &str) {
("sem_t", "named_sem_id") => true,
("sigaction", "sa_sigaction") => true,
("sigevent", "sigev_value") => true,
+ ("fpu_state", "_fpreg") => true,
+ // these fields have a simplified data definition in libc
+ ("fpu_state", "_xmm") => true,
+ ("savefpu", "_fp_ymm") => true,
// skip these enum-type fields
("thread_info", "state") => true,
@@ -3264,11 +4292,13 @@ fn test_haiku(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "area_info" | "port_info" | "port_message_info" | "team_info"
- | "sem_info" | "team_usage_info" | "thread_info" | "cpu_info"
- | "system_info" | "object_wait_info" | "image_info"
- | "attr_info" | "index_info" | "fs_info" | "FILE" | "DIR"
- | "Dl_info" => ty.to_string(),
+ "area_info" | "port_info" | "port_message_info" | "team_info" | "sem_info"
+ | "team_usage_info" | "thread_info" | "cpu_info" | "system_info"
+ | "object_wait_info" | "image_info" | "attr_info" | "index_info" | "fs_info"
+ | "FILE" | "DIR" | "Dl_info" => ty.to_string(),
+
+ // enums don't need a prefix
+ "directory_which" | "path_base_directory" => ty.to_string(),
// is actually a union
"sigval" => format!("union sigval"),
diff --git a/libc-test/semver/README.md b/libc-test/semver/README.md
new file mode 100644
index 0000000000000..624387172d00a
--- /dev/null
+++ b/libc-test/semver/README.md
@@ -0,0 +1,17 @@
+# Supported API by libc
+
+These files are read by [`build.rs`](../build.rs) and turned into tests to
+ensure that APIs aren't removed between libc releases.
+
+## File order
+
+Files are including in the following order:
+ * Family, e.g. `unix.txt`. NOTE: Windows is skipped here and includes as OS
+ name below.
+ * Vendor, e.g. `apple.txt`. This allows us to have a single file with system
+ calls shared between multiple OSs, e.g. `ios.txt`, `macos.txt` share the same
+ kernel.
+ * OS, e.g `linux.txt`, `macos.txt`, `windows.txt`.
+ * Architecture specific system calls, e.g. `linux-x86_64.txt` or
+ `linux-aarch64.txt`.
+ * Target environment, e.g. `windows-mscv.txt` or `windows-gnu.txt`.
diff --git a/libc-test/semver/TODO-linux.txt b/libc-test/semver/TODO-linux.txt
new file mode 100644
index 0000000000000..7855498efafcf
--- /dev/null
+++ b/libc-test/semver/TODO-linux.txt
@@ -0,0 +1,84 @@
+# The following symbols are not not available in some combinations of
+# musl/gnu/android and/or architecture.
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPING_OPT_STATS
+SCM_TIMESTAMPING_PKTINFO
+SCM_TIMESTAMPNS
+SCM_TXTIME
+SCM_WIFI_STATUS
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_ATTACH_REUSEPORT_CBPF
+SO_ATTACH_REUSEPORT_EBPF
+SO_BINDTOIFINDEX
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_CNX_ADVICE
+SO_COOKIE
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_DETACH_REUSEPORT_BPF
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_INCOMING_NAPI_ID
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_MEMINFO
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERGROUPS
+SO_PEERNAME
+SO_RCVTIMEO_NEW
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_SNDTIMEO_NEW
+SO_STYLE
+SO_TIMESTAMPING_NEW
+SO_TIMESTAMPNS
+SO_TIMESTAMPNS_NEW
+SO_TIMESTAMP_NEW
+SO_TXTIME
+SO_WIFI_STATUS
+SO_ZEROCOPY
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_create_module
+SYS_fadvise64
+SYS_fstatat64
+SYS_get_kernel_syms
+SYS_get_thread_area
+SYS_getrlimit
+SYS_migrate_pages
+SYS_mmap
+SYS_nfsservctl
+SYS_pread64
+SYS_pwrite64
+SYS_query_module
+SYS_set_thread_area
+SYS_uselib
+fsblkcnt64_t
+fsfilcnt64_t
+getrandom
+sysctl
+termios2
diff --git a/libc-test/semver/TODO-unix.txt b/libc-test/semver/TODO-unix.txt
new file mode 100644
index 0000000000000..4d6874d90c874
--- /dev/null
+++ b/libc-test/semver/TODO-unix.txt
@@ -0,0 +1,5 @@
+# These symbols are missing for the targets:
+# * asmjs-unknown-emscripten
+getpwuid_r
+pthread_atfork
+pthread_sigmask
diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt
new file mode 100644
index 0000000000000..7a8868aa2c5de
--- /dev/null
+++ b/libc-test/semver/android-aarch64.txt
@@ -0,0 +1,15 @@
+HWCAP2_DCPODP
+HWCAP2_FLAGM2
+HWCAP2_FRINT
+HWCAP2_SVE2
+HWCAP2_SVEAES
+HWCAP2_SVEBITPERM
+HWCAP2_SVEPMULL
+HWCAP2_SVESHA3
+HWCAP2_SVESM4
+SYS_arch_specific_syscall
+SYS_syscalls
+SYS_fcntl
+__system_property_wait
+user_regs_struct
+user_fpsimd_struct
diff --git a/libc-test/semver/android-arm.txt b/libc-test/semver/android-arm.txt
new file mode 100644
index 0000000000000..fe1ce5bba1c5d
--- /dev/null
+++ b/libc-test/semver/android-arm.txt
@@ -0,0 +1,121 @@
+NGREG
+PTRACE_GETFPREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETREGS
+REG_R0
+REG_R1
+REG_R10
+REG_R11
+REG_R12
+REG_R13
+REG_R14
+REG_R15
+REG_R2
+REG_R3
+REG_R4
+REG_R5
+REG_R6
+REG_R7
+REG_R8
+REG_R9
+SYS_accept
+SYS_access
+SYS_arm_fadvise64_64
+SYS_arm_sync_file_range
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_chown32
+SYS_creat
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fchown32
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftruncate64
+SYS_futimesat
+SYS_getdents
+SYS_getegid32
+SYS_geteuid32
+SYS_getgid32
+SYS_getgroups32
+SYS_getpgrp
+SYS_getresgid32
+SYS_getresuid32
+SYS_getuid32
+SYS_inotify_init
+SYS_lchown
+SYS_lchown32
+SYS_link
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_rmdir
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_setfsgid32
+SYS_setfsuid32
+SYS_setgid32
+SYS_setgroups32
+SYS_setregid32
+SYS_setresgid32
+SYS_setresuid32
+SYS_setreuid32
+SYS_setuid32
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sigaction
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_symlink
+SYS_sysfs
+SYS_truncate64
+SYS_ugetrlimit
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utimes
+SYS_vfork
+SYS_vserver
+__c_anonymous_uc_sigmask
+__c_anonymous_uc_sigmask_with_padding
+greg_t
+sigcontext
+time64_t
+timegm64
diff --git a/libc-test/semver/android-i686.txt b/libc-test/semver/android-i686.txt
new file mode 100644
index 0000000000000..eb6ecadba60b5
--- /dev/null
+++ b/libc-test/semver/android-i686.txt
@@ -0,0 +1,4 @@
+__c_anonymous_uc_sigmask
+__c_anonymous_uc_sigmask_with_padding
+time64_t
+timegm64
diff --git a/libc-test/semver/android-x86_64.txt b/libc-test/semver/android-x86_64.txt
new file mode 100644
index 0000000000000..c4bb87bccb66d
--- /dev/null
+++ b/libc-test/semver/android-x86_64.txt
@@ -0,0 +1,65 @@
+EFLAGS
+FS_BASE
+GS_BASE
+ORIG_RAX
+R10
+R11
+R12
+R13
+R14
+R15
+R8
+R9
+RAX
+RBP
+RBX
+RCX
+RDI
+RDX
+REG_CR2
+REG_CSGSFS
+REG_OLDMASK
+REG_R10
+REG_R11
+REG_R12
+REG_R13
+REG_R14
+REG_R15
+REG_R8
+REG_R9
+REG_RAX
+REG_RBP
+REG_RBX
+REG_RCX
+REG_RDI
+REG_RDX
+REG_RIP
+REG_RSI
+REG_RSP
+RIP
+RSI
+RSP
+SYS_accept
+SYS_arch_prctl
+SYS_epoll_ctl_old
+SYS_epoll_wait_old
+SYS_kexec_file_load
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_security
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_tuxcall
+SYS_vserver
+__c_anonymous_uc_sigmask
+_libc_fpxreg
+_libc_xmmreg
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
new file mode 100644
index 0000000000000..c2c417a2da2b6
--- /dev/null
+++ b/libc-test/semver/android.txt
@@ -0,0 +1,3606 @@
+ABS_CNT
+ABS_MAX
+ADDR_COMPAT_LAYOUT
+ADDR_LIMIT_32BIT
+ADDR_LIMIT_3GB
+ADDR_NO_RANDOMIZE
+ADFS_SUPER_MAGIC
+AFFS_SUPER_MAGIC
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IEEE802154
+AF_INET
+AF_INET6
+AF_IPX
+AF_IRDA
+AF_ISDN
+AF_IUCV
+AF_KEY
+AF_LLC
+AF_LOCAL
+AF_NETBEUI
+AF_NETLINK
+AF_NETROM
+AF_NFC
+AF_PACKET
+AF_PHONET
+AF_PPPOX
+AF_RDS
+AF_ROSE
+AF_ROUTE
+AF_RXRPC
+AF_SECURITY
+AF_SNA
+AF_TIPC
+AF_UNIX
+AF_UNSPEC
+AF_VSOCK
+AF_WANPIPE
+AF_X25
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_DEFAULT
+AI_MASK
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_V4MAPPED
+AI_V4MAPPED_CFG
+ALG_OP_DECRYPT
+ALG_OP_ENCRYPT
+ALG_SET_AEAD_ASSOCLEN
+ALG_SET_AEAD_AUTHSIZE
+ALG_SET_IV
+ALG_SET_KEY
+ALG_SET_OP
+ARPHRD_ADAPT
+ARPHRD_APPLETLK
+ARPHRD_ARCNET
+ARPHRD_ASH
+ARPHRD_ATM
+ARPHRD_AX25
+ARPHRD_BIF
+ARPHRD_CAN
+ARPHRD_CHAOS
+ARPHRD_CISCO
+ARPHRD_CSLIP
+ARPHRD_CSLIP6
+ARPHRD_DDCMP
+ARPHRD_DLCI
+ARPHRD_ECONET
+ARPHRD_EETHER
+ARPHRD_ETHER
+ARPHRD_EUI64
+ARPHRD_FCAL
+ARPHRD_FCFABRIC
+ARPHRD_FCPL
+ARPHRD_FCPP
+ARPHRD_FDDI
+ARPHRD_FRAD
+ARPHRD_HDLC
+ARPHRD_HIPPI
+ARPHRD_HWX25
+ARPHRD_IEEE1394
+ARPHRD_IEEE802
+ARPHRD_IEEE80211
+ARPHRD_IEEE80211_PRISM
+ARPHRD_IEEE80211_RADIOTAP
+ARPHRD_IEEE802154
+ARPHRD_IEEE802_TR
+ARPHRD_INFINIBAND
+ARPHRD_IPDDP
+ARPHRD_IPGRE
+ARPHRD_IRDA
+ARPHRD_LAPB
+ARPHRD_LOCALTLK
+ARPHRD_LOOPBACK
+ARPHRD_METRICOM
+ARPHRD_NETROM
+ARPHRD_NONE
+ARPHRD_PIMREG
+ARPHRD_PPP
+ARPHRD_PRONET
+ARPHRD_RAWHDLC
+ARPHRD_ROSE
+ARPHRD_RSRVD
+ARPHRD_SIT
+ARPHRD_SKIP
+ARPHRD_SLIP
+ARPHRD_SLIP6
+ARPHRD_TUNNEL
+ARPHRD_TUNNEL6
+ARPHRD_VOID
+ARPHRD_X25
+ARPOP_InREPLY
+ARPOP_InREQUEST
+ARPOP_NAK
+ARPOP_REPLY
+ARPOP_REQUEST
+ARPOP_RREPLY
+ARPOP_RREQUEST
+ATF_COM
+ATF_DONTPUB
+ATF_NETMASK
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EMPTY_PATH
+AT_FDCWD
+AT_NO_AUTOMOUNT
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B0
+B1000000
+B110
+B115200
+B1152000
+B1200
+B134
+B150
+B1500000
+B1800
+B19200
+B200
+B2000000
+B230400
+B2400
+B2500000
+B300
+B3000000
+B3500000
+B38400
+B4000000
+B460800
+B4800
+B50
+B500000
+B57600
+B576000
+B600
+B75
+B921600
+B9600
+BOTHER
+BRKINT
+BS0
+BS1
+BSDLY
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+BUS_MCEERR_AR
+BUS_MCEERR_AO
+CBAUD
+CBAUDEX
+CIBAUD
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCAL
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+CLONE_NEWCGROUP
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWNS
+CLONE_NEWPID
+CLONE_NEWUSER
+CLONE_NEWUTS
+CLONE_PARENT
+CLONE_PARENT_SETTID
+CLONE_PIDFD
+CLONE_PTRACE
+CLONE_SETTLS
+CLONE_SIGHAND
+CLONE_SYSVSEM
+CLONE_THREAD
+CLONE_UNTRACED
+CLONE_VFORK
+CLONE_VM
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CMSPAR
+CODA_SUPER_MAGIC
+CPU_CLR
+CPU_EQUAL
+CPU_ISSET
+CPU_SET
+CPU_SETSIZE
+CPU_ZERO
+CR0
+CR1
+CR2
+CR3
+CRAMFS_MAGIC
+CRDLY
+CREAD
+CRTSCTS
+CS5
+CS6
+CS7
+CS8
+CSIZE
+CSTOPB
+CTRL_ATTR_FAMILY_ID
+CTRL_ATTR_FAMILY_NAME
+CTRL_ATTR_HDRSIZE
+CTRL_ATTR_MAXATTR
+CTRL_ATTR_MCAST_GROUPS
+CTRL_ATTR_MCAST_GRP_ID
+CTRL_ATTR_MCAST_GRP_NAME
+CTRL_ATTR_MCAST_GRP_UNSPEC
+CTRL_ATTR_OPS
+CTRL_ATTR_OP_FLAGS
+CTRL_ATTR_OP_ID
+CTRL_ATTR_OP_UNSPEC
+CTRL_ATTR_UNSPEC
+CTRL_ATTR_VERSION
+CTRL_CMD_DELFAMILY
+CTRL_CMD_DELMCAST_GRP
+CTRL_CMD_DELOPS
+CTRL_CMD_GETFAMILY
+CTRL_CMD_GETMCAST_GRP
+CTRL_CMD_GETOPS
+CTRL_CMD_NEWFAMILY
+CTRL_CMD_NEWMCAST_GRP
+CTRL_CMD_NEWOPS
+CTRL_CMD_UNSPEC
+
+DCCP_SERVICE_LIST_MAX_LEN
+DCCP_SOCKOPT_AVAILABLE_CCIDS
+DCCP_SOCKOPT_CCID
+DCCP_SOCKOPT_CCID_RX_INFO
+DCCP_SOCKOPT_CCID_TX_INFO
+DCCP_SOCKOPT_CHANGE_L
+DCCP_SOCKOPT_CHANGE_R
+DCCP_SOCKOPT_GET_CUR_MPS
+DCCP_SOCKOPT_PACKET_SIZE
+DCCP_SOCKOPT_QPOLICY_ID
+DCCP_SOCKOPT_QPOLICY_TXQLEN
+DCCP_SOCKOPT_RECV_CSCOV
+DCCP_SOCKOPT_RX_CCID
+DCCP_SOCKOPT_SEND_CSCOV
+DCCP_SOCKOPT_SERVER_TIMEWAIT
+DCCP_SOCKOPT_SERVICE
+DCCP_SOCKOPT_TX_CCID
+DIR
+DT_BLK
+DT_CHR
+DT_DIR
+DT_FIFO
+DT_LNK
+DT_REG
+DT_SOCK
+DT_UNKNOWN
+Dl_info
+E2BIG
+EACCES
+EADDRINUSE
+EADDRNOTAVAIL
+EADV
+EAFNOSUPPORT
+EAGAIN
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAI_SYSTEM
+EALREADY
+EBADE
+EBADF
+EBADFD
+EBADMSG
+EBADR
+EBADRQC
+EBADSLT
+EBFONT
+EBUSY
+ECANCELED
+ECHILD
+ECHO
+ECHOCTL
+ECHOE
+ECHOK
+ECHOKE
+ECHONL
+ECHOPRT
+ECHRNG
+ECOMM
+ECONNABORTED
+ECONNREFUSED
+ECONNRESET
+EDEADLK
+EDESTADDRREQ
+EDOM
+EDOTDOT
+EDQUOT
+EEXIST
+EFAULT
+EFBIG
+EFD_CLOEXEC
+EFD_NONBLOCK
+EFD_SEMAPHORE
+EFS_SUPER_MAGIC
+EHOSTDOWN
+EHOSTUNREACH
+EIDRM
+EILSEQ
+EINPROGRESS
+EINTR
+EINVAL
+EIO
+EISCONN
+EISDIR
+EISNAM
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EL2HLT
+EL2NSYNC
+EL3HLT
+EL3RST
+ELIBACC
+ELIBBAD
+ELIBEXEC
+ELIBMAX
+ELIBSCN
+ELNRNG
+ELOOP
+EMEDIUMTYPE
+EMFILE
+EMLINK
+EMSGSIZE
+EMULTIHOP
+ENAMETOOLONG
+ENAVAIL
+ENETDOWN
+ENETRESET
+ENETUNREACH
+ENFILE
+ENOANO
+ENOATTR
+ENOBUFS
+ENOCSI
+ENODATA
+ENODEV
+ENOENT
+ENOEXEC
+ENOKEY
+ENOLCK
+ENOLINK
+ENOMEDIUM
+ENOMEM
+ENOMSG
+ENONET
+ENOPKG
+ENOPROTOOPT
+ENOSPC
+ENOSR
+ENOSTR
+ENOSYS
+ENOTBLK
+ENOTCONN
+ENOTDIR
+ENOTEMPTY
+ENOTNAM
+ENOTRECOVERABLE
+ENOTSOCK
+ENOTSUP
+ENOTTY
+ENOTUNIQ
+ENXIO
+EOF
+EOPNOTSUPP
+EOVERFLOW
+EOWNERDEAD
+EPERM
+EPFNOSUPPORT
+EPIPE
+EPOLLERR
+EPOLLET
+EPOLLEXCLUSIVE
+EPOLLHUP
+EPOLLIN
+EPOLLMSG
+EPOLLONESHOT
+EPOLLOUT
+EPOLLPRI
+EPOLLRDBAND
+EPOLLRDHUP
+EPOLLRDNORM
+EPOLLWAKEUP
+EPOLLWRBAND
+EPOLLWRNORM
+EPOLL_CLOEXEC
+EPOLL_CTL_ADD
+EPOLL_CTL_DEL
+EPOLL_CTL_MOD
+EPROTO
+EPROTONOSUPPORT
+EPROTOTYPE
+ERANGE
+EREMCHG
+EREMOTE
+EREMOTEIO
+ERESTART
+EROFS
+ESHUTDOWN
+ESOCKTNOSUPPORT
+ESPIPE
+ESRCH
+ESRMNT
+ESTALE
+ESTRPIPE
+ETH_ALEN
+ETH_DATA_LEN
+ETH_FCS_LEN
+ETH_FRAME_LEN
+ETH_HLEN
+ETH_MAX_MTU
+ETH_MIN_MTU
+ETH_P_1588
+ETH_P_8021AD
+ETH_P_8021AH
+ETH_P_8021Q
+ETH_P_80221
+ETH_P_802_2
+ETH_P_802_3
+ETH_P_802_3_MIN
+ETH_P_802_EX1
+ETH_P_AARP
+ETH_P_AF_IUCV
+ETH_P_ALL
+ETH_P_AOE
+ETH_P_ARCNET
+ETH_P_ARP
+ETH_P_ATALK
+ETH_P_ATMFATE
+ETH_P_ATMMPOA
+ETH_P_AX25
+ETH_P_BATMAN
+ETH_P_BPQ
+ETH_P_CAIF
+ETH_P_CAN
+ETH_P_CANFD
+ETH_P_CONTROL
+ETH_P_CUST
+ETH_P_DDCMP
+ETH_P_DEC
+ETH_P_DIAG
+ETH_P_DNA_DL
+ETH_P_DNA_RC
+ETH_P_DNA_RT
+ETH_P_DSA
+ETH_P_ECONET
+ETH_P_EDSA
+ETH_P_FCOE
+ETH_P_FIP
+ETH_P_HDLC
+ETH_P_HSR
+ETH_P_IEEE802154
+ETH_P_IEEEPUP
+ETH_P_IEEEPUPAT
+ETH_P_IP
+ETH_P_IPV6
+ETH_P_IPX
+ETH_P_IRDA
+ETH_P_LAT
+ETH_P_LINK_CTL
+ETH_P_LOCALTALK
+ETH_P_LOOP
+ETH_P_LOOPBACK
+ETH_P_MACSEC
+ETH_P_MOBITEX
+ETH_P_MPLS_MC
+ETH_P_MPLS_UC
+ETH_P_MVRP
+ETH_P_NCSI
+ETH_P_PAE
+ETH_P_PAUSE
+ETH_P_PHONET
+ETH_P_PPPTALK
+ETH_P_PPP_DISC
+ETH_P_PPP_MP
+ETH_P_PPP_SES
+ETH_P_PRP
+ETH_P_PUP
+ETH_P_PUPAT
+ETH_P_QINQ1
+ETH_P_QINQ2
+ETH_P_QINQ3
+ETH_P_RARP
+ETH_P_SCA
+ETH_P_SLOW
+ETH_P_SNAP
+ETH_P_TDLS
+ETH_P_TEB
+ETH_P_TIPC
+ETH_P_TRAILER
+ETH_P_TR_802_2
+ETH_P_TSN
+ETH_P_WAN_PPP
+ETH_P_WCCP
+ETH_P_X25
+ETH_P_XDSA
+ETH_ZLEN
+ETIME
+ETIMEDOUT
+ETOOMANYREFS
+ETXTBSY
+EUCLEAN
+EUNATCH
+EUSERS
+EV_CNT
+EV_MAX
+EWOULDBLOCK
+EXDEV
+EXFULL
+EXIT_FAILURE
+EXIT_SUCCESS
+EXT2_SUPER_MAGIC
+EXT3_SUPER_MAGIC
+EXT4_SUPER_MAGIC
+EXTA
+EXTB
+EXTPROC
+FALLOC_FL_COLLAPSE_RANGE
+FALLOC_FL_INSERT_RANGE
+FALLOC_FL_KEEP_SIZE
+FALLOC_FL_NO_HIDE_STALE
+FALLOC_FL_PUNCH_HOLE
+FALLOC_FL_UNSHARE_RANGE
+FALLOC_FL_ZERO_RANGE
+FD_CLOEXEC
+FD_CLR
+FD_ISSET
+FD_SET
+FD_SETSIZE
+FD_ZERO
+FF0
+FF1
+FFDLY
+FF_CNT
+FF_MAX
+FILE
+FILENAME_MAX
+FIOCLEX
+FIONBIO
+FIONCLEX
+FIONREAD
+FLUSHO
+FOPEN_MAX
+FUTEX_CLOCK_REALTIME
+FUTEX_CMD_MASK
+FUTEX_CMP_REQUEUE
+FUTEX_CMP_REQUEUE_PI
+FUTEX_FD
+FUTEX_LOCK_PI
+FUTEX_PRIVATE_FLAG
+FUTEX_REQUEUE
+FUTEX_TRYLOCK_PI
+FUTEX_UNLOCK_PI
+FUTEX_WAIT
+FUTEX_WAIT_BITSET
+FUTEX_WAIT_REQUEUE_PI
+FUTEX_WAKE
+FUTEX_WAKE_BITSET
+FUTEX_WAKE_OP
+F_ADD_SEALS
+F_CANCELLK
+F_DUPFD
+F_DUPFD_CLOEXEC
+F_GETFD
+F_GETFL
+F_GETLEASE
+F_GETLK
+F_GETOWN
+F_GETPIPE_SZ
+F_GET_SEALS
+F_LOCK
+F_NOTIFY
+F_OFD_GETLK
+F_OFD_SETLK
+F_OFD_SETLKW
+F_OK
+F_RDLCK
+F_SEAL_GROW
+F_SEAL_SEAL
+F_SEAL_SHRINK
+F_SEAL_WRITE
+F_SETFD
+F_SETFL
+F_SETLEASE
+F_SETLK
+F_SETLKW
+F_SETOWN
+F_SETPIPE_SZ
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GENL_ADMIN_PERM
+GENL_CMD_CAP_DO
+GENL_CMD_CAP_DUMP
+GENL_CMD_CAP_HASPOL
+GENL_ID_CTRL
+GENL_ID_PMCRAID
+GENL_ID_VFS_DQUOT
+GENL_MAX_ID
+GENL_MIN_ID
+GENL_NAMSIZ
+GENL_UNS_ADMIN_PERM
+GRND_NONBLOCK
+GRND_RANDOM
+GRND_INSECURE
+GRPQUOTA
+HPFS_SUPER_MAGIC
+HUGETLBFS_MAGIC
+HUPCL
+IBSHIFT
+BLKIOMIN
+BLKIOOPT
+BLKSSZGET
+BLKPBSZGET
+ICANON
+ICRNL
+IEXTEN
+IFF_ALLMULTI
+IFF_AUTOMEDIA
+IFF_BROADCAST
+IFF_DEBUG
+IFF_DYNAMIC
+IFF_LOOPBACK
+IFF_MASTER
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_NO_PI
+IFF_POINTOPOINT
+IFF_PORTSEL
+IFF_PROMISC
+IFF_RUNNING
+IFF_SLAVE
+IFF_TAP
+IFF_TUN
+IFF_UP
+IFNAMSIZ
+IF_NAMESIZE
+IFA_UNSPEC
+IFA_ADDRESS
+IFA_LOCAL
+IFA_LABEL
+IFA_BROADCAST
+IFA_ANYCAST
+IFA_CACHEINFO
+IFA_MULTICAST
+IFA_F_SECONDARY
+IFA_F_TEMPORARY
+IFA_F_NODAD
+IFA_F_OPTIMISTIC
+IFA_F_DADFAILED
+IFA_F_HOMEADDRESS
+IFA_F_DEPRECATED
+IFA_F_TENTATIVE
+IFA_F_PERMANENT
+IFLA_UNSPEC
+IFLA_ADDRESS
+IFLA_BROADCAST
+IFLA_IFNAME
+IFLA_MTU
+IFLA_LINK
+IFLA_QDISC
+IFLA_STATS
+IFLA_COST
+IFLA_PRIORITY
+IFLA_MASTER
+IFLA_WIRELESS
+IFLA_PROTINFO
+IFLA_TXQLEN
+IFLA_MAP
+IFLA_WEIGHT
+IFLA_OPERSTATE
+IFLA_LINKMODE
+IFLA_LINKINFO
+IFLA_NET_NS_PID
+IFLA_IFALIAS
+IFLA_NUM_VF
+IFLA_VFINFO_LIST
+IFLA_STATS64
+IFLA_VF_PORTS
+IFLA_PORT_SELF
+IFLA_AF_SPEC
+IFLA_GROUP
+IFLA_NET_NS_FD
+IFLA_EXT_MASK
+IFLA_PROMISCUITY
+IFLA_NUM_TX_QUEUES
+IFLA_NUM_RX_QUEUES
+IFLA_CARRIER
+IFLA_PHYS_PORT_ID
+IFLA_CARRIER_CHANGES
+IFLA_PHYS_SWITCH_ID
+IFLA_LINK_NETNSID
+IFLA_PHYS_PORT_NAME
+IFLA_PROTO_DOWN
+IFLA_GSO_MAX_SEGS
+IFLA_GSO_MAX_SIZE
+IFLA_PAD
+IFLA_XDP
+IFLA_EVENT
+IFLA_NEW_NETNSID
+IFLA_IF_NETNSID
+IFLA_TARGET_NETNSID
+IFLA_CARRIER_UP_COUNT
+IFLA_CARRIER_DOWN_COUNT
+IFLA_NEW_IFINDEX
+IFLA_MIN_MTU
+IFLA_MAX_MTU
+IFLA_INFO_UNSPEC
+IFLA_INFO_KIND
+IFLA_INFO_DATA
+IFLA_INFO_XSTATS
+IFLA_INFO_SLAVE_KIND
+IFLA_INFO_SLAVE_DATA
+IGNBRK
+IGNCR
+IGNPAR
+IMAXBEL
+INADDR_ANY
+INADDR_BROADCAST
+INADDR_LOOPBACK
+INADDR_NONE
+INLCR
+INPCK
+INPUT_PROP_CNT
+INPUT_PROP_MAX
+INT_MAX
+INT_MIN
+IN_ACCESS
+IN_ALL_EVENTS
+IN_ATTRIB
+IN_CLOEXEC
+IN_CLOSE
+IN_CLOSE_NOWRITE
+IN_CLOSE_WRITE
+IN_CREATE
+IN_DELETE
+IN_DELETE_SELF
+IN_DONT_FOLLOW
+IN_EXCL_UNLINK
+IN_IGNORED
+IN_MASK_CREATE
+IN_MASK_ADD
+IN_ISDIR
+IN_MODIFY
+IN_MOVE
+IN_MOVED_FROM
+IN_MOVED_TO
+IN_MOVE_SELF
+IN_NONBLOCK
+IN_ONESHOT
+IN_ONLYDIR
+IN_OPEN
+IN_Q_OVERFLOW
+IN_UNMOUNT
+IP6T_SO_ORIGINAL_DST
+IPDEFTTL
+IPOPT_CLASS
+IPOPT_CLASS_MASK
+IPOPT_CONTROL
+IPOPT_COPIED
+IPOPT_COPY
+IPOPT_END
+IPOPT_EOL
+IPOPT_LSRR
+IPOPT_MEASUREMENT
+IPOPT_MINOFF
+IPOPT_NOOP
+IPOPT_NOP
+IPOPT_NUMBER
+IPOPT_NUMBER_MASK
+IPOPT_OFFSET
+IPOPT_OLEN
+IPOPT_OPTVAL
+IPOPT_RA
+IPOPT_RESERVED1
+IPOPT_RESERVED2
+IPOPT_RR
+IPOPT_SEC
+IPOPT_SID
+IPOPT_SSRR
+IPOPT_TIMESTAMP
+IPOPT_TS
+IPOPT_TS_PRESPEC
+IPOPT_TS_TSANDADDR
+IPOPT_TS_TSONLY
+IPPROTO_AH
+IPPROTO_BEETPH
+IPPROTO_COMP
+IPPROTO_DCCP
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_ESP
+IPPROTO_FRAGMENT
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_ICMP
+IPPROTO_ICMPV6
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IP
+IPPROTO_IPIP
+IPPROTO_IPV6
+IPPROTO_MAX
+IPPROTO_MH
+IPPROTO_MPLS
+IPPROTO_MTP
+IPPROTO_NONE
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_SCTP
+IPPROTO_TCP
+IPPROTO_TP
+IPPROTO_UDP
+IPPROTO_UDPLITE
+IPTOS_ECN
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPTOS_LOWDELAY
+IPTOS_MINCOST
+IPTOS_PREC_CRITIC_ECP
+IPTOS_PREC_FLASH
+IPTOS_PREC_FLASHOVERRIDE
+IPTOS_PREC_IMMEDIATE
+IPTOS_PREC_INTERNETCONTROL
+IPTOS_PREC_NETCONTROL
+IPTOS_PREC_PRIORITY
+IPTOS_PREC_ROUTINE
+IPTOS_RELIABILITY
+IPTOS_THROUGHPUT
+IPV6_2292DSTOPTS
+IPV6_2292HOPLIMIT
+IPV6_2292HOPOPTS
+IPV6_2292PKTINFO
+IPV6_2292PKTOPTIONS
+IPV6_2292RTHDR
+IPV6_ADDRFORM
+IPV6_ADDR_PREFERENCES
+IPV6_ADD_MEMBERSHIP
+IPV6_AUTHHDR
+IPV6_AUTOFLOWLABEL
+IPV6_CHECKSUM
+IPV6_DONTFRAG
+IPV6_DROP_MEMBERSHIP
+IPV6_DSTOPTS
+IPV6_FLOWINFO
+IPV6_FLOWINFO_FLOWLABEL
+IPV6_FLOWINFO_PRIORITY
+IPV6_FLOWINFO_SEND
+IPV6_FLOWLABEL_MGR
+IPV6_FREEBIND
+IPV6_HDRINCL
+IPV6_HOPLIMIT
+IPV6_HOPOPTS
+IPV6_IPSEC_POLICY
+IPV6_JOIN_ANYCAST
+IPV6_LEAVE_ANYCAST
+IPV6_MINHOPCOUNT
+IPV6_MTU
+IPV6_MTU_DISCOVER
+IPV6_MULTICAST_ALL
+IPV6_MULTICAST_HOPS
+IPV6_MULTICAST_IF
+IPV6_MULTICAST_LOOP
+IPV6_NEXTHOP
+IPV6_ORIGDSTADDR
+IPV6_PATHMTU
+IPV6_PKTINFO
+IPV6_PMTUDISC_DO
+IPV6_PMTUDISC_DONT
+IPV6_PMTUDISC_INTERFACE
+IPV6_PMTUDISC_OMIT
+IPV6_PMTUDISC_PROBE
+IPV6_PMTUDISC_WANT
+IPV6_PREFER_SRC_CGA
+IPV6_PREFER_SRC_COA
+IPV6_PREFER_SRC_HOME
+IPV6_PREFER_SRC_NONCGA
+IPV6_PREFER_SRC_PUBLIC
+IPV6_PREFER_SRC_PUBTMP_DEFAULT
+IPV6_PREFER_SRC_TMP
+IPV6_RECVDSTOPTS
+IPV6_RECVERR
+IPV6_RECVFRAGSIZE
+IPV6_RECVHOPLIMIT
+IPV6_RECVHOPOPTS
+IPV6_RECVORIGDSTADDR
+IPV6_RECVPATHMTU
+IPV6_RECVPKTINFO
+IPV6_RECVRTHDR
+IPV6_RECVTCLASS
+IPV6_ROUTER_ALERT
+IPV6_ROUTER_ALERT_ISOLATE
+IPV6_RTHDR
+IPV6_RTHDRDSTOPTS
+IPV6_TCLASS
+IPV6_TRANSPARENT
+IPV6_UNICAST_HOPS
+IPV6_UNICAST_IF
+IPV6_V6ONLY
+IPV6_XFRM_POLICY
+IPVERSION
+IP_ADD_MEMBERSHIP
+IP_ADD_SOURCE_MEMBERSHIP
+IP_BIND_ADDRESS_NO_PORT
+IP_BLOCK_SOURCE
+IP_CHECKSUM
+IP_DEFAULT_MULTICAST_LOOP
+IP_DEFAULT_MULTICAST_TTL
+IP_DROP_MEMBERSHIP
+IP_DROP_SOURCE_MEMBERSHIP
+IP_FREEBIND
+IP_HDRINCL
+IP_IPSEC_POLICY
+IP_MINTTL
+IP_MSFILTER
+IP_MTU
+IP_MTU_DISCOVER
+IP_MULTICAST_ALL
+IP_MULTICAST_IF
+IP_MULTICAST_LOOP
+IP_MULTICAST_TTL
+IP_NODEFRAG
+IP_OPTIONS
+IP_ORIGDSTADDR
+IP_PASSSEC
+IP_PKTINFO
+IP_PKTOPTIONS
+IP_PMTUDISC_DO
+IP_PMTUDISC_DONT
+IP_PMTUDISC_INTERFACE
+IP_PMTUDISC_OMIT
+IP_PMTUDISC_PROBE
+IP_PMTUDISC_WANT
+IP_RECVERR
+IP_RECVFRAGSIZE
+IP_RECVOPTS
+IP_RECVORIGDSTADDR
+IP_RECVTOS
+IP_RECVTTL
+IP_RETOPTS
+IP_ROUTER_ALERT
+IP_TOS
+IP_TRANSPARENT
+IP_TTL
+IP_UNBLOCK_SOURCE
+IP_UNICAST_IF
+IP_XFRM_POLICY
+ISIG
+ISOFS_SUPER_MAGIC
+ISTRIP
+IUTF8
+IXANY
+IXOFF
+IXON
+JFFS2_SUPER_MAGIC
+KEY_CNT
+KEY_MAX
+LC_ADDRESS
+LC_ADDRESS_MASK
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_IDENTIFICATION
+LC_IDENTIFICATION_MASK
+LC_MEASUREMENT
+LC_MEASUREMENT_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NAME
+LC_NAME_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_PAPER
+LC_PAPER_MASK
+LC_TELEPHONE
+LC_TELEPHONE_MASK
+LC_TIME
+LC_TIME_MASK
+LED_CNT
+LED_MAX
+LINUX_REBOOT_CMD_CAD_OFF
+LINUX_REBOOT_CMD_CAD_ON
+LINUX_REBOOT_CMD_HALT
+LINUX_REBOOT_CMD_KEXEC
+LINUX_REBOOT_CMD_POWER_OFF
+LINUX_REBOOT_CMD_RESTART
+LINUX_REBOOT_CMD_RESTART2
+LINUX_REBOOT_CMD_SW_SUSPEND
+LINUX_REBOOT_MAGIC1
+LINUX_REBOOT_MAGIC2
+LINUX_REBOOT_MAGIC2A
+LINUX_REBOOT_MAGIC2B
+LINUX_REBOOT_MAGIC2C
+LOCK_EX
+LOCK_NB
+LOCK_SH
+LOCK_UN
+LOG_ALERT
+LOG_AUTH
+LOG_AUTHPRIV
+LOG_CONS
+LOG_CRIT
+LOG_CRON
+LOG_DAEMON
+LOG_DEBUG
+LOG_EMERG
+LOG_ERR
+LOG_FACMASK
+LOG_FTP
+LOG_INFO
+LOG_KERN
+LOG_LOCAL0
+LOG_LOCAL1
+LOG_LOCAL2
+LOG_LOCAL3
+LOG_LOCAL4
+LOG_LOCAL5
+LOG_LOCAL6
+LOG_LOCAL7
+LOG_LPR
+LOG_MAIL
+LOG_NDELAY
+LOG_NEWS
+LOG_NOTICE
+LOG_NOWAIT
+LOG_ODELAY
+LOG_PERROR
+LOG_PID
+LOG_PRIMASK
+LOG_SYSLOG
+LOG_USER
+LOG_UUCP
+LOG_WARNING
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_SOFT_OFFLINE
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_ANON
+MAP_ANONYMOUS
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FAILED
+MAP_FILE
+MAP_FIXED
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_PRIVATE
+MAP_SHARED
+MAP_STACK
+MAP_TYPE
+MAXTTL
+MAX_IPOPTLEN
+MAX_LINKS
+MCAST_BLOCK_SOURCE
+MCAST_EXCLUDE
+MCAST_INCLUDE
+MCAST_JOIN_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+MCAST_UNBLOCK_SOURCE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MFD_HUGETLB
+MINIX2_SUPER_MAGIC
+MINIX2_SUPER_MAGIC2
+MINIX_SUPER_MAGIC
+MINIX_SUPER_MAGIC2
+MINSIGSTKSZ
+MMAP_PAGE_ZERO
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MODULE_INIT_IGNORE_MODVERSIONS
+MODULE_INIT_IGNORE_VERMAGIC
+MPOL_BIND
+MPOL_DEFAULT
+MPOL_F_NUMA_BALANCING
+MPOL_F_RELATIVE_NODES
+MPOL_F_STATIC_NODES
+MPOL_INTERLEAVE
+MPOL_LOCAL
+MPOL_PREFERRED
+MSC_CNT
+MSC_MAX
+MSDOS_SUPER_MAGIC
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_CTRUNC
+MSG_DONTROUTE
+MSG_DONTWAIT
+MSG_EOR
+MSG_ERRQUEUE
+MSG_FASTOPEN
+MSG_FIN
+MSG_MORE
+MSG_NOSIGNAL
+MSG_OOB
+MSG_PEEK
+MSG_RST
+MSG_SYN
+MSG_TRUNC
+MSG_WAITALL
+MSG_WAITFORONE
+MS_ACTIVE
+MS_ASYNC
+MS_BIND
+MS_DIRSYNC
+MS_INVALIDATE
+MS_I_VERSION
+MS_KERNMOUNT
+MS_LAZYTIME
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_RELATIME
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNC
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NCCS
+NCP_SUPER_MAGIC
+NETLINK_ADD_MEMBERSHIP
+NETLINK_AUDIT
+NETLINK_BROADCAST_ERROR
+NETLINK_CAP_ACK
+NETLINK_CONNECTOR
+NETLINK_CRYPTO
+NETLINK_DNRTMSG
+NETLINK_DROP_MEMBERSHIP
+NETLINK_ECRYPTFS
+NETLINK_EXT_ACK
+NETLINK_FIB_LOOKUP
+NETLINK_FIREWALL
+NETLINK_GENERIC
+NETLINK_GET_STRICT_CHK
+NETLINK_INET_DIAG
+NETLINK_IP6_FW
+NETLINK_ISCSI
+NETLINK_KOBJECT_UEVENT
+NETLINK_LISTEN_ALL_NSID
+NETLINK_LIST_MEMBERSHIPS
+NETLINK_NETFILTER
+NETLINK_NFLOG
+NETLINK_NO_ENOBUFS
+NETLINK_PKTINFO
+NETLINK_RDMA
+NETLINK_ROUTE
+NETLINK_RX_RING
+NETLINK_SCSITRANSPORT
+NETLINK_SELINUX
+NETLINK_SOCK_DIAG
+NETLINK_TX_RING
+NETLINK_UNUSED
+NETLINK_USERSOCK
+NETLINK_XFRM
+NFNETLINK_V0
+NFNLGRP_ACCT_QUOTA
+NFNLGRP_CONNTRACK_DESTROY
+NFNLGRP_CONNTRACK_EXP_DESTROY
+NFNLGRP_CONNTRACK_EXP_NEW
+NFNLGRP_CONNTRACK_EXP_UPDATE
+NFNLGRP_CONNTRACK_NEW
+NFNLGRP_CONNTRACK_UPDATE
+NFNLGRP_NFTABLES
+NFNLGRP_NONE
+NFNL_MSG_BATCH_BEGIN
+NFNL_MSG_BATCH_END
+NFNL_SUBSYS_ACCT
+NFNL_SUBSYS_COUNT
+NFNL_SUBSYS_CTHELPER
+NFNL_SUBSYS_CTNETLINK
+NFNL_SUBSYS_CTNETLINK_EXP
+NFNL_SUBSYS_CTNETLINK_TIMEOUT
+NFNL_SUBSYS_IPSET
+NFNL_SUBSYS_NFTABLES
+NFNL_SUBSYS_NFT_COMPAT
+NFNL_SUBSYS_NONE
+NFNL_SUBSYS_OSF
+NFNL_SUBSYS_QUEUE
+NFNL_SUBSYS_ULOG
+NFPROTO_ARP
+NFPROTO_BRIDGE
+NFPROTO_DECNET
+NFPROTO_INET
+NFPROTO_IPV4
+NFPROTO_IPV6
+NFPROTO_NETDEV
+NFPROTO_NUMPROTO
+NFPROTO_UNSPEC
+NFQA_CAP_LEN
+NFQA_CFG_CMD
+NFQA_CFG_FLAGS
+NFQA_CFG_F_CONNTRACK
+NFQA_CFG_F_FAIL_OPEN
+NFQA_CFG_F_GSO
+NFQA_CFG_F_MAX
+NFQA_CFG_F_SECCTX
+NFQA_CFG_F_UID_GID
+NFQA_CFG_MASK
+NFQA_CFG_PARAMS
+NFQA_CFG_QUEUE_MAXLEN
+NFQA_CFG_UNSPEC
+NFQA_CT
+NFQA_CT_INFO
+NFQA_EXP
+NFQA_GID
+NFQA_HWADDR
+NFQA_IFINDEX_INDEV
+NFQA_IFINDEX_OUTDEV
+NFQA_IFINDEX_PHYSINDEV
+NFQA_IFINDEX_PHYSOUTDEV
+NFQA_MARK
+NFQA_PACKET_HDR
+NFQA_PAYLOAD
+NFQA_SECCTX
+NFQA_SKB_CSUMNOTREADY
+NFQA_SKB_CSUM_NOTVERIFIED
+NFQA_SKB_GSO
+NFQA_SKB_INFO
+NFQA_TIMESTAMP
+NFQA_UID
+NFQA_UNSPEC
+NFQA_VERDICT_HDR
+NFQNL_CFG_CMD_BIND
+NFQNL_CFG_CMD_NONE
+NFQNL_CFG_CMD_PF_BIND
+NFQNL_CFG_CMD_PF_UNBIND
+NFQNL_CFG_CMD_UNBIND
+NFQNL_COPY_META
+NFQNL_COPY_NONE
+NFQNL_COPY_PACKET
+NFQNL_MSG_CONFIG
+NFQNL_MSG_PACKET
+NFQNL_MSG_VERDICT
+NFQNL_MSG_VERDICT_BATCH
+NFS_SUPER_MAGIC
+NFT_BREAK
+NFT_BYTEORDER_HTON
+NFT_BYTEORDER_NTOH
+NFT_CHAIN_MAXNAMELEN
+NFT_CMP_EQ
+NFT_CMP_GT
+NFT_CMP_GTE
+NFT_CMP_LT
+NFT_CMP_LTE
+NFT_CMP_NEQ
+NFT_CONTINUE
+NFT_CT_BYTES
+NFT_CT_DIRECTION
+NFT_CT_DST
+NFT_CT_EXPIRATION
+NFT_CT_HELPER
+NFT_CT_L3PROTOCOL
+NFT_CT_LABELS
+NFT_CT_MARK
+NFT_CT_PKTS
+NFT_CT_PROTOCOL
+NFT_CT_PROTO_DST
+NFT_CT_PROTO_SRC
+NFT_CT_SECMARK
+NFT_CT_SRC
+NFT_CT_STATE
+NFT_CT_STATUS
+NFT_DATA_RESERVED_MASK
+NFT_DATA_VALUE
+NFT_DATA_VALUE_MAXLEN
+NFT_DATA_VERDICT
+NFT_DYNSET_F_INV
+NFT_DYNSET_OP_ADD
+NFT_DYNSET_OP_UPDATE
+NFT_GOTO
+NFT_JUMP
+NFT_LIMIT_F_INV
+NFT_LIMIT_PKTS
+NFT_LIMIT_PKT_BYTES
+NFT_LOOKUP_F_INV
+NFT_META_BRI_IIFNAME
+NFT_META_BRI_OIFNAME
+NFT_META_CGROUP
+NFT_META_CPU
+NFT_META_IIF
+NFT_META_IIFGROUP
+NFT_META_IIFNAME
+NFT_META_IIFTYPE
+NFT_META_L4PROTO
+NFT_META_LEN
+NFT_META_MARK
+NFT_META_NFPROTO
+NFT_META_NFTRACE
+NFT_META_OIF
+NFT_META_OIFGROUP
+NFT_META_OIFNAME
+NFT_META_OIFTYPE
+NFT_META_PKTTYPE
+NFT_META_PRANDOM
+NFT_META_PRIORITY
+NFT_META_PROTOCOL
+NFT_META_RTCLASSID
+NFT_META_SECMARK
+NFT_META_SKGID
+NFT_META_SKUID
+NFT_MSG_DELCHAIN
+NFT_MSG_DELOBJ
+NFT_MSG_DELRULE
+NFT_MSG_DELSET
+NFT_MSG_DELSETELEM
+NFT_MSG_DELTABLE
+NFT_MSG_GETCHAIN
+NFT_MSG_GETGEN
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_GETRULE
+NFT_MSG_GETSET
+NFT_MSG_GETSETELEM
+NFT_MSG_GETTABLE
+NFT_MSG_MAX
+NFT_MSG_NEWCHAIN
+NFT_MSG_NEWGEN
+NFT_MSG_NEWOBJ
+NFT_MSG_NEWRULE
+NFT_MSG_NEWSET
+NFT_MSG_NEWSETELEM
+NFT_MSG_NEWTABLE
+NFT_MSG_TRACE
+NFT_NAT_DNAT
+NFT_NAT_SNAT
+NFT_NG_INCREMENTAL
+NFT_NG_RANDOM
+NFT_OBJ_MAXNAMELEN
+NFT_PAYLOAD_CSUM_INET
+NFT_PAYLOAD_CSUM_NONE
+NFT_PAYLOAD_LL_HEADER
+NFT_PAYLOAD_NETWORK_HEADER
+NFT_PAYLOAD_TRANSPORT_HEADER
+NFT_QUEUE_FLAG_BYPASS
+NFT_QUEUE_FLAG_CPU_FANOUT
+NFT_QUEUE_FLAG_MASK
+NFT_QUOTA_F_INV
+NFT_RANGE_EQ
+NFT_RANGE_NEQ
+NFT_REG32_00
+NFT_REG32_01
+NFT_REG32_02
+NFT_REG32_03
+NFT_REG32_04
+NFT_REG32_05
+NFT_REG32_06
+NFT_REG32_07
+NFT_REG32_08
+NFT_REG32_09
+NFT_REG32_10
+NFT_REG32_11
+NFT_REG32_12
+NFT_REG32_13
+NFT_REG32_14
+NFT_REG32_15
+NFT_REG32_SIZE
+NFT_REG_1
+NFT_REG_2
+NFT_REG_3
+NFT_REG_4
+NFT_REG_SIZE
+NFT_REG_VERDICT
+NFT_REJECT_ICMPX_ADMIN_PROHIBITED
+NFT_REJECT_ICMPX_HOST_UNREACH
+NFT_REJECT_ICMPX_NO_ROUTE
+NFT_REJECT_ICMPX_PORT_UNREACH
+NFT_REJECT_ICMPX_UNREACH
+NFT_REJECT_ICMP_UNREACH
+NFT_REJECT_TCP_RST
+NFT_RETURN
+NFT_SET_ANONYMOUS
+NFT_SET_CONSTANT
+NFT_SET_ELEM_INTERVAL_END
+NFT_SET_EVAL
+NFT_SET_INTERVAL
+NFT_SET_MAP
+NFT_SET_MAXNAMELEN
+NFT_SET_POL_MEMORY
+NFT_SET_POL_PERFORMANCE
+NFT_SET_TIMEOUT
+NFT_TABLE_MAXNAMELEN
+NFT_TRACETYPE_POLICY
+NFT_TRACETYPE_RETURN
+NFT_TRACETYPE_RULE
+NFT_TRACETYPE_UNSPEC
+NFT_USERDATA_MAXLEN
+NFULA_CFG_CMD
+NFULA_CFG_FLAGS
+NFULA_CFG_MODE
+NFULA_CFG_NLBUFSIZ
+NFULA_CFG_QTHRESH
+NFULA_CFG_TIMEOUT
+NFULA_CFG_UNSPEC
+NFULA_CT
+NFULA_CT_INFO
+NFULA_GID
+NFULA_HWADDR
+NFULA_HWHEADER
+NFULA_HWLEN
+NFULA_HWTYPE
+NFULA_IFINDEX_INDEV
+NFULA_IFINDEX_OUTDEV
+NFULA_IFINDEX_PHYSINDEV
+NFULA_IFINDEX_PHYSOUTDEV
+NFULA_MARK
+NFULA_PACKET_HDR
+NFULA_PAYLOAD
+NFULA_PREFIX
+NFULA_SEQ
+NFULA_SEQ_GLOBAL
+NFULA_TIMESTAMP
+NFULA_UID
+NFULA_UNSPEC
+NFULNL_CFG_CMD_BIND
+NFULNL_CFG_CMD_NONE
+NFULNL_CFG_CMD_PF_BIND
+NFULNL_CFG_CMD_PF_UNBIND
+NFULNL_CFG_CMD_UNBIND
+NFULNL_CFG_F_CONNTRACK
+NFULNL_CFG_F_SEQ
+NFULNL_CFG_F_SEQ_GLOBAL
+NFULNL_COPY_META
+NFULNL_COPY_NONE
+NFULNL_COPY_PACKET
+NFULNL_MSG_CONFIG
+NFULNL_MSG_PACKET
+NF_ACCEPT
+NF_DROP
+NF_INET_FORWARD
+NF_INET_LOCAL_IN
+NF_INET_LOCAL_OUT
+NF_INET_NUMHOOKS
+NF_INET_POST_ROUTING
+NF_INET_PRE_ROUTING
+NF_IP6_FORWARD
+NF_IP6_LOCAL_IN
+NF_IP6_LOCAL_OUT
+NF_IP6_NUMHOOKS
+NF_IP6_POST_ROUTING
+NF_IP6_PRE_ROUTING
+NF_IP6_PRI_CONNTRACK
+NF_IP6_PRI_CONNTRACK_DEFRAG
+NF_IP6_PRI_CONNTRACK_HELPER
+NF_IP6_PRI_FILTER
+NF_IP6_PRI_FIRST
+NF_IP6_PRI_LAST
+NF_IP6_PRI_MANGLE
+NF_IP6_PRI_NAT_DST
+NF_IP6_PRI_NAT_SRC
+NF_IP6_PRI_RAW
+NF_IP6_PRI_SECURITY
+NF_IP6_PRI_SELINUX_FIRST
+NF_IP6_PRI_SELINUX_LAST
+NF_IP_FORWARD
+NF_IP_LOCAL_IN
+NF_IP_LOCAL_OUT
+NF_IP_NUMHOOKS
+NF_IP_POST_ROUTING
+NF_IP_PRE_ROUTING
+NF_IP_PRI_CONNTRACK
+NF_IP_PRI_CONNTRACK_CONFIRM
+NF_IP_PRI_CONNTRACK_DEFRAG
+NF_IP_PRI_CONNTRACK_HELPER
+NF_IP_PRI_FILTER
+NF_IP_PRI_FIRST
+NF_IP_PRI_LAST
+NF_IP_PRI_MANGLE
+NF_IP_PRI_NAT_DST
+NF_IP_PRI_NAT_SRC
+NF_IP_PRI_RAW
+NF_IP_PRI_SECURITY
+NF_IP_PRI_SELINUX_FIRST
+NF_IP_PRI_SELINUX_LAST
+NF_MAX_VERDICT
+NF_NETDEV_INGRESS
+NF_NETDEV_NUMHOOKS
+NF_QUEUE
+NF_REPEAT
+NF_STOLEN
+NF_STOP
+NF_VERDICT_BITS
+NF_VERDICT_FLAG_QUEUE_BYPASS
+NF_VERDICT_MASK
+NF_VERDICT_QBITS
+NF_VERDICT_QMASK
+NI_DGRAM
+NI_MAXHOST
+NI_MAXSERV
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSERV
+NL0
+NL1
+NLA_ALIGN
+NLA_ALIGNTO
+NLA_F_NESTED
+NLA_F_NET_BYTEORDER
+NLA_TYPE_MASK
+NLDLY
+NLMSG_DONE
+NLMSG_ERROR
+NLMSG_MIN_TYPE
+NLMSG_NOOP
+NLMSG_OVERRUN
+NLM_F_ACK
+NLM_F_APPEND
+NLM_F_ATOMIC
+NLM_F_CREATE
+NLM_F_DUMP
+NLM_F_DUMP_INTR
+NLM_F_ECHO
+NLM_F_EXCL
+NLM_F_MATCH
+NLM_F_MULTI
+NLM_F_REPLACE
+NLM_F_REQUEST
+NLM_F_ROOT
+NOFLSH
+OCRNL
+OFDEL
+OFILL
+OLCUC
+ONLCR
+ONLRET
+ONOCR
+OPENPROM_SUPER_MAGIC
+OPOST
+O_ACCMODE
+O_APPEND
+O_ASYNC
+O_CLOEXEC
+O_CREAT
+O_DIRECT
+O_DIRECTORY
+O_DSYNC
+O_EXCL
+O_LARGEFILE
+O_NDELAY
+O_NOATIME
+O_NOCTTY
+O_NOFOLLOW
+O_NONBLOCK
+O_PATH
+O_RDONLY
+O_RDWR
+O_RSYNC
+O_SYNC
+O_TMPFILE
+O_TRUNC
+O_WRONLY
+PARENB
+PARMRK
+PARODD
+PATH_MAX
+PENDIN
+PF_ALG
+PF_APPLETALK
+PF_ASH
+PF_ATMPVC
+PF_ATMSVC
+PF_AX25
+PF_BLUETOOTH
+PF_BRIDGE
+PF_CAIF
+PF_CAN
+PF_DECnet
+PF_ECONET
+PF_IEEE802154
+PF_INET
+PF_INET6
+PF_IPX
+PF_IRDA
+PF_ISDN
+PF_IUCV
+PF_KEY
+PF_LLC
+PF_LOCAL
+PF_NETBEUI
+PF_NETLINK
+PF_NETROM
+PF_NFC
+PF_PACKET
+PF_PHONET
+PF_PPPOX
+PF_RDS
+PF_ROSE
+PF_ROUTE
+PF_RXRPC
+PF_SECURITY
+PF_SNA
+PF_TIPC
+PF_UNIX
+PF_UNSPEC
+PF_VSOCK
+PF_WANPIPE
+PF_X25
+PIPE_BUF
+POLLERR
+POLLHUP
+POLLIN
+POLLNVAL
+POLLOUT
+POLLPRI
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+PR_GET_NO_NEW_PRIVS
+PR_GET_SECCOMP
+PR_GET_TIMING
+PR_SET_NO_NEW_PRIVS
+PR_SET_SECCOMP
+PR_TIMING_STATISTICAL
+PR_TIMING_TIMESTAMP
+PR_SET_VMA
+PR_SET_VMA_ANON_NAME
+PRIO_MAX
+PRIO_MIN
+PRIO_PGRP
+PRIO_PROCESS
+PRIO_USER
+PROC_SUPER_MAGIC
+PROP_NAME_MAX
+PROP_VALUE_MAX
+PROT_EXEC
+PROT_GROWSDOWN
+PROT_GROWSUP
+PROT_NONE
+PROT_READ
+PROT_WRITE
+PTHREAD_COND_INITIALIZER
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_MUTEX_INITIALIZER
+PTHREAD_MUTEX_NORMAL
+PTHREAD_MUTEX_RECURSIVE
+PTHREAD_RWLOCK_INITIALIZER
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_STOP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETSIGINFO
+PTRACE_KILL
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SETOPTIONS
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+PT_HIOS
+PT_LOPROC
+PT_HIPROC
+PT_DYNAMIC
+PT_GNU_EH_FRAME
+PT_GNU_RELRO
+PT_GNU_STACK
+PT_INTERP
+PT_LOAD
+PT_LOOS
+PT_NOTE
+PT_NULL
+PT_PHDR
+PT_SHLIB
+PT_TLS
+P_ALL
+P_PGID
+P_PID
+P_PIDFD
+QCMD
+QIF_ALL
+QIF_BLIMITS
+QIF_BTIME
+QIF_ILIMITS
+QIF_INODES
+QIF_ITIME
+QIF_LIMITS
+QIF_SPACE
+QIF_TIMES
+QIF_USAGE
+QNX4_SUPER_MAGIC
+Q_GETFMT
+Q_GETINFO
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETINFO
+Q_SETQUOTA
+Q_SYNC
+RAND_MAX
+READ_IMPLIES_EXEC
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+REISERFS_SUPER_MAGIC
+REL_CNT
+REL_MAX
+RENAME_EXCHANGE
+RENAME_NOREPLACE
+RENAME_WHITEOUT
+REP_CNT
+REP_MAX
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_LOCKS
+RLIMIT_MEMLOCK
+RLIMIT_MSGQUEUE
+RLIMIT_NICE
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_RTPRIO
+RLIMIT_SIGPENDING
+RLIMIT_STACK
+RLIM_INFINITY
+RTLD_DEFAULT
+RTLD_GLOBAL
+RTLD_LAZY
+RTLD_LOCAL
+RTLD_NOLOAD
+RTLD_NOW
+TCA_UNSPEC
+TCA_KIND
+TCA_OPTIONS
+TCA_STATS
+TCA_XSTATS
+TCA_RATE
+TCA_FCNT
+TCA_STATS2
+TCA_STAB
+RTM_NEWLINK
+RTM_DELLINK
+RTM_GETLINK
+RTM_SETLINK
+RTM_NEWADDR
+RTM_DELADDR
+RTM_GETADDR
+RTM_NEWROUTE
+RTM_DELROUTE
+RTM_GETROUTE
+RTM_NEWNEIGH
+RTM_DELNEIGH
+RTM_GETNEIGH
+RTM_NEWRULE
+RTM_DELRULE
+RTM_GETRULE
+RTM_NEWQDISC
+RTM_DELQDISC
+RTM_GETQDISC
+RTM_NEWTCLASS
+RTM_DELTCLASS
+RTM_GETTCLASS
+RTM_NEWTFILTER
+RTM_DELTFILTER
+RTM_GETTFILTER
+RTM_NEWACTION
+RTM_DELACTION
+RTM_GETACTION
+RTM_NEWPREFIX
+RTM_GETMULTICAST
+RTM_GETANYCAST
+RTM_NEWNEIGHTBL
+RTM_GETNEIGHTBL
+RTM_SETNEIGHTBL
+RTM_NEWNDUSEROPT
+RTM_NEWADDRLABEL
+RTM_DELADDRLABEL
+RTM_GETADDRLABEL
+RTM_GETDCB
+RTM_SETDCB
+RTM_NEWNETCONF
+RTM_GETNETCONF
+RTM_NEWMDB
+RTM_DELMDB
+RTM_GETMDB
+RTM_NEWNSID
+RTM_DELNSID
+RTM_GETNSID
+RTM_F_NOTIFY
+RTM_F_CLONED
+RTM_F_EQUALIZE
+RTM_F_PREFIX
+RTA_UNSPEC
+RTA_DST
+RTA_SRC
+RTA_IIF
+RTA_OIF
+RTA_GATEWAY
+RTA_PRIORITY
+RTA_PREFSRC
+RTA_METRICS
+RTA_MULTIPATH
+RTA_PROTOINFO
+RTA_FLOW
+RTA_CACHEINFO
+RTA_SESSION
+RTA_MP_ALGO
+RTA_TABLE
+RTA_MARK
+RTA_MFC_STATS
+RTN_UNSPEC
+RTN_UNICAST
+RTN_LOCAL
+RTN_BROADCAST
+RTN_ANYCAST
+RTN_MULTICAST
+RTN_BLACKHOLE
+RTN_UNREACHABLE
+RTN_PROHIBIT
+RTN_THROW
+RTN_NAT
+RTN_XRESOLVE
+RTPROT_UNSPEC
+RTPROT_REDIRECT
+RTPROT_KERNEL
+RTPROT_BOOT
+RTPROT_STATIC
+RT_SCOPE_UNIVERSE
+RT_SCOPE_SITE
+RT_SCOPE_LINK
+RT_SCOPE_HOST
+RT_SCOPE_NOWHERE
+RT_TABLE_UNSPEC
+RT_TABLE_COMPAT
+RT_TABLE_DEFAULT
+RT_TABLE_MAIN
+RT_TABLE_LOCAL
+RTMSG_NEWDEVICE
+RTMSG_DELDEVICE
+RTMSG_NEWROUTE
+RTMSG_DELROUTE
+RUSAGE_CHILDREN
+RUSAGE_SELF
+R_OK
+SA_NOCLDSTOP
+SA_NOCLDWAIT
+SA_NODEFER
+SA_ONSTACK
+SA_RESETHAND
+SA_RESTART
+SA_SIGINFO
+SCHED_BATCH
+SCHED_DEADLINE
+SCHED_FIFO
+SCHED_IDLE
+SCHED_NORMAL
+SCHED_RESET_ON_FORK
+SCHED_RR
+SCM_CREDENTIALS
+SCM_RIGHTS
+SCM_TIMESTAMP
+
+SECCOMP_FILTER_FLAG_LOG
+SECCOMP_FILTER_FLAG_NEW_LISTENER
+SECCOMP_FILTER_FLAG_SPEC_ALLOW
+SECCOMP_FILTER_FLAG_TSYNC
+SECCOMP_MODE_DISABLED
+SECCOMP_MODE_FILTER
+SECCOMP_MODE_STRICT
+SECCOMP_RET_ACTION
+SECCOMP_RET_ACTION_FULL
+SECCOMP_RET_ALLOW
+SECCOMP_RET_DATA
+SECCOMP_RET_ERRNO
+SECCOMP_RET_KILL
+SECCOMP_RET_KILL_PROCESS
+SECCOMP_RET_KILL_THREAD
+SECCOMP_RET_LOG
+SECCOMP_RET_TRACE
+SECCOMP_RET_TRAP
+SECCOMP_RET_USER_NOTIF
+SEEK_CUR
+SEEK_DATA
+SEEK_END
+SEEK_HOLE
+SEEK_SET
+SEM_FAILED
+SFD_CLOEXEC
+SFD_NONBLOCK
+SHORT_INODE
+SHUT_RD
+SHUT_RDWR
+SHUT_WR
+SIGABRT
+SIGALRM
+SIGBUS
+SIGCHLD
+SIGCONT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGEV_THREAD_ID
+SIGFPE
+SIGHUP
+SIGILL
+SIGINT
+SIGIO
+SIGIOT
+SIGKILL
+SIGPIPE
+SIGPOLL
+SIGPROF
+SIGPWR
+SIGQUIT
+SIGSEGV
+SIGSTKFLT
+SIGSTKSZ
+SIGSTOP
+SIGSYS
+SIGTERM
+SIGTRAP
+SIGTSTP
+SIGTTIN
+SIGTTOU
+SIGUNUSED
+SIGURG
+SIGUSR1
+SIGUSR2
+SIGVTALRM
+SIGWINCH
+SIGXCPU
+SIGXFSZ
+SIG_BLOCK
+SIG_DFL
+SIG_ERR
+SIG_IGN
+SIG_SETMASK
+SIG_UNBLOCK
+SIOCADDMULTI
+SIOCADDRT
+SIOCDARP
+SIOCDELMULTI
+SIOCDELRT
+SIOCDRARP
+SIOCGARP
+SIOCGIFADDR
+SIOCGIFBRDADDR
+SIOCGIFCONF
+SIOCGIFDSTADDR
+SIOCGIFENCAP
+SIOCGIFFLAGS
+SIOCGIFHWADDR
+SIOCGIFMAP
+SIOCGIFMEM
+SIOCGIFMETRIC
+SIOCGIFMTU
+SIOCGIFNAME
+SIOCGIFNETMASK
+SIOCGIFSLAVE
+SIOCGRARP
+SIOCSARP
+SIOCSIFADDR
+SIOCSIFBRDADDR
+SIOCSIFDSTADDR
+SIOCSIFENCAP
+SIOCSIFFLAGS
+SIOCSIFHWADDR
+SIOCSIFLINK
+SIOCSIFMAP
+SIOCSIFMEM
+SIOCSIFMETRIC
+SIOCSIFMTU
+SIOCSIFNETMASK
+SIOCSIFSLAVE
+SIOCSRARP
+SI_LOAD_SHIFT
+SMB_SUPER_MAGIC
+SND_CNT
+SND_MAX
+SOCK_CLOEXEC
+SOCK_DCCP
+SOCK_DGRAM
+SOCK_NONBLOCK
+SOCK_PACKET
+SOCK_RAW
+SOCK_RDM
+SOCK_SEQPACKET
+SOCK_STREAM
+SOL_AAL
+SOL_ALG
+SOL_ATALK
+SOL_ATM
+SOL_AX25
+SOL_BLUETOOTH
+SOL_DCCP
+SOL_DECNET
+SOL_ICMPV6
+SOL_IP
+SOL_IPV6
+SOL_IPX
+SOL_IRDA
+SOL_LLC
+SOL_NETBEUI
+SOL_NETLINK
+SOL_NETROM
+SOL_PACKET
+SOL_RAW
+SOL_ROSE
+SOL_SCTP
+SOL_SOCKET
+SOL_TCP
+SOL_TIPC
+SOL_UDP
+SOL_X25
+SOMAXCONN
+SO_ACCEPTCONN
+SO_BINDTODEVICE
+SO_BROADCAST
+SO_BSDCOMPAT
+SO_BUSY_POLL
+SO_DEBUG
+SO_DOMAIN
+SO_DONTROUTE
+SO_EE_OFFENDER
+SO_EE_ORIGIN_ICMP
+SO_EE_ORIGIN_ICMP6
+SO_EE_ORIGIN_LOCAL
+SO_EE_ORIGIN_NONE
+SO_EE_ORIGIN_TIMESTAMPING
+SO_EE_ORIGIN_TXSTATUS
+SO_ERROR
+SO_KEEPALIVE
+SO_LINGER
+SO_MARK
+SO_OOBINLINE
+SO_ORIGINAL_DST
+SO_PASSCRED
+SO_PASSSEC
+SO_PEEK_OFF
+SO_PEERCRED
+SO_PEERSEC
+SO_PRIORITY
+SO_PROTOCOL
+SO_RCVBUF
+SO_RCVBUFFORCE
+SO_RCVLOWAT
+SO_RCVTIMEO
+SO_REUSEADDR
+SO_REUSEPORT
+SO_RXQ_OVFL
+SO_SNDBUF
+SO_SNDBUFFORCE
+SO_SNDLOWAT
+SO_SNDTIMEO
+SO_TIMESTAMP
+SO_TYPE
+SPLICE_F_GIFT
+SPLICE_F_MORE
+SPLICE_F_MOVE
+SPLICE_F_NONBLOCK
+SS_DISABLE
+SS_ONSTACK
+STDERR_FILENO
+STDIN_FILENO
+STDOUT_FILENO
+STICKY_TIMEOUTS
+ST_MANDLOCK
+ST_NOATIME
+ST_NODEV
+ST_NODIRATIME
+ST_NOEXEC
+ST_NOSUID
+ST_RDONLY
+ST_RELATIME
+ST_SYNCHRONOUS
+SW_CNT
+SW_MAX
+SYN_CNT
+SYN_MAX
+SYS_accept4
+SYS_acct
+SYS_add_key
+SYS_adjtimex
+SYS_bind
+SYS_bpf
+SYS_brk
+SYS_capget
+SYS_capset
+SYS_chdir
+SYS_chroot
+SYS_clock_adjtime
+SYS_clock_getres
+SYS_clock_gettime
+SYS_clock_nanosleep
+SYS_clock_settime
+SYS_clone
+SYS_close
+SYS_connect
+SYS_copy_file_range
+SYS_delete_module
+SYS_dup
+SYS_dup3
+SYS_epoll_create1
+SYS_epoll_ctl
+SYS_epoll_pwait
+SYS_eventfd2
+SYS_execve
+SYS_execveat
+SYS_exit
+SYS_exit_group
+SYS_faccessat
+SYS_fallocate
+SYS_fanotify_init
+SYS_fanotify_mark
+SYS_fchdir
+SYS_fchmod
+SYS_fchmodat
+SYS_fchown
+SYS_fchownat
+SYS_fdatasync
+SYS_fgetxattr
+SYS_finit_module
+SYS_flistxattr
+SYS_flock
+SYS_fremovexattr
+SYS_fsetxattr
+SYS_fsync
+SYS_futex
+SYS_get_mempolicy
+SYS_get_robust_list
+SYS_getcpu
+SYS_getcwd
+SYS_getdents64
+SYS_getegid
+SYS_geteuid
+SYS_getgid
+SYS_getgroups
+SYS_getitimer
+SYS_getpeername
+SYS_getpgid
+SYS_getpid
+SYS_getppid
+SYS_getpriority
+SYS_getrandom
+SYS_getresgid
+SYS_getresuid
+SYS_getrusage
+SYS_getsid
+SYS_getsockname
+SYS_getsockopt
+SYS_gettid
+SYS_gettimeofday
+SYS_getuid
+SYS_getxattr
+SYS_init_module
+SYS_inotify_add_watch
+SYS_inotify_init1
+SYS_inotify_rm_watch
+SYS_io_cancel
+SYS_io_destroy
+SYS_io_getevents
+SYS_io_setup
+SYS_io_submit
+SYS_ioctl
+SYS_ioprio_get
+SYS_ioprio_set
+SYS_kcmp
+SYS_kexec_load
+SYS_keyctl
+SYS_kill
+SYS_lgetxattr
+SYS_linkat
+SYS_listen
+SYS_listxattr
+SYS_llistxattr
+SYS_lookup_dcookie
+SYS_lremovexattr
+SYS_lsetxattr
+SYS_madvise
+SYS_mbind
+SYS_membarrier
+SYS_memfd_create
+SYS_mincore
+SYS_mkdirat
+SYS_mknodat
+SYS_mlock
+SYS_mlock2
+SYS_mlockall
+SYS_mount
+SYS_move_pages
+SYS_mprotect
+SYS_mq_getsetattr
+SYS_mq_notify
+SYS_mq_open
+SYS_mq_timedreceive
+SYS_mq_timedsend
+SYS_mq_unlink
+SYS_mremap
+SYS_msync
+SYS_munlock
+SYS_munlockall
+SYS_munmap
+SYS_name_to_handle_at
+SYS_nanosleep
+SYS_nfsservctl
+SYS_open_by_handle_at
+SYS_openat
+SYS_perf_event_open
+SYS_personality
+SYS_pipe2
+SYS_pivot_root
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_ppoll
+SYS_prctl
+SYS_pread64
+SYS_preadv
+SYS_preadv2
+SYS_prlimit64
+SYS_process_vm_readv
+SYS_process_vm_writev
+SYS_pselect6
+SYS_ptrace
+SYS_pwrite64
+SYS_pwritev
+SYS_pwritev2
+SYS_quotactl
+SYS_read
+SYS_readahead
+SYS_readlinkat
+SYS_readv
+SYS_reboot
+SYS_recvfrom
+SYS_recvmmsg
+SYS_recvmsg
+SYS_remap_file_pages
+SYS_removexattr
+SYS_renameat
+SYS_renameat2
+SYS_request_key
+SYS_restart_syscall
+SYS_rt_sigaction
+SYS_rt_sigpending
+SYS_rt_sigprocmask
+SYS_rt_sigqueueinfo
+SYS_rt_sigreturn
+SYS_rt_sigsuspend
+SYS_rt_sigtimedwait
+SYS_rt_tgsigqueueinfo
+SYS_sched_get_priority_max
+SYS_sched_get_priority_min
+SYS_sched_getaffinity
+SYS_sched_getattr
+SYS_sched_getparam
+SYS_sched_getscheduler
+SYS_sched_rr_get_interval
+SYS_sched_setaffinity
+SYS_sched_setattr
+SYS_sched_setparam
+SYS_sched_setscheduler
+SYS_sched_yield
+SYS_seccomp
+SYS_sendmmsg
+SYS_sendmsg
+SYS_sendto
+SYS_set_mempolicy
+SYS_set_robust_list
+SYS_set_tid_address
+SYS_setdomainname
+SYS_setfsgid
+SYS_setfsuid
+SYS_setgid
+SYS_setgroups
+SYS_sethostname
+SYS_setitimer
+SYS_setns
+SYS_setpgid
+SYS_setpriority
+SYS_setregid
+SYS_setresgid
+SYS_setresuid
+SYS_setreuid
+SYS_setrlimit
+SYS_setsid
+SYS_setsockopt
+SYS_settimeofday
+SYS_setuid
+SYS_setxattr
+SYS_shutdown
+SYS_sigaltstack
+SYS_signalfd4
+SYS_socket
+SYS_socketpair
+SYS_splice
+SYS_swapoff
+SYS_swapon
+SYS_symlinkat
+SYS_sync
+SYS_syncfs
+SYS_sysinfo
+SYS_syslog
+SYS_tee
+SYS_tgkill
+SYS_timer_create
+SYS_timer_delete
+SYS_timer_getoverrun
+SYS_timer_gettime
+SYS_timer_settime
+SYS_timerfd_create
+SYS_timerfd_gettime
+SYS_timerfd_settime
+SYS_times
+SYS_tkill
+SYS_umask
+SYS_umount2
+SYS_uname
+SYS_unlinkat
+SYS_unshare
+SYS_userfaultfd
+SYS_utimensat
+SYS_vhangup
+SYS_vmsplice
+SYS_wait4
+SYS_waitid
+SYS_write
+SYS_writev
+S_IFBLK
+S_IFCHR
+S_IFDIR
+S_IFIFO
+S_IFLNK
+S_IFMT
+S_IFREG
+S_IFSOCK
+S_IRGRP
+S_IROTH
+S_IRUSR
+S_IRWXG
+S_IRWXO
+S_IRWXU
+S_ISGID
+S_ISUID
+S_ISVTX
+S_IWGRP
+S_IWOTH
+S_IWUSR
+S_IXGRP
+S_IXOTH
+S_IXUSR
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCFLSH
+TCGETA
+TCGETS
+TCIFLUSH
+TCIOFF
+TCIOFLUSH
+TCION
+TCOFLUSH
+TCOOFF
+TCOON
+TCP_CONGESTION
+TCP_CORK
+TCP_DEFER_ACCEPT
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINTVL
+TCP_LINGER2
+TCP_MAXSEG
+TCP_NODELAY
+TCP_QUICKACK
+TCP_SYNCNT
+TCP_ULP
+TCP_WINDOW_CLAMP
+TCSADRAIN
+TCSAFLUSH
+TCSANOW
+TCSBRK
+TCSBRKP
+TCSETA
+TCSETAF
+TCSETAW
+TCSETS
+TCSETSF
+TCSETSW
+TCXONC
+TFD_CLOEXEC
+TFD_NONBLOCK
+TFD_TIMER_ABSTIME
+TFD_TIMER_CANCEL_ON_SET
+TIMER_ABSTIME
+TIOCCBRK
+TIOCCONS
+TIOCEXCL
+TIOCGPGRP
+TIOCGSERIAL
+TIOCGSOFTCAR
+TIOCGWINSZ
+TIOCINQ
+TIOCLINUX
+TIOCMBIC
+TIOCMBIS
+TIOCMGET
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNXCL
+TIOCOUTQ
+TIOCSBRK
+TIOCSCTTY
+TIOCSPGRP
+TIOCSSOFTCAR
+TIOCSTI
+TIOCSWINSZ
+TMPFS_MAGIC
+TMP_MAX
+TOSTOP
+UINPUT_MAX_NAME_SIZE
+UINPUT_VERSION
+UIO_MAXIOV
+USBDEVICE_SUPER_MAGIC
+USER_PROCESS
+USRQUOTA
+UTIME_NOW
+UTIME_OMIT
+UT_HOSTSIZE
+UT_LINESIZE
+UT_NAMESIZE
+VDISCARD
+VEOF
+VEOL
+VEOL2
+VERASE
+VINTR
+VKILL
+VLNEXT
+VMADDR_CID_ANY
+VMADDR_CID_HOST
+VMADDR_CID_HYPERVISOR
+VMADDR_CID_LOCAL
+VMADDR_PORT_ANY
+VMIN
+VQUIT
+VREPRINT
+VSTART
+VSTOP
+VSUSP
+VSWTC
+VT0
+VT1
+VTDLY
+VTIME
+VWERASE
+WCONTINUED
+WCOREDUMP
+WEXITED
+WEXITSTATUS
+WHOLE_SECONDS
+WIFCONTINUED
+WIFEXITED
+WIFSIGNALED
+WIFSTOPPED
+WNOHANG
+WNOWAIT
+WSTOPPED
+WSTOPSIG
+WTERMSIG
+WUNTRACED
+W_EXITCODE
+W_OK
+W_STOPCODE
+XFS_SUPER_MAGIC
+XTABS
+X_OK
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CHOWN_RESTRICTED
+_PC_LINK_MAX
+_PC_MAX_CANON
+_PC_MAX_INPUT
+_PC_NAME_MAX
+_PC_NO_TRUNC
+_PC_PATH_MAX
+_PC_PIPE_BUF
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_PC_VDISABLE
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_C_VERSION
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ARG_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_AVPHYS_PAGES
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CHILD_MAX
+_SC_CLK_TCK
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_HOST_NAME_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NGROUPS_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_OPEN_MAX
+_SC_PAGESIZE
+_SC_PAGE_SIZE
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RE_DUP_MAX
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAM_MAX
+_SC_SYMLOOP_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TTY_NAME_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_TZNAME_MAX
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_VERSION
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_UUCP
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+__CPU_BITS
+__CPU_BITTYPE
+__NFT_REG_MAX
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno
+__fsid_t
+__kernel_loff_t
+__kernel_pid_t
+__sched_cpualloc
+__sched_cpucount
+__sched_cpufree
+__system_property_find
+__system_property_find_nth
+__system_property_foreach
+__system_property_get
+__system_property_set
+_exit
+abort
+accept
+accept4
+access
+acct
+addrinfo
+af_alg_iv
+alarm
+android_set_abort_message
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+arpreq
+arpreq_old
+atexit
+atof
+atoi
+atol
+atoll
+bind
+blkcnt_t
+blksize_t
+brk
+bsearch
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+cc_t
+cfgetispeed
+cfgetospeed
+cfmakeraw
+cfsetispeed
+cfsetospeed
+cfsetspeed
+chdir
+chmod
+chown
+chroot
+clearenv
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+clock_t
+clockid_t
+clone
+close
+closedir
+closelog
+cmsghdr
+connect
+cpu_set_t
+creat
+creat64
+daemon
+dev_t
+difftime
+dirent
+dirent64
+dirfd
+dladdr
+dlclose
+dlerror
+dlopen
+dlsym
+dup
+dup2
+duplocale
+endservent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_wait
+eventfd
+execl
+execle
+execlp
+execv
+execve
+execvp
+execvpe
+exit
+exit_status
+faccessat
+fallocate
+fallocate64
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fd_set
+fdatasync
+fdopen
+fdopendir
+feof
+ferror
+fexecve
+fflush
+ff_condition_effect
+ff_constant_effect
+ff_effect
+ff_envelope
+ff_periodic_effect
+ff_ramp_effect
+ff_replay
+ff_rumble_effect
+ff_trigger
+fgetc
+fgetpos
+fgets
+fgetxattr
+fileno
+flistxattr
+flock
+flock64
+fmemopen
+fopen
+fork
+forkpty
+fpathconf
+fpos_t
+fprintf
+fputc
+fputs
+fread
+free
+freeaddrinfo
+freeifaddrs
+freelocale
+fremovexattr
+freopen
+fsblkcnt_t
+fscanf
+fseek
+fseeko
+fsetpos
+fsetxattr
+fsfilcnt_t
+fstat
+fstat64
+fstatat
+fstatat64
+fstatfs
+fstatfs64
+fstatvfs
+fstatvfs64
+fsync
+ftell
+ftello
+ftruncate
+ftruncate64
+futimens
+fwrite
+gai_strerror
+genlmsghdr
+getaddrinfo
+getchar
+getchar_unlocked
+getcwd
+getegid
+getenv
+geteuid
+getgid
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostname
+getifaddrs
+getline
+getlogin
+getnameinfo
+getopt
+getopt_long
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresgid
+getresuid
+getrlimit
+getrlimit64
+getrusage
+getservbyname
+getservbyport
+getservent
+getsid
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getutent
+getxattr
+gid_t
+gmtime
+gmtime_r
+grantpt
+group
+hostent
+id_t
+idtype_t
+if_indextoname
+if_nametoindex
+ifaddrs
+in6_addr
+in6_pktinfo
+in6_rtmsg
+in_addr
+in_addr_t
+in_pktinfo
+in_port_t
+initgroups
+ino64_t
+ino_t
+inotify_add_watch
+inotify_event
+inotify_init
+inotify_init1
+inotify_rm_watch
+input_absinfo
+input_event
+input_id
+input_keymap_entry
+input_mask
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+ioctl
+iovec
+ip_mreq
+ip_mreqn
+ip_mreq_source
+ipv6_mreq
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+itimerspec
+itimerval
+key_t
+kill
+killpg
+lastlog
+lchown
+lconv
+lgetxattr
+linger
+link
+linkat
+listen
+listxattr
+llistxattr
+locale_t
+localeconv
+localtime
+localtime_r
+lockf
+loff_t
+login_tty
+lremovexattr
+lseek
+lseek64
+lsetxattr
+lstat
+lstat64
+madvise
+major
+makedev
+mallinfo
+malloc
+malloc_usable_size
+mcontext_t
+memalign
+memchr
+memcmp
+memcpy
+memmove
+memrchr
+memset
+mincore
+minor
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mknodat
+mkstemp
+mktime
+mlock
+mlockall
+mmap
+mmap64
+mmsghdr
+mode_t
+mount
+mprotect
+msghdr
+msync
+munlock
+munlockall
+munmap
+nanosleep
+newlocale
+nfds_t
+nice
+nl_mmap_hdr
+nl_mmap_req
+nl_pktinfo
+nlattr
+nlink_t
+nlmsgerr
+nlmsghdr
+off64_t
+off_t
+open
+open64
+open_memstream
+open_wmemstream
+openat
+openat64
+opendir
+openlog
+openpty
+passwd
+pathconf
+pause
+pclose
+perror
+personality
+pid_t
+pipe
+pipe2
+poll
+pollfd
+popen
+posix_fadvise
+posix_fadvise64
+posix_fallocate
+posix_fallocate64
+posix_memalign
+posix_openpt
+ppoll
+prctl
+pread
+pread64
+preadv
+preadv64
+printf
+prlimit
+prlimit64
+process_vm_readv
+process_vm_writev
+prop_info
+protoent
+pselect
+pthread_atfork
+pthread_attr_destroy
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setstacksize
+pthread_attr_t
+pthread_barrierattr_destroy
+pthread_barrierattr_getpshared
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_barrierattr_t
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_barrier_wait
+pthread_barrier_t
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_t
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_condattr_destroy
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_init
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_condattr_t
+pthread_create
+pthread_detach
+pthread_exit
+pthread_getattr_np
+pthread_getcpuclockid
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_key_t
+pthread_kill
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_t
+pthread_mutex_timedlock
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getpshared
+pthread_mutexattr_init
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_mutexattr_t
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_t
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_init
+pthread_rwlockattr_setpshared
+pthread_rwlockattr_t
+pthread_self
+pthread_setschedparam
+pthread_setspecific
+pthread_sigmask
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+pthread_t
+ptrace
+ptrace_peeksiginfo_args
+ptrdiff_t
+ptsname
+ptsname_r
+
+putchar
+putchar_unlocked
+putenv
+puts
+pwrite
+pwrite64
+pwritev
+pwritev64
+qsort
+raise
+read
+readdir
+readdir64
+readdir64_r
+readdir_r
+readlink
+readlinkat
+readv
+realloc
+reallocarray
+realpath
+recv
+recvfrom
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+remove
+removexattr
+rename
+renameat
+res_init
+rewind
+rewinddir
+rlim_t
+rlimit
+rlimit64
+rmdir
+rusage
+sa_family_t
+sbrk
+scanf
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getcpu
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+sched_yield
+seccomp_data
+seekdir
+select
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_t
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendfile
+sendmmsg
+sendmsg
+sendto
+servent
+setbuf
+setegid
+setenv
+seteuid
+setfsgid
+setfsuid
+setgid
+setgroups
+sethostname
+setlocale
+setlogmask
+setns
+setpgid
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setrlimit64
+setservent
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setvbuf
+setxattr
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigdelset
+sigemptyset
+sigevent
+sigfillset
+sighandler_t
+siginfo_t
+sigismember
+signal
+signalfd
+signalfd_siginfo
+sigpending
+sigprocmask
+sigset64_t
+sigset_t
+sigsuspend
+sigtimedwait
+sigval
+sigwait
+size_t
+sleep
+snprintf
+sock_extended_err
+sock_filter
+sock_fprog
+sockaddr
+sockaddr_alg
+sockaddr_in
+sockaddr_in6
+sockaddr_ll
+sockaddr_nl
+sockaddr_storage
+sockaddr_un
+sockaddr_vm
+socket
+socketpair
+socklen_t
+speed_t
+splice
+sprintf
+sscanf
+ssize_t
+stack_t
+stat
+stat64
+statfs
+statfs64
+statvfs
+statvfs64
+strcasecmp
+strcasestr
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strlen
+strncasecmp
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strpbrk
+strrchr
+strsignal
+strspn
+strstr
+strtod
+strtof
+strtok
+strtol
+strtoll
+strtoul
+strtoull
+strxfrm
+suseconds_t
+swapoff
+swapon
+symlink
+symlinkat
+syscall
+sysconf
+sysinfo
+syslog
+system
+tcdrain
+tcflag_t
+tcflow
+tcflush
+tcgetattr
+tcgetpgrp
+tcgetsid
+tcsendbreak
+tcsetattr
+tcsetpgrp
+tee
+telldir
+termios
+termios2
+time
+time_t
+timegm
+timerfd_create
+timerfd_gettime
+timerfd_settime
+times
+timespec
+timeval
+timezone
+tm
+tmpfile
+tmpnam
+tms
+tolower
+toupper
+truncate
+truncate64
+ttyname
+ttyname_r
+ucontext_t
+ucred
+uid_t
+uinput_abs_setup
+uinput_ff_erase
+uinput_ff_upload
+uinput_setup
+uinput_user_dev
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+umask
+umount
+umount2
+uname
+ungetc
+unlink
+unlinkat
+unlockpt
+unsetenv
+unshare
+useconds_t
+uselocale
+usleep
+utimbuf
+utime
+utimensat
+utimes
+utmp
+utmpname
+utsname
+vfork
+vmsplice
+wait
+wait4
+waitid
+waitpid
+wchar_t
+wcslen
+wcstombs
+winsize
+wmemchr
+write
+writev
+dirname
+basename
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
new file mode 100644
index 0000000000000..3a39b2e9ca20b
--- /dev/null
+++ b/libc-test/semver/apple.txt
@@ -0,0 +1,2231 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ACCOUNTING
+AF_APPLETALK
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_HYLINK
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_NATM
+AF_NETBIOS
+AF_NS
+AF_OSI
+AF_PPP
+AF_PUP
+AF_ROUTE
+AF_SIP
+AF_SNA
+AF_SYSTEM
+AF_SYS_CONTROL
+AIO_ALLDONE
+AIO_CANCELED
+AIO_LISTIO_MAX
+AIO_NOTCANCELED
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_DEFAULT
+AI_MASK
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_UNUSABLE
+AI_V4MAPPED
+AI_V4MAPPED_CFG
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+ATTR_BIT_MAP_COUNT
+ATTR_CMNEXT_CLONEID
+ATTR_CMNEXT_EXT_FLAGS
+ATTR_CMNEXT_LINKID
+ATTR_CMNEXT_NOFIRMLINKPATH
+ATTR_CMNEXT_PRIVATESIZE
+ATTR_CMNEXT_REALDEVID
+ATTR_CMNEXT_REALFSID
+ATTR_CMNEXT_RECURSIVE_GENCOUNT
+ATTR_CMNEXT_RELPATH
+ATTR_CMN_ACCESSMASK
+ATTR_CMN_ACCTIME
+ATTR_CMN_ADDEDTIME
+ATTR_CMN_BKUPTIME
+ATTR_CMN_CHGTIME
+ATTR_CMN_CRTIME
+ATTR_CMN_DATA_PROTECT_FLAGS
+ATTR_CMN_DEVID
+ATTR_CMN_DOCUMENT_ID
+ATTR_CMN_EXTENDED_SECURITY
+ATTR_CMN_FILEID
+ATTR_CMN_FLAGS
+ATTR_CMN_FNDRINFO
+ATTR_CMN_FSID
+ATTR_CMN_FULLPATH
+ATTR_CMN_GEN_COUNT
+ATTR_CMN_GRPID
+ATTR_CMN_GRPUUID
+ATTR_CMN_MODTIME
+ATTR_CMN_NAME
+ATTR_CMN_OBJID
+ATTR_CMN_OBJPERMANENTID
+ATTR_CMN_OBJTAG
+ATTR_CMN_OBJTYPE
+ATTR_CMN_OWNERID
+ATTR_CMN_PARENTID
+ATTR_CMN_PAROBJID
+ATTR_CMN_RETURNED_ATTRS
+ATTR_CMN_SCRIPT
+ATTR_CMN_USERACCESS
+ATTR_CMN_UUID
+ATTR_DIR_ALLOCSIZE
+ATTR_DIR_DATALENGTH
+ATTR_DIR_ENTRYCOUNT
+ATTR_DIR_IOBLOCKSIZE
+ATTR_DIR_LINKCOUNT
+ATTR_DIR_MOUNTSTATUS
+ATTR_FILE_ALLOCSIZE
+ATTR_FILE_DATAALLOCSIZE
+ATTR_FILE_DATALENGTH
+ATTR_FILE_DEVTYPE
+ATTR_FILE_FORKCOUNT
+ATTR_FILE_FORKLIST
+ATTR_FILE_IOBLOCKSIZE
+ATTR_FILE_LINKCOUNT
+ATTR_FILE_RSRCALLOCSIZE
+ATTR_FILE_RSRCLENGTH
+ATTR_FILE_TOTALSIZE
+ATTR_VOL_ALLOCATIONCLUMP
+ATTR_VOL_ATTRIBUTES
+ATTR_VOL_CAPABILITIES
+ATTR_VOL_DIRCOUNT
+ATTR_VOL_ENCODINGSUSED
+ATTR_VOL_FILECOUNT
+ATTR_VOL_FSTYPE
+ATTR_VOL_INFO
+ATTR_VOL_IOBLOCKSIZE
+ATTR_VOL_MAXOBJCOUNT
+ATTR_VOL_MINALLOCATION
+ATTR_VOL_MOUNTEDDEVICE
+ATTR_VOL_MOUNTFLAGS
+ATTR_VOL_MOUNTPOINT
+ATTR_VOL_NAME
+ATTR_VOL_OBJCOUNT
+ATTR_VOL_QUOTA_SIZE
+ATTR_VOL_RESERVED_SIZE
+ATTR_VOL_SIGNATURE
+ATTR_VOL_SIZE
+ATTR_VOL_SPACEAVAIL
+ATTR_VOL_SPACEFREE
+ATTR_VOL_SPACEUSED
+ATTR_VOL_UUID
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B7200
+B76800
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGDLTLIST
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGRTIMEOUT
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETF
+BIOCSETFNR
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSRTIMEOUT
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BPF_ALIGNMENT
+BS0
+BS1
+BSDLY
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+CCStatus
+CCCryptorStatus
+CCRandomGenerateBytes
+CCRNGStatus
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_THREAD_CPUTIME_ID
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CONNECT_DATA_AUTHENTICATED
+CONNECT_DATA_IDEMPOTENT
+CONNECT_RESUME_ON_READ_WRITE
+COPYFILE_ACL
+COPYFILE_CHECK
+COPYFILE_CLONE
+COPYFILE_CLONE_FORCE
+COPYFILE_CONTINUE
+COPYFILE_COPY_DATA
+COPYFILE_COPY_XATTR
+COPYFILE_DATA
+COPYFILE_DATA_SPARSE
+COPYFILE_ERR
+COPYFILE_EXCL
+COPYFILE_FINISH
+COPYFILE_METADATA
+COPYFILE_MOVE
+COPYFILE_NOFOLLOW
+COPYFILE_NOFOLLOW_DST
+COPYFILE_NOFOLLOW_SRC
+COPYFILE_PRESERVE_DST_TRACKED
+COPYFILE_PROGRESS
+COPYFILE_QUIT
+COPYFILE_RECURSE_DIR
+COPYFILE_RECURSE_DIR_CLEANUP
+COPYFILE_RECURSE_ERROR
+COPYFILE_RECURSE_FILE
+COPYFILE_RECURSIVE
+COPYFILE_RUN_IN_PLACE
+COPYFILE_SECURITY
+COPYFILE_SKIP
+COPYFILE_START
+COPYFILE_STAT
+COPYFILE_VERBOSE
+COPYFILE_UNLINK
+COPYFILE_XATTR
+CR0
+CR1
+CR2
+CR3
+CRDLY
+CRNCYSTR
+CRTSCTS
+CTLFLAG_ANYBODY
+CTLFLAG_KERN
+CTLFLAG_LOCKED
+CTLFLAG_MASKED
+CTLFLAG_NOAUTO
+CTLFLAG_NOLOCK
+CTLFLAG_OID2
+CTLFLAG_RD
+CTLFLAG_RW
+CTLFLAG_SECURE
+CTLFLAG_WR
+CTLTYPE
+CTLTYPE_INT
+CTLTYPE_NODE
+CTLTYPE_OPAQUE
+CTLTYPE_QUAD
+CTLTYPE_STRING
+CTLTYPE_STRUCT
+CTL_DEBUG
+CTL_DEBUG_MAXID
+CTL_DEBUG_NAME
+CTL_DEBUG_VALUE
+CTL_HW
+CTL_KERN
+CTL_MACHDEP
+CTL_MAXID
+CTL_NET
+CTL_UNSPEC
+CTL_USER
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DEAD_PROCESS
+DIR_MNTSTATUS_MNTPOINT
+DLT_ARCNET
+DLT_ATM_RFC1483
+DLT_AX25
+DLT_CHAOS
+DLT_EN10MB
+DLT_EN3MB
+DLT_FDDI
+DLT_IEEE802
+DLT_LOOP
+DLT_NULL
+DLT_PPP
+DLT_PRONET
+DLT_RAW
+DLT_SLIP
+DT_UNKNOWN
+D_FMT
+D_MD_ORDER
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADARCH
+EBADEXEC
+EBADMACHO
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EDEVERR
+EFTYPE
+ELAST
+EMPTY
+EMULTIHOP
+ENEEDAUTH
+ENOATTR
+ENODATA
+ENOLINK
+ENOPOLICY
+ENOSR
+ENOSTR
+ENOTBLK
+ENOTRECOVERABLE
+ENOTSUP
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+EPWROFF
+EQFULL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMOTE
+ERPCMISMATCH
+ESHLIBVERS
+ESOCKTNOSUPPORT
+ETIME
+ETOOMANYREFS
+EUSERS
+EVFILT_AIO
+EVFILT_FS
+EVFILT_MACHPORT
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VM
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG0
+EV_FLAG1
+EV_ONESHOT
+EV_OOBAND
+EV_POLL
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+FF0
+FF1
+FFDLY
+FILENAME_MAX
+FIOASYNC
+FIODTYPE
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+FSOPT_ATTR_CMN_EXTENDED
+FSOPT_NOFOLLOW
+FSOPT_NOFOLLOW_ANY
+FSOPT_PACK_INVAL_ATTRS
+FSOPT_REPORT_FULLSIZE
+FSOPT_RETURN_REALDEV
+F_ALLOCATEALL
+F_ALLOCATECONTIG
+F_BARRIERFSYNC
+F_FREEZE_FS
+F_FULLFSYNC
+F_GETOWN
+F_GETPATH
+F_GETPATH_NOFIRMLINK
+F_GLOBAL_NOCACHE
+F_LOCK
+F_LOG2PHYS
+F_LOG2PHYS_EXT
+F_NOCACHE
+F_NODIRECT
+F_PEOFPOSMODE
+F_PREALLOCATE
+F_RDADVISE
+F_RDAHEAD
+F_RDLCK
+F_SETOWN
+F_TEST
+F_THAW_FS
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_VOLPOSMODE
+F_WRLCK
+GETALL
+GETNCNT
+GETPID
+GETVAL
+GETZCNT
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+HW_AVAILCPU
+HW_BUS_FREQ
+HW_BYTEORDER
+HW_CACHELINE
+HW_CPU_FREQ
+HW_DISKNAMES
+HW_DISKSTATS
+HW_EPOCH
+HW_FLOATINGPT
+HW_L1DCACHESIZE
+HW_L1ICACHESIZE
+HW_L2CACHESIZE
+HW_L2SETTINGS
+HW_L3CACHESIZE
+HW_L3SETTINGS
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MAXID
+HW_MEMSIZE
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_PRODUCT
+HW_TARGET
+HW_TB_FREQ
+HW_USERMEM
+HW_VECTORUNIT
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_DEBUG
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_UP
+IMAXBEL
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DDP
+IPPROTO_DGP
+IPPROTO_DIVERT
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_EMCON
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GMTP
+IPPROTO_GRE
+IPPROTO_HELLO
+IPPROTO_HMP
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IDPR
+IPPROTO_IDRP
+IPPROTO_IGMP
+IPPROTO_IGP
+IPPROTO_IGRP
+IPPROTO_IL
+IPPROTO_INLSP
+IPPROTO_INP
+IPPROTO_IPCOMP
+IPPROTO_IPCV
+IPPROTO_IPEIP
+IPPROTO_IPIP
+IPPROTO_IPPC
+IPPROTO_IRTP
+IPPROTO_KRYPTOLAN
+IPPROTO_LARP
+IPPROTO_LEAF1
+IPPROTO_LEAF2
+IPPROTO_MAX
+IPPROTO_MEAS
+IPPROTO_MHRP
+IPPROTO_MICP
+IPPROTO_MTP
+IPPROTO_MUX
+IPPROTO_ND
+IPPROTO_NHRP
+IPPROTO_NONE
+IPPROTO_NSP
+IPPROTO_NVPII
+IPPROTO_OSPFIGP
+IPPROTO_PGM
+IPPROTO_PIGP
+IPPROTO_PIM
+IPPROTO_PRM
+IPPROTO_PUP
+IPPROTO_PVP
+IPPROTO_RAW
+IPPROTO_RCCMON
+IPPROTO_RDP
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_RVD
+IPPROTO_SATEXPAK
+IPPROTO_SATMON
+IPPROTO_SCCSP
+IPPROTO_SCTP
+IPPROTO_SDRP
+IPPROTO_SEP
+IPPROTO_SRPC
+IPPROTO_ST
+IPPROTO_SVMTP
+IPPROTO_SWIPE
+IPPROTO_TCF
+IPPROTO_TP
+IPPROTO_TPXX
+IPPROTO_TRUNK1
+IPPROTO_TRUNK2
+IPPROTO_TTP
+IPPROTO_VINES
+IPPROTO_VISA
+IPPROTO_VMTP
+IPPROTO_WBEXPAK
+IPPROTO_WBMON
+IPPROTO_WSN
+IPPROTO_XNET
+IPPROTO_XTP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_BOUND_IF
+IPV6_CHECKSUM
+IPV6_HOPLIMIT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_HDRINCL
+IP_BOUND_IF
+IP_PKTINFO
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVTOS
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+KERN_ABORTED
+KERN_AFFINITY
+KERN_AIOMAX
+KERN_AIOPROCMAX
+KERN_AIOTHREADS
+KERN_ALREADY_WAITING
+KERN_ARGMAX
+KERN_BOOTFILE
+KERN_BOOTTIME
+KERN_CHECKOPENEVT
+KERN_CLASSIC
+KERN_CLASSICHANDLER
+KERN_CLOCKRATE
+KERN_CODESIGN_ERROR
+KERN_COREDUMP
+KERN_COREFILE
+KERN_DEFAULT_SET
+KERN_DOMAINNAME
+KERN_DUMMY
+KERN_DUMPDEV
+KERN_EXCEPTION_PROTECTED
+KERN_EXEC
+KERN_FAILURE
+KERN_FILE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_IPC
+KERN_INSUFFICIENT_BUFFER_SIZE
+KERN_INVALID_ADDRESS
+KERN_INVALID_ARGUMENT
+KERN_INVALID_HOST
+KERN_INVALID_LEDGER
+KERN_INVALID_MEMORY_CONTROL
+KERN_INVALID_NAME
+KERN_INVALID_POLICY
+KERN_INVALID_OBJECT
+KERN_INVALID_SECURITY
+KERN_INVALID_TASK
+KERN_INVALID_RIGHT
+KERN_INVALID_VALUE
+KERN_JOB_CONTROL
+KERN_KDBUFWAIT
+KERN_KDCPUMAP
+KERN_KDDFLAGS
+KERN_KDEBUG
+KERN_KDEFLAGS
+KERN_KDENABLE
+KERN_KDGETBUF
+KERN_KDGETENTROPY
+KERN_KDGETREG
+KERN_KDPIDEX
+KERN_KDPIDTR
+KERN_KDREADCURTHRMAP
+KERN_KDREADTR
+KERN_KDREMOVE
+KERN_KDSETBUF
+KERN_KDSETREG
+KERN_KDSETRTCDEC
+KERN_KDSETUP
+KERN_KDSET_TYPEFILTER
+KERN_KDTHRMAP
+KERN_KDWRITEMAP
+KERN_KDWRITETR
+KERN_LOGSIGEXIT
+KERN_LOCK_OWNED
+KERN_LOCK_OWNED_SELF
+KERN_LOCK_SET_DESTROYED
+KERN_LOCK_UNSTABLE
+KERN_LOW_PRI_DELAY
+KERN_LOW_PRI_WINDOW
+KERN_MAXFILES
+KERN_MAXFILESPERPROC
+KERN_MAXID
+KERN_MAXPARTITIONS
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_MEMORY_DATA_MOVED
+KERN_MEMORY_PRESENT
+KERN_MEMORY_RESTART_COPY
+KERN_NAME_EXISTS
+KERN_NETBOOT
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NODE_DOWN
+KERN_NOT_DEPRESSED
+KERN_NOT_IN_SET
+KERN_NOT_RECEIVER
+KERN_NOT_SUPPORTED
+KERN_NOT_WAITING
+KERN_NTP_PLL
+KERN_NX_PROTECTION
+KERN_OPENEVT_PROC
+KERN_OPERATION_TIMED_OUT
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_OSVERSION
+KERN_POLICY_LIMIT
+KERN_POLICY_STATIC
+KERN_POSIX
+KERN_POSIX1
+KERN_PROC
+KERN_PROCARGS
+KERN_PROCARGS2
+KERN_PROCDELAYTERM
+KERN_PROCNAME
+KERN_PROC_ALL
+KERN_PROC_LCID
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_PS_STRINGS
+KERN_RAGEVNODE
+KERN_RAGE_PROC
+KERN_RAGE_THREAD
+KERN_RIGHT_EXISTS
+KERN_RPC_CONTINUE_ORPHAN
+KERN_RPC_SERVER_TERMINATED
+KERN_RPC_TERMINATE_ORPHAN
+KERN_SAFEBOOT
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_SEMAPHORE_DESTROYED
+KERN_SUCCESS
+KERN_SHREG_PRIVATIZABLE
+KERN_SPECULATIVE_READS
+KERN_SUGID_COREDUMP
+KERN_SYMFILE
+KERN_SYSV
+KERN_TERMINATED
+KERN_TFP
+KERN_TFP_POLICY
+KERN_TFP_POLICY_DEFAULT
+KERN_TFP_POLICY_DENY
+KERN_THALTSTACK
+KERN_THREADNAME
+KERN_TRANSLATE
+KERN_TTY
+KERN_UNOPENEVT_PROC
+KERN_UNRAGE_PROC
+KERN_UNRAGE_THREAD
+KERN_UPDATEINTERVAL
+KERN_UREFS_OVERFLOW
+KERN_USRSTACK32
+KERN_USRSTACK64
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_MBSTAT
+KIPC_NMBCLUSTERS
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+KIPC_SOQLIMITCOMPAT
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_SEGMENT
+LC_SEGMENT_64
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_PEERCRED
+LOCAL_PEEREPID
+LOCAL_PEEREUUID
+LOCAL_PEERPID
+LOCAL_PEERUUID
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_INSTALL
+LOG_LAUNCHD
+LOG_NETINFO
+LOG_NFACILITIES
+LOG_PERROR
+LOG_RAS
+LOG_REMOTEAUTH
+L_tmpnam
+MADV_CAN_REUSE
+MADV_DONTNEED
+MADV_FREE
+MADV_FREE_REUSABLE
+MADV_FREE_REUSE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MADV_ZERO_WIRED_PAGES
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_JIT
+MAP_NOCACHE
+MAP_NOEXTEND
+MAP_NORESERVE
+MAP_RENAME
+MAXCOMLEN
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MAXTHREADNAMESIZE
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MEMORY_OBJECT_NULL
+MH_MAGIC
+MH_MAGIC_64
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINSEC
+MINSIGSTKSZ
+MNT_ASYNC
+MNT_AUTOMOUNTED
+MNT_CPROTECT
+MNT_DEFWRITE
+MNT_DONTBROWSE
+MNT_DOVOLFS
+MNT_EXPORTED
+MNT_FORCE
+MNT_IGNORE_OWNERSHIP
+MNT_JOURNALED
+MNT_LOCAL
+MNT_MULTILABEL
+MNT_NOATIME
+MNT_NOBLOCK
+MNT_NODEV
+MNT_NOEXEC
+MNT_NOSUID
+MNT_NOUSERXATTR
+MNT_NOWAIT
+MNT_QUARANTINE
+MNT_QUOTA
+MNT_RDONLY
+MNT_RELOAD
+MNT_ROOTFS
+MNT_SNAPSHOT
+MNT_SYNCHRONOUS
+MNT_UNION
+MNT_UPDATE
+MNT_WAIT
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_DONTWAIT
+MSG_EOF
+MSG_FLUSH
+MSG_HAVEMORE
+MSG_HOLD
+MSG_RCVMORE
+MSG_SEND
+MS_DEACTIVATE
+MS_KILLPAGES
+NANOSECOND
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_IFLIST2
+NEW_TIME
+NI_DGRAM
+NI_MAXSERV
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSCOPE
+NI_NUMERICSERV
+NL0
+NL1
+NLDLY
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ABSOLUTE
+NOTE_ATTRIB
+NOTE_BACKGROUND
+NOTE_CHILD
+NOTE_CRITICAL
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXITSTATUS
+NOTE_EXIT_CSERROR
+NOTE_EXIT_DECRYPTFAIL
+NOTE_EXIT_DETAIL
+NOTE_EXIT_DETAIL_MASK
+NOTE_EXIT_MEMORY
+NOTE_EXTEND
+NOTE_FFAND
+NOTE_FFCOPY
+NOTE_FFCTRLMASK
+NOTE_FFLAGSMASK
+NOTE_FFNOP
+NOTE_FFOR
+NOTE_FORK
+NOTE_LEEWAY
+NOTE_LINK
+NOTE_LOWAT
+NOTE_NONE
+NOTE_NSECONDS
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_SECONDS
+NOTE_SIGNAL
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_USECONDS
+NOTE_VM_ERROR
+NOTE_VM_PRESSURE
+NOTE_VM_PRESSURE_SUDDEN_TERMINATE
+NOTE_VM_PRESSURE_TERMINATE
+NOTE_WRITE
+NTP_API
+OFDEL
+OFILL
+OLD_TIME
+ONOEOT
+OS_LOG_TYPE_DEBUG
+OS_LOG_TYPE_DEFAULT
+OS_LOG_TYPE_ERROR
+OS_LOG_TYPE_FAULT
+OS_LOG_TYPE_INFO
+OS_SIGNPOST_EVENT
+OS_SIGNPOST_INTERVAL_BEGIN
+OS_SIGNPOST_INTERVAL_END
+OS_UNFAIR_LOCK_INIT
+OXTABS
+O_ASYNC
+O_DSYNC
+O_EVTONLY
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_NOFOLLOW_ANY
+O_SHLOCK
+O_SYMLINK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NS
+PF_OSI
+PF_PIP
+PF_PPP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_SYSTEM
+PF_XTP
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_CLOEXEC_DEFAULT
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETEXEC
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+POSIX_SPAWN_START_SUSPENDED
+PRIO_DARWIN_BG
+PRIO_DARWIN_NONUI
+PRIO_DARWIN_PROCESS
+PRIO_DARWIN_THREAD
+PROC_CSM_ALL
+PROC_CSM_NOSMT
+PROC_CSM_TECS
+PROC_PIDTASKALLINFO
+PROC_PIDTASKINFO
+PROC_PIDTHREADINFO
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_INTROSPECTION_THREAD_CREATE
+PTHREAD_INTROSPECTION_THREAD_DESTROY
+PTHREAD_INTROSPECTION_THREAD_START
+PTHREAD_INTROSPECTION_THREAD_TERMINATE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PT_ATTACH
+PT_ATTACHEXC
+PT_CONTINUE
+PT_DENY_ATTACH
+PT_DETACH
+PT_FIRSTMACH
+PT_FORCEQUOTA
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_READ_U
+PT_SIGEXC
+PT_STEP
+PT_THUPDATE
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+PT_WRITE_U
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RENAME_EXCL
+RENAME_SWAP
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_NLIMITS
+RTAX_AUTHOR
+RTAX_BRD
+RTAX_DST
+RTAX_GATEWAY
+RTAX_GENMASK
+RTAX_IFA
+RTAX_IFP
+RTAX_MAX
+RTAX_NETMASK
+RTA_AUTHOR
+RTA_BRD
+RTA_DST
+RTA_GATEWAY
+RTA_GENMASK
+RTA_IFA
+RTA_IFP
+RTA_NETMASK
+RTF_BLACKHOLE
+RTF_BROADCAST
+RTF_CLONING
+RTF_CONDEMNED
+RTF_DEAD
+RTF_DELCLONE
+RTF_DONE
+RTF_DYNAMIC
+RTF_GATEWAY
+RTF_GLOBAL
+RTF_HOST
+RTF_IFREF
+RTF_IFSCOPE
+RTF_LLINFO
+RTF_LOCAL
+RTF_MODIFIED
+RTF_MULTICAST
+RTF_NOIFREF
+RTF_PINNED
+RTF_PRCLONING
+RTF_PROTO1
+RTF_PROTO2
+RTF_PROTO3
+RTF_PROXY
+RTF_REJECT
+RTF_ROUTER
+RTF_STATIC
+RTF_UP
+RTF_WASCLONED
+RTF_XRESOLVE
+RTLD_FIRST
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTLD_SELF
+RTM_ADD
+RTM_CHANGE
+RTM_DELADDR
+RTM_DELETE
+RTM_DELMADDR
+RTM_GET
+RTM_GET2
+RTM_IFINFO
+RTM_IFINFO2
+RTM_LOCK
+RTM_LOSING
+RTM_MISS
+RTM_NEWADDR
+RTM_NEWMADDR
+RTM_NEWMADDR2
+RTM_OLDADD
+RTM_OLDDEL
+RTM_REDIRECT
+RTM_RESOLVE
+RTM_VERSION
+RTV_EXPIRE
+RTV_HOPCOUNT
+RTV_MTU
+RTV_RPIPE
+RTV_RTT
+RTV_RTTVAR
+RTV_SPIPE
+RTV_SSTHRESH
+RUN_LVL
+RUSAGE_CHILDREN
+RUSAGE_SELF
+SAE_ASSOCID_ALL
+SAE_ASSOCID_ANY
+SAE_CONNID_ALL
+SAE_CONNID_ANY
+SCALE_PPM
+SCHED_OTHER
+SCHED_FIFO
+SCHED_RR
+SCM_CREDS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEEK_DATA
+SEEK_HOLE
+SEM_FAILED
+SEM_UNDO
+SETALL
+SETVAL
+SF_APPEND
+SF_ARCHIVED
+SF_IMMUTABLE
+SF_SETTABLE
+SHMLBA
+SHM_R
+SHM_RDONLY
+SHM_RND
+SHM_W
+SHUTDOWN_TIME
+SIGEMT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGINFO
+SIGIO
+SIGNATURE
+SIGSTKSZ
+SIOCGIFADDR
+SOCK_MAXADDRLEN
+SOCK_RAW
+SOCK_RDM
+SOL_LOCAL
+SOMAXCONN
+SO_DONTTRUNC
+SO_LABEL
+SO_LINGER_SEC
+SO_NKE
+SO_NOADDRERR
+SO_NOSIGPIPE
+SO_NOTIFYCONFLICT
+SO_NP_EXTENSIONS
+SO_NREAD
+SO_NWRITE
+SO_PEERLABEL
+SO_RANDOMPORT
+SO_REUSEPORT
+SO_REUSESHAREUID
+SO_TIMESTAMP
+SO_TIMESTAMP_MONOTONIC
+SO_USELOOPBACK
+SO_WANTMORE
+SO_WANTOOBFLAG
+SS_DISABLE
+SS_ONSTACK
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_NOSUID
+ST_RDONLY
+SUPERPAGE_NONE
+SUPERPAGE_SIZE_2MB
+SUPERPAGE_SIZE_ANY
+SYSPROTO_CONTROL
+SYSPROTO_EVENT
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCP_FASTOPEN
+TCP_KEEPALIVE
+TCP_KEEPCNT
+TCP_KEEPINTVL
+TCP_MAXSEG
+TCP_NOOPT
+TCP_NOPUSH
+THOUSEP
+THREAD_BACKGROUND_POLICY
+THREAD_BACKGROUND_POLICY_DARWIN_BG
+THREAD_BACKGROUND_POLICY_COUNT
+THREAD_AFFINITY_POLICY
+THREAD_AFFINITY_POLICY_COUNT
+THREAD_AFFINITY_TAG_NULL
+THREAD_BASIC_INFO
+THREAD_BASIC_INFO_COUNT
+THREAD_EXTENDED_INFO
+THREAD_EXTENDED_INFO_COUNT
+THREAD_EXTENDED_POLICY
+THREAD_EXTENDED_POLICY_COUNT
+THREAD_IDENTIFIER_INFO
+THREAD_IDENTIFIER_INFO_COUNT
+THREAD_LATENCY_QOS_POLICY
+THREAD_LATENCY_QOS_POLICY_COUNT
+THREAD_PRECEDENCE_POLICY
+THREAD_PRECEDENCE_POLICY_COUNT
+THREAD_STANDARD_POLICY
+THREAD_STANDARD_POLICY_COUNT
+THREAD_THROUGHPUT_QOS_POLICY
+THREAD_THROUGHPUT_QOS_POLICY_COUNT
+THREAD_TIME_CONSTRAINT_POLICY
+THREAD_TIME_CONSTRAINT_POLICY_COUNT
+TH_FLAGS_GLOBAL_FORCED_IDLE
+TH_FLAGS_IDLE
+TH_FLAGS_SWAPPED
+TH_STATE_HALTED
+TH_STATE_RUNNING
+TH_STATE_STOPPED
+TH_STATE_UNINTERRUPTIBLE
+TH_STATE_WAITING
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TIOCCBRK
+TIOCCDTR
+TIOCCONS
+TIOCDCDTIMESTAMP
+TIOCDRAIN
+TIOCDSIMICROCODE
+TIOCEXCL
+TIOCEXT
+TIOCFLUSH
+TIOCGDRAINWAIT
+TIOCGETD
+TIOCGPGRP
+TIOCIXOFF
+TIOCIXON
+TIOCMBIC
+TIOCMBIS
+TIOCMGDTRWAIT
+TIOCMGET
+TIOCMODG
+TIOCMODS
+TIOCMSDTRWAIT
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNOTTY
+TIOCNXCL
+TIOCOUTQ
+TIOCPKT
+TIOCPKT_DATA
+TIOCPKT_DOSTOP
+TIOCPKT_FLUSHREAD
+TIOCPKT_FLUSHWRITE
+TIOCPKT_IOCTL
+TIOCPKT_NOSTOP
+TIOCPKT_START
+TIOCPKT_STOP
+TIOCPTYGNAME
+TIOCPTYGRANT
+TIOCPTYUNLK
+TIOCREMOTE
+TIOCSBRK
+TIOCSCONS
+TIOCSCTTY
+TIOCSDRAINWAIT
+TIOCSDTR
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_COMPRESSED
+UF_HIDDEN
+UF_IMMUTABLE
+UF_NODUMP
+UF_OPAQUE
+UF_SETTABLE
+UF_TRACKED
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_MAXID
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTUN_OPT_FLAGS
+UTUN_OPT_IFNAME
+VDISCARD
+VDSUSP
+VLNEXT
+VM_FLAGS_ALIAS_MASK
+VM_FLAGS_ANYWHERE
+VM_FLAGS_FIXED
+VM_FLAGS_NO_CACHE
+VM_FLAGS_OVERWRITE
+VM_FLAGS_PURGABLE
+VM_FLAGS_RANDOM_ADDR
+VM_FLAGS_RESILIENT_CODESIGN
+VM_FLAGS_RESILIENT_MEDIA
+VM_FLAGS_RETURN_4K_DATA_ADDR
+VM_FLAGS_RETURN_DATA_ADDR
+VM_FLAGS_SUPERPAGE_MASK
+VM_FLAGS_SUPERPAGE_NONE
+VM_FLAGS_SUPERPAGE_SHIFT
+VM_FLAGS_SUPERPAGE_SIZE_2MB
+VM_FLAGS_SUPERPAGE_SIZE_ANY
+VM_FLAGS_USER_ALLOCATE
+VM_FLAGS_USER_MAP
+VM_FLAGS_USER_REMAP
+VM_LOADAVG
+VM_MACHFACTOR
+VM_MAKE_TAG
+VM_MAXID
+VM_MEMORY_ACCELERATE
+VM_MEMORY_ANALYSIS_TOOL
+VM_MEMORY_APPKIT
+VM_MEMORY_APPLICATION_SPECIFIC_1
+VM_MEMORY_APPLICATION_SPECIFIC_16
+VM_MEMORY_ASL
+VM_MEMORY_ASSETSD
+VM_MEMORY_ATS
+VM_MEMORY_CARBON
+VM_MEMORY_CGIMAGE
+VM_MEMORY_COREDATA
+VM_MEMORY_COREDATA_OBJECTIDS
+VM_MEMORY_COREGRAPHICS
+VM_MEMORY_COREGRAPHICS_BACKINGSTORES
+VM_MEMORY_COREGRAPHICS_DATA
+VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS
+VM_MEMORY_COREGRAPHICS_MISC
+VM_MEMORY_COREGRAPHICS_SHARED
+VM_MEMORY_COREGRAPHICS_XALLOC
+VM_MEMORY_COREIMAGE
+VM_MEMORY_COREPROFILE
+VM_MEMORY_CORESERVICES
+VM_MEMORY_COREUI
+VM_MEMORY_COREUIFILE
+VM_MEMORY_CORPSEINFO
+VM_MEMORY_DHMM
+VM_MEMORY_DYLD
+VM_MEMORY_DYLD_MALLOC
+VM_MEMORY_DYLIB
+VM_MEMORY_FOUNDATION
+VM_MEMORY_GENEALOGY
+VM_MEMORY_GLSL
+VM_MEMORY_GUARD
+VM_MEMORY_IMAGEIO
+VM_MEMORY_IOKIT
+VM_MEMORY_JAVA
+VM_MEMORY_JAVASCRIPT_CORE
+VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR
+VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE
+VM_MEMORY_LAYERKIT
+VM_MEMORY_LIBDISPATCH
+VM_MEMORY_MACH_MSG
+VM_MEMORY_MALLOC
+VM_MEMORY_MALLOC_HUGE
+VM_MEMORY_MALLOC_LARGE
+VM_MEMORY_MALLOC_LARGE_REUSABLE
+VM_MEMORY_MALLOC_LARGE_REUSED
+VM_MEMORY_MALLOC_NANO
+VM_MEMORY_MALLOC_SMALL
+VM_MEMORY_MALLOC_TINY
+VM_MEMORY_OBJC_DISPATCHERS
+VM_MEMORY_OPENCL
+VM_MEMORY_OS_ALLOC_ONCE
+VM_MEMORY_RAWCAMERA
+VM_MEMORY_REALLOC
+VM_MEMORY_SBRK
+VM_MEMORY_SCENEKIT
+VM_MEMORY_SHARED_PMAP
+VM_MEMORY_SKYWALK
+VM_MEMORY_SQLITE
+VM_MEMORY_STACK
+VM_MEMORY_SWIFT_METADATA
+VM_MEMORY_SWIFT_RUNTIME
+VM_MEMORY_TCMALLOC
+VM_MEMORY_UNSHARED_PMAP
+VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS
+VM_METER
+VM_PROT_EXECUTE
+VM_PROT_NONE
+VM_PROT_READ
+VM_PROT_WRITE
+VM_SWAPUSAGE
+VOL_CAPABILITIES_FORMAT
+VOL_CAPABILITIES_INTERFACES
+VOL_CAP_FMT_2TB_FILESIZE
+VOL_CAP_FMT_64BIT_OBJECT_IDS
+VOL_CAP_FMT_CASE_PRESERVING
+VOL_CAP_FMT_CASE_SENSITIVE
+VOL_CAP_FMT_DECMPFS_COMPRESSION
+VOL_CAP_FMT_DIR_HARDLINKS
+VOL_CAP_FMT_DOCUMENT_ID
+VOL_CAP_FMT_FAST_STATFS
+VOL_CAP_FMT_HARDLINKS
+VOL_CAP_FMT_HIDDEN_FILES
+VOL_CAP_FMT_JOURNAL
+VOL_CAP_FMT_JOURNAL_ACTIVE
+VOL_CAP_FMT_NO_IMMUTABLE_FILES
+VOL_CAP_FMT_NO_PERMISSIONS
+VOL_CAP_FMT_NO_ROOT_TIMES
+VOL_CAP_FMT_NO_VOLUME_SIZES
+VOL_CAP_FMT_OPENDENYMODES
+VOL_CAP_FMT_PATH_FROM_ID
+VOL_CAP_FMT_PERSISTENTOBJECTIDS
+VOL_CAP_FMT_SEALED
+VOL_CAP_FMT_SHARED_SPACE
+VOL_CAP_FMT_SPARSE_FILES
+VOL_CAP_FMT_SYMBOLICLINKS
+VOL_CAP_FMT_VOL_GROUPS
+VOL_CAP_FMT_WRITE_GENERATION_COUNT
+VOL_CAP_FMT_ZERO_RUNS
+VOL_CAP_INT_ADVLOCK
+VOL_CAP_INT_ALLOCATE
+VOL_CAP_INT_ATTRLIST
+VOL_CAP_INT_CLONE
+VOL_CAP_INT_COPYFILE
+VOL_CAP_INT_EXCHANGEDATA
+VOL_CAP_INT_EXTENDED_ATTR
+VOL_CAP_INT_EXTENDED_SECURITY
+VOL_CAP_INT_FLOCK
+VOL_CAP_INT_MANLOCK
+VOL_CAP_INT_NAMEDSTREAMS
+VOL_CAP_INT_NFSEXPORT
+VOL_CAP_INT_READDIRATTR
+VOL_CAP_INT_RENAME_EXCL
+VOL_CAP_INT_RENAME_OPENFAIL
+VOL_CAP_INT_RENAME_SWAP
+VOL_CAP_INT_SEARCHFS
+VOL_CAP_INT_SNAPSHOT
+VOL_CAP_INT_USERACCESS
+VOL_CAP_INT_VOL_RENAME
+VREPRINT
+VSTATUS
+VT0
+VT1
+VTDLY
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+XATTR_CREATE
+XATTR_NODEFAULT
+XATTR_NOFOLLOW
+XATTR_NOSECURITY
+XATTR_REPLACE
+XATTR_SHOWCOMPRESSION
+XUCRED_VERSION
+YESEXPR
+YESSTR
+_CS_PATH
+_CS_DARWIN_USER_DIR
+_CS_DARWIN_USER_TEMP_DIR
+_CS_DARWIN_USER_CACHE_DIR
+_IOFBF
+_IOLBF
+_IONBF
+_NSGetEnviron
+_NSGetExecutablePath
+_POSIX_VDISABLE
+_PTHREAD_COND_SIG_init
+_PTHREAD_MUTEX_SIG_init
+_PTHREAD_RWLOCK_SIG_init
+_RLIMIT_POSIX_FLAG
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FILE_LOCKING
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_RE_DUP_MAX
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_UTX_HOSTSIZE
+_UTX_IDSIZE
+_UTX_LINESIZE
+_UTX_USERSIZE
+_WSTATUS
+_WSTOPPED
+__PTHREAD_CONDATTR_SIZE__
+__PTHREAD_COND_SIZE__
+__PTHREAD_MUTEX_SIZE__
+__PTHREAD_RWLOCKATTR_SIZE__
+__PTHREAD_RWLOCK_SIZE__
+__darwin_mcontext64
+__error
+_dyld_get_image_header
+_dyld_get_image_name
+_dyld_get_image_vmaddr_slide
+_dyld_image_count
+abs
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+attrgroup_t
+attribute_set_t
+attrlist
+attrreference_t
+backtrace
+backtrace_from_fp
+backtrace_image_offsets
+backtrace_symbols
+backtrace_symbols_fd
+boolean_t
+bpf_hdr
+brk
+bsearch
+chflags
+chroot
+clearerr
+clock_getres
+clonefile
+clonefileat
+cmsghdr
+confstr
+connectx
+copyfile
+copyfile_flags_t
+cpu_subtype_t
+cpu_type_t
+difftime
+dirfd
+disconnectx
+dqblk
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+exchangedata
+faccessat
+fchdir
+fchflags
+fclonefileat
+fdopendir
+fgetattrlist
+fgetxattr
+flistxattr
+fmemopen
+fmount
+forkpty
+freeifaddrs
+freelocale
+fremovexattr
+fsetattrlist
+fsetxattr
+fsid_t
+fstatfs
+fstore_t
+ftok
+futimes
+getattrlist
+getattrlistat
+getattrlistbulk
+getdomainname
+getdtablesize
+getfsstat
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getitimer
+getline
+getloadavg
+getmntinfo
+getnameinfo
+getopt_long
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxent
+getutxid
+getutxline
+getxattr
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+image_offset
+in6_pktinfo
+in_pktinfo
+initgroups
+integer_t
+ip_mreqn
+ipc_perm
+kern_return_t
+kevent
+kevent64
+kevent64_s
+key_t
+killpg
+kqueue
+labs
+lio_listio
+listxattr
+load_command
+localeconv_l
+lockf
+log2phys
+login_tty
+lutimes
+mach_absolute_time
+mach_header
+mach_header_64
+mach_host_self
+mach_port_t
+mach_thread_self
+mach_timebase_info
+mach_timebase_info_data_t
+mach_vm_address_t
+mach_vm_map
+mach_vm_offset_t
+mach_vm_size_t
+madvise
+malloc_default_zone
+malloc_good_size
+malloc_printf
+malloc_size
+malloc_statistics_t
+malloc_zone_calloc
+malloc_zone_check
+malloc_zone_free
+malloc_zone_from_ptr
+malloc_zone_log
+malloc_zone_malloc
+malloc_zone_print
+malloc_zone_print_ptr_info
+malloc_zone_realloc
+malloc_zone_statistics
+malloc_zone_t
+malloc_zone_valloc
+max_align_t
+mcontext_t
+memory_object_t
+memory_object_offset_t
+memset_pattern4
+memset_pattern8
+memset_pattern16
+memset_s
+mem_entry_name_port_t
+mincore
+mkdirat
+mkstemps
+mount
+msghdr
+mstats
+newlocale
+nice
+nl_item
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+os_log_create
+os_log_t
+os_log_type_t
+os_log_type_enabled
+os_signpost_enabled
+os_signpost_id_generate
+os_signpost_id_make_with_pointer
+os_signpost_id_t
+os_signpost_type_t
+os_unfair_lock
+os_unfair_lock_s
+os_unfair_lock_t
+os_unfair_lock_lock
+os_unfair_lock_trylock
+os_unfair_lock_unlock
+os_unfair_lock_assert_owner
+os_unfair_lock_assert_not_owner
+pause
+policy_t
+popen
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getarchpref_np
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setarchpref_np
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+preadv
+proc_bsdinfo
+proc_kmsgbuf
+proc_listallpids
+proc_listchildpids
+proc_listpgrppids
+proc_listpids
+proc_libversion
+proc_name
+proc_pidinfo
+proc_pidfdinfo
+proc_pidfileportinfo
+proc_pidpath
+proc_regionfilename
+proc_set_no_smt
+proc_setthread_no_smt
+proc_set_csm
+proc_setthread_csm
+proc_taskallinfo
+proc_taskinfo
+proc_threadinfo
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_getschedparam
+pthread_attr_setschedparam
+pthread_cpu_number_np
+pthread_create_from_mach_thread
+pthread_getschedparam
+pthread_introspection_getspecific_np
+pthread_introspection_hook_t
+pthread_introspection_hook_install
+pthread_introspection_setspecific_np
+pthread_jit_write_callback_t
+pthread_jit_write_freeze_callbacks_np
+pthread_jit_write_protect_np
+pthread_jit_write_protect_supported_np
+pthread_jit_write_with_callback_np
+pthread_setschedparam
+pthread_cancel
+pthread_condattr_getpshared
+pthread_condattr_setpshared
+pthread_from_mach_thread_np
+pthread_get_stackaddr_np
+pthread_get_stacksize_np
+pthread_getname_np
+pthread_kill
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_setname_np
+ptrace
+pututxline
+pwritev
+qsort
+querylocale
+quotactl
+radvisory
+rand
+readdir_r
+readlinkat
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+removexattr
+renameatx_np
+renamex_np
+sa_endpoints_t
+sae_associd_t
+sae_connid_t
+sbrk
+sched_get_priority_max
+sched_get_priority_min
+sched_param
+seekdir
+segment_command
+segment_command_64
+sem_close
+sem_open
+sem_unlink
+sembuf
+semctl
+semget
+semid_ds
+semop
+semun
+sendfile
+sendmsg
+setattrlist
+setattrlistat
+setdomainname
+setgrent
+setgroups
+sethostid
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setrlimit
+setservent
+settimeofday
+setutxent
+setxattr
+sf_hdtr
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigwait
+sockaddr_ctl
+sockaddr_dl
+sockaddr_inarp
+srand
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+strtonum
+sync
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+sysdir_get_next_search_path_enumeration
+sysdir_search_path_directory_t
+sysdir_search_path_domain_mask_t
+sysdir_start_search_path_enumeration
+task_create
+task_for_pid
+task_info
+task_inspect_t
+task_terminate
+task_threads
+telldir
+thread_basic_info_t
+thread_extended_info_t
+thread_flavor_t
+thread_identifier_info_t
+thread_info
+thread_info_t
+thread_inspect_t
+thread_policy_set
+thread_policy_get
+timeval32
+timex
+time_value_t
+truncate
+ttyname_r
+ucontext_t
+unmount
+useconds_t
+uselocale
+utimensat
+utmpx
+utmpxname
+vm_inherit_t
+vm_map_t
+vm_prot_t
+vm_size_t
+vol_attributes_attr_t
+vol_capabilities_attr_t
+vol_capabilities_set_t
+wait4
+waitid
+xsw_usage
+xucred
+dirname
+basename
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
new file mode 100644
index 0000000000000..115c2919af3b1
--- /dev/null
+++ b/libc-test/semver/dragonfly.txt
@@ -0,0 +1,1550 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ACCOUNTING
+AF_APPLETALK
+AF_ATM
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NETBIOS
+AF_NETGRAPH
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SIP
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_LISTIO_MAX
+AIO_NOTCANCELED
+ALTMON_1
+ALTMON_10
+ALTMON_11
+ALTMON_12
+ALTMON_2
+ALTMON_3
+ALTMON_4
+ALTMON_5
+ALTMON_6
+ALTMON_7
+ALTMON_8
+ALTMON_9
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B7200
+B76800
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGDLTLIST
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGRTIMEOUT
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETF
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSRTIMEOUT
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BPF_ALIGNMENT
+BTUARTDISC
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+CCAR_OFLOW
+CCTS_OFLOW
+CDSR_OFLOW
+CDTR_IFLOW
+CIGNORE
+CKPT_FREEZE
+CKPT_THAW
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_MONOTONIC_FAST
+CLOCK_MONOTONIC_PRECISE
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_PROF
+CLOCK_REALTIME_FAST
+CLOCK_REALTIME_PRECISE
+CLOCK_SECOND
+CLOCK_THREAD_CPUTIME_ID
+CLOCK_UPTIME
+CLOCK_UPTIME_FAST
+CLOCK_UPTIME_PRECISE
+CLOCK_VIRTUAL
+CMGROUP_MAX
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CPU_CLR
+CPU_ISSET
+CPU_SET
+CPU_SETSIZE
+CPU_ZERO
+CPUCTL_RSMSR
+CPUCTL_WRMSR
+CPUCTL_CPUID
+CPUCTL_UPDATE
+CPUCTL_MSRSBIT
+CPUCTL_MSRCBIT
+CPUCTL_CPUID_COUNT
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTL_DEBUG
+CTL_HW
+CTL_KERN
+CTL_LWKT
+CTL_MACHDEP
+CTL_MAXID
+CTL_NET
+CTL_P1003_1B
+CTL_P1003_1B_AIO_LISTIO_MAX
+CTL_P1003_1B_AIO_MAX
+CTL_P1003_1B_AIO_PRIO_DELTA_MAX
+CTL_P1003_1B_ASYNCHRONOUS_IO
+CTL_P1003_1B_DELAYTIMER_MAX
+CTL_P1003_1B_FSYNC
+CTL_P1003_1B_MAPPED_FILES
+CTL_P1003_1B_MAXID
+CTL_P1003_1B_MEMLOCK
+CTL_P1003_1B_MEMLOCK_RANGE
+CTL_P1003_1B_MEMORY_PROTECTION
+CTL_P1003_1B_MESSAGE_PASSING
+CTL_P1003_1B_PAGESIZE
+CTL_P1003_1B_PRIORITIZED_IO
+CTL_P1003_1B_PRIORITY_SCHEDULING
+CTL_P1003_1B_REALTIME_SIGNALS
+CTL_P1003_1B_RTSIG_MAX
+CTL_P1003_1B_SEMAPHORES
+CTL_P1003_1B_SEM_NSEMS_MAX
+CTL_P1003_1B_SEM_VALUE_MAX
+CTL_P1003_1B_SHARED_MEMORY_OBJECTS
+CTL_P1003_1B_SIGQUEUE_MAX
+CTL_P1003_1B_SYNCHRONIZED_IO
+CTL_P1003_1B_TIMERS
+CTL_P1003_1B_TIMER_MAX
+CTL_P1003_1B_UNUSED1
+CTL_UNSPEC
+CTL_USER
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DEAD_PROCESS
+DOWNTIME
+DT_UNKNOWN
+D_FMT
+D_MD_ORDER
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EASYNC
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EDOOFUS
+EFTYPE
+ELAST
+EMPTY
+EMULTIHOP
+ENEEDAUTH
+ENOATTR
+ENOLINK
+ENOMEDIUM
+ENOTBLK
+ENOTRECOVERABLE
+ENOTSUP
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMOTE
+ERPCMISMATCH
+ESOCKTNOSUPPORT
+ETOOMANYREFS
+EUSERS
+EVFILT_AIO
+EVFILT_EXCEPT
+EVFILT_FS
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_NODATA
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIODNAME
+FIODTYPE
+FIOGETLBA
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+F_DUP2FD
+F_DUP2FD_CLOEXEC
+F_GETOWN
+F_GETPATH
+F_LOCK
+F_RDLCK
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+HW_BYTEORDER
+HW_DISKNAMES
+HW_DISKSTATS
+HW_FLOATINGPT
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MACHINE_PLATFORM
+HW_MAXID
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_SENSORS
+HW_USERMEM
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_DEBUG
+IFF_IDIRECT
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MONITOR
+IFF_MULTICAST
+IFF_NOARP
+IFF_NPOLLING
+IFF_OACTIVE_COMPAT
+IFF_POINTOPOINT
+IFF_POLLING_COMPAT
+IFF_PPROMISC
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_SMART
+IFF_STATICARP
+IFF_UP
+IMAXBEL
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CARP
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DDP
+IPPROTO_DGP
+IPPROTO_DIVERT
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_EMCON
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GMTP
+IPPROTO_GRE
+IPPROTO_HELLO
+IPPROTO_HMP
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IDPR
+IPPROTO_IDRP
+IPPROTO_IGMP
+IPPROTO_IGP
+IPPROTO_IGRP
+IPPROTO_IL
+IPPROTO_INLSP
+IPPROTO_INP
+IPPROTO_IPCOMP
+IPPROTO_IPCV
+IPPROTO_IPEIP
+IPPROTO_IPIP
+IPPROTO_IPPC
+IPPROTO_IRTP
+IPPROTO_KRYPTOLAN
+IPPROTO_LARP
+IPPROTO_LEAF1
+IPPROTO_LEAF2
+IPPROTO_MAX
+IPPROTO_MEAS
+IPPROTO_MHRP
+IPPROTO_MICP
+IPPROTO_MOBILE
+IPPROTO_MTP
+IPPROTO_MUX
+IPPROTO_ND
+IPPROTO_NHRP
+IPPROTO_NONE
+IPPROTO_NSP
+IPPROTO_NVPII
+IPPROTO_OSPFIGP
+IPPROTO_PFSYNC
+IPPROTO_PGM
+IPPROTO_PIGP
+IPPROTO_PIM
+IPPROTO_PRM
+IPPROTO_PUP
+IPPROTO_PVP
+IPPROTO_RAW
+IPPROTO_RCCMON
+IPPROTO_RDP
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_RVD
+IPPROTO_SATEXPAK
+IPPROTO_SATMON
+IPPROTO_SCCSP
+IPPROTO_SDRP
+IPPROTO_SEP
+IPPROTO_SKIP
+IPPROTO_SRPC
+IPPROTO_ST
+IPPROTO_SVMTP
+IPPROTO_SWIPE
+IPPROTO_TCF
+IPPROTO_TLSP
+IPPROTO_TP
+IPPROTO_TPXX
+IPPROTO_TRUNK1
+IPPROTO_TRUNK2
+IPPROTO_TTP
+IPPROTO_UNKNOWN
+IPPROTO_VINES
+IPPROTO_VISA
+IPPROTO_VMTP
+IPPROTO_WBEXPAK
+IPPROTO_WBMON
+IPPROTO_WSN
+IPPROTO_XNET
+IPPROTO_XTP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_CHECKSUM
+IPV6_HOPLIMIT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IPV6_DONTFRAG
+IP_HDRINCL
+IP_RECVDSTADDR
+IP_RECVIF
+IP_SENDSRCADDR
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+KERN_ARGMAX
+KERN_BOOTFILE
+KERN_BOOTTIME
+KERN_CLOCKRATE
+KERN_DUMMY
+KERN_DUMPDEV
+KERN_FILE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_IOV_MAX
+KERN_IPC
+KERN_JOB_CONTROL
+KERN_LOGSIGEXIT
+KERN_MAXFILES
+KERN_MAXFILESPERPROC
+KERN_MAXID
+KERN_MAXPOSIXLOCKSPERUID
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NTP_PLL
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_CWD
+KERN_PROC_FLAGMASK
+KERN_PROC_FLAG_LWP
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_PS_STRINGS
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_UPDATEINTERVAL
+KERN_USRSTACK
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_MBSTAT
+KIPC_NMBCLUSTERS
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_PEERCRED
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CONSOLE
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_NTP
+LOG_PERROR
+LOG_SECURITY
+L_tmpnam
+MADV_AUTOSYNC
+MADV_CORE
+MADV_DONTNEED
+MADV_FREE
+MADV_INVAL
+MADV_NOCORE
+MADV_NORMAL
+MADV_NOSYNC
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_SETMAP
+MADV_WILLNEED
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOCORE
+MAP_NOSYNC
+MAP_STACK
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINCORE_SUPER
+MINSEC
+MNT_AUTOMOUNTED
+MNT_EXPUBLIC
+MNT_FORCE
+MNT_IGNORE
+MNT_LOCAL
+MNT_NODEV
+MNT_QUOTA
+MNT_ROOTFS
+MNT_TRIM
+MNT_USER
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_CMSG_CLOEXEC
+MSG_DONTWAIT
+MSG_EOF
+MSG_FBLOCKING
+MSG_FMASK
+MSG_FNONBLOCKING
+MSG_NOSIGNAL
+MSG_SYNC
+MSG_UNUSED09
+NANOSECOND
+NETGRAPHDISC
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_MAXID
+NEW_TIME
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FFAND
+NOTE_FFCOPY
+NOTE_FFCTRLMASK
+NOTE_FFLAGSMASK
+NOTE_FFNOP
+NOTE_FFOR
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_OOB
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_WRITE
+NTP_API
+OLD_TIME
+ONOEOT
+OXTABS
+O_ASYNC
+O_DIRECT
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_SHLOCK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_ATM
+PF_BLUETOOTH
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NETGRAPH
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_XTP
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLSTANDARD
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PPPDISC
+PROC_PDEATHSIG_CTL
+PROC_PDEATHSIG_STATUS
+PROC_REAP_ACQUIRE
+PROC_REAP_RELEASE
+PROC_REAP_STATUS
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_IO
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_STEP
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_ILLSEQ
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_POSIXLOCKS
+RLIMIT_RSS
+RLIMIT_SBSIZE
+RLIMIT_STACK
+RLIMIT_VMEM
+RLIM_INFINITY
+RLIM_NLIMITS
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTLD_SELF
+RTP_LOOKUP
+RTP_PRIO_IDLE
+RTP_PRIO_MAX
+RTP_PRIO_MIN
+RTP_PRIO_NORMAL
+RTP_PRIO_REALTIME
+RTP_PRIO_THREAD
+RTP_SET
+RUN_LVL
+RUSAGE_CHILDREN
+RUSAGE_SELF
+SCALE_PPM
+SCHED_FIFO
+SCHED_OTHER
+SCHED_RR
+SCM_CREDS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEEK_DATA
+SEEK_HOLE
+SEM_FAILED
+SF_APPEND
+SF_ARCHIVED
+SF_CACHE
+SF_IMMUTABLE
+SF_NOHISTORY
+SF_NOUNLINK
+SF_SETTABLE
+SF_XLINK
+SHM_R
+SHM_RDONLY
+SHM_RND
+SHM_W
+SIGCKPT
+SIGCKPTEXIT
+SIGEMT
+SIGEV_KEVENT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGINFO
+SIGIO
+SIGNATURE
+SIGSTKSZ
+SIOCGIFADDR
+SLIPDISC
+SOCK_CLOEXEC
+SOCK_MAXADDRLEN
+SOCK_NONBLOCK
+SOCK_RAW
+SOCK_RDM
+SOMAXCONN
+SOMAXOPT_SIZE
+SO_ACCEPTFILTER
+SO_CPUHINT
+SO_NOSIGPIPE
+SO_PASSCRED
+SO_SNDSPACE
+SO_TIMESTAMP
+SO_USELOOPBACK
+SS_DISABLE
+SS_ONSTACK
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_NOSUID
+ST_RDONLY
+S_IEXEC
+S_IREAD
+S_IWRITE
+TCP_FASTKEEP
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINIT
+TCP_KEEPINTVL
+TCP_MAXSEG
+TCP_NOOPT
+TCP_NOPUSH
+TCP_SIGNATURE_ENABLE
+THOUSEP
+TIMER_ABSTIME
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TIOCCBRK
+TIOCCDTR
+TIOCCONS
+TIOCDCDTIMESTAMP
+TIOCDRAIN
+TIOCEXCL
+TIOCEXT
+TIOCFLUSH
+TIOCGDRAINWAIT
+TIOCGETA
+TIOCGETD
+TIOCGPGRP
+TIOCGSID
+TIOCISPTMASTER
+TIOCMBIC
+TIOCMBIS
+TIOCMGDTRWAIT
+TIOCMGET
+TIOCMODG
+TIOCMODS
+TIOCMSDTRWAIT
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNOTTY
+TIOCNXCL
+TIOCOUTQ
+TIOCPKT
+TIOCPKT_DATA
+TIOCPKT_DOSTOP
+TIOCPKT_FLUSHREAD
+TIOCPKT_FLUSHWRITE
+TIOCPKT_IOCTL
+TIOCPKT_NOSTOP
+TIOCPKT_START
+TIOCPKT_STOP
+TIOCREMOTE
+TIOCSBRK
+TIOCSCTTY
+TIOCSDRAINWAIT
+TIOCSDTR
+TIOCSETA
+TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+TTYDISC
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_CACHE
+UF_IMMUTABLE
+UF_NODUMP
+UF_NOHISTORY
+UF_NOUNLINK
+UF_OPAQUE
+UF_SETTABLE
+UF_XLINK
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_MAXID
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTX_DB_LASTLOG
+UTX_DB_UTMPX
+UTX_DB_WTMPX
+VCHECKPT
+VDISCARD
+VDSUSP
+VERASE2
+VLNEXT
+VREPRINT
+VSTATUS
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+WTRAPPED
+XUCRED_VERSION
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ACL_EXTENDED
+_PC_ACL_PATH_MAX
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CAP_PRESENT
+_PC_FILESIZEBITS
+_PC_INF_PRESENT
+_PC_MAC_PRESENT
+_PC_MIN_HOLE_SIZE
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_PC_TIMESTAMP_RESOLUTION
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FILE_LOCKING
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_RE_DUP_MAX
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_UTX_HOSTSIZE
+_UTX_IDSIZE
+_UTX_LINESIZE
+_UTX_USERSIZE
+__errno_location
+abs
+accept_filter_arg
+accept4
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_waitcomplete
+aio_write
+aiocb
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+backtrace
+backtrace_symbols
+backtrace_symbols_fd
+bpf_dltlist
+bpf_hdr
+bpf_insn
+bpf_program
+bpf_stat
+bpf_version
+bsearch
+chflags
+chflagsat
+chroot
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_settime
+cmsgcred
+cmsghdr
+cpuctl_cpuid_args_t
+cpuctl_cpuid_count_args_t
+cpuctl_msr_args_t
+cpuctl_update_args_t
+daemon
+devname_r
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+drand48
+erand48
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+eui64_aton
+eui64_hostton
+eui64_ntoa
+eui64_ntohost
+exit_status
+explicit_bzero
+faccessat
+fchdir
+fchflags
+fdopendir
+fexecve
+fmemopen
+forkpty
+fparseln
+freeifaddrs
+freelocale
+freezero
+fsid_t
+fstatfs
+futimes
+getdomainname
+getdtablesize
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getitimer
+getlastlogx
+getline
+getloadavg
+getnameinfo
+getopt_long
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getresgid
+getresuid
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxuser
+getutxent
+getutxid
+getutxline
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+jrand48
+kevent
+killpg
+kinfo_cputime
+kinfo_file
+kinfo_lwp
+kinfo_proc
+kvm_close
+kvm_getloadavg
+kvm_getprocs
+kvm_open
+kvm_openfiles
+kvm_read
+kvm_t
+kvm_vm_map_entry_first
+kvm_vm_map_entry_next
+kvm_write
+kqueue
+labs
+lastlog
+lchflags
+lcong48
+lio_listio
+lockf
+login_tty
+lrand48
+lutimes
+lwp_rtprio
+lwpid_t
+madvise
+mcontext_t
+memmem
+memrchr
+memset_s
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkstemps
+mq_attr
+mq_close
+mq_getattr
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+mrand48
+msghdr
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+nrand48
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+ppoll
+preadv
+procctl
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_barrierattr_destroy
+pthread_barrierattr_getpshared
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_barrierattr_t
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_get_name_np
+pthread_getcpuclockid
+pthread_kill
+pthread_main_np
+pthread_mutex_timedlock
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_set_name_np
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+ptrace
+ptrace_io_desc
+pututxline
+pwritev
+qsort
+querylocale
+rand
+readdir_r
+readlinkat
+reallocf
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+rtprio
+sched_getparam
+sched_getscheduler
+sched_get_priority_max
+sched_get_priority_min
+sched_param
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+seed48
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendfile
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostid
+sethostname
+setitimer
+setpriority
+setproctitle
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+setutxdb
+setutxent
+sf_hdtr
+shmat
+shmctl
+shmdt
+shmget
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_dl
+srand
+srand48
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+sys_checkpoint
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+telldir
+timex
+truncate
+ttyname_r
+ucontext_t
+umtx_sleep
+umtx_wakeup
+unmount
+updatelastlogx
+updwtmpx
+useconds_t
+uselocale
+utimensat
+utmpx
+utmpxname
+utrace
+uuid
+uuid_t
+vm_map_entry_t
+vm_size_t
+vmspace
+wait4
+waitid
+xucred
+eaccess
+dirname
+basename
diff --git a/libc-test/semver/freebsd-x86_64.txt b/libc-test/semver/freebsd-x86_64.txt
new file mode 100644
index 0000000000000..8edfb525633db
--- /dev/null
+++ b/libc-test/semver/freebsd-x86_64.txt
@@ -0,0 +1,19 @@
+Elf64_Auxinfo
+MAP_32BIT
+_MC_FLAG_MASK
+_MC_FPFMT_NODEV
+_MC_FPFMT_XMM
+_MC_FPOWNED_FPU
+_MC_FPOWNED_NONE
+_MC_FPOWNED_PCB
+_MC_HASBASES
+_MC_HASFPXSTATE
+_MC_HASSEGS
+fpreg
+fpreg32
+max_align_t
+mcontext_t
+reg
+reg32
+ucontext_t
+xmmreg
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
new file mode 100644
index 0000000000000..c188346b9b740
--- /dev/null
+++ b/libc-test/semver/freebsd.txt
@@ -0,0 +1,1965 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_APPLETALK
+AF_ARP
+AF_ATM
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_INET6_SDP
+AF_INET_SDP
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_NATM
+AF_NETBIOS
+AF_NETGRAPH
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SCLUSTER
+AF_SIP
+AF_SLOW
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_LISTIO_MAX
+AIO_NOTCANCELED
+AI_PASSIVE
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_ALL
+AI_ADDRCONFIG
+AI_V4MAPPED
+ALTMON_1
+ALTMON_10
+ALTMON_11
+ALTMON_12
+ALTMON_2
+ALTMON_3
+ALTMON_4
+ALTMON_5
+ALTMON_6
+ALTMON_7
+ALTMON_8
+ALTMON_9
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_BASE
+AT_EACCESS
+AT_EGID
+AT_ENTRY
+AT_EUID
+AT_EXECPATH
+AT_FDCWD
+AT_FLAGS
+AT_GID
+AT_NOTELF
+AT_NULL
+AT_PAGESZ
+AT_PHDR
+AT_PHENT
+AT_PHNUM
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+AT_UID
+B14400
+B28800
+B460800
+B7200
+B76800
+B921600
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGDLTLIST
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGRTIMEOUT
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETF
+BIOCSETFNR
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSRTIMEOUT
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BPF_ALIGNMENT
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+CCAR_OFLOW
+CCTS_OFLOW
+CDSR_OFLOW
+CDTR_IFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_MONOTONIC_FAST
+CLOCK_MONOTONIC_PRECISE
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_PROF
+CLOCK_REALTIME_FAST
+CLOCK_REALTIME_PRECISE
+CLOCK_SECOND
+CLOCK_THREAD_CPUTIME_ID
+CLOCK_UPTIME
+CLOCK_UPTIME_FAST
+CLOCK_UPTIME_PRECISE
+CLOCK_VIRTUAL
+CMGROUP_MAX
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CPU_CLR
+CPU_COUNT
+CPU_ISSET
+CPU_LEVEL_CPUSET
+CPU_LEVEL_ROOT
+CPU_LEVEL_WHICH
+CPU_SET
+CPU_SETSIZE
+CPU_WHICH_CPUSET
+CPU_WHICH_IRQ
+CPU_WHICH_JAIL
+CPU_WHICH_PID
+CPU_WHICH_TID
+CPU_ZERO
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTL_DEBUG
+CTL_HW
+CTL_KERN
+CTL_MACHDEP
+CTL_NET
+CTL_P1003_1B
+CTL_P1003_1B_AIO_LISTIO_MAX
+CTL_P1003_1B_AIO_MAX
+CTL_P1003_1B_AIO_PRIO_DELTA_MAX
+CTL_P1003_1B_ASYNCHRONOUS_IO
+CTL_P1003_1B_DELAYTIMER_MAX
+CTL_P1003_1B_FSYNC
+CTL_P1003_1B_MAPPED_FILES
+CTL_P1003_1B_MEMLOCK
+CTL_P1003_1B_MEMLOCK_RANGE
+CTL_P1003_1B_MEMORY_PROTECTION
+CTL_P1003_1B_MESSAGE_PASSING
+CTL_P1003_1B_MQ_OPEN_MAX
+CTL_P1003_1B_PAGESIZE
+CTL_P1003_1B_PRIORITIZED_IO
+CTL_P1003_1B_PRIORITY_SCHEDULING
+CTL_P1003_1B_REALTIME_SIGNALS
+CTL_P1003_1B_RTSIG_MAX
+CTL_P1003_1B_SEMAPHORES
+CTL_P1003_1B_SEM_NSEMS_MAX
+CTL_P1003_1B_SEM_VALUE_MAX
+CTL_P1003_1B_SHARED_MEMORY_OBJECTS
+CTL_P1003_1B_SIGQUEUE_MAX
+CTL_P1003_1B_SYNCHRONIZED_IO
+CTL_P1003_1B_TIMERS
+CTL_P1003_1B_TIMER_MAX
+CTL_SYSCTL
+CTL_SYSCTL_DEBUG
+CTL_SYSCTL_NAME
+CTL_SYSCTL_NAME2OID
+CTL_SYSCTL_NEXT
+CTL_SYSCTL_OIDDESCR
+CTL_SYSCTL_OIDFMT
+CTL_SYSCTL_OIDLABEL
+CTL_USER
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DEAD_PROCESS
+DT_UNKNOWN
+D_FMT
+D_MD_ORDER
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADRPC
+ECAPMODE
+ECHOCTL
+ECHOKE
+ECHOPRT
+EDOOFUS
+EFTYPE
+ELAST
+EMPTY
+EMULTIHOP
+ENEEDAUTH
+ENOATTR
+ENOLINK
+ENOTBLK
+ENOTCAPABLE
+ENOTRECOVERABLE
+ENOTSUP
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMOTE
+ERPCMISMATCH
+ESOCKTNOSUPPORT
+ETOOMANYREFS
+EUSERS
+EVFILT_AIO
+EVFILT_EMPTY
+EVFILT_FS
+EVFILT_LIO
+EVFILT_PROC
+EVFILT_PROCDESC
+EVFILT_READ
+EVFILT_SENDFILE
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_DROP
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTATTR_NAMESPACE_EMPTY
+EXTATTR_NAMESPACE_SYSTEM
+EXTATTR_NAMESPACE_USER
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Auxinfo
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIODGNAME
+FIODTYPE
+FIOGETLBA
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIONSPACE
+FIONWRITE
+FIOSEEKDATA
+FIOSEEKHOLE
+FIOSETOWN
+FIOSSHMLPGCNF
+FLUSHO
+FOPEN_MAX
+F_DUP2FD
+F_DUP2FD_CLOEXEC
+F_GETOWN
+F_LOCK
+F_OGETLK
+F_OSETLK
+F_OSETLKW
+F_RDAHEAD
+F_RDLCK
+F_READAHEAD
+F_SETLK_REMOTE
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+H4DISC
+HOSTNAME_FOUND
+HOSTNAME_INCORRECTNAME
+HOSTNAME_INVALIDADDR
+HOSTNAME_INVALIDNAME
+HW_BYTEORDER
+HW_DISKNAMES
+HW_DISKSTATS
+HW_FLOATINGPT
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_REALMEM
+HW_USERMEM
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_CANTCONFIG
+IFF_DEBUG
+IFF_DYING
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MONITOR
+IFF_MULTICAST
+IFF_NOARP
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PPROMISC
+IFF_PROMISC
+IFF_RENAMING
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_STATICARP
+IFF_UP
+IMAXBEL
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_INFO
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CARP
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DCCP
+IPPROTO_DDP
+IPPROTO_DGP
+IPPROTO_DIVERT
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_EMCON
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GMTP
+IPPROTO_GRE
+IPPROTO_HELLO
+IPPROTO_HIP
+IPPROTO_HMP
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IDPR
+IPPROTO_IDRP
+IPPROTO_IGMP
+IPPROTO_IGP
+IPPROTO_IGRP
+IPPROTO_IL
+IPPROTO_INLSP
+IPPROTO_INP
+IPPROTO_IPCOMP
+IPPROTO_IPCV
+IPPROTO_IPEIP
+IPPROTO_IPIP
+IPPROTO_IPPC
+IPPROTO_IRTP
+IPPROTO_KRYPTOLAN
+IPPROTO_LARP
+IPPROTO_LEAF1
+IPPROTO_LEAF2
+IPPROTO_MAX
+IPPROTO_MEAS
+IPPROTO_MH
+IPPROTO_MHRP
+IPPROTO_MICP
+IPPROTO_MOBILE
+IPPROTO_MPLS
+IPPROTO_MTP
+IPPROTO_MUX
+IPPROTO_ND
+IPPROTO_NHRP
+IPPROTO_NONE
+IPPROTO_NSP
+IPPROTO_NVPII
+IPPROTO_OLD_DIVERT
+IPPROTO_OSPFIGP
+IPPROTO_PFSYNC
+IPPROTO_PGM
+IPPROTO_PIGP
+IPPROTO_PIM
+IPPROTO_PRM
+IPPROTO_PUP
+IPPROTO_PVP
+IPPROTO_RAW
+IPPROTO_RCCMON
+IPPROTO_RDP
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_RVD
+IPPROTO_SATEXPAK
+IPPROTO_SATMON
+IPPROTO_SCCSP
+IPPROTO_SCTP
+IPPROTO_SDRP
+IPPROTO_SEND
+IPPROTO_SHIM6
+IPPROTO_SKIP
+IPPROTO_SRPC
+IPPROTO_ST
+IPPROTO_SVMTP
+IPPROTO_SWIPE
+IPPROTO_TCF
+IPPROTO_TLSP
+IPPROTO_TP
+IPPROTO_TPXX
+IPPROTO_TRUNK1
+IPPROTO_TRUNK2
+IPPROTO_TTP
+IPPROTO_UDPLITE
+IPPROTO_VINES
+IPPROTO_VISA
+IPPROTO_VMTP
+IPPROTO_WBEXPAK
+IPPROTO_WBMON
+IPPROTO_WSN
+IPPROTO_XNET
+IPPROTO_XTP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_BINDANY
+IPV6_CHECKSUM
+IPV6_HOPLIMIT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_ORIGDSTADDR
+IPV6_PKTINFO
+IPV6_RECVORIGDSTADDR
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IPV6_DONTFRAG
+IP_BINDANY
+IP_BINDMULTI
+IP_HDRINCL
+IP_ORIGDSTADDR
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVORIGDSTADDR
+IP_DONTFRAG
+IP_RECVTOS
+IP_RSS_LISTEN_BUCKET
+IP_SENDSRCADDR
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+JAIL_API_VERSION
+JAIL_ATTACH
+JAIL_CREATE
+JAIL_DYING
+JAIL_GET_MASK
+JAIL_SET_MASK
+JAIL_SYS_DISABLE
+JAIL_SYS_INHERIT
+JAIL_SYS_NEW
+JAIL_UPDATE
+KERN_ARGMAX
+KERN_ARND
+KERN_BOOTFILE
+KERN_BOOTTIME
+KERN_CLOCKRATE
+KERN_DUMMY
+KERN_DUMPDEV
+KERN_FILE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_HOSTUUID
+KERN_IOV_MAX
+KERN_IPC
+KERN_JOB_CONTROL
+KERN_LOGSIGEXIT
+KERN_MAXFILES
+KERN_MAXFILESPERPROC
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NTP_PLL
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_AUXV
+KERN_PROC_ENV
+KERN_PROC_FILEDESC
+KERN_PROC_GID
+KERN_PROC_GROUPS
+KERN_PROC_INC_THREAD
+KERN_PROC_KSTACK
+KERN_PROC_OFILEDESC
+KERN_PROC_OSREL
+KERN_PROC_OVMMAP
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_PROC
+KERN_PROC_PS_STRINGS
+KERN_PROC_RGID
+KERN_PROC_RLIMIT
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_SIGTRAMP
+KERN_PROC_SV_NAME
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROC_UMASK
+KERN_PROC_VMMAP
+KERN_PROF
+KERN_PS_STRINGS
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_UPDATEINTERVAL
+KERN_USRSTACK
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_CONNWAIT
+LOCAL_CREDS
+LOCAL_PEERCRED
+LOCAL_VENDOR
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CONSOLE
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_NTP
+LOG_PERROR
+LOG_SECURITY
+L_tmpnam
+MADV_AUTOSYNC
+MADV_CORE
+MADV_DONTNEED
+MADV_FREE
+MADV_NOCORE
+MADV_NORMAL
+MADV_NOSYNC
+MADV_PROTECT
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MALLOCX_ARENA
+MALLOCX_ALIGN
+MALLOCX_TCACHE
+MALLOCX_ZERO
+MAP_COPY
+MAP_EXCL
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOCORE
+MAP_NOSYNC
+MAP_PREFAULT_READ
+MAP_STACK
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MFD_HUGE_16GB
+MFD_HUGE_16MB
+MFD_HUGE_1GB
+MFD_HUGE_1MB
+MFD_HUGE_256MB
+MFD_HUGE_2GB
+MFD_HUGE_2MB
+MFD_HUGE_32MB
+MFD_HUGE_512KB
+MFD_HUGE_512MB
+MFD_HUGE_64KB
+MFD_HUGE_8MB
+MFD_HUGE_MASK
+MFD_HUGETLB
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINCORE_SUPER
+MINSEC
+MINSIGSTKSZ
+MNT_FORCE
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_CMSG_CLOEXEC
+MSG_COMPAT
+MSG_DONTWAIT
+MSG_EOF
+MSG_NBIO
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_NOTIFICATION
+NANOSECOND
+NETGRAPHDISC
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_IFLISTL
+NET_RT_IFMALIST
+NEW_TIME
+NI_DGRAM
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSCOPE
+NI_NUMERICSERV
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FFAND
+NOTE_FFCOPY
+NOTE_FFCTRLMASK
+NOTE_FFLAGSMASK
+NOTE_FFNOP
+NOTE_FFOR
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_MSECONDS
+NOTE_NSECONDS
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_SECONDS
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_USECONDS
+NOTE_WRITE
+NTP_API
+OLD_TIME
+ONOEOT
+OXTABS
+O_ASYNC
+O_DIRECT
+O_EXEC
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_SHLOCK
+O_SYNC
+O_TTY_INIT
+PD_ALLOWED_AT_FORK
+PD_CLOEXEC
+PD_DAEMON
+PENDIN
+PF_APPLETALK
+PF_ARP
+PF_ATM
+PF_BLUETOOTH
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IEEE80211
+PF_IMPLINK
+PF_INET6_SDP
+PF_INET_SDP
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NETGRAPH
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SCLUSTER
+PF_SIP
+PF_SLOW
+PF_SNA
+PF_XTP
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PL_EVENT_NONE
+PL_EVENT_SIGNAL
+PL_FLAG_BORN
+PL_FLAG_BOUND
+PL_FLAG_CHILD
+PL_FLAG_EXEC
+PL_FLAG_EXITED
+PL_FLAG_VFORKED
+PL_FLAG_VFORK_DONE
+PL_FLAG_SA
+PL_FLAG_SCE
+PL_FLAG_SCX
+PL_FLAG_SI
+PM_STR
+POLLINIGNEOF
+POLLRDBAND
+POLLRDNORM
+POLLSTANDARD
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSCHEDPARAM
+POSIX_SPAWN_SETSCHEDULER
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+PPPDISC
+PROC_NO_NEW_PRIVS_CTL
+PROC_NO_NEW_PRIVS_DISABLE
+PROC_NO_NEW_PRIVS_ENABLE
+PROC_NO_NEW_PRIVS_STATUS
+PROC_PDEATHSIG_CTL
+PROC_PDEATHSIG_STATUS
+PROC_REAP_ACQUIRE
+PROC_REAP_GETPIDS
+PROC_REAP_RELEASE
+PROC_REAP_STATUS
+PROC_SPROTECT
+PROC_STACKGAP_CTL
+PROC_STACKGAP_STATUS
+PROC_TRACE_CTL
+PROC_TRACE_STATUS
+PROC_TRAPCAP_CTL
+PROC_TRAPCAP_STATUS
+PROC_WX_MAPPINGS_DISALLOW_EXEC
+PROC_WX_MAPPINGS_PERMIT
+PROC_WXMAP_CTL
+PROC_WXMAP_STATUS
+PROC_WXORX_ENFORCE
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_ADAPTIVE_NP
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_DEFAULT
+PTRACE_EXEC
+PTRACE_FORK
+PTRACE_LWP
+PTRACE_SCE
+PTRACE_SCX
+PTRACE_SYSCALL
+PTRACE_VFORK
+PT_ATTACH
+PT_CLEARSTEP
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_FOLLOW_FORK
+PT_GETDBREGS
+PT_GETFPREGS
+PT_GETLWPLIST
+PT_GETNUMLWPS
+PT_GETREGS
+PT_GET_EVENT_MASK
+PT_GET_SC_ARGS
+PT_GET_SC_RET
+PT_IO
+PT_KILL
+PT_LWPINFO
+PT_LWP_EVENTS
+PT_READ_D
+PT_READ_I
+PT_RESUME
+PT_SETDBREGS
+PT_SETFPREGS
+PT_SETREGS
+PT_SETSTEP
+PT_SET_EVENT_MASK
+PT_STEP
+PT_SUSPEND
+PT_SYSCALL
+PT_TO_SCE
+PT_TO_SCX
+PT_TRACE_ME
+PT_VM_ENTRY
+PT_VM_TIMESTAMP
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_ILLSEQ
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RFCFDG
+RFFDG
+RFLINUXTHPN
+RFMEM
+RFNOWAIT
+RFPROC
+RFSPAWN
+RFTHREAD
+RFTSIGZMB
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_KQUEUES
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_NPTS
+RLIMIT_RSS
+RLIMIT_SBSIZE
+RLIMIT_STACK
+RLIMIT_SWAP
+RLIMIT_UMTXP
+RLIMIT_VMEM
+RLIM_INFINITY
+RLIM_NLIMITS
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTLD_SELF
+RTP_LOOKUP
+RTP_PRIO_IDLE
+RTP_PRIO_MAX
+RTP_PRIO_MIN
+RTP_PRIO_NORMAL
+RTP_PRIO_REALTIME
+RTP_SET
+RUSAGE_CHILDREN
+RUSAGE_SELF
+RUSAGE_THREAD
+SCALE_PPM
+SCHED_FIFO
+SCHED_OTHER
+SCHED_RR
+SCM_CREDS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEEK_DATA
+SEEK_HOLE
+SEM_FAILED
+SF_APPEND
+SF_ARCHIVED
+SF_IMMUTABLE
+SF_MNOWAIT
+SF_NOCACHE
+SF_NODISKIO
+SF_NOUNLINK
+SF_SETTABLE
+SF_SNAPSHOT
+SF_SYNC
+SF_USER_READAHEAD
+SHM_ANON
+SHM_INFO
+SHM_LOCK
+SHM_R
+SHM_RDONLY
+SHM_RND
+SHM_STAT
+SHM_UNLOCK
+SHM_W
+SHUTDOWN_TIME
+SIGEMT
+SIGEV_KEVENT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGEV_THREAD_ID
+SIGINFO
+SIGIO
+SIGSTKSZ
+SIOCGIFADDR
+SLIPDISC
+SOCKCREDSIZE
+SOCK_CLOEXEC
+SOCK_MAXADDRLEN
+SOCK_NONBLOCK
+SOCK_RAW
+SOCK_RDM
+SOMAXCONN
+SO_ACCEPTFILTER
+SO_BINTIME
+SO_LABEL
+SO_LISTENINCQLEN
+SO_LISTENQLEN
+SO_LISTENQLIMIT
+SO_NOSIGPIPE
+SO_NO_DDP
+SO_NO_OFFLOAD
+SO_PEERLABEL
+SO_PROTOCOL
+SO_PROTOTYPE
+SO_REUSEPORT
+SO_REUSEPORT_LB
+SO_SETFIB
+SO_TIMESTAMP
+SO_USELOOPBACK
+SO_USER_COOKIE
+SO_VENDOR
+SS_DISABLE
+SS_ONSTACK
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_NOSUID
+ST_RDONLY
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB3
+TABDLY
+TCP_CCALGOOPT
+TCP_CONGESTION
+TCP_DELACK
+TCP_FASTOPEN
+TCP_FASTOPEN_PSK_LEN
+TCP_FIN_IS_RST
+TCP_FUNCTION_NAME_LEN_MAX
+TCP_IDLE_REDUCE
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINIT
+TCP_KEEPINTVL
+TCP_LOG_LIMIT
+TCP_MAXPEAKRATE
+TCP_MAXSEG
+TCP_MAXUNACKTIME
+TCP_MD5SIG
+TCP_NOOPT
+TCP_NOPUSH
+TCP_PCAP_IN
+TCP_PCAP_OUT
+TCP_PERF_INFO
+TCP_PROC_ACCOUNTING
+TCP_REMOTE_UDP_ENCAPS_PORT
+TCP_SHARED_CWND_ALLOWED
+TCP_USE_CMP_ACKS
+THOUSEP
+TIMER_ABSTIME
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TIOCCBRK
+TIOCCDTR
+TIOCCONS
+TIOCDRAIN
+TIOCEXCL
+TIOCEXT
+TIOCFLUSH
+TIOCGDRAINWAIT
+TIOCGETA
+TIOCGETD
+TIOCGPGRP
+TIOCGPTN
+TIOCGSID
+TIOCMBIC
+TIOCMBIS
+TIOCMGDTRWAIT
+TIOCMGET
+TIOCMSDTRWAIT
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DCD
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNOTTY
+TIOCNXCL
+TIOCOUTQ
+TIOCPKT
+TIOCPKT_DATA
+TIOCPKT_DOSTOP
+TIOCPKT_FLUSHREAD
+TIOCPKT_FLUSHWRITE
+TIOCPKT_IOCTL
+TIOCPKT_NOSTOP
+TIOCPKT_START
+TIOCPKT_STOP
+TIOCPTMASTER
+TIOCSBRK
+TIOCSCTTY
+TIOCSDRAINWAIT
+TIOCSDTR
+TIOCSETA
+TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+TTYDISC
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_ARCHIVE
+UF_HIDDEN
+UF_IMMUTABLE
+UF_NODUMP
+UF_NOUNLINK
+UF_OFFLINE
+UF_OPAQUE
+UF_READONLY
+UF_REPARSE
+UF_SETTABLE
+UF_SPARSE
+UF_SYSTEM
+UMTX_ABSTIME
+UMTX_OP_WAIT
+UMTX_OP_WAKE
+UMTX_OP_MUTEX_TRYLOCK
+UMTX_OP_MUTEX_LOCK
+UMTX_OP_MUTEX_UNLOCK
+UMTX_OP_SET_CEILING
+UMTX_OP_CV_WAIT
+UMTX_OP_CV_SIGNAL
+UMTX_OP_CV_BROADCAST
+UMTX_OP_WAIT_UINT
+UMTX_OP_RW_RDLOCK
+UMTX_OP_RW_WRLOCK
+UMTX_OP_RW_UNLOCK
+UMTX_OP_WAIT_UINT_PRIVATE
+UMTX_OP_WAKE_PRIVATE
+UMTX_OP_MUTEX_WAIT
+UMTX_OP_NWAKE_PRIVATE
+UMTX_OP_MUTEX_WAKE2
+UMTX_OP_SEM2_WAIT
+UMTX_OP_SEM2_WAKE
+UMTX_OP_SHM
+UMTX_OP_ROBUST_LISTS
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTXDB_ACTIVE
+UTXDB_LASTLOGIN
+UTXDB_LOG
+VDISCARD
+VDSUSP
+VERASE2
+VLNEXT
+VM_TOTAL
+VSTATUS
+VREPRINT
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+WTRAPPED
+XUCRED_VERSION
+XU_NGROUPS
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_ACL_EXTENDED
+_PC_ACL_NFS4
+_PC_ACL_PATH_MAX
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CAP_PRESENT
+_PC_FILESIZEBITS
+_PC_INF_PRESENT
+_PC_MAC_PRESENT
+_PC_MIN_HOLE_SIZE
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUSET_SIZE
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FILE_LOCKING
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RE_DUP_MAX
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_UUID_NODE_LEN
+__c_anonymous_cr_pid
+__error
+__xuname
+_sem
+_umtx_op
+abs
+accept4
+accept_filter_arg
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_waitcomplete
+aio_write
+aiocb
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+au_asid_t
+au_id_t
+au_mask_t
+au_tid_t
+auditinfo_t
+backtrace
+backtrace_symbols
+backtrace_symbols_fd
+bpf_dltlist
+bpf_hdr
+bpf_insn
+bpf_program
+bpf_stat
+bpf_version
+bsearch
+cap_enter
+cap_getmode
+cap_fcntls_get
+cap_fcntls_limit
+cap_ioctls_get
+cap_ioctls_limit
+__cap_rights_init
+__cap_rights_get
+__cap_rights_set
+__cap_rights_clear
+__cap_rights_is_set
+cap_rights_is_valid
+cap_rights_limit
+cap_rights_merge
+cap_rights_remove
+cap_rights_contains
+cap_sandboxed
+cfmakesane
+chflags
+chflagsat
+chroot
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_settime
+copy_file_range
+cmsgcred
+cmsghdr
+cpuset
+cpuset_getid
+cpuset_setid
+cpusetid_t
+daemon
+dallocx
+devname_r
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+drand48
+dup3
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+erand48
+eui64_aton
+eui64_hostton
+eui64_ntoa
+eui64_ntohost
+explicit_bzero
+extattr_delete_fd
+extattr_delete_file
+extattr_delete_link
+extattr_get_fd
+extattr_get_file
+extattr_get_link
+extattr_list_fd
+extattr_list_file
+extattr_list_link
+extattr_namespace_to_string
+extattr_set_fd
+extattr_set_file
+extattr_set_link
+extattr_string_to_namespace
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fexecve
+fflags_t
+ffs
+ffsl
+ffsll
+filestat
+filestat_list
+flopen
+flopenat
+fls
+flsl
+flsll
+fmemopen
+forkpty
+fparseln
+freeifaddrs
+freelocale
+fsid_t
+fstatfs
+ftok
+futimes
+getdomainname
+getdtablesize
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getitimer
+getline
+getloadavg
+getlocalbase
+getnameinfo
+getopt_long
+getpagesize
+getpagesizes
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getresgid
+getresuid
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxent
+getutxid
+getutxline
+getutxuser
+glob
+glob_t
+globfree
+hexdump
+humanize_number
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+ifconf
+ifreq
+in6_pktinfo
+initgroups
+ip_mreqn
+ipc_perm
+jail
+jail_attach
+jail_get
+jail_remove
+jail_set
+jrand48
+kevent
+key_t
+killpg
+kinfo_getvmmap
+kinfo_proc
+kinfo_vmentry
+kqueue
+kld_isloaded
+kld_load
+labs
+lchflags
+lcong48
+lio_listio
+lockf
+login_tty
+lrand48
+lutimes
+lwpid_t
+madvise
+mallctl
+mallctlbymib
+mallctlnametomib
+mallocx
+memmem
+memrchr
+memset_s
+memstat_get_name
+memstat_mtl_alloc
+memstat_mtl_find
+memstat_mtl_first
+memstat_mtl_free
+memstat_mtl_geterror
+memstat_mtl_next
+memstat_strerror
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mq_attr
+mq_close
+mq_getattr
+mq_getfd_np
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+mrand48
+msgctl
+msgget
+msghdr
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+nallocx
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+nmount
+nrand48
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pdfork
+pdgetpid
+pdkill
+pipe2
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+ppoll
+preadv
+procctl
+procstat
+procstat_close
+procstat_freefiles
+procstat_freeprocs
+procstat_freevmmap
+procstat_getfiles
+procstat_getprocs
+procstat_getvmmap
+procstat_open_sysctl
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_barrierattr_destroy
+pthread_barrierattr_getpshared
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_barrierattr_t
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_barrier_wait
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_get_name_np
+pthread_getaffinity_np
+pthread_getcpuclockid
+pthread_getthreadid_np
+pthread_kill
+pthread_main_np
+pthread_mutex_consistent
+pthread_mutex_timedlock
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_mutexattr_getrobust
+pthread_mutexattr_setrobust
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_setaffinity_np
+pthread_set_name_np
+pthread_getschedparam
+pthread_setschedparam
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+ptrace
+ptrace_io_desc
+ptrace_lwpinfo
+ptrace_sc_ret
+ptrace_vm_entry
+ptsname_r
+pututxline
+pwritev
+qsort
+querylocale
+rallocx
+rand
+readdir_r
+readlinkat
+realhostname
+realhostname_sa
+reallocarray
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+register_t
+regmatch_t
+regoff_t
+rtprio
+rtprio_thread
+sallocx
+sched_getparam
+sched_getscheduler
+sched_get_priority_max
+sched_get_priority_min
+sched_param
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sdallocx
+seed48
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sembuf
+semctl
+semget
+semid_ds
+semop
+sendfile
+sendmmsg
+sendmsg
+setaudit
+setdomainname
+setgrent
+setgroups
+sethostid
+sethostname
+setitimer
+setpriority
+setproctitle
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+setutxdb
+setutxent
+sf_hdtr
+shmat
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_dl
+sockcred
+srand
+srand48
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+tcp_fastopen
+tcp_function_set
+telldir
+thr_kill
+thr_kill2
+thr_self
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+timer_t
+timex
+truncate
+ttyname_r
+uuidgen
+unmount
+useconds_t
+uselocale
+utimensat
+utmpx
+utrace
+vm_size_t
+vmtotal
+wait4
+waitid
+xallocx
+xucred
+eaccess
+dirname
+basename
diff --git a/libc-test/semver/fuchsia-x86_64.txt b/libc-test/semver/fuchsia-x86_64.txt
new file mode 100644
index 0000000000000..cd3d548ac3c5f
--- /dev/null
+++ b/libc-test/semver/fuchsia-x86_64.txt
@@ -0,0 +1,30 @@
+CS
+DS
+EFLAGS
+ES
+FS
+FS_BASE
+GS
+GS_BASE
+MAP_32BIT
+ORIG_RAX
+R10
+R11
+R12
+R13
+R14
+R15
+R8
+R9
+RAX
+RBP
+RBX
+RCX
+RDI
+RDX
+RIP
+RSI
+RSP
+SS
+mcontext_t
+ucontext_t
diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt
new file mode 100644
index 0000000000000..804b27093095a
--- /dev/null
+++ b/libc-test/semver/fuchsia.txt
@@ -0,0 +1,1394 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IB
+AF_IEEE802154
+AF_IPX
+AF_IRDA
+AF_ISDN
+AF_IUCV
+AF_KEY
+AF_LLC
+AF_LOCAL
+AF_MPLS
+AF_NETBEUI
+AF_NETLINK
+AF_NETROM
+AF_NFC
+AF_PACKET
+AF_PHONET
+AF_PPPOX
+AF_RDS
+AF_ROSE
+AF_ROUTE
+AF_RXRPC
+AF_SECURITY
+AF_SNA
+AF_TIPC
+AF_VSOCK
+AF_WANPIPE
+AF_X25
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_V4MAPPED
+ALT_DIGITS
+AM_STR
+AT_EACCESS
+AT_EMPTY_PATH
+AT_FDCWD
+AT_NO_AUTOMOUNT
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B1000000
+B1152000
+B1500000
+B2000000
+B2500000
+B3000000
+B3500000
+B4000000
+B460800
+B500000
+B576000
+B921600
+BS0
+BS1
+BSDLY
+BUFSIZ
+CBAUD
+CBAUDEX
+CIBAUD
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_SGI_CYCLE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+CLONE_NEWCGROUP
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWNS
+CLONE_NEWPID
+CLONE_NEWUSER
+CLONE_NEWUTS
+CLONE_PARENT
+CLONE_PARENT_SETTID
+CLONE_PTRACE
+CLONE_SETTLS
+CLONE_SIGHAND
+CLONE_SYSVSEM
+CLONE_THREAD
+CLONE_UNTRACED
+CLONE_VFORK
+CLONE_VM
+CMSG_ALIGN
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CMSPAR
+CODESET
+CPU_CLR
+CPU_EQUAL
+CPU_ISSET
+CPU_SET
+CPU_SETSIZE
+CPU_ZERO
+CR0
+CR1
+CR2
+CR3
+CRDLY
+CRNCYSTR
+CRTSCTS
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+D_FMT
+D_T_FMT
+EADV
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EBADE
+EBADFD
+EBADR
+EBADRQC
+EBADSLT
+EBFONT
+ECHOCTL
+ECHOKE
+ECHOPRT
+ECHRNG
+ECOMM
+EDEADLOCK
+EDOTDOT
+EFD_CLOEXEC
+EFD_NONBLOCK
+EFD_SEMAPHORE
+EHWPOISON
+EISNAM
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EL2HLT
+EL2NSYNC
+EL3HLT
+EL3RST
+ELIBACC
+ELIBBAD
+ELIBEXEC
+ELIBMAX
+ELIBSCN
+ELNRNG
+EMEDIUMTYPE
+EMULTIHOP
+ENAVAIL
+ENOANO
+ENOATTR
+ENOCSI
+ENODATA
+ENOKEY
+ENOLINK
+ENOMEDIUM
+ENONET
+ENOPKG
+ENOSR
+ENOSTR
+ENOTBLK
+ENOTNAM
+ENOTRECOVERABLE
+ENOTSUP
+ENOTUNIQ
+EOF
+EOWNERDEAD
+EPOLLERR
+EPOLLET
+EPOLLEXCLUSIVE
+EPOLLHUP
+EPOLLIN
+EPOLLMSG
+EPOLLONESHOT
+EPOLLOUT
+EPOLLPRI
+EPOLLRDBAND
+EPOLLRDHUP
+EPOLLRDNORM
+EPOLLWAKEUP
+EPOLLWRBAND
+EPOLLWRNORM
+EPOLL_CLOEXEC
+EPOLL_CTL_ADD
+EPOLL_CTL_DEL
+EPOLL_CTL_MOD
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMCHG
+EREMOTE
+EREMOTEIO
+ERESTART
+ERFKILL
+ESOCKTNOSUPPORT
+ESRMNT
+ESTRPIPE
+ETH_P_IP
+ETIME
+ETOOMANYREFS
+EUCLEAN
+EUNATCH
+EUSERS
+EXFULL
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Off
+Elf32_Phdr
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Off
+Elf64_Phdr
+Elf64_Word
+Elf64_Xword
+FALLOC_FL_COLLAPSE_RANGE
+FALLOC_FL_INSERT_RANGE
+FALLOC_FL_KEEP_SIZE
+FALLOC_FL_PUNCH_HOLE
+FALLOC_FL_UNSHARE_RANGE
+FALLOC_FL_ZERO_RANGE
+FF0
+FF1
+FFDLY
+FILENAME_MAX
+FIONREAD
+FLUSHO
+FOPEN_MAX
+F_ADD_SEALS
+F_CANCELLK
+F_GETLEASE
+F_GETOWN
+F_GETPIPE_SZ
+F_GET_SEALS
+F_LOCK
+F_NOTIFY
+F_SEAL_GROW
+F_SEAL_SEAL
+F_SEAL_SHRINK
+F_SEAL_WRITE
+F_SETLEASE
+F_SETOWN
+F_SETPIPE_SZ
+F_TEST
+F_TLOCK
+F_ULOCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+IFF_ALLMULTI
+IFF_AUTOMEDIA
+IFF_BROADCAST
+IFF_DEBUG
+IFF_DORMANT
+IFF_DYNAMIC
+IFF_ECHO
+IFF_LOOPBACK
+IFF_LOWER_UP
+IFF_MASTER
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_NO_PI
+IFF_POINTOPOINT
+IFF_PORTSEL
+IFF_PROMISC
+IFF_RUNNING
+IFF_SLAVE
+IFF_TAP
+IFF_TUN
+IFF_UP
+IMAXBEL
+IPC_CREAT
+IPC_EXCL
+IPC_INFO
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPPROTO_AH
+IPPROTO_BEETPH
+IPPROTO_COMP
+IPPROTO_DCCP
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_ESP
+IPPROTO_FRAGMENT
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IPIP
+IPPROTO_MAX
+IPPROTO_MH
+IPPROTO_MPLS
+IPPROTO_MTP
+IPPROTO_NONE
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_SCTP
+IPPROTO_TP
+IPPROTO_UDPLITE
+IPV6_ADD_MEMBERSHIP
+IPV6_DROP_MEMBERSHIP
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_FREEBIND
+IP_TOS
+IP_RECVTOS
+IP_HDRINCL
+IP_TRANSPARENT
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+LC_ALL
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_SOFT_OFFLINE
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FILE
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_STACK
+MAP_TYPE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MINSIGSTKSZ
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MREMAP_FIXED
+MREMAP_MAYMOVE
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_COPY
+MSG_DONTWAIT
+MSG_ERRQUEUE
+MSG_EXCEPT
+MSG_FASTOPEN
+MSG_FIN
+MSG_INFO
+MSG_MORE
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_RST
+MSG_STAT
+MSG_SYN
+MSG_WAITFORONE
+MS_ACTIVE
+MS_BIND
+MS_DIRSYNC
+MS_I_VERSION
+MS_KERNMOUNT
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_RELATIME
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NI_DGRAM
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSERV
+NL0
+NL1
+NLDLY
+NOEXPR
+NOSTR
+OFDEL
+OFILL
+OLCUC
+O_ASYNC
+O_DIRECT
+O_DSYNC
+O_EXEC
+O_LARGEFILE
+O_NDELAY
+O_NOATIME
+O_NOCTTY
+O_PATH
+O_RSYNC
+O_SEARCH
+O_SYNC
+O_TMPFILE
+PENDIN
+PF_ALG
+PF_APPLETALK
+PF_ASH
+PF_ATMPVC
+PF_ATMSVC
+PF_AX25
+PF_BLUETOOTH
+PF_BRIDGE
+PF_CAIF
+PF_CAN
+PF_DECnet
+PF_ECONET
+PF_IB
+PF_IEEE802154
+PF_IPX
+PF_IRDA
+PF_ISDN
+PF_IUCV
+PF_KEY
+PF_LLC
+PF_LOCAL
+PF_MPLS
+PF_NETBEUI
+PF_NETLINK
+PF_NETROM
+PF_NFC
+PF_PACKET
+PF_PHONET
+PF_PPPOX
+PF_RDS
+PF_ROSE
+PF_ROUTE
+PF_RXRPC
+PF_SECURITY
+PF_SNA
+PF_TIPC
+PF_VSOCK
+PF_WANPIPE
+PF_X25
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PROT_GROWSDOWN
+PROT_GROWSUP
+PR_CAPBSET_DROP
+PR_CAPBSET_READ
+PR_CAP_AMBIENT
+PR_CAP_AMBIENT_CLEAR_ALL
+PR_CAP_AMBIENT_IS_SET
+PR_CAP_AMBIENT_LOWER
+PR_CAP_AMBIENT_RAISE
+PR_ENDIAN_BIG
+PR_ENDIAN_LITTLE
+PR_ENDIAN_PPC_LITTLE
+PR_FPEMU_NOPRINT
+PR_FPEMU_SIGFPE
+PR_FP_EXC_ASYNC
+PR_FP_EXC_DISABLED
+PR_FP_EXC_DIV
+PR_FP_EXC_INV
+PR_FP_EXC_NONRECOV
+PR_FP_EXC_OVF
+PR_FP_EXC_PRECISE
+PR_FP_EXC_RES
+PR_FP_EXC_SW_ENABLE
+PR_FP_EXC_UND
+PR_FP_MODE_FR
+PR_FP_MODE_FRE
+PR_GET_CHILD_SUBREAPER
+PR_GET_DUMPABLE
+PR_GET_ENDIAN
+PR_GET_FPEMU
+PR_GET_FPEXC
+PR_GET_FP_MODE
+PR_GET_KEEPCAPS
+PR_GET_NAME
+PR_GET_NO_NEW_PRIVS
+PR_GET_PDEATHSIG
+PR_GET_SECCOMP
+PR_GET_SECUREBITS
+PR_GET_THP_DISABLE
+PR_GET_TID_ADDRESS
+PR_GET_TIMERSLACK
+PR_GET_TIMING
+PR_GET_TSC
+PR_GET_UNALIGN
+PR_MCE_KILL
+PR_MCE_KILL_CLEAR
+PR_MCE_KILL_DEFAULT
+PR_MCE_KILL_EARLY
+PR_MCE_KILL_GET
+PR_MCE_KILL_LATE
+PR_MCE_KILL_SET
+PR_MPX_DISABLE_MANAGEMENT
+PR_MPX_ENABLE_MANAGEMENT
+PR_SET_CHILD_SUBREAPER
+PR_SET_DUMPABLE
+PR_SET_ENDIAN
+PR_SET_FPEMU
+PR_SET_FPEXC
+PR_SET_FP_MODE
+PR_SET_KEEPCAPS
+PR_SET_MM
+PR_SET_MM_ARG_END
+PR_SET_MM_ARG_START
+PR_SET_MM_AUXV
+PR_SET_MM_BRK
+PR_SET_MM_END_CODE
+PR_SET_MM_END_DATA
+PR_SET_MM_ENV_END
+PR_SET_MM_ENV_START
+PR_SET_MM_EXE_FILE
+PR_SET_MM_MAP
+PR_SET_MM_MAP_SIZE
+PR_SET_MM_START_BRK
+PR_SET_MM_START_CODE
+PR_SET_MM_START_DATA
+PR_SET_MM_START_STACK
+PR_SET_NAME
+PR_SET_NO_NEW_PRIVS
+PR_SET_PDEATHSIG
+PR_SET_PTRACER
+PR_SET_SECCOMP
+PR_SET_SECUREBITS
+PR_SET_THP_DISABLE
+PR_SET_TIMERSLACK
+PR_SET_TIMING
+PR_SET_TSC
+PR_SET_UNALIGN
+PR_TASK_PERF_EVENTS_DISABLE
+PR_TASK_PERF_EVENTS_ENABLE
+PR_TIMING_STATISTICAL
+PR_TIMING_TIMESTAMP
+PR_TSC_ENABLE
+PR_TSC_SIGSEGV
+PR_UNALIGN_NOPRINT
+PR_UNALIGN_SIGBUS
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_GETREGSET
+PTRACE_GETSIGINFO
+PTRACE_INTERRUPT
+PTRACE_KILL
+PTRACE_LISTEN
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKSIGINFO
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SEIZE
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETOPTIONS
+PTRACE_SETREGS
+PTRACE_SETREGSET
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+PT_DYNAMIC
+PT_GNU_EH_FRAME
+PT_GNU_RELRO
+PT_GNU_STACK
+PT_INTERP
+PT_LOAD
+PT_LOOS
+PT_NOTE
+PT_NULL
+PT_NUM
+PT_PHDR
+PT_SHLIB
+PT_TLS
+P_ALL
+P_PGID
+P_PID
+QCMD
+QFMT_VFS_OLD
+QFMT_VFS_V0
+QFMT_VFS_V1
+QIF_ALL
+QIF_BLIMITS
+QIF_BTIME
+QIF_ILIMITS
+QIF_INODES
+QIF_ITIME
+QIF_LIMITS
+QIF_SPACE
+QIF_TIMES
+QIF_USAGE
+Q_GETFMT
+Q_GETINFO
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETINFO
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+RB_AUTOBOOT
+RB_DISABLE_CAD
+RB_ENABLE_CAD
+RB_HALT_SYSTEM
+RB_KEXEC
+RB_POWER_OFF
+RB_SW_SUSPEND
+RENAME_EXCHANGE
+RENAME_NOREPLACE
+RENAME_WHITEOUT
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_LOCKS
+RLIMIT_MEMLOCK
+RLIMIT_MSGQUEUE
+RLIMIT_NICE
+RLIMIT_NLIMITS
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_RTPRIO
+RLIMIT_RTTIME
+RLIMIT_SIGPENDING
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_SAVED_CUR
+RLIM_SAVED_MAX
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RUSAGE_CHILDREN
+RUSAGE_SELF
+RUSAGE_THREAD
+SCHED_BATCH
+SCHED_FIFO
+SCHED_IDLE
+SCHED_OTHER
+SCHED_RR
+SCM_CREDENTIALS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEM_FAILED
+SFD_CLOEXEC
+SFD_NONBLOCK
+SHM_EXEC
+SHM_HUGETLB
+SHM_LOCK
+SHM_NORESERVE
+SHM_R
+SHM_RDONLY
+SHM_REMAP
+SHM_RND
+SHM_UNLOCK
+SHM_W
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGIO
+SIGPOLL
+SIGPWR
+SIGSTKFLT
+SIGSTKSZ
+SIGUNUSED
+SI_LOAD_SHIFT
+SOCK_CLOEXEC
+SOCK_DCCP
+SOCK_NONBLOCK
+SOCK_PACKET
+SOCK_RAW
+SOCK_RDM
+SOL_AAL
+SOL_ATM
+SOL_DCCP
+SOL_DECNET
+SOL_ICMPV6
+SOL_IP
+SOL_IPV6
+SOL_IRDA
+SOL_LLC
+SOL_NETBEUI
+SOL_NETLINK
+SOL_PACKET
+SOL_RAW
+SOL_TCP
+SOL_TIPC
+SOL_UDP
+SOL_X25
+SOMAXCONN
+SO_BINDTODEVICE
+SO_BSDCOMPAT
+SO_BUSY_POLL
+SO_DOMAIN
+SO_MARK
+SO_NO_CHECK
+SO_ORIGINAL_DST
+SO_PASSCRED
+SO_PEEK_OFF
+SO_PEERCRED
+SO_PRIORITY
+SO_PROTOCOL
+SO_RCVBUFFORCE
+SO_RXQ_OVFL
+SO_SNDBUFFORCE
+SO_TIMESTAMP
+SPLICE_F_GIFT
+SPLICE_F_MORE
+SPLICE_F_MOVE
+SPLICE_F_NONBLOCK
+SS_DISABLE
+SS_ONSTACK
+ST_APPEND
+ST_IMMUTABLE
+ST_MANDLOCK
+ST_NOATIME
+ST_NODEV
+ST_NODIRATIME
+ST_NOEXEC
+ST_NOSUID
+ST_RDONLY
+ST_SYNCHRONOUS
+ST_WRITE
+SYNC_FILE_RANGE_WAIT_AFTER
+SYNC_FILE_RANGE_WAIT_BEFORE
+SYNC_FILE_RANGE_WRITE
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCFLSH
+TCGETA
+TCGETS
+TCP_CONGESTION
+TCP_COOKIE_TRANSACTIONS
+TCP_CORK
+TCP_DEFER_ACCEPT
+TCP_FASTOPEN
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINTVL
+TCP_LINGER2
+TCP_MAXSEG
+TCP_MD5SIG
+TCP_QUEUE_SEQ
+TCP_QUICKACK
+TCP_REPAIR
+TCP_REPAIR_OPTIONS
+TCP_REPAIR_QUEUE
+TCP_SYNCNT
+TCP_THIN_DUPACK
+TCP_THIN_LINEAR_TIMEOUTS
+TCP_TIMESTAMP
+TCP_USER_TIMEOUT
+TCP_WINDOW_CLAMP
+TCSBRK
+TCSETA
+TCSETAF
+TCSETAW
+TCSETS
+TCSETSF
+TCSETSW
+TCXONC
+TFD_CLOEXEC
+TFD_NONBLOCK
+TFD_TIMER_ABSTIME
+THOUSEP
+TIMER_ABSTIME
+TIOCCONS
+TIOCEXCL
+TIOCGPGRP
+TIOCGSERIAL
+TIOCGSOFTCAR
+TIOCINQ
+TIOCLINUX
+TIOCMBIC
+TIOCMBIS
+TIOCMGET
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNXCL
+TIOCOUTQ
+TIOCSCTTY
+TIOCSPGRP
+TIOCSSOFTCAR
+TIOCSTI
+TMP_MAX
+T_FMT
+T_FMT_AMPM
+UTIME_NOW
+UTIME_OMIT
+VSWTC
+VDISCARD
+VLNEXT
+VREPRINT
+VT0
+VT1
+VTDLY
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+XATTR_CREATE
+XATTR_REPLACE
+XTABS
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_FILESIZEBITS
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SOCK_MAXBUF
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_AVPHYS_PAGES
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_NZERO
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_RE_DUP_MAX
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAMS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_UIO_MAXIOV
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_SC_XOPEN_XPG2
+_SC_XOPEN_XPG3
+_SC_XOPEN_XPG4
+__SIZEOF_PTHREAD_CONDATTR_T
+__SIZEOF_PTHREAD_COND_T
+__SIZEOF_PTHREAD_MUTEXATTR_T
+__SIZEOF_PTHREAD_MUTEX_T
+__SIZEOF_PTHREAD_RWLOCKATTR_T
+__SIZEOF_PTHREAD_RWLOCK_T
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno_location
+__s16
+__s32
+__u16
+__u32
+__u64
+__u8
+abs
+accept4
+acct
+aiocb
+atof
+atoi
+atol
+atoll
+blkcnt64_t
+brk
+clearenv
+clock_getres
+clock_nanosleep
+clock_settime
+clone
+cmsghdr
+cpu_set_t
+daemon
+dirent64
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+dup3
+duplocale
+endpwent
+epoll_event
+eventfd
+execvpe
+faccessat
+fallocate
+fdatasync
+fdopendir
+fexecve
+ff_condition_effect
+ff_constant_effect
+ff_effect
+ff_envelope
+ff_periodic_effect
+ff_ramp_effect
+ff_replay
+ff_rumble_effect
+ff_trigger
+fpos64_t
+freeifaddrs
+freelocale
+fsid_t
+fstatfs
+ftok
+futimes
+getdomainname
+getdtablesize
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getnameinfo
+getpwent
+getpwnam_r
+getresgid
+getresuid
+getsid
+glob
+glob_t
+globfree
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+ino64_t
+input_absinfo
+input_event
+input_id
+input_keymap_entry
+input_mask
+ip_mreqn
+ipc_perm
+itimerspec
+key_t
+labs
+loff_t
+lutimes
+madvise
+major
+makedev
+memalign
+memrchr
+minor
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mount
+mq_attr
+mqd_t
+msgctl
+msgget
+msghdr
+msginfo
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+newlocale
+nl_item
+nl_langinfo
+nl_langinfo_l
+off64_t
+openat
+openpty
+pause
+personality
+pipe2
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+ppoll
+preadv
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_setclock
+pthread_getattr_np
+pthread_kill
+pthread_mutex_timedlock
+ptsname_r
+pwritev
+quotactl
+rand
+readahead
+readdir_r
+readlinkat
+reboot
+recvmmsg
+recvmsg
+rlim64_t
+rlimit64
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sembuf
+semctl
+semget
+semop
+sendmmsg
+sendmsg
+setdomainname
+setfsgid
+setfsuid
+setgroups
+sethostname
+setpwent
+setresgid
+setresuid
+settimeofday
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+signalfd
+signalfd_siginfo
+sigsuspend
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_ll
+sockaddr_nl
+splice
+spwd
+srand
+stack_t
+stat64
+statfs
+statfs64
+statvfs64
+strtoll
+strtoull
+swapoff
+swapon
+sync
+sync_file_range
+syscall
+sysinfo
+tee
+telldir
+termios2
+timerfd_create
+timerfd_gettime
+timerfd_settime
+ucred
+umount
+umount2
+useconds_t
+uselocale
+utimensat
+vhangup
+vmsplice
+waitid
diff --git a/libc-test/semver/ios.txt b/libc-test/semver/ios.txt
new file mode 100644
index 0000000000000..1a5fcd2ac3fe2
--- /dev/null
+++ b/libc-test/semver/ios.txt
@@ -0,0 +1,3 @@
+__darwin_arm_exception_state64
+__darwin_arm_neon_state64
+__darwin_arm_thread_state64
diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt
new file mode 100644
index 0000000000000..5714299010e9e
--- /dev/null
+++ b/libc-test/semver/linux-aarch64.txt
@@ -0,0 +1,96 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BPF_ABS
+BPF_ADD
+BPF_ALU
+BPF_B
+BPF_DIV
+BPF_H
+BPF_IMM
+BPF_IND
+BPF_JA
+BPF_JEQ
+BPF_JGE
+BPF_JGT
+BPF_JMP
+BPF_JUMP
+BPF_K
+BPF_LD
+BPF_LDX
+BPF_LEN
+BPF_LL_OFF
+BPF_MEM
+BPF_MISC
+BPF_MISCOP
+BPF_MOD
+BPF_MSH
+BPF_NEG
+BPF_NET_OFF
+BPF_RET
+BPF_RVAL
+BPF_ST
+BPF_STMT
+BPF_STX
+BPF_SUB
+BPF_W
+BPF_X
+BPF_XOR
+CIBAUD
+FICLONE
+FICLONERANGE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+SIGSTKFLT
+SIGUNUSED
+SKF_AD_ALU_XOR_X
+SKF_AD_CPU
+SKF_AD_HATYPE
+SKF_AD_MARK
+SKF_AD_MAX
+SKF_AD_NLATTR
+SKF_AD_NLATTR_NEST
+SKF_AD_OFF
+SKF_AD_PAY_OFFSET
+SKF_AD_PKTTYPE
+SKF_AD_PROTOCOL
+SKF_AD_QUEUE
+SKF_AD_RANDOM
+SKF_AD_RXHASH
+SKF_AD_VLAN_TAG
+SKF_AD_VLAN_TAG_PRESENT
+SKF_AD_VLAN_TPID
+SKF_LL_OFF
+SKF_NET_OFF
+SO_PRIORITY
+SO_PROTOCOL
+SYS_accept
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_renameat
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sync_file_range
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+max_align_t
+mcontext_t
+ucontext_t
+user_regs_struct
+user_fpsimd_struct
diff --git a/libc-test/semver/linux-gnu-riscv64gc.txt b/libc-test/semver/linux-gnu-riscv64gc.txt
new file mode 100644
index 0000000000000..4d60496082024
--- /dev/null
+++ b/libc-test/semver/linux-gnu-riscv64gc.txt
@@ -0,0 +1,6 @@
+PTRACE_GETFPREGS
+PTRACE_SETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_SETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETREGS
diff --git a/libc-test/semver/linux-gnu-x86_64.txt b/libc-test/semver/linux-gnu-x86_64.txt
new file mode 100644
index 0000000000000..604f7d845e7b7
--- /dev/null
+++ b/libc-test/semver/linux-gnu-x86_64.txt
@@ -0,0 +1,32 @@
+FICLONE
+FICLONERANGE
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_GET_RSEQ_CONFIGURATION
+PTRACE_SYSEMU
+PTRACE_SYSEMU_SINGLESTEP
+_libc_fpstate
+flock64
+getcontext
+makecontext
+ptrace_rseq_configuration
+setcontext
+swapcontext
+termios2
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
new file mode 100644
index 0000000000000..bf663a193014b
--- /dev/null
+++ b/libc-test/semver/linux-gnu.txt
@@ -0,0 +1,663 @@
+ACCOUNTING
+ADFS_SUPER_MAGIC
+ADJ_ESTERROR
+ADJ_FREQUENCY
+ADJ_MAXERROR
+ADJ_MICRO
+ADJ_NANO
+ADJ_OFFSET
+ADJ_OFFSET_SINGLESHOT
+ADJ_OFFSET_SS_READ
+ADJ_SETOFFSET
+ADJ_STATUS
+ADJ_TAI
+ADJ_TICK
+ADJ_TIMECONST
+AFFS_SUPER_MAGIC
+AFS_SUPER_MAGIC
+AF_MPLS
+AF_XDP
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+AT_STATX_DONT_SYNC
+AT_STATX_FORCE_SYNC
+AT_STATX_SYNC_AS_STAT
+AT_STATX_SYNC_TYPE
+AUTOFS_SUPER_MAGIC
+BINDERFS_SUPER_MAGIC
+BOOT_TIME
+BPF_FS_MAGIC
+BTRFS_SUPER_MAGIC
+CGROUP2_SUPER_MAGIC
+CGROUP_SUPER_MAGIC
+CODA_SUPER_MAGIC
+CRAMFS_MAGIC
+DCCP_SERVICE_LIST_MAX_LEN
+DCCP_SOCKOPT_AVAILABLE_CCIDS
+DCCP_SOCKOPT_CCID
+DCCP_SOCKOPT_CCID_RX_INFO
+DCCP_SOCKOPT_CCID_TX_INFO
+DCCP_SOCKOPT_CHANGE_L
+DCCP_SOCKOPT_CHANGE_R
+DCCP_SOCKOPT_GET_CUR_MPS
+DCCP_SOCKOPT_PACKET_SIZE
+DCCP_SOCKOPT_QPOLICY_ID
+DCCP_SOCKOPT_QPOLICY_TXQLEN
+DCCP_SOCKOPT_RECV_CSCOV
+DCCP_SOCKOPT_RX_CCID
+DCCP_SOCKOPT_SEND_CSCOV
+DCCP_SOCKOPT_SERVER_TIMEWAIT
+DCCP_SOCKOPT_SERVICE
+DCCP_SOCKOPT_TX_CCID
+DEAD_PROCESS
+DEBUGFS_MAGIC
+DEVPTS_SUPER_MAGIC
+ECRYPTFS_SUPER_MAGIC
+EFS_SUPER_MAGIC
+ELFOSABI_ARM_AEABI
+EMPTY
+EXT2_SUPER_MAGIC
+EXT3_SUPER_MAGIC
+EXT4_SUPER_MAGIC
+Elf32_Chdr
+Elf64_Chdr
+F2FS_SUPER_MAGIC
+FDPIC_FUNCPTRS
+FUTEXFS_SUPER_MAGIC
+GENL_ID_PMCRAID
+GENL_ID_VFS_DQUOT
+GENL_UNS_ADMIN_PERM
+HOSTFS_SUPER_MAGIC
+HPFS_SUPER_MAGIC
+HUGETLBFS_MAGIC
+HUGETLB_FLAG_ENCODE_16GB
+HUGETLB_FLAG_ENCODE_16MB
+HUGETLB_FLAG_ENCODE_1GB
+HUGETLB_FLAG_ENCODE_1MB
+HUGETLB_FLAG_ENCODE_256MB
+HUGETLB_FLAG_ENCODE_2GB
+HUGETLB_FLAG_ENCODE_2MB
+HUGETLB_FLAG_ENCODE_32MB
+HUGETLB_FLAG_ENCODE_512KB
+HUGETLB_FLAG_ENCODE_512MB
+HUGETLB_FLAG_ENCODE_64KB
+HUGETLB_FLAG_ENCODE_8MB
+HUGETLB_FLAG_ENCODE_MASK
+HUGETLB_FLAG_ENCODE_SHIFT
+IFA_FLAGS
+IFA_F_MANAGETEMPADDR
+IFA_F_MCAUTOJOIN
+IFA_F_NODAD
+IFA_F_NOPREFIXROUTE
+IFA_F_STABLE_PRIVACY
+INIT_PROCESS
+ISOFS_SUPER_MAGIC
+JFFS2_SUPER_MAGIC
+KEYCTL_DH_COMPUTE
+KEYCTL_PKEY_DECRYPT
+KEYCTL_PKEY_ENCRYPT
+KEYCTL_PKEY_QUERY
+KEYCTL_PKEY_SIGN
+KEYCTL_PKEY_VERIFY
+KEYCTL_RESTRICT_KEYRING
+KEYCTL_SUPPORTS_DECRYPT
+KEYCTL_SUPPORTS_ENCRYPT
+KEYCTL_SUPPORTS_SIGN
+KEYCTL_SUPPORTS_VERIFY
+LC_ADDRESS
+LC_ADDRESS_MASK
+LC_ALL
+LC_ALL_MASK
+LC_IDENTIFICATION
+LC_IDENTIFICATION_MASK
+LC_MEASUREMENT
+LC_MEASUREMENT_MASK
+LC_NAME
+LC_NAME_MASK
+LC_PAPER
+LC_PAPER_MASK
+LC_TELEPHONE
+LC_TELEPHONE_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LM_ID_BASE
+LM_ID_NEWLM
+LOGIN_PROCESS
+Lmid_t
+MAXTC
+MAX_LINKS
+MINIX2_SUPER_MAGIC
+MINIX2_SUPER_MAGIC2
+MINIX3_SUPER_MAGIC
+MINIX_SUPER_MAGIC
+MINIX_SUPER_MAGIC2
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MPOL_BIND
+MPOL_DEFAULT
+MPOL_F_NUMA_BALANCING
+MPOL_F_RELATIVE_NODES
+MPOL_F_STATIC_NODES
+MPOL_INTERLEAVE
+MPOL_LOCAL
+MPOL_PREFERRED
+MSDOS_SUPER_MAGIC
+MSG_TRYHARD
+MS_RELATIME
+M_ARENA_MAX
+M_ARENA_TEST
+M_CHECK_ACTION
+M_GRAIN
+M_KEEP
+M_MMAP_MAX
+M_MMAP_THRESHOLD
+M_MXFAST
+M_NLBLKS
+M_PERTURB
+M_TOP_PAD
+M_TRIM_THRESHOLD
+NCP_SUPER_MAGIC
+NDA_LINK_NETNSID
+NDA_LLADDR
+NDA_MASTER
+NDA_SRC_VNI
+NEW_TIME
+NFPROTO_INET
+NFPROTO_NETDEV
+NFS_SUPER_MAGIC
+NFT_BREAK
+NFT_BYTEORDER_HTON
+NFT_BYTEORDER_NTOH
+NFT_CHAIN_MAXNAMELEN
+NFT_CMP_EQ
+NFT_CMP_GT
+NFT_CMP_GTE
+NFT_CMP_LT
+NFT_CMP_LTE
+NFT_CMP_NEQ
+NFT_CONTINUE
+NFT_CT_BYTES
+NFT_CT_DIRECTION
+NFT_CT_DST
+NFT_CT_EXPIRATION
+NFT_CT_HELPER
+NFT_CT_L3PROTOCOL
+NFT_CT_LABELS
+NFT_CT_MARK
+NFT_CT_PKTS
+NFT_CT_PROTOCOL
+NFT_CT_PROTO_DST
+NFT_CT_PROTO_SRC
+NFT_CT_SECMARK
+NFT_CT_SRC
+NFT_CT_STATE
+NFT_CT_STATUS
+NFT_DATA_RESERVED_MASK
+NFT_DATA_VALUE
+NFT_DATA_VALUE_MAXLEN
+NFT_DATA_VERDICT
+NFT_DYNSET_F_INV
+NFT_DYNSET_OP_ADD
+NFT_DYNSET_OP_UPDATE
+NFT_GOTO
+NFT_JUMP
+NFT_LIMIT_F_INV
+NFT_LIMIT_PKTS
+NFT_LIMIT_PKT_BYTES
+NFT_LOOKUP_F_INV
+NFT_META_BRI_IIFNAME
+NFT_META_BRI_OIFNAME
+NFT_META_CGROUP
+NFT_META_CPU
+NFT_META_IIF
+NFT_META_IIFGROUP
+NFT_META_IIFNAME
+NFT_META_IIFTYPE
+NFT_META_L4PROTO
+NFT_META_LEN
+NFT_META_MARK
+NFT_META_NFPROTO
+NFT_META_NFTRACE
+NFT_META_OIF
+NFT_META_OIFGROUP
+NFT_META_OIFNAME
+NFT_META_OIFTYPE
+NFT_META_PKTTYPE
+NFT_META_PRANDOM
+NFT_META_PRIORITY
+NFT_META_PROTOCOL
+NFT_META_RTCLASSID
+NFT_META_SECMARK
+NFT_META_SKGID
+NFT_META_SKUID
+NFT_MSG_DELCHAIN
+NFT_MSG_DELRULE
+NFT_MSG_DELSET
+NFT_MSG_DELSETELEM
+NFT_MSG_DELTABLE
+NFT_MSG_GETCHAIN
+NFT_MSG_GETGEN
+NFT_MSG_GETRULE
+NFT_MSG_GETSET
+NFT_MSG_GETSETELEM
+NFT_MSG_GETTABLE
+NFT_MSG_MAX
+NFT_MSG_NEWCHAIN
+NFT_MSG_NEWGEN
+NFT_MSG_NEWRULE
+NFT_MSG_NEWSET
+NFT_MSG_NEWSETELEM
+NFT_MSG_NEWTABLE
+NFT_MSG_TRACE
+NFT_NAT_DNAT
+NFT_NAT_SNAT
+NFT_NG_INCREMENTAL
+NFT_NG_RANDOM
+NFT_OBJ_MAXNAMELEN
+NFT_PAYLOAD_CSUM_INET
+NFT_PAYLOAD_CSUM_NONE
+NFT_PAYLOAD_LL_HEADER
+NFT_PAYLOAD_NETWORK_HEADER
+NFT_PAYLOAD_TRANSPORT_HEADER
+NFT_QUEUE_FLAG_BYPASS
+NFT_QUEUE_FLAG_CPU_FANOUT
+NFT_QUEUE_FLAG_MASK
+NFT_QUOTA_F_INV
+NFT_RANGE_EQ
+NFT_RANGE_NEQ
+NFT_REG32_00
+NFT_REG32_01
+NFT_REG32_02
+NFT_REG32_03
+NFT_REG32_04
+NFT_REG32_05
+NFT_REG32_06
+NFT_REG32_07
+NFT_REG32_08
+NFT_REG32_09
+NFT_REG32_10
+NFT_REG32_11
+NFT_REG32_12
+NFT_REG32_13
+NFT_REG32_14
+NFT_REG32_15
+NFT_REG32_SIZE
+NFT_REG_1
+NFT_REG_2
+NFT_REG_3
+NFT_REG_4
+NFT_REG_SIZE
+NFT_REG_VERDICT
+NFT_REJECT_ICMPX_ADMIN_PROHIBITED
+NFT_REJECT_ICMPX_HOST_UNREACH
+NFT_REJECT_ICMPX_NO_ROUTE
+NFT_REJECT_ICMPX_PORT_UNREACH
+NFT_REJECT_ICMPX_UNREACH
+NFT_REJECT_ICMP_UNREACH
+NFT_REJECT_TCP_RST
+NFT_RETURN
+NFT_SET_ANONYMOUS
+NFT_SET_CONSTANT
+NFT_SET_ELEM_INTERVAL_END
+NFT_SET_EVAL
+NFT_SET_INTERVAL
+NFT_SET_MAP
+NFT_SET_MAXNAMELEN
+NFT_SET_POL_MEMORY
+NFT_SET_POL_PERFORMANCE
+NFT_SET_TIMEOUT
+NFT_TABLE_MAXNAMELEN
+NFT_TRACETYPE_POLICY
+NFT_TRACETYPE_RETURN
+NFT_TRACETYPE_RULE
+NFT_TRACETYPE_UNSPEC
+NFT_USERDATA_MAXLEN
+NF_NETDEV_INGRESS
+NF_NETDEV_NUMHOOKS
+NILFS_SUPER_MAGIC
+NT_PRSTATUS
+NT_PRFPREG
+NT_FPREGSET
+NT_PRPSINFO
+NT_PRXREG
+NT_TASKSTRUCT
+NT_PLATFORM
+NT_AUXV
+NT_GWINDOWS
+NT_ASRS
+NT_PSTATUS
+NT_PSINFO
+NT_PRCRED
+NT_UTSNAME
+NT_LWPSTATUS
+NT_LWPSINFO
+NT_PRFPXREG
+NTF_EXT_LEARNED
+NTF_MASTER
+NTF_OFFLOADED
+NTP_API
+OCFS2_SUPER_MAGIC
+OLD_TIME
+OPENPROM_SUPER_MAGIC
+OVERLAYFS_SUPER_MAGIC
+O_FSYNC
+PF_IB
+PF_MPLS
+PF_XDP
+PR_SET_VMA
+PR_SET_VMA_ANON_NAME
+PROC_SUPER_MAGIC
+PTHREAD_MUTEX_ADAPTIVE_NP
+PTRACE_GET_SYSCALL_INFO
+QNX4_SUPER_MAGIC
+QNX6_SUPER_MAGIC
+RDTGROUP_SUPER_MAGIC
+REG_EEND
+REG_ERPAREN
+REG_ESIZE
+REG_STARTEND
+REISERFS_SUPER_MAGIC
+RTA_NEWDST
+RTA_OIF
+RTA_PAD
+RTA_PREF
+RTA_TTL_PROPAGATE
+RTA_UID
+RTA_UNSPEC
+RTA_VIA
+RTLD_DEEPBIND
+RTLD_DI_CONFIGADDR
+RTLD_DI_LINKMAP
+RTLD_DI_LMID
+RTLD_DI_ORIGIN
+RTLD_DI_PROFILENAME
+RTLD_DI_PROFILEOUT
+RTLD_DI_SERINFO
+RTLD_DI_SERINFOSIZE
+RTLD_DI_TLS_DATA
+RTLD_DI_TLS_MODID
+RTM_DELNETCONF
+RTM_F_FIB_MATCH
+RTM_F_LOOKUP_TABLE
+RTM_GETSTATS
+RTM_NEWCACHEREPORT
+RTM_NEWSTATS
+RUN_LVL
+RWF_APPEND
+RWF_DSYNC
+RWF_HIPRI
+RWF_NOWAIT
+RWF_SYNC
+SECURITYFS_MAGIC
+SELINUX_MAGIC
+SIGEV_THREAD_ID
+SMACK_MAGIC
+SMB_SUPER_MAGIC
+SOL_CAIF
+SOL_IUCV
+SOL_NFC
+SOL_PACKET
+SOL_PNPIPE
+SOL_PPPOL2TP
+SOL_RAW
+SOL_RDS
+SOL_RXRPC
+SOL_XDP
+STATX_ALL
+STATX_ATIME
+STATX_ATTR_APPEND
+STATX_ATTR_AUTOMOUNT
+STATX_ATTR_COMPRESSED
+STATX_ATTR_ENCRYPTED
+STATX_ATTR_IMMUTABLE
+STATX_ATTR_NODUMP
+STATX_ATTR_MOUNT_ROOT
+STATX_ATTR_VERITY
+STATX_ATTR_DAX
+STATX_BASIC_STATS
+STATX_BLOCKS
+STATX_BTIME
+STATX_CTIME
+STATX_GID
+STATX_INO
+STATX_MNT_ID
+STATX_MODE
+STATX_MTIME
+STATX_NLINK
+STATX_SIZE
+STATX_TYPE
+STATX_UID
+STATX__RESERVED
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_RELATIME
+SYSFS_MAGIC
+TCA_CHAIN
+TCA_DUMP_INVISIBLE
+TCA_FCNT
+TCA_HW_OFFLOAD
+TCA_PAD
+TIME_BAD
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TMPFS_MAGIC
+TMP_MAX
+TRACEFS_MAGIC
+UDF_SUPER_MAGIC
+UNAME26
+USBDEVICE_SUPER_MAGIC
+USER_PROCESS
+XENFS_SUPER_MAGIC
+XFS_SUPER_MAGIC
+_SC_2_C_VERSION
+_SC_BASE
+_SC_CHARCLASS_NAME_MAX
+_SC_CHAR_BIT
+_SC_CHAR_MAX
+_SC_CHAR_MIN
+_SC_C_LANG_SUPPORT
+_SC_C_LANG_SUPPORT_R
+_SC_DELAYTIMER_MAX
+_SC_DEVICE_IO
+_SC_DEVICE_SPECIFIC
+_SC_DEVICE_SPECIFIC_R
+_SC_EQUIV_CLASS_MAX
+_SC_EXPR_NEST_MAX
+_SC_FD_MGMT
+_SC_FIFO
+_SC_FILE_ATTRIBUTES
+_SC_FILE_LOCKING
+_SC_FILE_SYSTEM
+_SC_INT_MAX
+_SC_INT_MIN
+_SC_LEVEL1_DCACHE_ASSOC
+_SC_LEVEL1_DCACHE_LINESIZE
+_SC_LEVEL1_DCACHE_SIZE
+_SC_LEVEL1_ICACHE_ASSOC
+_SC_LEVEL1_ICACHE_LINESIZE
+_SC_LEVEL1_ICACHE_SIZE
+_SC_LEVEL2_CACHE_ASSOC
+_SC_LEVEL2_CACHE_LINESIZE
+_SC_LEVEL2_CACHE_SIZE
+_SC_LEVEL3_CACHE_ASSOC
+_SC_LEVEL3_CACHE_LINESIZE
+_SC_LEVEL3_CACHE_SIZE
+_SC_LEVEL4_CACHE_ASSOC
+_SC_LEVEL4_CACHE_LINESIZE
+_SC_LEVEL4_CACHE_SIZE
+_SC_LINE_MAX
+_SC_LONG_BIT
+_SC_MAPPED_FILES
+_SC_MB_LEN_MAX
+_SC_MULTI_PROCESS
+_SC_NETWORKING
+_SC_NL_ARGMAX
+_SC_NL_LANGMAX
+_SC_NL_MSGMAX
+_SC_NL_NMAX
+_SC_NL_SETMAX
+_SC_NL_TEXTMAX
+_SC_PII
+_SC_PII_INTERNET
+_SC_PII_INTERNET_DGRAM
+_SC_PII_INTERNET_STREAM
+_SC_PII_OSI
+_SC_PII_OSI_CLTS
+_SC_PII_OSI_COTS
+_SC_PII_OSI_M
+_SC_PII_SOCKET
+_SC_PII_XTI
+_SC_PIPE
+_SC_POLL
+_SC_REGEX_VERSION
+_SC_SCHAR_MAX
+_SC_SCHAR_MIN
+_SC_SELECT
+_SC_SHRT_MAX
+_SC_SHRT_MIN
+_SC_SIGNALS
+_SC_SIGQUEUE_MAX
+_SC_SINGLE_PROCESS
+_SC_SSIZE_MAX
+_SC_SYSTEM_DATABASE
+_SC_SYSTEM_DATABASE_R
+_SC_T_IOV_MAX
+_SC_UCHAR_MAX
+_SC_UINT_MAX
+_SC_UIO_MAXIOV
+_SC_ULONG_MAX
+_SC_USER_GROUPS
+_SC_USER_GROUPS_R
+_SC_USHRT_MAX
+_SC_WORD_BIT
+__NFT_REG_MAX
+__UT_HOSTSIZE
+__UT_LINESIZE
+__UT_NAMESIZE
+__fsword_t
+__priority_which_t
+__rlimit_resource_t
+__timeval
+adjtimex
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+backtrace
+clock_adjtime
+copy_file_range
+ctermid
+dlinfo
+dlmopen
+endutxent
+explicit_bzero
+fgetspent_r
+futimes
+getauxval
+getentropy
+getgrent_r
+fgetgrent_r
+getloadavg
+getpt
+getpwent_r
+fgetpwent_r
+getpwnam_r
+getspent_r
+getutxent
+getutxid
+getutxline
+glob
+glob_t
+glob64
+glob64_t
+globfree
+globfree64
+lio_listio
+mallinfo
+mallinfo2
+malloc_info
+malloc_trim
+malloc_usable_size
+mallopt
+nl_mmap_hdr
+nl_mmap_req
+nl_pktinfo
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_wmemstream
+preadv2
+preadv64
+prlimit
+prlimit64
+process_vm_readv
+process_vm_writev
+pthread_attr_getaffinity_np
+pthread_attr_setaffinity_np
+pthread_rwlockattr_getkind_np
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setkind_np
+ptrace_peeksiginfo_args
+ptrace_syscall_info
+pututxline
+pwritev2
+pwritev64
+qsort_r
+reallocarray
+semid_ds
+seminfo
+sethostid
+setutxent
+setxattr
+sgetspent_r
+statx
+statx_timestamp
+timex
+utmpname
+utmpx
+utmpxname
+euidaccess
+eaccess
+asctime_r
+ctime_r
+strftime
+strptime
+dirname
+posix_basename
+gnu_basename
\ No newline at end of file
diff --git a/libc-test/semver/linux-i686.txt b/libc-test/semver/linux-i686.txt
new file mode 100644
index 0000000000000..97e9f741a8929
--- /dev/null
+++ b/libc-test/semver/linux-i686.txt
@@ -0,0 +1,225 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+CS
+DS
+EAX
+EBP
+EBX
+ECX
+EDI
+EDX
+EFL
+EIP
+ES
+ESI
+FS
+GS
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_32BIT
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+ORIG_EAX
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+PTRACE_SYSEMU
+PTRACE_SYSEMU_SINGLESTEP
+REG_CS
+REG_DS
+REG_EAX
+REG_EBP
+REG_EBX
+REG_ECX
+REG_EDI
+REG_EDX
+REG_EFL
+REG_EIP
+REG_ERR
+REG_ES
+REG_ESI
+REG_ESP
+REG_FS
+REG_GS
+REG_SS
+REG_TRAPNO
+REG_UESP
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_chown32
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fchown32
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_get_thread_area
+SYS_getdents
+SYS_getegid32
+SYS_geteuid32
+SYS_getgid32
+SYS_getgroups32
+SYS_getpgrp
+SYS_getpmsg
+SYS_getresgid32
+SYS_getresuid32
+SYS_getuid32
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_lchown
+SYS_lchown32
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_select
+SYS_sendfile
+SYS_sendfile64
+SYS_set_thread_area
+SYS_setfsgid32
+SYS_setfsuid32
+SYS_setgid32
+SYS_setgroups32
+SYS_setregid32
+SYS_setresgid32
+SYS_setresuid32
+SYS_setreuid32
+SYS_setuid32
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_time
+SYS_truncate64
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_vm86old
+SYS_vserver
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+UESP
+_libc_fpreg
+_libc_fpstate
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
+getcontext
+greg_t
+makecontext
+max_align_t
+mcontext_t
+setcontext
+swapcontext
+sysctl
+termios2
+ucontext_t
+user
+user_fpregs_struct
+user_fpxregs_struct
+user_regs_struct
diff --git a/libc-test/semver/linux-mips.txt b/libc-test/semver/linux-mips.txt
new file mode 100644
index 0000000000000..80aa25a60bf84
--- /dev/null
+++ b/libc-test/semver/linux-mips.txt
@@ -0,0 +1,115 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+SO_PRIORITY
+SO_PROTOCOL
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_cachectl
+SYS_cacheflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_set_thread_area
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_symlink
+SYS_sync_file_range
+SYS_syscall
+SYS_sysfs
+SYS_sysmips
+SYS_time
+SYS_timerfd
+SYS_truncate64
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vm86
+SYS_vserver
+SYS_waitpid
+TIOCCBRK
+TIOCSBRK
+max_align_t
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
new file mode 100644
index 0000000000000..9fbb9032c31bf
--- /dev/null
+++ b/libc-test/semver/linux-musl.txt
@@ -0,0 +1,58 @@
+# TODO: musl.
+AF_IB
+AF_MPLS
+AF_XDP
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+MPOL_BIND
+MPOL_DEFAULT
+MPOL_INTERLEAVE
+MPOL_LOCAL
+MPOL_PREFERRED
+Elf32_Chdr
+Elf64_Chdr
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+PF_IB
+PF_MPLS
+PF_XDP
+PIDFD_NONBLOCK
+PR_SET_VMA
+PR_SET_VMA_ANON_NAME
+adjtimex
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+clock_adjtime
+ctermid
+explicit_bzero
+futimes
+getauxval
+getloadavg
+lio_listio
+ntptimeval
+open_wmemstream
+preadv64
+prlimit
+prlimit64
+process_vm_readv
+process_vm_writev
+pwritev64
+reallocarray
+timex
+euidaccess
+eaccess
+asctime_r
+strftime
+strptime
+dirname
+basename
diff --git a/libc-test/semver/linux-powerpc.txt b/libc-test/semver/linux-powerpc.txt
new file mode 100644
index 0000000000000..1d162417608fa
--- /dev/null
+++ b/libc-test/semver/linux-powerpc.txt
@@ -0,0 +1,158 @@
+B2500000
+B3000000
+B3500000
+B4000000
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_GETFPREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETREGS
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_truncate64
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
+sysctl
diff --git a/libc-test/semver/linux-powerpc64.txt b/libc-test/semver/linux-powerpc64.txt
new file mode 100644
index 0000000000000..983c7e7d30c28
--- /dev/null
+++ b/libc-test/semver/linux-powerpc64.txt
@@ -0,0 +1,162 @@
+B2500000
+B3000000
+B3500000
+B4000000
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SIGUNUSED
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fork
+SYS_fstatfs64
+SYS_ftime
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_newfstatat
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+max_align_t
+sysctl
diff --git a/libc-test/semver/linux-powerpc64le.txt b/libc-test/semver/linux-powerpc64le.txt
new file mode 100644
index 0000000000000..983c7e7d30c28
--- /dev/null
+++ b/libc-test/semver/linux-powerpc64le.txt
@@ -0,0 +1,162 @@
+B2500000
+B3000000
+B3500000
+B4000000
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SIGUNUSED
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fork
+SYS_fstatfs64
+SYS_ftime
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_newfstatat
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+max_align_t
+sysctl
diff --git a/libc-test/semver/linux-riscv64gc.txt b/libc-test/semver/linux-riscv64gc.txt
new file mode 100644
index 0000000000000..cc4d97fe6fa51
--- /dev/null
+++ b/libc-test/semver/linux-riscv64gc.txt
@@ -0,0 +1,71 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS_accept
+SYS_fadvise64
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_sendfile
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sync_file_range
+TIOCGRS485
+TIOCSRS485
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
diff --git a/libc-test/semver/linux-s390x.txt b/libc-test/semver/linux-s390x.txt
new file mode 100644
index 0000000000000..c2ffaf8d06f39
--- /dev/null
+++ b/libc-test/semver/linux-s390x.txt
@@ -0,0 +1,115 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_PRIORITY
+SO_PROTOCOL
+SYS__sysctl
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fork
+SYS_fstatfs64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_idle
+SYS_inotify_init
+SYS_ipc
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_newfstatat
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_poll
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_s390_pci_mmio_read
+SYS_s390_pci_mmio_write
+SYS_s390_runtime_instr
+SYS_select
+SYS_sendfile
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_stat
+SYS_statfs64
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_timerfd
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+TIOCCBRK
+TIOCSBRK
+XCASE
+__psw_t
+flock64
+fpreg_t
+fpregset_t
+getcontext
+greg_t
+makecontext
+mcontext_t
+setcontext
+swapcontext
+sysctl
+termios2
+ucontext_t
diff --git a/libc-test/semver/linux-sparc64.txt b/libc-test/semver/linux-sparc64.txt
new file mode 100644
index 0000000000000..956cd2aeda15e
--- /dev/null
+++ b/libc-test/semver/linux-sparc64.txt
@@ -0,0 +1,113 @@
+B153600
+B307200
+B614400
+B76800
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_execv
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getdomainname
+SYS_getpagesize
+SYS_getpgrp
+SYS_inotify_init
+SYS_ipc
+SYS_kern_features
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_lstat64
+SYS_memory_ordering
+SYS_mkdir
+SYS_mknod
+SYS_nice
+SYS_oldlstat
+SYS_open
+SYS_pause
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_perfctr
+SYS_pipe
+SYS_poll
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_sched_get_affinity
+SYS_sched_set_affinity
+SYS_select
+SYS_sendfile
+SYS_sendfile64
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_utrap_install
+SYS_vfork
+SYS_waitpid
+TIOCCBRK
+TIOCSBRK
+flock64
+max_align_t
+sysctl
+termios2
diff --git a/libc-test/semver/linux-x86_64.txt b/libc-test/semver/linux-x86_64.txt
new file mode 100644
index 0000000000000..64126fbc841e1
--- /dev/null
+++ b/libc-test/semver/linux-x86_64.txt
@@ -0,0 +1,144 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BPF_ABS
+BPF_ADD
+BPF_ALU
+BPF_B
+BPF_DIV
+BPF_H
+BPF_IMM
+BPF_IND
+BPF_JA
+BPF_JEQ
+BPF_JGE
+BPF_JGT
+BPF_JMP
+BPF_JUMP
+BPF_K
+BPF_LD
+BPF_LDX
+BPF_LEN
+BPF_LL_OFF
+BPF_MEM
+BPF_MISC
+BPF_MISCOP
+BPF_MOD
+BPF_MSH
+BPF_NEG
+BPF_NET_OFF
+BPF_RET
+BPF_RVAL
+BPF_ST
+BPF_STMT
+BPF_STX
+BPF_SUB
+BPF_W
+BPF_X
+BPF_XOR
+CIBAUD
+CS
+DS
+ES
+FS
+GS
+MADV_SOFT_OFFLINE
+MAP_32BIT
+MAP_SYNC
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+REG_EFL
+REG_ERR
+REG_TRAPNO
+SIGSTKFLT
+SIGUNUSED
+SKF_AD_ALU_XOR_X
+SKF_AD_CPU
+SKF_AD_HATYPE
+SKF_AD_MARK
+SKF_AD_MAX
+SKF_AD_NLATTR
+SKF_AD_NLATTR_NEST
+SKF_AD_OFF
+SKF_AD_PAY_OFFSET
+SKF_AD_PKTTYPE
+SKF_AD_PROTOCOL
+SKF_AD_QUEUE
+SKF_AD_RANDOM
+SKF_AD_RXHASH
+SKF_AD_VLAN_TAG
+SKF_AD_VLAN_TAG_PRESENT
+SKF_AD_VLAN_TPID
+SKF_LL_OFF
+SKF_NET_OFF
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SS
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fork
+SYS_futimesat
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_putpmsg
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_select
+SYS_sendfile
+SYS_signalfd
+SYS_stat
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_time
+SYS_unlink
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+greg_t
+max_align_t
+mcontext_t
+ucontext_t
+user
+user_fpregs_struct
+user_regs_struct
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
new file mode 100644
index 0000000000000..871eb5cca21ba
--- /dev/null
+++ b/libc-test/semver/linux.txt
@@ -0,0 +1,3316 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ABS_CNT
+ABS_MAX
+ADDR_COMPAT_LAYOUT
+ADDR_LIMIT_32BIT
+ADDR_LIMIT_3GB
+ADDR_NO_RANDOMIZE
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IEEE802154
+AF_IPX
+AF_IRDA
+AF_ISDN
+AF_IUCV
+AF_KEY
+AF_LLC
+AF_LOCAL
+AF_NETBEUI
+AF_NETLINK
+AF_NETROM
+AF_NFC
+AF_PACKET
+AF_PHONET
+AF_PPPOX
+AF_RDS
+AF_ROSE
+AF_ROUTE
+AF_RXRPC
+AF_SECURITY
+AF_SNA
+AF_TIPC
+AF_VSOCK
+AF_WANPIPE
+AF_X25
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_V4MAPPED
+ALG_OP_DECRYPT
+ALG_OP_ENCRYPT
+ALG_SET_AEAD_ASSOCLEN
+ALG_SET_AEAD_AUTHSIZE
+ALG_SET_IV
+ALG_SET_KEY
+ALG_SET_OP
+ALT_DIGITS
+AM_STR
+ARPD_FLUSH
+ARPD_LOOKUP
+ARPD_UPDATE
+ARPHRD_ADAPT
+ARPHRD_APPLETLK
+ARPHRD_ARCNET
+ARPHRD_ASH
+ARPHRD_ATM
+ARPHRD_AX25
+ARPHRD_BIF
+ARPHRD_CAN
+ARPHRD_CHAOS
+ARPHRD_CISCO
+ARPHRD_CSLIP
+ARPHRD_CSLIP6
+ARPHRD_DDCMP
+ARPHRD_DLCI
+ARPHRD_ECONET
+ARPHRD_EETHER
+ARPHRD_ETHER
+ARPHRD_EUI64
+ARPHRD_FCAL
+ARPHRD_FCFABRIC
+ARPHRD_FCPL
+ARPHRD_FCPP
+ARPHRD_FDDI
+ARPHRD_FRAD
+ARPHRD_HDLC
+ARPHRD_HIPPI
+ARPHRD_HWX25
+ARPHRD_IEEE1394
+ARPHRD_IEEE802
+ARPHRD_IEEE80211
+ARPHRD_IEEE80211_PRISM
+ARPHRD_IEEE80211_RADIOTAP
+ARPHRD_IEEE802154
+ARPHRD_IEEE802_TR
+ARPHRD_INFINIBAND
+ARPHRD_IPDDP
+ARPHRD_IPGRE
+ARPHRD_IRDA
+ARPHRD_LAPB
+ARPHRD_LOCALTLK
+ARPHRD_LOOPBACK
+ARPHRD_METRICOM
+ARPHRD_NETROM
+ARPHRD_NONE
+ARPHRD_PIMREG
+ARPHRD_PPP
+ARPHRD_PRONET
+ARPHRD_RAWHDLC
+ARPHRD_ROSE
+ARPHRD_RSRVD
+ARPHRD_SIT
+ARPHRD_SKIP
+ARPHRD_SLIP
+ARPHRD_SLIP6
+ARPHRD_TUNNEL
+ARPHRD_TUNNEL6
+ARPHRD_VOID
+ARPHRD_X25
+ARPOP_InREPLY
+ARPOP_InREQUEST
+ARPOP_NAK
+ARPOP_REPLY
+ARPOP_REQUEST
+ARPOP_RREPLY
+ARPOP_RREQUEST
+ATF_COM
+ATF_DONTPUB
+ATF_MAGIC
+ATF_NETMASK
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_BASE
+AT_BASE_PLATFORM
+AT_CLKTCK
+AT_EACCESS
+AT_EGID
+AT_EMPTY_PATH
+AT_ENTRY
+AT_EUID
+AT_EXECFD
+AT_EXECFN
+AT_FDCWD
+AT_FLAGS
+AT_GID
+AT_HWCAP
+AT_HWCAP2
+AT_IGNORE
+AT_NOTELF
+AT_NO_AUTOMOUNT
+AT_NULL
+AT_PAGESZ
+AT_PHDR
+AT_PHENT
+AT_PHNUM
+AT_PLATFORM
+AT_RANDOM
+AT_REMOVEDIR
+AT_SECURE
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+AT_UID
+AT_SYSINFO_EHDR
+B1000000
+B1152000
+B1500000
+B2000000
+B460800
+B500000
+B576000
+B921600
+BLKIOMIN
+BLKIOOPT
+BLKPBSZGET
+BLKSSZGET
+BOTHER
+BS0
+BS1
+BSDLY
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+BUS_MCEERR_AR
+BUS_MCEERR_AO
+CANFD_BRS
+CANFD_ESI
+CANFD_MAX_DLC
+CANFD_MAX_DLEN
+CANFD_MTU
+CAN_BCM
+CAN_EFF_FLAG
+CAN_EFF_ID_BITS
+CAN_EFF_MASK
+CAN_ERR_FLAG
+CAN_ERR_MASK
+CAN_INV_FILTER
+CAN_ISOTP
+CAN_J1939
+CAN_MAX_DLC
+CAN_MAX_DLEN
+CAN_MCNET
+CAN_MTU
+CAN_NPROTO
+CAN_RAW
+CAN_RAW_FILTER_MAX
+CAN_RTR_FLAG
+CAN_SFF_ID_BITS
+CAN_SFF_MASK
+CAN_TP16
+CAN_TP20
+CAN_RAW_FILTER
+CAN_RAW_ERR_FILTER
+CAN_RAW_LOOPBACK
+CAN_RAW_RECV_OWN_MSGS
+CAN_RAW_FD_FRAMES
+CAN_RAW_JOIN_FILTERS
+CBAUD
+CBAUDEX
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+CLONE_NEWCGROUP
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWNS
+CLONE_NEWPID
+CLONE_NEWUSER
+CLONE_NEWUTS
+CLONE_PARENT
+CLONE_PARENT_SETTID
+CLONE_PIDFD
+CLONE_PTRACE
+CLONE_SETTLS
+CLONE_SIGHAND
+CLONE_SYSVSEM
+CLONE_THREAD
+CLONE_UNTRACED
+CLONE_VFORK
+CLONE_VM
+CLOSE_RANGE_CLOEXEC
+CLOSE_RANGE_UNSHARE
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CMSPAR
+CODESET
+CPU_ALLOC_SIZE
+CPU_CLR
+CPU_COUNT
+CPU_COUNT_S
+CPU_EQUAL
+CPU_ISSET
+CPU_SET
+CPU_SETSIZE
+CPU_ZERO
+CR0
+CR1
+CR2
+CR3
+CRDLY
+CRNCYSTR
+CRTSCTS
+CTRL_ATTR_FAMILY_ID
+CTRL_ATTR_FAMILY_NAME
+CTRL_ATTR_HDRSIZE
+CTRL_ATTR_MAXATTR
+CTRL_ATTR_MCAST_GROUPS
+CTRL_ATTR_MCAST_GRP_ID
+CTRL_ATTR_MCAST_GRP_NAME
+CTRL_ATTR_MCAST_GRP_UNSPEC
+CTRL_ATTR_OPS
+CTRL_ATTR_OP_FLAGS
+CTRL_ATTR_OP_ID
+CTRL_ATTR_OP_UNSPEC
+CTRL_ATTR_UNSPEC
+CTRL_ATTR_VERSION
+CTRL_CMD_DELFAMILY
+CTRL_CMD_DELMCAST_GRP
+CTRL_CMD_DELOPS
+CTRL_CMD_GETFAMILY
+CTRL_CMD_GETMCAST_GRP
+CTRL_CMD_GETOPS
+CTRL_CMD_NEWFAMILY
+CTRL_CMD_NEWMCAST_GRP
+CTRL_CMD_NEWOPS
+CTRL_CMD_UNSPEC
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DT_UNKNOWN
+D_FMT
+D_T_FMT
+EADV
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EBADE
+EBADFD
+EBADR
+EBADRQC
+EBADSLT
+EBFONT
+ECHOCTL
+ECHOKE
+ECHOPRT
+ECHRNG
+ECOMM
+EDEADLOCK
+EDOTDOT
+EFD_CLOEXEC
+EFD_NONBLOCK
+EFD_SEMAPHORE
+EHWPOISON
+EISNAM
+EI_ABIVERSION
+EI_CLASS
+EI_DATA
+EI_MAG0
+EI_MAG1
+EI_MAG2
+EI_MAG3
+EI_NIDENT
+EI_OSABI
+EI_PAD
+EI_VERSION
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EL2HLT
+EL2NSYNC
+EL3HLT
+EL3RST
+ELFCLASS32
+ELFCLASS64
+ELFCLASSNONE
+ELFCLASSNUM
+ELFDATA2LSB
+ELFDATA2MSB
+ELFDATANONE
+ELFDATANUM
+ELFMAG0
+ELFMAG1
+ELFMAG2
+ELFMAG3
+ELFOSABI_AIX
+ELFOSABI_ARM
+ELFOSABI_FREEBSD
+ELFOSABI_GNU
+ELFOSABI_HPUX
+ELFOSABI_IRIX
+ELFOSABI_LINUX
+ELFOSABI_MODESTO
+ELFOSABI_NETBSD
+ELFOSABI_NONE
+ELFOSABI_OPENBSD
+ELFOSABI_SOLARIS
+ELFOSABI_STANDALONE
+ELFOSABI_SYSV
+ELFOSABI_TRU64
+ELIBACC
+ELIBBAD
+ELIBEXEC
+ELIBMAX
+ELIBSCN
+ELNRNG
+EMEDIUMTYPE
+EMULTIHOP
+EM_386
+EM_68HC05
+EM_68HC08
+EM_68HC11
+EM_68HC12
+EM_68HC16
+EM_68K
+EM_860
+EM_88K
+EM_960
+EM_AARCH64
+EM_ALPHA
+EM_ARC
+EM_ARC_A5
+EM_ARM
+EM_AVR
+EM_COLDFIRE
+EM_CRIS
+EM_D10V
+EM_D30V
+EM_FAKE_ALPHA
+EM_FIREPATH
+EM_FR20
+EM_FR30
+EM_FX66
+EM_H8_300
+EM_H8_300H
+EM_H8_500
+EM_H8S
+EM_HUANY
+EM_IA_64
+EM_JAVELIN
+EM_M32
+EM_M32R
+EM_ME16
+EM_MIPS
+EM_MIPS_RS3_LE
+EM_MIPS_X
+EM_MMA
+EM_MMIX
+EM_MN10200
+EM_MN10300
+EM_NCPU
+EM_NDR1
+EM_NONE
+EM_OPENRISC
+EM_PARISC
+EM_PCP
+EM_PDSP
+EM_PJ
+EM_PPC
+EM_PPC64
+EM_PRISM
+EM_RCE
+EM_RH32
+EM_S370
+EM_S390
+EM_SH
+EM_SPARC
+EM_SPARC32PLUS
+EM_SPARCV9
+EM_ST100
+EM_ST19
+EM_ST7
+EM_ST9PLUS
+EM_STARCORE
+EM_SVX
+EM_TILEGX
+EM_TILEPRO
+EM_TINYJ
+EM_TRICORE
+EM_V800
+EM_V850
+EM_VAX
+EM_VPP500
+EM_X86_64
+EM_XTENSA
+EM_ZSP
+ENAVAIL
+ENOANO
+ENOATTR
+ENOCSI
+ENODATA
+ENOKEY
+ENOLINK
+ENOMEDIUM
+ENONET
+ENOPKG
+ENOTBLK
+ENOSR
+ENOSTR
+ENOTNAM
+ENOTRECOVERABLE
+ENOTSUP
+ENOTUNIQ
+EOF
+EOWNERDEAD
+EPOLLERR
+EPOLLET
+EPOLLEXCLUSIVE
+EPOLLHUP
+EPOLLIN
+EPOLLMSG
+EPOLLONESHOT
+EPOLLOUT
+EPOLLPRI
+EPOLLRDBAND
+EPOLLRDHUP
+EPOLLRDNORM
+EPOLLWAKEUP
+EPOLLWRBAND
+EPOLLWRNORM
+EPOLL_CLOEXEC
+EPOLL_CTL_ADD
+EPOLL_CTL_DEL
+EPOLL_CTL_MOD
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMCHG
+EREMOTE
+EREMOTEIO
+ERESTART
+ERFKILL
+ESOCKTNOSUPPORT
+ESRMNT
+ESTRPIPE
+ETH_ALEN
+ETH_DATA_LEN
+ETH_FCS_LEN
+ETH_FRAME_LEN
+ETH_HLEN
+ETH_P_1588
+ETH_P_8021AD
+ETH_P_8021AH
+ETH_P_8021Q
+ETH_P_80221
+ETH_P_802_2
+ETH_P_802_3
+ETH_P_802_3_MIN
+ETH_P_802_EX1
+ETH_P_AARP
+ETH_P_AF_IUCV
+ETH_P_ALL
+ETH_P_AOE
+ETH_P_ARCNET
+ETH_P_ARP
+ETH_P_ATALK
+ETH_P_ATMFATE
+ETH_P_ATMMPOA
+ETH_P_AX25
+ETH_P_BATMAN
+ETH_P_BPQ
+ETH_P_CAIF
+ETH_P_CANFD
+ETH_P_CONTROL
+ETH_P_CUST
+ETH_P_DDCMP
+ETH_P_DEC
+ETH_P_DIAG
+ETH_P_DNA_DL
+ETH_P_DNA_RC
+ETH_P_DNA_RT
+ETH_P_DSA
+ETH_P_ECONET
+ETH_P_EDSA
+ETH_P_FCOE
+ETH_P_FIP
+ETH_P_HDLC
+ETH_P_IEEE802154
+ETH_P_IEEEPUP
+ETH_P_IEEEPUPAT
+ETH_P_IP
+ETH_P_IPV6
+ETH_P_IPX
+ETH_P_IRDA
+ETH_P_LAT
+ETH_P_LINK_CTL
+ETH_P_LOCALTALK
+ETH_P_LOOP
+ETH_P_LOOPBACK
+ETH_P_MACSEC
+ETH_P_MOBITEX
+ETH_P_MPLS_MC
+ETH_P_MPLS_UC
+ETH_P_MVRP
+ETH_P_PAE
+ETH_P_PAUSE
+ETH_P_PHONET
+ETH_P_PPPTALK
+ETH_P_PPP_DISC
+ETH_P_PPP_MP
+ETH_P_PPP_SES
+ETH_P_PRP
+ETH_P_PUP
+ETH_P_PUPAT
+ETH_P_QINQ1
+ETH_P_QINQ2
+ETH_P_QINQ3
+ETH_P_RARP
+ETH_P_SCA
+ETH_P_SLOW
+ETH_P_SNAP
+ETH_P_TDLS
+ETH_P_TEB
+ETH_P_TIPC
+ETH_P_TRAILER
+ETH_P_TR_802_2
+ETH_P_WAN_PPP
+ETH_P_WCCP
+ETH_P_X25
+ETH_ZLEN
+ETOOMANYREFS
+ETIME
+ET_CORE
+ET_DYN
+ET_EXEC
+ET_HIOS
+ET_HIPROC
+ET_LOOS
+ET_LOPROC
+ET_NONE
+ET_NUM
+ET_REL
+EUCLEAN
+EUNATCH
+EUSERS
+EV_CNT
+EV_CURRENT
+EV_MAX
+EV_NONE
+EV_NUM
+EXFULL
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Ehdr
+Elf32_Half
+Elf32_Off
+Elf32_Phdr
+Elf32_Section
+Elf32_Shdr
+Elf32_Sym
+Elf32_Word
+Elf64_Addr
+Elf64_Ehdr
+Elf64_Half
+Elf64_Off
+Elf64_Phdr
+Elf64_Section
+Elf64_Shdr
+Elf64_Sxword
+Elf64_Sym
+Elf64_Word
+Elf64_Xword
+FALLOC_FL_COLLAPSE_RANGE
+FALLOC_FL_INSERT_RANGE
+FALLOC_FL_KEEP_SIZE
+FALLOC_FL_PUNCH_HOLE
+FALLOC_FL_UNSHARE_RANGE
+FALLOC_FL_ZERO_RANGE
+FANOTIFY_METADATA_VERSION
+FAN_ACCESS
+FAN_ACCESS_PERM
+FAN_ALLOW
+FAN_CLASS_CONTENT
+FAN_CLASS_NOTIF
+FAN_CLASS_PRE_CONTENT
+FAN_CLOEXEC
+FAN_CLOSE
+FAN_CLOSE_NOWRITE
+FAN_CLOSE_WRITE
+FAN_DENY
+FAN_EVENT_ON_CHILD
+FAN_MARK_ADD
+FAN_MARK_DONT_FOLLOW
+FAN_MARK_FILESYSTEM
+FAN_MARK_FLUSH
+FAN_MARK_IGNORED_MASK
+FAN_MARK_IGNORED_SURV_MODIFY
+FAN_MARK_INODE
+FAN_MARK_MOUNT
+FAN_MARK_ONLYDIR
+FAN_MARK_REMOVE
+FAN_MODIFY
+FAN_NOFD
+FAN_NONBLOCK
+FAN_ONDIR
+FAN_OPEN
+FAN_OPEN_PERM
+FAN_Q_OVERFLOW
+FAN_UNLIMITED_MARKS
+FAN_UNLIMITED_QUEUE
+FF0
+FF1
+FFDLY
+FF_CNT
+FF_MAX
+FILENAME_MAX
+FIONCLEX
+FIONREAD
+FLUSHO
+FOPEN_MAX
+FUTEX_CLOCK_REALTIME
+FUTEX_CMD_MASK
+FUTEX_CMP_REQUEUE
+FUTEX_CMP_REQUEUE_PI
+FUTEX_FD
+FUTEX_LOCK_PI
+FUTEX_LOCK_PI2
+FUTEX_PRIVATE_FLAG
+FUTEX_REQUEUE
+FUTEX_TRYLOCK_PI
+FUTEX_UNLOCK_PI
+FUTEX_WAIT
+FUTEX_WAIT_BITSET
+FUTEX_WAIT_REQUEUE_PI
+FUTEX_WAKE
+FUTEX_WAKE_BITSET
+FUTEX_WAKE_OP
+F_ADD_SEALS
+F_CANCELLK
+F_GETLEASE
+F_GETOWN
+F_GETPIPE_SZ
+F_GET_SEALS
+F_LOCK
+F_NOTIFY
+F_OFD_GETLK
+F_OFD_SETLK
+F_OFD_SETLKW
+F_RDLCK
+F_SEAL_FUTURE_WRITE
+F_SEAL_GROW
+F_SEAL_SEAL
+F_SEAL_SHRINK
+F_SEAL_WRITE
+F_SETLEASE
+F_SETOWN
+F_SETPIPE_SZ
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GENL_ADMIN_PERM
+GENL_CMD_CAP_DO
+GENL_CMD_CAP_DUMP
+GENL_CMD_CAP_HASPOL
+GENL_ID_CTRL
+GENL_MAX_ID
+GENL_MIN_ID
+GENL_NAMSIZ
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+GRND_NONBLOCK
+GRND_RANDOM
+GRND_INSECURE
+IBSHIFT
+IFA_ADDRESS
+IFA_ANYCAST
+IFA_BROADCAST
+IFA_CACHEINFO
+IFA_F_DADFAILED
+IFA_F_DEPRECATED
+IFA_F_HOMEADDRESS
+IFA_F_OPTIMISTIC
+IFA_F_PERMANENT
+IFA_F_SECONDARY
+IFA_F_TEMPORARY
+IFA_F_TENTATIVE
+IFA_LABEL
+IFA_LOCAL
+IFA_MULTICAST
+IFA_UNSPEC
+IFF_ALLMULTI
+IFF_ATTACH_QUEUE
+IFF_AUTOMEDIA
+IFF_BROADCAST
+IFF_DEBUG
+IFF_DETACH_QUEUE
+IFF_DORMANT
+IFF_DYNAMIC
+IFF_ECHO
+IFF_LOOPBACK
+IFF_LOWER_UP
+IFF_MASTER
+IFF_MULTICAST
+IFF_MULTI_QUEUE
+IFF_NOARP
+IFF_NOFILTER
+IFF_NOTRAILERS
+IFF_NO_PI
+IFF_ONE_QUEUE
+IFF_PERSIST
+IFF_POINTOPOINT
+IFF_PORTSEL
+IFF_PROMISC
+IFF_RUNNING
+IFF_SLAVE
+IFF_TAP
+IFF_TUN
+IFF_TUN_EXCL
+IFF_UP
+IFF_VNET_HDR
+IFLA_ADDRESS
+IFLA_AF_SPEC
+IFLA_ALT_IFNAME
+IFLA_BROADCAST
+IFLA_CARRIER
+IFLA_CARRIER_CHANGES
+IFLA_CARRIER_DOWN_COUNT
+IFLA_CARRIER_UP_COUNT
+IFLA_COST
+IFLA_EVENT
+IFLA_EXT_MASK
+IFLA_GROUP
+IFLA_GSO_MAX_SEGS
+IFLA_GSO_MAX_SIZE
+IFLA_IFALIAS
+IFLA_IFNAME
+IFLA_IF_NETNSID
+IFLA_INFO_DATA
+IFLA_INFO_KIND
+IFLA_INFO_SLAVE_DATA
+IFLA_INFO_SLAVE_KIND
+IFLA_INFO_UNSPEC
+IFLA_INFO_XSTATS
+IFLA_LINK
+IFLA_LINKINFO
+IFLA_LINKMODE
+IFLA_LINK_NETNSID
+IFLA_MAP
+IFLA_MASTER
+IFLA_MAX_MTU
+IFLA_MIN_MTU
+IFLA_MTU
+IFLA_NET_NS_FD
+IFLA_NET_NS_PID
+IFLA_NEW_IFINDEX
+IFLA_NEW_NETNSID
+IFLA_NUM_RX_QUEUES
+IFLA_NUM_TX_QUEUES
+IFLA_NUM_VF
+IFLA_OPERSTATE
+IFLA_PAD
+IFLA_PERM_ADDRESS
+IFLA_PHYS_PORT_ID
+IFLA_PHYS_PORT_NAME
+IFLA_PHYS_SWITCH_ID
+IFLA_PORT_SELF
+IFLA_PRIORITY
+IFLA_PROMISCUITY
+IFLA_PROP_LIST
+IFLA_PROTINFO
+IFLA_PROTO_DOWN
+IFLA_PROTO_DOWN_REASON
+IFLA_QDISC
+IFLA_STATS
+IFLA_STATS64
+IFLA_TARGET_NETNSID
+IFLA_TXQLEN
+IFLA_UNSPEC
+IFLA_VFINFO_LIST
+IFLA_VF_PORTS
+IFLA_WEIGHT
+IFLA_WIRELESS
+IFLA_XDP
+IMAXBEL
+INPUT_PROP_CNT
+INPUT_PROP_MAX
+IN_ACCESS
+IN_ALL_EVENTS
+IN_ATTRIB
+IN_CLOEXEC
+IN_CLOSE
+IN_CLOSE_NOWRITE
+IN_CLOSE_WRITE
+IN_CREATE
+IN_DELETE
+IN_DELETE_SELF
+IN_DONT_FOLLOW
+IN_EXCL_UNLINK
+IN_IGNORED
+IN_MASK_CREATE
+IN_MASK_ADD
+IN_ISDIR
+IN_MODIFY
+IN_MOVE
+IN_MOVED_FROM
+IN_MOVED_TO
+IN_MOVE_SELF
+IN_NONBLOCK
+IN_ONESHOT
+IN_ONLYDIR
+IN_OPEN
+IN_Q_OVERFLOW
+IN_UNMOUNT
+IP6T_SO_ORIGINAL_DST
+IPC_CREAT
+IPC_EXCL
+IPC_INFO
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPDEFTTL
+IPOPT_CLASS
+IPOPT_CLASS_MASK
+IPOPT_CONTROL
+IPOPT_COPIED
+IPOPT_COPY
+IPOPT_END
+IPOPT_EOL
+IPOPT_LSRR
+IPOPT_MEASUREMENT
+IPOPT_MINOFF
+IPOPT_NOOP
+IPOPT_NOP
+IPOPT_NUMBER
+IPOPT_NUMBER_MASK
+IPOPT_OFFSET
+IPOPT_OLEN
+IPOPT_OPTVAL
+IPOPT_RA
+IPOPT_RESERVED1
+IPOPT_RESERVED2
+IPOPT_RR
+IPOPT_SEC
+IPOPT_SID
+IPOPT_SSRR
+IPOPT_TIMESTAMP
+IPOPT_TS
+IPOPT_TS_PRESPEC
+IPOPT_TS_TSANDADDR
+IPOPT_TS_TSONLY
+IPPROTO_AH
+IPPROTO_BEETPH
+IPPROTO_COMP
+IPPROTO_DCCP
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_ESP
+IPPROTO_FRAGMENT
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IPIP
+IPPROTO_MAX
+IPPROTO_MH
+IPPROTO_MPLS
+IPPROTO_MPTCP
+IPPROTO_MTP
+IPPROTO_NONE
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_SCTP
+IPPROTO_TP
+IPPROTO_UDPLITE
+IPTOS_ECN
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOT_ECT
+IPTOS_LOWDELAY
+IPTOS_MINCOST
+IPTOS_PREC
+IPTOS_PREC_CRITIC_ECP
+IPTOS_PREC_FLASH
+IPTOS_PREC_FLASHOVERRIDE
+IPTOS_PREC_IMMEDIATE
+IPTOS_PREC_INTERNETCONTROL
+IPTOS_PREC_MASK
+IPTOS_PREC_NETCONTROL
+IPTOS_PREC_PRIORITY
+IPTOS_PREC_ROUTINE
+IPTOS_RELIABILITY
+IPTOS_THROUGHPUT
+IPTOS_TOS
+IPTOS_TOS_MASK
+IPV6_2292DSTOPTS
+IPV6_2292HOPLIMIT
+IPV6_2292HOPOPTS
+IPV6_2292PKTINFO
+IPV6_2292PKTOPTIONS
+IPV6_2292RTHDR
+IPV6_ADDRFORM
+IPV6_ADDR_PREFERENCES
+IPV6_ADD_MEMBERSHIP
+IPV6_AUTHHDR
+IPV6_AUTOFLOWLABEL
+IPV6_CHECKSUM
+IPV6_DONTFRAG
+IPV6_DROP_MEMBERSHIP
+IPV6_DSTOPTS
+IPV6_FLOWINFO
+IPV6_FLOWINFO_FLOWLABEL
+IPV6_FLOWINFO_PRIORITY
+IPV6_FLOWINFO_SEND
+IPV6_FLOWLABEL_MGR
+IPV6_FREEBIND
+IPV6_HDRINCL
+IPV6_HOPLIMIT
+IPV6_HOPOPTS
+IPV6_IPSEC_POLICY
+IPV6_JOIN_ANYCAST
+IPV6_LEAVE_ANYCAST
+IPV6_MINHOPCOUNT
+IPV6_MTU
+IPV6_MTU_DISCOVER
+IPV6_MULTICAST_ALL
+IPV6_NEXTHOP
+IPV6_ORIGDSTADDR
+IPV6_PATHMTU
+IPV6_PKTINFO
+IPV6_PMTUDISC_DO
+IPV6_PMTUDISC_DONT
+IPV6_PMTUDISC_INTERFACE
+IPV6_PMTUDISC_OMIT
+IPV6_PMTUDISC_PROBE
+IPV6_PMTUDISC_WANT
+IPV6_PREFER_SRC_CGA
+IPV6_PREFER_SRC_COA
+IPV6_PREFER_SRC_HOME
+IPV6_PREFER_SRC_NONCGA
+IPV6_PREFER_SRC_PUBLIC
+IPV6_PREFER_SRC_PUBTMP_DEFAULT
+IPV6_PREFER_SRC_TMP
+IPV6_RECVDSTOPTS
+IPV6_RECVERR
+IPV6_RECVFRAGSIZE
+IPV6_RECVHOPLIMIT
+IPV6_RECVHOPOPTS
+IPV6_RECVORIGDSTADDR
+IPV6_RECVPATHMTU
+IPV6_RECVPKTINFO
+IPV6_RECVRTHDR
+IPV6_RECVTCLASS
+IPV6_ROUTER_ALERT
+IPV6_ROUTER_ALERT_ISOLATE
+IPV6_RTHDR
+IPV6_RTHDRDSTOPTS
+IPV6_RTHDR_LOOSE
+IPV6_RTHDR_STRICT
+IPV6_TCLASS
+IPV6_TRANSPARENT
+IPV6_UNICAST_IF
+IPV6_XFRM_POLICY
+IPVERSION
+IP_ADD_SOURCE_MEMBERSHIP
+IP_BIND_ADDRESS_NO_PORT
+IP_BLOCK_SOURCE
+IP_CHECKSUM
+IP_DEFAULT_MULTICAST_LOOP
+IP_DEFAULT_MULTICAST_TTL
+IP_DROP_SOURCE_MEMBERSHIP
+IP_FREEBIND
+IP_HDRINCL
+IP_IPSEC_POLICY
+IP_MINTTL
+IP_MSFILTER
+IP_MTU
+IP_MTU_DISCOVER
+IP_MULTICAST_ALL
+IP_NODEFRAG
+IP_OPTIONS
+IP_ORIGDSTADDR
+IP_PASSSEC
+IP_PKTINFO
+IP_PKTOPTIONS
+IP_PMTUDISC_DO
+IP_PMTUDISC_DONT
+IP_PMTUDISC_INTERFACE
+IP_PMTUDISC_OMIT
+IP_PMTUDISC_PROBE
+IP_PMTUDISC_WANT
+IP_RECVERR
+IP_RECVFRAGSIZE
+IP_RECVOPTS
+IP_RECVORIGDSTADDR
+IP_RECVTOS
+IP_RECVTTL
+IP_RETOPTS
+IP_ROUTER_ALERT
+IP_TOS
+IP_TRANSPARENT
+IP_UNBLOCK_SOURCE
+IP_UNICAST_IF
+IP_XFRM_POLICY
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+J1939_IDLE_ADDR
+J1939_MAX_UNICAST_ADDR
+J1939_NLA_BYTES_ACKED
+J1939_NLA_DEST_ADDR
+J1939_NLA_DEST_NAME
+J1939_NLA_PAD
+J1939_NLA_PGN
+J1939_NLA_SRC_ADDR
+J1939_NLA_SRC_NAME
+J1939_NLA_TOTAL_SIZE
+J1939_NO_ADDR
+J1939_NO_NAME
+J1939_NO_PGN
+J1939_PGN_ADDRESS_CLAIMED
+J1939_PGN_ADDRESS_COMMANDED
+J1939_PGN_MAX
+J1939_PGN_PDU1_MAX
+J1939_PGN_REQUEST
+KERNEL_VERSION
+KEYCTL_ASSUME_AUTHORITY
+KEYCTL_CHOWN
+KEYCTL_CLEAR
+KEYCTL_DESCRIBE
+KEYCTL_GET_KEYRING_ID
+KEYCTL_GET_PERSISTENT
+KEYCTL_GET_SECURITY
+KEYCTL_INSTANTIATE
+KEYCTL_INSTANTIATE_IOV
+KEYCTL_INVALIDATE
+KEYCTL_JOIN_SESSION_KEYRING
+KEYCTL_LINK
+KEYCTL_NEGATE
+KEYCTL_READ
+KEYCTL_REJECT
+KEYCTL_REVOKE
+KEYCTL_SEARCH
+KEYCTL_SESSION_TO_PARENT
+KEYCTL_SETPERM
+KEYCTL_SET_REQKEY_KEYRING
+KEYCTL_SET_TIMEOUT
+KEYCTL_UNLINK
+KEYCTL_UPDATE
+KEY_CNT
+KEY_MAX
+KEY_REQKEY_DEFL_DEFAULT
+KEY_REQKEY_DEFL_GROUP_KEYRING
+KEY_REQKEY_DEFL_NO_CHANGE
+KEY_REQKEY_DEFL_PROCESS_KEYRING
+KEY_REQKEY_DEFL_REQUESTOR_KEYRING
+KEY_REQKEY_DEFL_SESSION_KEYRING
+KEY_REQKEY_DEFL_THREAD_KEYRING
+KEY_REQKEY_DEFL_USER_KEYRING
+KEY_REQKEY_DEFL_USER_SESSION_KEYRING
+KEY_SPEC_GROUP_KEYRING
+KEY_SPEC_PROCESS_KEYRING
+KEY_SPEC_REQKEY_AUTH_KEY
+KEY_SPEC_REQUESTOR_KEYRING
+KEY_SPEC_SESSION_KEYRING
+KEY_SPEC_THREAD_KEYRING
+KEY_SPEC_USER_KEYRING
+KEY_SPEC_USER_SESSION_KEYRING
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LED_CNT
+LED_MAX
+LINUX_REBOOT_CMD_CAD_OFF
+LINUX_REBOOT_CMD_CAD_ON
+LINUX_REBOOT_CMD_HALT
+LINUX_REBOOT_CMD_KEXEC
+LINUX_REBOOT_CMD_POWER_OFF
+LINUX_REBOOT_CMD_RESTART
+LINUX_REBOOT_CMD_RESTART2
+LINUX_REBOOT_CMD_SW_SUSPEND
+LINUX_REBOOT_MAGIC1
+LINUX_REBOOT_MAGIC2
+LINUX_REBOOT_MAGIC2A
+LINUX_REBOOT_MAGIC2B
+LINUX_REBOOT_MAGIC2C
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FILE
+MAP_FIXED_NOREPLACE
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_HUGE_16GB
+MAP_HUGE_16MB
+MAP_HUGE_1GB
+MAP_HUGE_1MB
+MAP_HUGE_256MB
+MAP_HUGE_2GB
+MAP_HUGE_2MB
+MAP_HUGE_32MB
+MAP_HUGE_512KB
+MAP_HUGE_512MB
+MAP_HUGE_64KB
+MAP_HUGE_8MB
+MAP_HUGE_MASK
+MAP_HUGE_SHIFT
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_SHARED_VALIDATE
+MAP_STACK
+MAP_TYPE
+MAXTTL
+MAX_ADDR_LEN
+MAX_IPOPTLEN
+MCAST_BLOCK_SOURCE
+MCAST_EXCLUDE
+MCAST_INCLUDE
+MCAST_JOIN_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+MCAST_UNBLOCK_SOURCE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MFD_HUGETLB
+MINSIGSTKSZ
+MMAP_PAGE_ZERO
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MODULE_INIT_IGNORE_MODVERSIONS
+MODULE_INIT_IGNORE_VERMAGIC
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MREMAP_FIXED
+MREMAP_MAYMOVE
+MSC_CNT
+MSC_MAX
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_COPY
+MSG_DONTWAIT
+MSG_ERRQUEUE
+MSG_EXCEPT
+MSG_FASTOPEN
+MSG_FIN
+MSG_INFO
+MSG_MORE
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_RST
+MSG_STAT
+MSG_SYN
+MSG_WAITFORONE
+MSG_ZEROCOPY
+MS_ACTIVE
+MS_BIND
+MS_DIRSYNC
+MS_I_VERSION
+MS_KERNMOUNT
+MS_LAZYTIME
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NDA_CACHEINFO
+NDA_DST
+NDA_IFINDEX
+NDA_PORT
+NDA_PROBES
+NDA_UNSPEC
+NDA_VLAN
+NDA_VNI
+NETLINK_ADD_MEMBERSHIP
+NETLINK_AUDIT
+NETLINK_BROADCAST_ERROR
+NETLINK_CAP_ACK
+NETLINK_CONNECTOR
+NETLINK_CRYPTO
+NETLINK_DNRTMSG
+NETLINK_DROP_MEMBERSHIP
+NETLINK_ECRYPTFS
+NETLINK_EXT_ACK
+NETLINK_FIB_LOOKUP
+NETLINK_FIREWALL
+NETLINK_GENERIC
+NETLINK_GET_STRICT_CHK
+NETLINK_INET_DIAG
+NETLINK_IP6_FW
+NETLINK_ISCSI
+NETLINK_KOBJECT_UEVENT
+NETLINK_LISTEN_ALL_NSID
+NETLINK_LIST_MEMBERSHIPS
+NETLINK_NETFILTER
+NETLINK_NFLOG
+NETLINK_NO_ENOBUFS
+NETLINK_PKTINFO
+NETLINK_RDMA
+NETLINK_ROUTE
+NETLINK_RX_RING
+NETLINK_SCSITRANSPORT
+NETLINK_SELINUX
+NETLINK_SOCK_DIAG
+NETLINK_TX_RING
+NETLINK_UNUSED
+NETLINK_USERSOCK
+NETLINK_XFRM
+NFNETLINK_V0
+NFNLGRP_ACCT_QUOTA
+NFNLGRP_CONNTRACK_DESTROY
+NFNLGRP_CONNTRACK_EXP_DESTROY
+NFNLGRP_CONNTRACK_EXP_NEW
+NFNLGRP_CONNTRACK_EXP_UPDATE
+NFNLGRP_CONNTRACK_NEW
+NFNLGRP_CONNTRACK_UPDATE
+NFNLGRP_NFTABLES
+NFNLGRP_NONE
+NFNL_MSG_BATCH_BEGIN
+NFNL_MSG_BATCH_END
+NFNL_SUBSYS_ACCT
+NFNL_SUBSYS_COUNT
+NFNL_SUBSYS_CTHELPER
+NFNL_SUBSYS_CTNETLINK
+NFNL_SUBSYS_CTNETLINK_EXP
+NFNL_SUBSYS_CTNETLINK_TIMEOUT
+NFNL_SUBSYS_IPSET
+NFNL_SUBSYS_NFTABLES
+NFNL_SUBSYS_NFT_COMPAT
+NFNL_SUBSYS_NONE
+NFNL_SUBSYS_OSF
+NFNL_SUBSYS_QUEUE
+NFNL_SUBSYS_ULOG
+NFPROTO_ARP
+NFPROTO_BRIDGE
+NFPROTO_DECNET
+NFPROTO_IPV4
+NFPROTO_IPV6
+NFPROTO_NUMPROTO
+NFPROTO_UNSPEC
+NFQA_CAP_LEN
+NFQA_CFG_CMD
+NFQA_CFG_FLAGS
+NFQA_CFG_F_CONNTRACK
+NFQA_CFG_F_FAIL_OPEN
+NFQA_CFG_F_GSO
+NFQA_CFG_F_MAX
+NFQA_CFG_F_SECCTX
+NFQA_CFG_F_UID_GID
+NFQA_CFG_MASK
+NFQA_CFG_PARAMS
+NFQA_CFG_QUEUE_MAXLEN
+NFQA_CFG_UNSPEC
+NFQA_CT
+NFQA_CT_INFO
+NFQA_EXP
+NFQA_GID
+NFQA_HWADDR
+NFQA_IFINDEX_INDEV
+NFQA_IFINDEX_OUTDEV
+NFQA_IFINDEX_PHYSINDEV
+NFQA_IFINDEX_PHYSOUTDEV
+NFQA_MARK
+NFQA_PACKET_HDR
+NFQA_PAYLOAD
+NFQA_SECCTX
+NFQA_SKB_CSUMNOTREADY
+NFQA_SKB_CSUM_NOTVERIFIED
+NFQA_SKB_GSO
+NFQA_SKB_INFO
+NFQA_TIMESTAMP
+NFQA_UID
+NFQA_UNSPEC
+NFQA_VERDICT_HDR
+NFQNL_CFG_CMD_BIND
+NFQNL_CFG_CMD_NONE
+NFQNL_CFG_CMD_PF_BIND
+NFQNL_CFG_CMD_PF_UNBIND
+NFQNL_CFG_CMD_UNBIND
+NFQNL_COPY_META
+NFQNL_COPY_NONE
+NFQNL_COPY_PACKET
+NFQNL_MSG_CONFIG
+NFQNL_MSG_PACKET
+NFQNL_MSG_VERDICT
+NFQNL_MSG_VERDICT_BATCH
+NFULA_CFG_CMD
+NFULA_CFG_FLAGS
+NFULA_CFG_MODE
+NFULA_CFG_NLBUFSIZ
+NFULA_CFG_QTHRESH
+NFULA_CFG_TIMEOUT
+NFULA_CFG_UNSPEC
+NFULA_CT
+NFULA_CT_INFO
+NFULA_GID
+NFULA_HWADDR
+NFULA_HWHEADER
+NFULA_HWLEN
+NFULA_HWTYPE
+NFULA_IFINDEX_INDEV
+NFULA_IFINDEX_OUTDEV
+NFULA_IFINDEX_PHYSINDEV
+NFULA_IFINDEX_PHYSOUTDEV
+NFULA_MARK
+NFULA_PACKET_HDR
+NFULA_PAYLOAD
+NFULA_PREFIX
+NFULA_SEQ
+NFULA_SEQ_GLOBAL
+NFULA_TIMESTAMP
+NFULA_UID
+NFULA_UNSPEC
+NFULNL_CFG_CMD_BIND
+NFULNL_CFG_CMD_NONE
+NFULNL_CFG_CMD_PF_BIND
+NFULNL_CFG_CMD_PF_UNBIND
+NFULNL_CFG_CMD_UNBIND
+NFULNL_CFG_F_CONNTRACK
+NFULNL_CFG_F_SEQ
+NFULNL_CFG_F_SEQ_GLOBAL
+NFULNL_COPY_META
+NFULNL_COPY_NONE
+NFULNL_COPY_PACKET
+NFULNL_MSG_CONFIG
+NFULNL_MSG_PACKET
+NF_ACCEPT
+NF_DROP
+NF_INET_FORWARD
+NF_INET_LOCAL_IN
+NF_INET_LOCAL_OUT
+NF_INET_NUMHOOKS
+NF_INET_POST_ROUTING
+NF_INET_PRE_ROUTING
+NF_IP6_FORWARD
+NF_IP6_LOCAL_IN
+NF_IP6_LOCAL_OUT
+NF_IP6_NUMHOOKS
+NF_IP6_POST_ROUTING
+NF_IP6_PRE_ROUTING
+NF_IP6_PRI_CONNTRACK
+NF_IP6_PRI_CONNTRACK_DEFRAG
+NF_IP6_PRI_CONNTRACK_HELPER
+NF_IP6_PRI_FILTER
+NF_IP6_PRI_FIRST
+NF_IP6_PRI_LAST
+NF_IP6_PRI_MANGLE
+NF_IP6_PRI_NAT_DST
+NF_IP6_PRI_NAT_SRC
+NF_IP6_PRI_RAW
+NF_IP6_PRI_SECURITY
+NF_IP6_PRI_SELINUX_FIRST
+NF_IP6_PRI_SELINUX_LAST
+NF_IP_FORWARD
+NF_IP_LOCAL_IN
+NF_IP_LOCAL_OUT
+NF_IP_NUMHOOKS
+NF_IP_POST_ROUTING
+NF_IP_PRE_ROUTING
+NF_IP_PRI_CONNTRACK
+NF_IP_PRI_CONNTRACK_CONFIRM
+NF_IP_PRI_CONNTRACK_DEFRAG
+NF_IP_PRI_CONNTRACK_HELPER
+NF_IP_PRI_FILTER
+NF_IP_PRI_FIRST
+NF_IP_PRI_LAST
+NF_IP_PRI_MANGLE
+NF_IP_PRI_NAT_DST
+NF_IP_PRI_NAT_SRC
+NF_IP_PRI_RAW
+NF_IP_PRI_SECURITY
+NF_IP_PRI_SELINUX_FIRST
+NF_IP_PRI_SELINUX_LAST
+NF_MAX_VERDICT
+NF_QUEUE
+NF_REPEAT
+NF_STOLEN
+NF_STOP
+NF_VERDICT_BITS
+NF_VERDICT_FLAG_QUEUE_BYPASS
+NF_VERDICT_MASK
+NF_VERDICT_QBITS
+NF_VERDICT_QMASK
+NI_DGRAM
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSERV
+NL0
+NL1
+NLA_ALIGN
+NLA_ALIGNTO
+NLA_F_NESTED
+NLA_F_NET_BYTEORDER
+NLA_TYPE_MASK
+NLDLY
+NLMSG_DONE
+NLMSG_ERROR
+NLMSG_MIN_TYPE
+NLMSG_NOOP
+NLMSG_OVERRUN
+NLM_F_ACK
+NLM_F_APPEND
+NLM_F_ATOMIC
+NLM_F_CREATE
+NLM_F_DUMP
+NLM_F_DUMP_FILTERED
+NLM_F_DUMP_INTR
+NLM_F_ECHO
+NLM_F_EXCL
+NLM_F_MATCH
+NLM_F_MULTI
+NLM_F_REPLACE
+NLM_F_REQUEST
+NLM_F_ROOT
+NOEXPR
+NOSTR
+NTF_PROXY
+NTF_ROUTER
+NTF_SELF
+NTF_USE
+NUD_DELAY
+NUD_FAILED
+NUD_INCOMPLETE
+NUD_NOARP
+NUD_NONE
+NUD_PERMANENT
+NUD_PROBE
+NUD_REACHABLE
+NUD_STALE
+OFDEL
+OFILL
+OLCUC
+O_ASYNC
+O_DIRECT
+O_DSYNC
+O_LARGEFILE
+O_NDELAY
+O_NOATIME
+O_NOCTTY
+O_PATH
+O_RSYNC
+O_SYNC
+O_TMPFILE
+PACKET_ADD_MEMBERSHIP
+PACKET_DROP_MEMBERSHIP
+PACKET_MR_ALLMULTI
+PACKET_MR_MULTICAST
+PACKET_MR_PROMISC
+PACKET_MR_UNICAST
+PENDIN
+PF_ALG
+PF_APPLETALK
+PF_ASH
+PF_ATMPVC
+PF_ATMSVC
+PF_AX25
+PF_BLUETOOTH
+PF_BRIDGE
+PF_CAIF
+PF_CAN
+PF_DECnet
+PF_ECONET
+PF_IEEE802154
+PF_IPX
+PF_IRDA
+PF_ISDN
+PF_IUCV
+PF_KEY
+PF_LLC
+PF_LOCAL
+PF_MASKOS
+PF_MASKPROC
+PF_NETBEUI
+PF_NETLINK
+PF_NETROM
+PF_NFC
+PF_PACKET
+PF_PHONET
+PF_PPPOX
+PF_R
+PF_RDS
+PF_ROSE
+PF_ROUTE
+PF_RXRPC
+PF_SECURITY
+PF_SNA
+PF_TIPC
+PF_VSOCK
+PF_W
+PF_WANPIPE
+PF_X
+PF_X25
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSCHEDPARAM
+POSIX_SPAWN_SETSCHEDULER
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+POSIX_SPAWN_USEVFORK
+POSIX_SPAWN_SETSID
+PROT_GROWSDOWN
+PROT_GROWSUP
+PR_CAPBSET_DROP
+PR_CAPBSET_READ
+PR_CAP_AMBIENT
+PR_CAP_AMBIENT_CLEAR_ALL
+PR_CAP_AMBIENT_IS_SET
+PR_CAP_AMBIENT_LOWER
+PR_CAP_AMBIENT_RAISE
+PR_ENDIAN_BIG
+PR_ENDIAN_LITTLE
+PR_ENDIAN_PPC_LITTLE
+PR_FPEMU_NOPRINT
+PR_FPEMU_SIGFPE
+PR_FP_EXC_ASYNC
+PR_FP_EXC_DISABLED
+PR_FP_EXC_DIV
+PR_FP_EXC_INV
+PR_FP_EXC_NONRECOV
+PR_FP_EXC_OVF
+PR_FP_EXC_PRECISE
+PR_FP_EXC_RES
+PR_FP_EXC_SW_ENABLE
+PR_FP_EXC_UND
+PR_FP_MODE_FR
+PR_FP_MODE_FRE
+PR_GET_CHILD_SUBREAPER
+PR_GET_DUMPABLE
+PR_GET_ENDIAN
+PR_GET_FPEMU
+PR_GET_FPEXC
+PR_GET_FP_MODE
+PR_GET_KEEPCAPS
+PR_GET_NAME
+PR_GET_NO_NEW_PRIVS
+PR_GET_PDEATHSIG
+PR_GET_SECCOMP
+PR_GET_SECUREBITS
+PR_GET_THP_DISABLE
+PR_GET_TID_ADDRESS
+PR_GET_TIMERSLACK
+PR_GET_TIMING
+PR_GET_TSC
+PR_GET_UNALIGN
+PR_MCE_KILL
+PR_MCE_KILL_CLEAR
+PR_MCE_KILL_DEFAULT
+PR_MCE_KILL_EARLY
+PR_MCE_KILL_GET
+PR_MCE_KILL_LATE
+PR_MCE_KILL_SET
+PR_MPX_DISABLE_MANAGEMENT
+PR_MPX_ENABLE_MANAGEMENT
+PR_SET_CHILD_SUBREAPER
+PR_SET_DUMPABLE
+PR_SET_ENDIAN
+PR_SET_FPEMU
+PR_SET_FPEXC
+PR_SET_FP_MODE
+PR_SET_KEEPCAPS
+PR_SET_MM
+PR_SET_MM_ARG_END
+PR_SET_MM_ARG_START
+PR_SET_MM_AUXV
+PR_SET_MM_BRK
+PR_SET_MM_END_CODE
+PR_SET_MM_END_DATA
+PR_SET_MM_ENV_END
+PR_SET_MM_ENV_START
+PR_SET_MM_EXE_FILE
+PR_SET_MM_MAP
+PR_SET_MM_MAP_SIZE
+PR_SET_MM_START_BRK
+PR_SET_MM_START_CODE
+PR_SET_MM_START_DATA
+PR_SET_MM_START_STACK
+PR_SET_NAME
+PR_SET_NO_NEW_PRIVS
+PR_SET_PDEATHSIG
+PR_SET_PTRACER
+PR_SET_SECCOMP
+PR_SET_SECUREBITS
+PR_SET_THP_DISABLE
+PR_SET_TIMERSLACK
+PR_SET_TIMING
+PR_SET_TSC
+PR_SET_UNALIGN
+PR_TASK_PERF_EVENTS_DISABLE
+PR_TASK_PERF_EVENTS_ENABLE
+PR_TIMING_STATISTICAL
+PR_TIMING_TIMESTAMP
+PR_TSC_ENABLE
+PR_TSC_SIGSEGV
+PR_UNALIGN_NOPRINT
+PR_UNALIGN_SIGBUS
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PRIO_NONE
+PTHREAD_PRIO_INHERIT
+PTHREAD_PRIO_PROTECT
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_STOP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETREGSET
+PTRACE_GETSIGINFO
+PTRACE_INTERRUPT
+PTRACE_KILL
+PTRACE_LISTEN
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKSIGINFO
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SEIZE
+PTRACE_SETOPTIONS
+PTRACE_SETREGSET
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+PT_HIOS
+PT_HISUNW
+PT_LOPROC
+PT_HIPROC
+PT_DYNAMIC
+PT_GNU_EH_FRAME
+PT_GNU_RELRO
+PT_GNU_STACK
+PT_INTERP
+PT_LOAD
+PT_LOOS
+PT_LOSUNW
+PT_NOTE
+PT_NULL
+PT_NUM
+PT_PHDR
+PT_SHLIB
+PT_SUNWBSS
+PT_SUNWSTACK
+PT_TLS
+P_ALL
+P_PGID
+P_PID
+P_PIDFD
+QCMD
+QFMT_VFS_OLD
+QFMT_VFS_V0
+QFMT_VFS_V1
+QIF_ALL
+QIF_BLIMITS
+QIF_BTIME
+QIF_ILIMITS
+QIF_INODES
+QIF_ITIME
+QIF_LIMITS
+QIF_SPACE
+QIF_TIMES
+QIF_USAGE
+Q_GETFMT
+Q_GETINFO
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETINFO
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+RB_AUTOBOOT
+RB_DISABLE_CAD
+RB_ENABLE_CAD
+RB_HALT_SYSTEM
+RB_KEXEC
+RB_POWER_OFF
+RB_SW_SUSPEND
+READ_IMPLIES_EXEC
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REL_CNT
+REL_MAX
+RENAME_EXCHANGE
+RENAME_NOREPLACE
+RENAME_WHITEOUT
+REP_CNT
+REP_MAX
+RESOLVE_BENEATH
+RESOLVE_CACHED
+RESOLVE_IN_ROOT
+RESOLVE_NO_MAGICLINKS
+RESOLVE_NO_SYMLINKS
+RESOLVE_NO_XDEV
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_LOCKS
+RLIMIT_MEMLOCK
+RLIMIT_MSGQUEUE
+RLIMIT_NICE
+RLIMIT_NLIMITS
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_RTPRIO
+RLIMIT_RTTIME
+RLIMIT_SIGPENDING
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_SAVED_CUR
+RLIM_SAVED_MAX
+RTA_CACHEINFO
+RTA_DST
+RTA_FLOW
+RTA_GATEWAY
+RTA_IIF
+RTA_MARK
+RTA_METRICS
+RTA_MFC_STATS
+RTA_MP_ALGO
+RTA_MULTIPATH
+RTA_PREFSRC
+RTA_PRIORITY
+RTA_PROTOINFO
+RTA_SESSION
+RTA_SRC
+RTA_TABLE
+RTCF_DIRECTSRC
+RTCF_DOREDIRECT
+RTCF_LOG
+RTCF_MASQ
+RTCF_NAT
+RTCF_VALVE
+RTF_ADDRCLASSMASK
+RTF_ADDRCONF
+RTF_ALLONLINK
+RTF_BROADCAST
+RTF_CACHE
+RTF_DEFAULT
+RTF_DYNAMIC
+RTF_FLOW
+RTF_GATEWAY
+RTF_HOST
+RTF_INTERFACE
+RTF_IRTT
+RTF_LINKRT
+RTF_LOCAL
+RTF_MODIFIED
+RTF_MSS
+RTF_MTU
+RTF_MULTICAST
+RTF_NAT
+RTF_NOFORWARD
+RTF_NONEXTHOP
+RTF_NOPMTUDISC
+RTF_POLICY
+RTF_REINSTATE
+RTF_REJECT
+RTF_STATIC
+RTF_THROW
+RTF_UP
+RTF_WINDOW
+RTF_XRESOLVE
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTMSG_AR_FAILED
+RTMSG_CONTROL
+RTMSG_DELDEVICE
+RTMSG_DELROUTE
+RTMSG_DELRULE
+RTMSG_NEWDEVICE
+RTMSG_NEWROUTE
+RTMSG_NEWRULE
+RTMSG_OVERRUN
+RTM_DELACTION
+RTM_DELADDR
+RTM_DELADDRLABEL
+RTM_DELLINK
+RTM_DELMDB
+RTM_DELNEIGH
+RTM_DELNSID
+RTM_DELQDISC
+RTM_DELROUTE
+RTM_DELRULE
+RTM_DELTCLASS
+RTM_DELTFILTER
+RTM_F_CLONED
+RTM_F_EQUALIZE
+RTM_F_NOTIFY
+RTM_F_PREFIX
+RTM_GETACTION
+RTM_GETADDR
+RTM_GETADDRLABEL
+RTM_GETANYCAST
+RTM_GETDCB
+RTM_GETLINK
+RTM_GETMDB
+RTM_GETMULTICAST
+RTM_GETNEIGH
+RTM_GETNEIGHTBL
+RTM_GETNETCONF
+RTM_GETNSID
+RTM_GETQDISC
+RTM_GETROUTE
+RTM_GETRULE
+RTM_GETTCLASS
+RTM_GETTFILTER
+RTM_NEWACTION
+RTM_NEWADDR
+RTM_NEWADDRLABEL
+RTM_NEWLINK
+RTM_NEWMDB
+RTM_NEWNDUSEROPT
+RTM_NEWNEIGH
+RTM_NEWNEIGHTBL
+RTM_NEWNETCONF
+RTM_NEWNSID
+RTM_NEWPREFIX
+RTM_NEWQDISC
+RTM_NEWROUTE
+RTM_NEWRULE
+RTM_NEWTCLASS
+RTM_NEWTFILTER
+RTM_SETDCB
+RTM_SETLINK
+RTM_SETNEIGHTBL
+RTN_ANYCAST
+RTN_BLACKHOLE
+RTN_BROADCAST
+RTN_LOCAL
+RTN_MULTICAST
+RTN_NAT
+RTN_PROHIBIT
+RTN_THROW
+RTN_UNICAST
+RTN_UNREACHABLE
+RTN_UNSPEC
+RTN_XRESOLVE
+RTPROT_BOOT
+RTPROT_KERNEL
+RTPROT_REDIRECT
+RTPROT_STATIC
+RTPROT_UNSPEC
+RT_ADDRCLASS
+RT_CLASS_DEFAULT
+RT_CLASS_LOCAL
+RT_CLASS_MAIN
+RT_CLASS_MAX
+RT_CLASS_UNSPEC
+RT_LOCALADDR
+RT_SCOPE_HOST
+RT_SCOPE_LINK
+RT_SCOPE_NOWHERE
+RT_SCOPE_SITE
+RT_SCOPE_UNIVERSE
+RT_TABLE_COMPAT
+RT_TABLE_DEFAULT
+RT_TABLE_LOCAL
+RT_TABLE_MAIN
+RT_TABLE_UNSPEC
+RT_TOS
+RUSAGE_CHILDREN
+RUSAGE_SELF
+RUSAGE_THREAD
+SCHED_BATCH
+SCHED_FIFO
+SCHED_IDLE
+SCHED_OTHER
+SCHED_RESET_ON_FORK
+SCHED_RR
+SCM_CREDENTIALS
+SCM_RIGHTS
+SCM_J1939_DEST_ADDR
+SCM_J1939_DEST_NAME
+SCM_J1939_ERRQUEUE
+SCM_J1939_PRIO
+SCM_TIMESTAMP
+SCM_TIMESTAMPING
+SECCOMP_FILTER_FLAG_LOG
+SECCOMP_FILTER_FLAG_SPEC_ALLOW
+SECCOMP_FILTER_FLAG_TSYNC
+SECCOMP_MODE_DISABLED
+SECCOMP_MODE_FILTER
+SECCOMP_MODE_STRICT
+SECCOMP_RET_ACTION
+SECCOMP_RET_ACTION_FULL
+SECCOMP_RET_ALLOW
+SECCOMP_RET_DATA
+SECCOMP_RET_ERRNO
+SECCOMP_RET_KILL
+SECCOMP_RET_KILL_PROCESS
+SECCOMP_RET_KILL_THREAD
+SECCOMP_RET_LOG
+SECCOMP_RET_TRACE
+SECCOMP_RET_TRAP
+SEEK_DATA
+SEEK_HOLE
+SELFMAG
+SEM_FAILED
+SFD_CLOEXEC
+SFD_NONBLOCK
+SHM_EXEC
+SHM_HUGETLB
+SHM_LOCK
+SHM_NORESERVE
+SHM_R
+SHM_RDONLY
+SHM_REMAP
+SHM_RND
+SHM_UNLOCK
+SHM_W
+SHORT_INODE
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGIO
+SIGPOLL
+SIGPWR
+SIGRTMAX
+SIGRTMIN
+SIGSTKSZ
+SIOCADDMULTI
+SIOCADDRT
+SIOCDARP
+SIOCDELMULTI
+SIOCDELRT
+SIOCDIFADDR
+SIOCDRARP
+SIOCETHTOOL
+SIOCGARP
+SIOCGIFADDR
+SIOCGIFBR
+SIOCGIFBRDADDR
+SIOCGIFCONF
+SIOCGIFCOUNT
+SIOCGIFDSTADDR
+SIOCGIFENCAP
+SIOCGIFFLAGS
+SIOCGIFHWADDR
+SIOCGIFINDEX
+SIOCGIFMAP
+SIOCGIFMEM
+SIOCGIFMETRIC
+SIOCGIFMTU
+SIOCGIFNAME
+SIOCGIFNETMASK
+SIOCGIFPFLAGS
+SIOCGIFSLAVE
+SIOCGIFTXQLEN
+SIOCGRARP
+SIOCGSKNS
+SIOGIFINDEX
+SIOCGMIIPHY
+SIOCGMIIREG
+SIOCSARP
+SIOCSIFADDR
+SIOCSIFBR
+SIOCSIFBRDADDR
+SIOCSIFDSTADDR
+SIOCSIFENCAP
+SIOCSIFFLAGS
+SIOCSIFHWADDR
+SIOCSIFHWBROADCAST
+SIOCSIFLINK
+SIOCSIFMAP
+SIOCSIFMEM
+SIOCSIFMETRIC
+SIOCSIFMTU
+SIOCSIFNETMASK
+SIOCSIFPFLAGS
+SIOCSIFSLAVE
+SIOCSIFTXQLEN
+SIOCSMIIREG
+SIOCSRARP
+SIOCOUTQNSD
+SIOCWANDEV
+SI_LOAD_SHIFT
+SND_CNT
+SND_MAX
+SOCK_CLOEXEC
+SOCK_DCCP
+SOCK_NONBLOCK
+SOCK_PACKET
+SOCK_RAW
+SOCK_RDM
+SOF_TIMESTAMPING_RAW_HARDWARE
+SOF_TIMESTAMPING_RX_HARDWARE
+SOF_TIMESTAMPING_RX_SOFTWARE
+SOF_TIMESTAMPING_SOFTWARE
+SOF_TIMESTAMPING_SYS_HARDWARE
+SOF_TIMESTAMPING_TX_HARDWARE
+SOF_TIMESTAMPING_TX_SOFTWARE
+SOF_TIMESTAMPING_OPT_ID
+SOF_TIMESTAMPING_TX_SCHED
+SOF_TIMESTAMPING_TX_ACK
+SOF_TIMESTAMPING_OPT_CMSG
+SOF_TIMESTAMPING_OPT_TSONLY
+SOF_TIMESTAMPING_OPT_STATS
+SOF_TIMESTAMPING_OPT_PKTINFO
+SOF_TIMESTAMPING_OPT_TX_SWHW
+SOF_TXTIME_DEADLINE_MODE
+SOF_TXTIME_REPORT_ERRORS
+SOL_AAL
+SOL_ALG
+SOL_ATM
+SOL_BLUETOOTH
+SOL_CAN_BASE
+SOL_CAN_J1939
+SOL_CAN_RAW
+SOL_DCCP
+SOL_DECNET
+SOL_ICMPV6
+SOL_IP
+SOL_IPV6
+SOL_IRDA
+SOL_LLC
+SOL_NETBEUI
+SOL_NETLINK
+SOL_TCP
+SOL_TIPC
+SOL_UDP
+SOL_X25
+SOMAXCONN
+SO_BINDTODEVICE
+SO_BUSY_POLL
+SO_DOMAIN
+SO_EE_OFFENDER
+SO_EE_ORIGIN_ICMP
+SO_EE_ORIGIN_ICMP6
+SO_EE_ORIGIN_LOCAL
+SO_EE_ORIGIN_NONE
+SO_EE_ORIGIN_TIMESTAMPING
+SO_EE_ORIGIN_TXSTATUS
+SO_MARK
+SO_J1939_ERRQUEUE
+SO_J1939_FILTER
+SO_J1939_PROMISC
+SO_J1939_SEND_PRIO
+SO_ORIGINAL_DST
+SO_PASSCRED
+SO_PASSSEC
+SO_PEEK_OFF
+SO_PEERCRED
+SO_PEERSEC
+SO_RCVBUFFORCE
+SO_REUSEPORT
+SO_RXQ_OVFL
+SO_SNDBUFFORCE
+SO_TIMESTAMP
+SO_TIMESTAMPING
+SPLICE_F_GIFT
+SPLICE_F_MORE
+SPLICE_F_MOVE
+SPLICE_F_NONBLOCK
+SS_DISABLE
+SS_ONSTACK
+STICKY_TIMEOUTS
+ST_APPEND
+ST_IMMUTABLE
+ST_MANDLOCK
+ST_NOATIME
+ST_NODEV
+ST_NODIRATIME
+ST_NOEXEC
+ST_NOSUID
+ST_RDONLY
+ST_SYNCHRONOUS
+ST_WRITE
+SW_CNT
+SW_MAX
+SYNC_FILE_RANGE_WAIT_AFTER
+SYNC_FILE_RANGE_WAIT_BEFORE
+SYNC_FILE_RANGE_WRITE
+SYN_CNT
+SYN_MAX
+SYS_accept4
+SYS_acct
+SYS_add_key
+SYS_adjtimex
+SYS_bind
+SYS_bpf
+SYS_brk
+SYS_capget
+SYS_capset
+SYS_chdir
+SYS_chroot
+SYS_clock_adjtime
+SYS_clock_getres
+SYS_clock_gettime
+SYS_clock_nanosleep
+SYS_clock_settime
+SYS_clone
+SYS_clone3
+SYS_close
+SYS_connect
+SYS_copy_file_range
+SYS_delete_module
+SYS_dup
+SYS_dup3
+SYS_epoll_create1
+SYS_epoll_ctl
+SYS_epoll_pwait
+SYS_eventfd2
+SYS_execve
+SYS_execveat
+SYS_exit
+SYS_exit_group
+SYS_faccessat
+SYS_fallocate
+SYS_fanotify_init
+SYS_fanotify_mark
+SYS_fchdir
+SYS_fchmod
+SYS_fchmodat
+SYS_fchown
+SYS_fchownat
+SYS_fcntl
+SYS_fdatasync
+SYS_fgetxattr
+SYS_finit_module
+SYS_flistxattr
+SYS_flock
+SYS_fremovexattr
+SYS_fsetxattr
+SYS_fstat
+SYS_fstatfs
+SYS_fsync
+SYS_ftruncate
+SYS_futex
+SYS_get_mempolicy
+SYS_get_robust_list
+SYS_getcpu
+SYS_getcwd
+SYS_getdents64
+SYS_getegid
+SYS_geteuid
+SYS_getgid
+SYS_getgroups
+SYS_getitimer
+SYS_getpeername
+SYS_getpgid
+SYS_getpid
+SYS_getppid
+SYS_getpriority
+SYS_getrandom
+SYS_getresgid
+SYS_getresuid
+SYS_getrusage
+SYS_getsid
+SYS_getsockname
+SYS_getsockopt
+SYS_gettid
+SYS_gettimeofday
+SYS_getuid
+SYS_getxattr
+SYS_init_module
+SYS_inotify_add_watch
+SYS_inotify_init1
+SYS_inotify_rm_watch
+SYS_io_cancel
+SYS_io_destroy
+SYS_io_getevents
+SYS_io_setup
+SYS_io_submit
+SYS_ioctl
+SYS_ioprio_get
+SYS_ioprio_set
+SYS_kcmp
+SYS_kexec_load
+SYS_keyctl
+SYS_kill
+SYS_lgetxattr
+SYS_linkat
+SYS_listen
+SYS_listxattr
+SYS_llistxattr
+SYS_lookup_dcookie
+SYS_lremovexattr
+SYS_lseek
+SYS_lsetxattr
+SYS_madvise
+SYS_mbind
+SYS_membarrier
+SYS_memfd_create
+SYS_mincore
+SYS_mkdirat
+SYS_mknodat
+SYS_mlock
+SYS_mlock2
+SYS_mlockall
+SYS_mount
+SYS_move_pages
+SYS_mprotect
+SYS_mq_getsetattr
+SYS_mq_notify
+SYS_mq_open
+SYS_mq_timedreceive
+SYS_mq_timedsend
+SYS_mq_unlink
+SYS_mremap
+SYS_msync
+SYS_munlock
+SYS_munlockall
+SYS_munmap
+SYS_name_to_handle_at
+SYS_nanosleep
+SYS_open_by_handle_at
+SYS_openat
+SYS_perf_event_open
+SYS_personality
+SYS_pidfd_open
+SYS_pipe2
+SYS_pivot_root
+SYS_ppoll
+SYS_prctl
+SYS_preadv
+SYS_preadv2
+SYS_prlimit64
+SYS_process_vm_readv
+SYS_process_vm_writev
+SYS_pselect6
+SYS_ptrace
+SYS_pwritev
+SYS_pwritev2
+SYS_quotactl
+SYS_read
+SYS_readahead
+SYS_readlinkat
+SYS_readv
+SYS_reboot
+SYS_recvfrom
+SYS_recvmmsg
+SYS_recvmsg
+SYS_remap_file_pages
+SYS_removexattr
+SYS_renameat2
+SYS_request_key
+SYS_restart_syscall
+SYS_rt_sigaction
+SYS_rt_sigpending
+SYS_rt_sigprocmask
+SYS_rt_sigqueueinfo
+SYS_rt_sigreturn
+SYS_rt_sigsuspend
+SYS_rt_sigtimedwait
+SYS_rt_tgsigqueueinfo
+SYS_sched_get_priority_max
+SYS_sched_get_priority_min
+SYS_sched_getaffinity
+SYS_sched_getattr
+SYS_sched_getparam
+SYS_sched_getscheduler
+SYS_sched_rr_get_interval
+SYS_sched_setaffinity
+SYS_sched_setattr
+SYS_sched_setparam
+SYS_sched_setscheduler
+SYS_sched_yield
+SYS_seccomp
+SYS_sendmmsg
+SYS_sendmsg
+SYS_sendto
+SYS_set_mempolicy
+SYS_set_robust_list
+SYS_set_tid_address
+SYS_setdomainname
+SYS_setfsgid
+SYS_setfsuid
+SYS_setgid
+SYS_setgroups
+SYS_sethostname
+SYS_setitimer
+SYS_setns
+SYS_setpgid
+SYS_setpriority
+SYS_setregid
+SYS_setresgid
+SYS_setresuid
+SYS_setreuid
+SYS_setrlimit
+SYS_setsid
+SYS_setsockopt
+SYS_settimeofday
+SYS_setuid
+SYS_setxattr
+SYS_shutdown
+SYS_sigaltstack
+SYS_signalfd4
+SYS_socket
+SYS_socketpair
+SYS_splice
+SYS_statfs
+SYS_statx
+SYS_swapoff
+SYS_swapon
+SYS_symlinkat
+SYS_sync
+SYS_syncfs
+SYS_sysinfo
+SYS_syslog
+SYS_tee
+SYS_tgkill
+SYS_timer_create
+SYS_timer_delete
+SYS_timer_getoverrun
+SYS_timer_gettime
+SYS_timer_settime
+SYS_timerfd_create
+SYS_timerfd_gettime
+SYS_timerfd_settime
+SYS_times
+SYS_tkill
+SYS_truncate
+SYS_umask
+SYS_umount2
+SYS_uname
+SYS_unlinkat
+SYS_unshare
+SYS_userfaultfd
+SYS_utimensat
+SYS_vhangup
+SYS_vmsplice
+SYS_wait4
+SYS_waitid
+SYS_write
+SYS_writev
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCA_KIND
+TCA_OPTIONS
+TCA_RATE
+TCA_STAB
+TCA_STATS
+TCA_STATS2
+TCA_UNSPEC
+TCA_XSTATS
+TCFLSH
+TCGETA
+TCGETS
+TCP_CONGESTION
+TCP_COOKIE_TRANSACTIONS
+TCP_CORK
+TCP_DEFER_ACCEPT
+TCP_FASTOPEN
+TCP_FASTOPEN_CONNECT
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINTVL
+TCP_LINGER2
+TCP_MAXSEG
+TCP_MD5SIG
+TCP_QUEUE_SEQ
+TCP_QUICKACK
+TCP_REPAIR
+TCP_REPAIR_OPTIONS
+TCP_REPAIR_QUEUE
+TCP_SYNCNT
+TCP_THIN_DUPACK
+TCP_THIN_LINEAR_TIMEOUTS
+TCP_TIMESTAMP
+TCP_ULP
+TCP_USER_TIMEOUT
+TCP_WINDOW_CLAMP
+TCSBRK
+TCSETA
+TCSETAF
+TCSETAW
+TCSETS
+TCSETSF
+TCSETSW
+TCXONC
+TFD_CLOEXEC
+TFD_NONBLOCK
+TFD_TIMER_ABSTIME
+TFD_TIMER_CANCEL_ON_SET
+THOUSEP
+TIMER_ABSTIME
+TIOCCONS
+TIOCEXCL
+TIOCGPGRP
+TIOCGSERIAL
+TIOCGSOFTCAR
+TIOCINQ
+TIOCLINUX
+TIOCMBIC
+TIOCMBIS
+TIOCMGET
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNXCL
+TIOCOUTQ
+TIOCSCTTY
+TIOCSPGRP
+TIOCSSOFTCAR
+TIOCSTI
+TUN_READQ_SIZE
+TUN_TAP_DEV
+TUN_TUN_DEV
+TUN_TYPE_MASK
+T_FMT
+T_FMT_AMPM
+UDP_CORK
+UDP_ENCAP
+UDP_GRO
+UDP_NO_CHECK6_RX
+UDP_NO_CHECK6_TX
+UDP_SEGMENT
+UINPUT_MAX_NAME_SIZE
+UINPUT_VERSION
+UIO_MAXIOV
+UTIME_NOW
+UTIME_OMIT
+VDISCARD
+VLNEXT
+VMADDR_CID_ANY
+VMADDR_CID_HOST
+VMADDR_CID_HYPERVISOR
+VMADDR_CID_LOCAL
+VMADDR_CID_RESERVED
+VMADDR_PORT_ANY
+VREPRINT
+VSWTC
+VWERASE
+VT0
+VT1
+VTDLY
+WEXITED
+WHOLE_SECONDS
+WNOWAIT
+WSTOPPED
+W_EXITCODE
+W_STOPCODE
+XATTR_CREATE
+XATTR_REPLACE
+XTABS
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_FILESIZEBITS
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SOCK_MAXBUF
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_AVPHYS_PAGES
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LOGIN_NAME_MAX
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_NZERO
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_RE_DUP_MAX
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAMS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_SC_XOPEN_XPG2
+_SC_XOPEN_XPG3
+_SC_XOPEN_XPG4
+__SIZEOF_PTHREAD_CONDATTR_T
+__SIZEOF_PTHREAD_COND_T
+__SIZEOF_PTHREAD_MUTEXATTR_T
+__SIZEOF_PTHREAD_MUTEX_T
+__SIZEOF_PTHREAD_RWLOCKATTR_T
+__SIZEOF_PTHREAD_RWLOCK_T
+__WALL
+__WCLONE
+__WNOTHREAD
+__c_anonymous_sockaddr_can_can_addr
+__c_anonymous_sockaddr_can_j1939
+__c_anonymous_sockaddr_can_tp
+__errno_location
+__exit_status
+__s16
+__s32
+__u16
+__u32
+__u64
+__u8
+abs
+accept4
+acct
+addmntent
+af_alg_iv
+arpd_request
+arphdr
+arpreq
+arpreq_old
+blkcnt64_t
+brk
+bsearch
+can_err_mask_t
+can_filter
+can_frame
+canfd_frame
+canid_t
+chroot
+clearenv
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_nanosleep
+clock_settime
+clone
+cmsghdr
+cpu_set_t
+creat64
+daemon
+difftime
+dirent64
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+drand48
+dup3
+duplocale
+endgrent
+endmntent
+endpwent
+endservent
+endspent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_pwait
+epoll_wait
+erand48
+eventfd
+execvpe
+faccessat
+fallocate
+fallocate64
+fanotify_event_metadata
+fanotify_init
+fanotify_mark
+fanotify_response
+fchdir
+fdatasync
+fdopendir
+fexecve
+ff_condition_effect
+ff_constant_effect
+ff_effect
+ff_envelope
+ff_periodic_effect
+ff_ramp_effect
+ff_replay
+ff_rumble_effect
+ff_trigger
+fgetpos64
+fgetxattr
+file_clone_range
+flistxattr
+fmemopen
+fopen64
+forkpty
+fpos64_t
+fread_unlocked
+freeifaddrs
+freelocale
+fremovexattr
+freopen64
+fseeko64
+fsetpos64
+fsetxattr
+fsid_t
+fstat64
+fstatat64
+fstatfs
+fstatfs64
+fstatvfs64
+ftello64
+ftok
+ftruncate64
+genlmsghdr
+getdomainname
+getdtablesize
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getline
+getmntent
+getnameinfo
+getopt_long
+getpriority
+getpwent
+getresgid
+getresuid
+getrlimit
+getrlimit64
+getrusage
+getservbyport
+getservent
+getsid
+getspent
+getspnam
+getspnam_r
+gettid
+getxattr
+hasmntopt
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+ifreq
+in6_ifreq
+in6_pktinfo
+in6_rtmsg
+in_pktinfo
+initgroups
+ino64_t
+inotify_add_watch
+inotify_event
+inotify_init
+inotify_init1
+inotify_rm_watch
+input_absinfo
+input_event
+input_id
+input_keymap_entry
+input_mask
+ip_mreqn
+ip_mreq_source
+ipc_perm
+itimerspec
+j1939_filter
+jrand48
+key_t
+killpg
+labs
+lcong48
+lgetxattr
+listxattr
+llistxattr
+lockf
+loff_t
+login_tty
+lrand48
+lremovexattr
+lseek64
+lsetxattr
+lstat64
+lutimes
+madvise
+major
+makedev
+memalign
+memmem
+memrchr
+mincore
+minor
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmap64
+mmsghdr
+mntent
+mount
+mq_attr
+mq_close
+mq_getattr
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+mrand48
+mremap
+msgctl
+msgget
+msghdr
+msginfo
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+name_t
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+nlattr
+nlmsgerr
+nlmsghdr
+nrand48
+off64_t
+open64
+open_how
+open_memstream
+openat
+openat64
+openpty
+packet_mreq
+pause
+personality
+pgn_t
+pipe2
+popen
+posix_fadvise
+posix_fadvise64
+posix_fallocate
+posix_fallocate64
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+ppoll
+prctl
+priority_t
+pread64
+preadv
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_getaffinity_np
+pthread_getattr_np
+pthread_getcpuclockid
+pthread_getname_np
+pthread_getschedparam
+pthread_kill
+pthread_mutex_consistent
+pthread_mutex_timedlock
+pthread_mutexattr_getprotocol
+pthread_mutexattr_getpshared
+pthread_mutexattr_setprotocol
+pthread_mutexattr_setpshared
+pthread_mutexattr_getrobust
+pthread_mutexattr_setrobust
+pthread_rwlockattr_setpshared
+pthread_setaffinity_np
+pthread_setname_np
+pthread_setschedparam
+pthread_setschedprio
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+ptrace
+ptsname_r
+pwrite64
+pwritev
+qsort
+quotactl
+rand
+readahead
+readdir64
+readdir64_r
+readdir_r
+readlinkat
+reboot
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+remap_file_pages
+removexattr
+rlim64_t
+rlimit64
+rtentry
+sbrk
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getcpu
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+seccomp_data
+seed48
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sembuf
+semctl
+semget
+semop
+sendfile
+sendfile64
+sendmmsg
+sendmsg
+setdomainname
+setfsgid
+setfsuid
+setgrent
+setgroups
+sethostname
+setmntent
+setns
+setpriority
+setpwent
+setresgid
+setresuid
+setrlimit
+setrlimit64
+setservent
+setspent
+settimeofday
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+signalfd
+signalfd_siginfo
+sigsuspend
+sigtimedwait
+sigwait
+sigwaitinfo
+sock_extended_err
+sock_filter
+sock_fprog
+sock_txtime
+sockaddr_alg
+sockaddr_can
+sockaddr_ll
+sockaddr_nl
+sockaddr_vm
+splice
+spwd
+srand
+srand48
+stack_t
+stat64
+statfs
+statfs64
+statvfs64
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+swapoff
+swapon
+sync
+sync_file_range
+syncfs
+syscall
+sysinfo
+tee
+telldir
+timerfd_create
+timerfd_gettime
+timerfd_settime
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+tmpfile64
+truncate
+truncate64
+ttyname_r
+ucred
+uinput_abs_setup
+uinput_ff_erase
+uinput_ff_upload
+uinput_setup
+uinput_user_dev
+umount
+umount2
+unshare
+useconds_t
+uselocale
+utimensat
+vfork
+vhangup
+vmsplice
+wait4
+waitid
diff --git a/libc-test/semver/macos-aarch64.txt b/libc-test/semver/macos-aarch64.txt
new file mode 100644
index 0000000000000..0dd36ae6a60c8
--- /dev/null
+++ b/libc-test/semver/macos-aarch64.txt
@@ -0,0 +1,3 @@
+__darwin_arm_exception_state64
+__darwin_arm_neon_state64
+__darwin_arm_thread_state64
\ No newline at end of file
diff --git a/libc-test/semver/macos-i686.txt b/libc-test/semver/macos-i686.txt
new file mode 100644
index 0000000000000..fb2107cd04183
--- /dev/null
+++ b/libc-test/semver/macos-i686.txt
@@ -0,0 +1,5 @@
+__darwin_mmst_reg
+__darwin_x86_exception_state64
+__darwin_x86_float_state64
+__darwin_x86_thread_state64
+__darwin_xmm_reg
diff --git a/libc-test/semver/macos-x86_64.txt b/libc-test/semver/macos-x86_64.txt
new file mode 100644
index 0000000000000..43de5e1f94baa
--- /dev/null
+++ b/libc-test/semver/macos-x86_64.txt
@@ -0,0 +1,6 @@
+__darwin_mmst_reg
+__darwin_x86_exception_state64
+__darwin_x86_float_state64
+__darwin_x86_thread_state64
+__darwin_xmm_reg
+malloc_introspection_t
diff --git a/libc-test/semver/macos.txt b/libc-test/semver/macos.txt
new file mode 100644
index 0000000000000..048c8a120329b
--- /dev/null
+++ b/libc-test/semver/macos.txt
@@ -0,0 +1,7 @@
+CLOCK_MONOTONIC_RAW
+CLOCK_MONOTONIC_RAW_APPROX
+CLOCK_UPTIME_RAW
+CLOCK_UPTIME_RAW_APPROX
+clock_settime
+memmem
+task_set_info
diff --git a/libc-test/semver/netbsd-aarch64.txt b/libc-test/semver/netbsd-aarch64.txt
new file mode 100644
index 0000000000000..e48c529a96c72
--- /dev/null
+++ b/libc-test/semver/netbsd-aarch64.txt
@@ -0,0 +1,7 @@
+PT_GETFPREGS
+PT_GETREGS
+PT_SETFPREGS
+PT_SETREGS
+__fregset
+mcontext_t
+ucontext_t
diff --git a/libc-test/semver/netbsd-powerpc.txt b/libc-test/semver/netbsd-powerpc.txt
new file mode 100644
index 0000000000000..e91dfcf654403
--- /dev/null
+++ b/libc-test/semver/netbsd-powerpc.txt
@@ -0,0 +1,3 @@
+PT_GETREGS
+PT_SETREGS
+PT_STEP
diff --git a/libc-test/semver/netbsd-x86_64.txt b/libc-test/semver/netbsd-x86_64.txt
new file mode 100644
index 0000000000000..573099c8bb69b
--- /dev/null
+++ b/libc-test/semver/netbsd-x86_64.txt
@@ -0,0 +1,6 @@
+Aux64Info
+PT_GETFPREGS
+PT_GETREGS
+PT_SETFPREGS
+PT_SETREGS
+PT_STEP
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
new file mode 100644
index 0000000000000..71cd0d3a48cdc
--- /dev/null
+++ b/libc-test/semver/netbsd.txt
@@ -0,0 +1,1543 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ACCOUNTING
+AF_APPLETALK
+AF_ARP
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NS
+AF_OROUTE
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+AI_ADDRCONFIG
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_SRV
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_BASE
+AT_DCACHEBSIZE
+AT_EACCESS
+AT_EGID
+AT_ENTRY
+AT_EUID
+AT_EXECFD
+AT_FDCWD
+AT_FLAGS
+AT_ICACHEBSIZE
+AT_IGNORE
+AT_NULL
+AT_PAGESZ
+AT_PHDR
+AT_PHENT
+AT_PHNUM
+AT_REMOVEDIR
+AT_RGID
+AT_RUID
+AT_SUN_CPU
+AT_SUN_EMUL_ENTRY
+AT_SUN_EMUL_EXECFD
+AT_SUN_EXECNAME
+AT_SUN_HWCAP
+AT_SUN_IFLUSH
+AT_SUN_LDELF
+AT_SUN_LDNAME
+AT_SUN_LDSHDR
+AT_SUN_LPGSIZE
+AT_SUN_PLATFORM
+AT_STACKBASE
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+AT_UCACHEBSIZE
+B14400
+B28800
+B460800
+B7200
+B76800
+B921600
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+CCTS_OFLOW
+CDTRCTS
+CHWFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTLFLAG_ALIAS
+CTLFLAG_ANYNUMBER
+CTLFLAG_ANYWRITE
+CTLFLAG_HEX
+CTLFLAG_HIDDEN
+CTLFLAG_IMMEDIATE
+CTLFLAG_MMAP
+CTLFLAG_OWNDATA
+CTLFLAG_OWNDESC
+CTLFLAG_PERMANENT
+CTLFLAG_PRIVATE
+CTLFLAG_READONLY
+CTLFLAG_READWRITE
+CTLFLAG_ROOT
+CTLFLAG_UNSIGNED
+CTLTYPE_BOOL
+CTLTYPE_INT
+CTLTYPE_NODE
+CTLTYPE_QUAD
+CTLTYPE_STRING
+CTLTYPE_STRUCT
+CTL_CREATE
+CTL_CREATESYM
+CTL_DDB
+CTL_DEBUG
+CTL_DESCRIBE
+CTL_DESTROY
+CTL_EMUL
+CTL_EOL
+CTL_HW
+CTL_IPPROTO_IPSEC
+CTL_KERN
+CTL_MACHDEP
+CTL_MAXID
+CTL_MAXNAME
+CTL_MMAP
+CTL_NET
+CTL_PROC
+CTL_QUERY
+CTL_SECURITY
+CTL_UNSPEC
+CTL_USER
+CTL_VENDOR
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DCCP_CCID
+DCCP_CSLEN
+DCCP_FEATURE_ACKRATIO
+DCCP_FEATURE_ACKVECTOR
+DCCP_FEATURE_CC
+DCCP_FEATURE_CONN_NONCE
+DCCP_FEATURE_ECN
+DCCP_FEATURE_IDENTREG
+DCCP_FEATURE_LOSSWINDOW
+DCCP_FEATURE_MOBILITY
+DCCP_MAXSEG
+DCCP_MAX_OPTIONS
+DCCP_MAX_PKTS
+DCCP_NDP_LIMIT
+DCCP_OPT_ACK_VECTOR0
+DCCP_OPT_ACK_VECTOR1
+DCCP_OPT_BUF_CLOSED
+DCCP_OPT_CHANGE_L
+DCCP_OPT_CHANGE_R
+DCCP_OPT_CONFIRM_L
+DCCP_OPT_CONFIRM_R
+DCCP_OPT_DATACHECKSUM
+DCCP_OPT_DATA_DISCARD
+DCCP_OPT_ELAPSEDTIME
+DCCP_OPT_INIT_COOKIE
+DCCP_OPT_NDP_COUNT
+DCCP_OPT_PADDING
+DCCP_OPT_RECV_BUF_DROPS
+DCCP_OPT_SLOW_RECV
+DCCP_OPT_TIMESTAMP
+DCCP_OPT_TIMESTAMP_ECHO
+DCCP_REASON_BAD_COOKIE
+DCCP_REASON_BAD_SNAME
+DCCP_REASON_CLOSED
+DCCP_REASON_CONN_REF
+DCCP_REASON_FEA_ERR
+DCCP_REASON_FRUITLESS_NEG
+DCCP_REASON_INVALID
+DCCP_REASON_INV_MOVE
+DCCP_REASON_OPTION_ERR
+DCCP_REASON_UNANSW_CH
+DCCP_REASON_UNSPEC
+DCCP_SEQ_NUM_LIMIT
+DCCP_SERVICE
+DCCP_TYPE_ACK
+DCCP_TYPE_CLOSE
+DCCP_TYPE_CLOSEREQ
+DCCP_TYPE_DATA
+DCCP_TYPE_DATAACK
+DCCP_TYPE_MOVE
+DCCP_TYPE_REQUEST
+DCCP_TYPE_RESET
+DCCP_TYPE_RESPONSE
+DEAD_PROCESS
+DOWN_TIME
+DT_UNKNOWN
+D_FMT
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EFTYPE
+ELAST
+EMPTY
+EMULTIHOP
+ENEEDAUTH
+ENOATTR
+ENODATA
+ENOLINK
+ENOSR
+ENOSTR
+ENOTBLK
+ENOTSUP
+EOF
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMOTE
+ERPCMISMATCH
+ESOCKTNOSUPPORT
+ETIME
+ETOOMANYREFS
+EUSERS
+EVFILT_AIO
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTATTR_NAMESPACE_SYSTEM
+EXTATTR_NAMESPACE_USER
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FIBMAP
+FILENAME_MAX
+FIOASYNC
+FIOGETBMAP
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIONSPACE
+FIONWRITE
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+FUTEX_WAIT
+FUTEX_WAKE
+FUTEX_FD
+FUTEX_REQUEUE
+FUTEX_CMP_REQUEUE
+FUTEX_WAKE_OP
+FUTEX_LOCK_PI
+FUTEX_UNLOCK_PI
+FUTEX_TRYLOCK_PI
+FUTEX_WAIT_BITSET
+FUTEX_WAKE_BITSET
+FUTEX_WAIT_REQUEUE_PI
+FUTEX_CMP_REQUEUE_PI
+FUTEX_PRIVATE_FLAG
+FUTEX_CLOCK_REALTIME
+FUTEX_CMD_MASK
+FUTEX_WAITERS
+FUTEX_OWNER_DIED
+FUTEX_SYNCOBJ_1
+FUTEX_SYNCOBJ_0
+FUTEX_TID_MASK
+FUTEX_BITSET_MATCH_ANY
+F_CLOSEM
+F_GETNOSIGPIPE
+F_GETOWN
+F_GETPATH
+F_LOCK
+F_MAXFD
+F_RDLCK
+F_SETNOSIGPIPE
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+GLOB_NOSYS
+HW_NCPU
+IFF_ALLMULTI
+IFF_BROADCAST
+IFF_DEBUG
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_UP
+IMAXBEL
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_AH
+IPPROTO_CARP
+IPPROTO_DCCP
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IPCOMP
+IPPROTO_IPIP
+IPPROTO_IPV6_ICMP
+IPPROTO_MAX
+IPPROTO_MOBILE
+IPPROTO_NONE
+IPPROTO_PFSYNC
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_SCTP
+IPPROTO_TP
+IPPROTO_VRRP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_HDRINCL
+IP_PKTINFO
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVPKTINFO
+IP_SENDSRCADDR
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+KERN_ARGMAX
+KERN_ARND
+KERN_AUTONICETIME
+KERN_AUTONICEVAL
+KERN_BOOTTIME
+KERN_BUF
+KERN_CCPU
+KERN_CLOCKRATE
+KERN_CONSDEV
+KERN_CP_ID
+KERN_CP_TIME
+KERN_DEFCORENAME
+KERN_DOMAINNAME
+KERN_DRIVERS
+KERN_DUMP_ON_PANIC
+KERN_EVCNT
+KERN_FILE
+KERN_FILE2
+KERN_FORKFSLEEP
+KERN_FSCALE
+KERN_FSYNC
+KERN_HARDCLOCK_TICKS
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_IOV_MAX
+KERN_JOB_CONTROL
+KERN_LABELOFFSET
+KERN_LABELSECTOR
+KERN_LOGIN_NAME_MAX
+KERN_LOGSIGEXIT
+KERN_LWP
+KERN_MAPPED_FILES
+KERN_MAXFILES
+KERN_MAXID
+KERN_MAXPARTITIONS
+KERN_MAXPHYS
+KERN_MAXPROC
+KERN_MAXPTYS
+KERN_MAXVNODES
+KERN_MBUF
+KERN_MEMLOCK
+KERN_MEMLOCK_RANGE
+KERN_MEMORY_PROTECTION
+KERN_MONOTONIC_CLOCK
+KERN_MSGBUF
+KERN_MSGBUFSIZE
+KERN_NGROUPS
+KERN_NTPTIME
+KERN_OBOOTTIME
+KERN_OLDSHORTCORENAME
+KERN_OLDSYSVIPC_INFO
+KERN_OLDSYSVMSG
+KERN_OLDSYSVSEM
+KERN_OLDSYSVSHM
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_PIPE
+KERN_POSIX1
+KERN_POSIX_BARRIERS
+KERN_POSIX_READER_WRITER_LOCKS
+KERN_POSIX_SEMAPHORES
+KERN_POSIX_SPIN_LOCKS
+KERN_POSIX_THREADS
+KERN_POSIX_TIMERS
+KERN_PROC
+KERN_PROC2
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_ARGV
+KERN_PROC_ENV
+KERN_PROC_GID
+KERN_PROC_NARGV
+KERN_PROC_NENV
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RGID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_RAWPARTITION
+KERN_ROOT_DEVICE
+KERN_ROOT_PARTITION
+KERN_RTC_OFFSET
+KERN_SAVED_IDS
+KERN_SBMAX
+KERN_SECURELVL
+KERN_SOMAXKVA
+KERN_SYNCHRONIZED_IO
+KERN_SYSVIPC
+KERN_TIMEX
+KERN_TKSTAT
+KERN_URND
+KERN_VERIEXEC
+KERN_VERSION
+KERN_VNODE
+KVME_FLAG_COW
+KVME_FLAG_GROWS_DOWN
+KVME_FLAG_GROWS_UP
+KVME_FLAG_NEEDS_COPY
+KVME_FLAG_NOCOREDUMP
+KVME_FLAG_PAGEABLE
+KVME_PROT_EXEC
+KVME_PROT_READ
+KVME_PROT_WRITE
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_CONNWAIT
+LOCAL_CREDS
+LOCAL_OCREDS
+LOCAL_PEEREID
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DONTNEED
+MADV_FREE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MAP_ALIGNMENT_16MB
+MAP_ALIGNMENT_1TB
+MAP_ALIGNMENT_256TB
+MAP_ALIGNMENT_4GB
+MAP_ALIGNMENT_64KB
+MAP_ALIGNMENT_64PB
+MAP_ALIGNMENT_MASK
+MAP_ALIGNMENT_SHIFT
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NORESERVE
+MAP_REMAPDUP
+MAP_RENAME
+MAP_STACK
+MAP_WIRED
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINSEC
+MNT_ACLS
+MNT_AUTOMOUNTED
+MNT_DISCARD
+MNT_EXTATTR
+MNT_FORCE
+MNT_IGNORE
+MNT_LOCAL
+MNT_LOG
+MNT_NFS4ACLS
+MNT_NOATIME
+MNT_NOCOREDUMP
+MNT_NODEV
+MNT_NODEVMTIME
+MNT_POSIX1EACLS
+MNT_QUOTA
+MNT_RELATIME
+MNT_SOFTDEP
+MNT_SYMPERM
+MNT_UNION
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_BCAST
+MSG_CMSG_CLOEXEC
+MSG_DONTWAIT
+MSG_MCAST
+MSG_NBIO
+MSG_NOSIGNAL
+MSG_NOTIFICATION
+MSG_WAITFORONE
+NANOSECOND
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_MAXID
+NET_RT_OIFLIST
+NET_RT_OOIFLIST
+NET_RT_OOOIFLIST
+NEW_TIME
+NI_DGRAM
+NI_MAXHOST
+NI_MAXSERV
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSCOPE
+NI_NUMERICSERV
+NI_WITHSCOPEID
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_WRITE
+NTP_API
+OFIOGETBMAP
+OLD_TIME
+ONOEOT
+OXTABS
+O_ALT_IO
+O_ASYNC
+O_DIRECT
+O_DSYNC
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_NOSIGPIPE
+O_RSYNC
+O_SEARCH
+O_SHLOCK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_ARP
+PF_BLUETOOTH
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_MPLS
+PF_NATM
+PF_NS
+PF_OROUTE
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SNA
+PF_XTP
+PIOD_READ_AUXV
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PL_EVENT_NONE
+PL_EVENT_SIGNAL
+PL_EVENT_SUSPENDED
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_RETURNERROR
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSCHEDPARAM
+POSIX_SPAWN_SETSCHEDULER
+POSIX_SPAWN_SETSIGDEP
+POSIX_SPAWN_SETSIGMASK
+PROT_MPROTECT
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_DUMPCORE
+PT_FIRSTMACH
+PT_GET_EVENT_MASK
+PT_GET_PROCESS_STATE
+PT_IO
+PT_KILL
+PT_LWPINFO
+PT_READ_D
+PT_READ_I
+PT_SET_EVENT_MASK
+PT_SYSCALL
+PT_SYSCALLEMU
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_NTHR
+RLIMIT_RSS
+RLIMIT_SBSIZE
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_NLIMITS
+RLIM_SAVED_CUR
+RLIM_SAVED_MAX
+RTLD_NEXT
+RTLD_NOLOAD
+RTLD_SELF
+RUN_LVL
+RUSAGE_CHILDREN
+RUSAGE_SELF
+SCALE_PPM
+SCHED_FIFO
+SCHED_NONE
+SCHED_OTHER
+SCHED_RR
+SCM_CREDS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEM_FAILED
+SF_APPEND
+SF_ARCHIVED
+SF_IMMUTABLE
+SF_LOG
+SF_SETTABLE
+SF_SNAPINVAL
+SF_SNAPSHOT
+SHM_R
+SHM_W
+SIGEMT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGINFO
+SIGIO
+SIGNATURE
+SIGSTKSZ
+SIOCGIFADDR
+SOCKCREDSIZE
+SOCK_CLOEXEC
+SOCK_CONN_DGRAM
+SOCK_DCCP
+SOCK_FLAGS_MASK
+SOCK_NONBLOCK
+SOCK_NOSIGPIPE
+SOCK_RAW
+SOCK_RDM
+SOMAXCONN
+SO_ACCEPTFILTER
+SO_NOHEADER
+SO_OVERFLOWED
+SO_REUSEPORT
+SO_TIMESTAMP
+SO_USELOOPBACK
+SS_DISABLE
+SS_ONSTACK
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_NOSUID
+ST_RDONLY
+SYSCTL_DEFSIZE
+SYSCTL_NAMELEN
+SYSCTL_VERSION
+SYSCTL_VERS_0
+SYSCTL_VERS_1
+SYSCTL_VERS_MASK
+S_IEXEC
+S_IREAD
+S_IWRITE
+TCP_CONGCTL
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINIT
+TCP_KEEPINTVL
+TCP_MAXSEG
+TCP_MD5SIG
+THOUSEP
+TIMER_ABSTIME
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TIOCCBRK
+TIOCEXCL
+TIOCFLUSH
+TIOCGETA
+TIOCGETD
+TIOCMBIC
+TIOCMBIS
+TIOCMGET
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNXCL
+TIOCSBRK
+TIOCSCTTY
+TIOCSETA
+TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSTART
+TIOCSTOP
+TMP_MAX
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_IMMUTABLE
+UF_NODUMP
+UF_OPAQUE
+UF_SETTABLE
+USER_PROCESS
+UTIME_NOW
+UTIME_OMIT
+UT_HOSTSIZE
+UT_LINESIZE
+UT_NAMESIZE
+VDISCARD
+VDSUSP
+VLNEXT
+VM_PROC
+VM_PROC_MAP
+VREPRINT
+VSTATUS
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ACL_EXTENDED
+_PC_FILESIZEBITS
+_PC_MIN_HOLE_SIZE
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITY_SCHEDULING
+_SC_READER_WRITER_LOCKS
+_SC_RE_DUP_MAX
+_SC_REGEXP
+_SC_SAVED_IDS
+_SC_SCHED_PRI_MAX
+_SC_SCHED_PRI_MIN
+_SC_SCHED_RT_TS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XOPEN_SHM
+_UTX_HOSTSIZE
+_UTX_IDSIZE
+_UTX_LINESIZE
+_UTX_PADSIZE
+_UTX_USERSIZE
+__cpu_simple_lock_nv_t
+__errno
+__exit_status
+_cpuset_clr
+_cpuset_create
+_cpuset_destroy
+_cpuset_isset
+_cpuset_set
+_cpuset_zero
+_lwp_self
+abs
+accept4
+accept_filter_arg
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+bsearch
+chflags
+chroot
+clearerr
+clock_getres
+clock_nanosleep
+clock_settime
+cmsghdr
+consttime_memequal
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+drand48
+dup3
+duplocale
+easprintf
+efopen
+emalloc
+erand48
+erealloc
+ereallocarr
+esetfunc
+estrdup
+estrndup
+estrlcat
+estrlcpy
+estrtoi
+estrtou
+evasprintf
+endgrent
+endpwent
+endservent
+endutent
+endutxent
+explicit_memset
+extattr_delete_fd
+extattr_delete_file
+extattr_delete_link
+extattr_get_fd
+extattr_get_file
+extattr_get_link
+extattr_namespace_to_string
+extattr_set_fd
+extattr_set_file
+extattr_set_link
+extattr_string_to_namespace
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fgetxattr
+flistxattr
+fremovexattr
+fsetxattr
+flags_to_string
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+fsid_t
+ftok
+futimes
+getbootfile
+getbyteorder
+getdiskrawname
+getdistcookedname
+getdomainname
+getdtablesize
+getfsspecname
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getitimer
+getlastlogx
+getline
+getloadavg
+getnameinfo
+getopt_long
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutent
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getxattr
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+ifconf
+in6_pktinfo
+in_pktinfo
+initgroups
+ipc_perm
+itimerspec
+jrand48
+kevent
+key_t
+killpg
+kinfo_getvmmap
+kinfo_lwp
+kinfo_proc2
+kinfo_vmentry
+kqueue
+kqueue1
+labs
+lastlog
+lastlogx
+lchflags
+lcong48
+lgetxattr
+lio_listio
+listxattr
+llistxaatr
+localeconv_l
+lockf
+login
+loginx
+logout
+logoutx
+logwtmp
+logwtmpx
+login_tty
+lrand48
+lremovexattr
+lsetxattr
+lutimes
+lwpid_t
+madvise
+memmem
+memrchr
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mount
+mq_attr
+mq_close
+mq_getattr
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+mrand48
+msghdr
+newlocale
+nice
+nl_item
+nl_langinfo
+nrand48
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+pollts
+popen
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_entry_t
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_setclock
+pthread_getattr_np
+pthread_getaffinity_np
+pthread_getname_np
+pthread_getschedparam
+pthread_kill
+pthread_mutex_timedlock
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+pthread_setaffinity_np
+pthread_setname_np
+pthread_setschedparam
+ptrace
+ptrace_io_desc
+ptrace_lwpinfo
+ptrace_siginfo
+pututxline
+pwritev
+qsort
+rand
+readdir_r
+readlinkat
+reallocarr
+reallocarray
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+removexattr
+sched_getparam
+sched_getscheduler
+sched_get_priority_max
+sched_get_priority_min
+sched_param
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+secure_path
+seed48
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendmmsg
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostid
+sethostname
+setitimer
+setpriority
+setproctitle
+setprogname
+setpwent
+setrlimit
+setservent
+settimeofday
+setutent
+setutxent
+setxattr
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+snprintb
+snprintb_m
+sockaddr_dl
+sockcred
+srand
+srand48
+stack_t
+strcasecmp
+strcasestr
+string_to_flags
+strncasecmp
+strndup
+strpct
+strsignal
+strspct
+sync
+syscall
+sysctl
+sysctlbyname
+sysctldesc
+telldir
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+timer_t
+timex
+truncate
+ttyname_r
+unmount
+unpcbid
+updlastlogx
+updwtmpx
+useconds_t
+utimensat
+utmp
+utmpx
+utmpxname
+utpname
+utrace
+uucred
+vm_size_t
+wait4
+waitid
+dirname
+basename
+XATTR_CREATE
+XATTR_REPLACE
+EXTATTR_NAMESPACE_EMPTY
+extattr_list_fd
+extattr_list_file
+extattr_list_link
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
new file mode 100644
index 0000000000000..07d419a61970e
--- /dev/null
+++ b/libc-test/semver/openbsd.txt
@@ -0,0 +1,1235 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_APPLETALK
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_ENCAP
+AF_HYLINK
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_KEY
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NS
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SIP
+AF_SNA
+AI_ADDRCONFIG
+AI_CANONNAME
+AI_EXT
+AI_FQDN
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+ALTWERASE
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B7200
+B76800
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCVERSION
+BUFSIZ
+BUS_ADRALN
+BUS_ADRERR
+BUS_OBJERR
+CCTS_OFLOW
+CHWFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTLTYPE_INT
+CTLTYPE_NODE
+CTLTYPE_QUAD
+CTLTYPE_STRING
+CTLTYPE_STRUCT
+CTL_DDB
+CTL_DEBUG
+CTL_FS
+CTL_HW
+CTL_KERN
+CTL_MACHDEP
+CTL_MAXID
+CTL_MAXNAME
+CTL_NET
+CTL_UNSPEC
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DT_UNKNOWN
+D_FMT
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EFTYPE
+EIPSEC
+ELAST
+EMEDIUMTYPE
+ENEEDAUTH
+ENOATTR
+ENOTBLK
+ENOMEDIUM
+ENOTRECOVERABLE
+ENOTSUP
+ENTER
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+EREMOTE
+ERPCMISMATCH
+ESOCKTNOSUPPORT
+ETOOMANYREFS
+EUSERS
+EVFILT_AIO
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+FIND
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+FUTEX_WAIT
+FUTEX_WAKE
+FUTEX_REQUEUE
+FUTEX_PRIVATE_FLAG
+F_GETOWN
+F_LOCK
+F_RDLCK
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+GLOB_NOSYS
+HW_NCPU
+HW_NCPUONLINE
+IFF_ALLMULTI
+IFF_BROADCAST
+IFF_DEBUG
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MULTICAST
+IFF_NOARP
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_STATICARP
+IFF_UP
+IMAXBEL
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_AH
+IPPROTO_CARP
+IPPROTO_DIVERT
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IPCOMP
+IPPROTO_IPIP
+IPPROTO_MAX
+IPPROTO_MOBILE
+IPPROTO_MPLS
+IPPROTO_NONE
+IPPROTO_PFSYNC
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_TP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_HDRINCL
+IP_RECVDSTADDR
+IP_RECVIF
+IP_SENDSRCADDR
+IP_TOS
+ISOFSMNT_EXTATT
+ISOFSMNT_GENS
+ISOFSMNT_NOJOLIET
+ISOFSMNT_NORRIP
+ISOFSMNT_SESS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+KERN_ARGMAX
+KERN_ARND
+KERN_AUDIO
+KERN_BOOTTIME
+KERN_CACHEPCT
+KERN_CCPU
+KERN_CLOCKRATE
+KERN_CONSBUF
+KERN_CONSBUFSIZE
+KERN_CONSDEV
+KERN_CPTIME
+KERN_CPTIME2
+KERN_CPUSTATS
+KERN_DOMAINNAME
+KERN_EVCOUNT
+KERN_FILE
+KERN_FORKSTAT
+KERN_FSCALE
+KERN_FSYNC
+KERN_GLOBAL_PTRACE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_INTRCNT
+KERN_JOB_CONTROL
+KERN_MALLOCSTATS
+KERN_MAXCLUSTERS
+KERN_MAXFILES
+KERN_MAXID
+KERN_MAXLOCKSPERUID
+KERN_MAXPARTITIONS
+KERN_MAXPROC
+KERN_MAXTHREAD
+KERN_MAXVNODES
+KERN_MBSTAT
+KERN_MSGBUF
+KERN_MSGBUFSIZE
+KERN_NCHSTATS
+KERN_NETLIVELOCKS
+KERN_NFILES
+KERN_NGROUPS
+KERN_NOSUIDCOREDUMP
+KERN_NPROCS
+KERN_NSELCOLL
+KERN_NTHREADS
+KERN_NUMVNODES
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_OSVERSION
+KERN_PFSTATUS
+KERN_POOL
+KERN_POOL_DEBUG
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_ARGV
+KERN_PROC_CWD
+KERN_PROC_ENV
+KERN_PROC_KTHREAD
+KERN_PROC_NARGV
+KERN_PROC_NENV
+KERN_PROC_NOBROADCASTKILL
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_SHOW_THREADS
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROC_VMMAP
+KERN_PROF
+KERN_RAWPARTITION
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_SEMINFO
+KERN_SHMINFO
+KERN_SOMAXCONN
+KERN_SOMINCONN
+KERN_SPLASSERT
+KERN_STACKGAPRANDOM
+KERN_SYSVIPC_INFO
+KERN_SYSVIPC_MSG_INFO
+KERN_SYSVIPC_SEM_INFO
+KERN_SYSVIPC_SHM_INFO
+KERN_SYSVMSG
+KERN_SYSVSEM
+KERN_SYSVSHM
+KERN_TIMECOUNTER
+KERN_TIMEOUT_STATS
+KERN_TTY
+KERN_TTYCOUNT
+KERN_USERMOUNT
+KERN_VERSION
+KERN_WATCHDOG
+KVE_ADV_NORMAL
+KVE_ADV_RANDOM
+KVE_ADV_SEQUENTIAL
+KVE_ET_CONCEAL
+KVE_ET_COPYONWRITE
+KVE_ET_FREEMAPPED
+KVE_ET_OBJ
+KVE_ET_STACK
+KVE_ET_SUBMAP
+KVE_ET_SYSCALL
+KVE_ET_WC
+KVE_F_KMEM
+KVE_F_STATIC
+KVE_INH_COPY
+KVE_INH_NONE
+KVE_INH_SHARE
+KVE_INH_ZERO
+KVE_PROT_EXEC
+KVE_PROT_NONE
+KVE_PROT_READ
+KVE_PROT_WRITE
+KI_EMULNAMELEN
+KI_MAXCOMLEN
+KI_MAXLOGNAME
+KI_NGROUPS
+KI_WMESGLEN
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_GLOBAL_LOCALE
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DONTNEED
+MADV_FREE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MAP_CONCEAL
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOEXTEND
+MAP_NORESERVE
+MAP_RENAME
+MAP_STACK
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINSIGSTKSZ
+MNT_DEFEXPORTED
+MNT_DELEXPORT
+MNT_DOOMED
+MNT_EXPORTANON
+MNT_EXRDONLY
+MNT_FORCE
+MNT_LOCAL
+MNT_NOATIME
+MNT_NODEV
+MNT_NOPERM
+MNT_QUOTA
+MNT_ROOTFS
+MNT_SOFTDEP
+MNT_STALLED
+MNT_SWAPPABLE
+MNT_WANTRDWR
+MNT_WXALLOWED
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSDOSFSMNT_LONGNAME
+MSDOSFSMNT_NOWIN95
+MSDOSFSMNT_SHORTNAME
+MSG_BCAST
+MSG_CMSG_CLOEXEC
+MSG_DONTWAIT
+MSG_MCAST
+MSG_NOSIGNAL
+MNT_LAZY
+MNT_NOWAIT
+MNT_WAIT
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_IFNAMES
+NET_RT_STATS
+NET_RT_TABLE
+NFSMNT_ACDIRMAX
+NFSMNT_ACDIRMIN
+NFSMNT_ACREGMAX
+NFSMNT_ACREGMIN
+NFSMNT_AUTHERR
+NFSMNT_DEADTHRESH
+NFSMNT_DISMINPROG
+NFSMNT_DISMNT
+NFSMNT_DUMBTIMR
+NFSMNT_GOTFSINFO
+NFSMNT_GOTPATHCONF
+NFSMNT_HASAUTH
+NFSMNT_HASWRITEVERF
+NFSMNT_INT
+NFSMNT_INTERNAL
+NFSMNT_KERB
+NFSMNT_LEASETERM
+NFSMNT_MAXGRPS
+NFSMNT_MNTD
+NFSMNT_NFSV3
+NFSMNT_NOAC
+NFSMNT_NOCONN
+NFSMNT_NQNFS
+NFSMNT_RCVLOCK
+NFSMNT_RDIRPLUS
+NFSMNT_READAHEAD
+NFSMNT_READDIRSIZE
+NFSMNT_RESVPORT
+NFSMNT_RETRANS
+NFSMNT_RSIZE
+NFSMNT_SNDLOCK
+NFSMNT_SOFT
+NFSMNT_TIMEO
+NFSMNT_WAITAUTH
+NFSMNT_WANTAUTH
+NFSMNT_WANTRCV
+NFSMNT_WANTSND
+NFSMNT_WSIZE
+NFS_ARGSVERSION
+NI_NUMERICHOST
+NI_NUMERICSERV
+NI_NOFQDN
+NI_NAMEREQD
+NI_DGRAM
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EOF
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRUNCATE
+NOTE_WRITE
+NTFS_MFLAG_ALLNAMES
+NTFS_MFLAG_CASEINS
+OLCUC
+ONOEOT
+OXTABS
+O_ASYNC
+O_DSYNC
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_RSYNC
+O_SHLOCK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_BLUETOOTH
+PF_BPF
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_ENCAP
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_MPLS
+PF_NATM
+PF_NS
+PF_OSI
+PF_PFLOW
+PF_PIP
+PF_PIPEX
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_XTP
+PIOD_READ_AUXV
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLNORM
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_MUTEX_STRICT_NP
+PTHREAD_STACK_MIN
+PTRACE_FORK
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_GET_EVENT_MASK
+PT_GET_PROCESS_STATE
+PT_GET_THREAD_FIRST
+PT_GET_THREAD_NEXT
+PT_IO
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_SET_EVENT_MASK
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_NLIMITS
+RLIM_SAVED_CUR
+RLIM_SAVED_MAX
+RTLD_NEXT
+RTLD_SELF
+RUSAGE_CHILDREN
+RUSAGE_SELF
+RUSAGE_THREAD
+SCHED_FIFO
+SCHED_OTHER
+SCHED_RR
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEM_FAILED
+SF_APPEND
+SF_ARCHIVED
+SF_IMMUTABLE
+SF_SETTABLE
+SHM_R
+SHM_W
+SIGEMT
+SIGINFO
+SIGIO
+SIGSTKSZ
+SIOCGIFADDR
+SOCK_CLOEXEC
+SOCK_DNS
+SOCK_NONBLOCK
+SOCK_RAW
+SOCK_RDM
+SOMAXCONN
+SO_BINDANY
+SO_NETPROC
+SO_PEERCRED
+SO_RTABLE
+SO_SPLICE
+SO_TIMESTAMP
+SO_USELOOPBACK
+SS_DISABLE
+SS_ONSTACK
+ST_NOSUID
+ST_RDONLY
+S_IEXEC
+S_IREAD
+S_IWRITE
+TCP_MAXSEG
+TCP_MD5SIG
+TCP_NOPUSH
+THOUSEP
+TIMER_ABSTIME
+TIOCCBRK
+TIOCEXCL
+TIOCFLUSH
+TIOCGETA
+TIOCGETD
+TIOCMBIC
+TIOCMBIS
+TIOCMGET
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNXCL
+TIOCSBRK
+TIOCSCTTY
+TIOCSETA
+TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSTART
+TIOCSTOP
+TMPFS_ARGS_VERSION
+TMP_MAX
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_IMMUTABLE
+UF_NODUMP
+UF_OPAQUE
+UF_SETTABLE
+UTIME_NOW
+UTIME_OMIT
+UT_HOSTSIZE
+UT_LINESIZE
+UT_NAMESIZE
+VDISCARD
+VDSUSP
+VLNEXT
+VREPRINT
+VSTATUS
+VWERASE
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_MAX_PAGE_SHIFT
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_FILESIZEBITS
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_PC_TIMESTAMP_RESOLUTION
+_POSIX_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_AVPHYS_PAGES
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_RE_DUP_MAX
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_UUCP
+_SC_XOPEN_VERSION
+__errno
+abs
+accept4
+acct
+arc4random
+arc4random_buf
+arc4random_uniform
+arphdr
+backtrace
+backtrace_symbols
+backtrace_symbols_fd
+backtrace_symbols_fmt
+bsearch
+caddr_t
+calloc_conceal
+chflags
+chflagsat
+chroot
+clearerr
+clock_getres
+clock_settime
+cmsghdr
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+drand48
+dup3
+duplocale
+endgrent
+endpwent
+endservent
+erand48
+execvpe
+explicit_bzero
+export_args
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+freezero
+fsid_t
+fstatfs
+ftok
+fusefs_args
+futex
+futimes
+getdomainname
+getdtablesize
+getentropy
+getfsstat
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+gethostid
+getifaddrs
+getitimer
+getline
+getloadavg
+getmntinfo
+getnameinfo
+getopt_long
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwnam_r
+getresgid
+getresuid
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getthrid
+glob
+glob_t
+globfree
+hcreate
+hdestroy
+hsearch
+id_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+ip_mreqn
+ipc_perm
+iso_args
+jrand48
+kevent
+key_t
+killpg
+kinfo_proc
+kinfo_vmentry
+kqueue
+labs
+lastlog
+lcong48
+lcong48_deterministic
+lfind
+lockf
+login_tty
+lrand48
+lsearch
+madvise
+malloc_conceal
+memmem
+memrchr
+mfs_args
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mount_info
+mrand48
+msdosfs_args
+msghdr
+newlocale
+nfs_args
+nice
+nl_item
+nl_langinfo
+nrand48
+ntfs_args
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+pledge
+popen
+posix_madvise
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_PFLOW
+pseudo_AF_PIP
+pseudo_AF_PIPEX
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_setclock
+pthread_get_name_np
+pthread_getschedparam
+pthread_kill
+pthread_main_np
+pthread_mutex_timedlock
+pthread_set_name_np
+pthread_setschedparam
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_spinlock_t
+pthread_stackseg_np
+ptrace
+ptrace_io_desc
+ptrace_state
+ptrace_thread_state
+pwritev
+qsort
+rand
+readdir_r
+readlinkat
+reallocarray
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+sched_get_priority_max
+sched_get_priority_min
+sched_param
+seed48
+seed48_deterministic
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostid
+sethostname
+setitimer
+setpriority
+setproctitle
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+shmat
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+siginfo_t
+sigwait
+sockaddr_dl
+sockpeercred
+splice
+srand
+srand48
+srand48_deterministic
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+strtonum
+sync
+syscall
+sysctl
+telldir
+tmpfs_args
+truncate
+ttyname_r
+udf_args
+ufs_args
+unmount
+unveil
+useconds_t
+uselocale
+utimensat
+utmp
+utrace
+wait4
+xucred
+dirname
+basename
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
new file mode 100644
index 0000000000000..4169bb79a24fd
--- /dev/null
+++ b/libc-test/semver/redox.txt
@@ -0,0 +1,213 @@
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+B1000000
+B1152000
+B1500000
+B2000000
+B2500000
+B3000000
+B3500000
+B4000000
+B460800
+B500000
+B576000
+B921600
+DT_UNKNOWN
+EADV
+EBADE
+EBADFD
+EBADR
+EBADRQC
+EBADSLT
+EBFONT
+ECHRNG
+ECOMM
+EDEADLOCK
+EDOTDOT
+EISNAM
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EL2HLT
+EL2NSYNC
+EL3HLT
+EL3RST
+ELIBACC
+ELIBBAD
+ELIBEXEC
+ELIBMAX
+ELIBSCN
+ELNRNG
+EMEDIUMTYPE
+EMULTIHOP
+ENAVAIL
+ENOANO
+ENOCSI
+ENODATA
+ENOKEY
+ENOLINK
+ENOMEDIUM
+ENONET
+ENOPKG
+ENOSR
+ENOSTR
+ENOTBLK
+ENOTNAM
+ENOTRECOVERABLE
+ENOTSUP
+ENOTUNIQ
+EOWNERDEAD
+EPOLLERR
+EPOLLET
+EPOLLEXCLUSIVE
+EPOLLHUP
+EPOLLIN
+EPOLLMSG
+EPOLLNVAL
+EPOLLONESHOT
+EPOLLOUT
+EPOLLPRI
+EPOLLRDBAND
+EPOLLRDHUP
+EPOLLRDNORM
+EPOLLWAKEUP
+EPOLLWRBAND
+EPOLLWRNORM
+EPOLL_CLOEXEC
+EPOLL_CTL_ADD
+EPOLL_CTL_DEL
+EPOLL_CTL_MOD
+EREMCHG
+EREMOTE
+EREMOTEIO
+ERESTART
+ESOCKTNOSUPPORT
+ESRMNT
+ESTRPIPE
+ETIME
+ETOOMANYREFS
+EUCLEAN
+EUNATCH
+EUSERS
+EXFULL
+FIONREAD
+IMAXBEL
+IPV6_ADD_MEMBERSHIP
+IPV6_DROP_MEMBERSHIP
+IUCLC
+IUTF8
+MADV_DONTNEED
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MSG_DONTWAIT
+NI_DGRAM
+NI_MAXSERV
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSERV
+NSIG
+OFDEL
+OFILL
+OLCUC
+O_ASYNC
+O_EXLOCK
+O_FSYNC
+O_PATH
+O_SHLOCK
+O_SYMLINK
+PTHREAD_STACK_MIN
+SA_RESTORER
+SIGIO
+SIGPWR
+SIGSTKFLT
+SOCK_CLOEXEC
+SOCK_NONBLOCK
+SO_BSDCOMPAT
+SO_DOMAIN
+SO_NO_CHECK
+SO_PASSCRED
+SO_PEERCRED
+SO_PEERSEC
+SO_PRIORITY
+SO_PROTOCOL
+SO_REUSEPORT
+SO_RCVBUFFORCE
+SO_SNDBUFFORCE
+TCFLSH
+TCGETS
+TCP_KEEPIDLE
+TCSETS
+TIOCGPGRP
+TIOCSPGRP
+UTSLENGTH
+VDISCARD
+VLNEXT
+VREPRINT
+VSWTC
+VT0
+VT1
+VTDLY
+VWERASE
+WEXITED
+WNOWAIT
+WSTOPPED
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_FILESIZEBITS
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SOCK_MAXBUF
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_SC_LOGIN_NAME_MAX
+_SC_RE_DUP_MAX
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno_location
+bsearch
+chroot
+clearerr
+difftime
+endservent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_wait
+fchdir
+fmemopen
+getline
+getrlimit
+getrusage
+getservbyport
+getservent
+killpg
+lockf
+madvise
+memalign
+nice
+open_memstream
+open_wmemstream
+pipe2
+pthread_condattr_setclock
+qsort
+setrlimit
+setservent
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+ttyname_r
diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt
new file mode 100644
index 0000000000000..8928c27feff9f
--- /dev/null
+++ b/libc-test/semver/unix.txt
@@ -0,0 +1,886 @@
+AF_INET
+AF_INET6
+AF_UNIX
+AF_UNSPEC
+B0
+B110
+B115200
+B1200
+B134
+B150
+B1800
+B19200
+B200
+B230400
+B2400
+B300
+B38400
+B4800
+B50
+B57600
+B600
+B75
+B9600
+BRKINT
+CLOCAL
+CLOCK_MONOTONIC
+CLOCK_REALTIME
+CREAD
+CS5
+CS6
+CS7
+CS8
+CSIZE
+CSTOPB
+DIR
+DT_BLK
+DT_CHR
+DT_DIR
+DT_FIFO
+DT_LNK
+DT_REG
+DT_SOCK
+Dl_info
+E2BIG
+EACCES
+EADDRINUSE
+EADDRNOTAVAIL
+EAFNOSUPPORT
+EAGAIN
+EAI_SYSTEM
+EALREADY
+EBADF
+EBADMSG
+EBUSY
+ECANCELED
+ECHILD
+ECHO
+ECHOE
+ECHOK
+ECHONL
+ECONNABORTED
+ECONNREFUSED
+ECONNRESET
+EDEADLK
+EDESTADDRREQ
+EDOM
+EDQUOT
+EEXIST
+EFAULT
+EFBIG
+EHOSTDOWN
+EHOSTUNREACH
+EIDRM
+EILSEQ
+EINPROGRESS
+EINTR
+EINVAL
+EIO
+EISCONN
+EISDIR
+ELOOP
+EMFILE
+EMLINK
+EMSGSIZE
+ENAMETOOLONG
+ENETDOWN
+ENETRESET
+ENETUNREACH
+ENFILE
+ENOBUFS
+ENODEV
+ENOENT
+ENOEXEC
+ENOLCK
+ENOMEM
+ENOMSG
+ENOPROTOOPT
+ENOSPC
+ENOSYS
+ENOTCONN
+ENOTDIR
+ENOTEMPTY
+ENOTSOCK
+ENOTTY
+ENXIO
+EOPNOTSUPP
+EOVERFLOW
+EPERM
+EPFNOSUPPORT
+EPIPE
+EPROTO
+EPROTONOSUPPORT
+EPROTOTYPE
+ERANGE
+EROFS
+ESHUTDOWN
+ESPIPE
+ESRCH
+ESTALE
+ETIMEDOUT
+ETXTBSY
+EWOULDBLOCK
+EXDEV
+EXIT_FAILURE
+EXIT_SUCCESS
+FD_CLOEXEC
+FD_CLR
+FD_ISSET
+FD_SET
+FD_SETSIZE
+FD_ZERO
+FILE
+FIOCLEX
+FIONBIO
+F_DUPFD
+F_DUPFD_CLOEXEC
+F_GETFD
+F_GETFL
+F_GETLK
+F_OK
+F_SETFD
+F_SETFL
+F_SETLK
+F_SETLKW
+GRPQUOTA
+HUPCL
+ICANON
+ICRNL
+IEXTEN
+IFNAMSIZ
+IF_NAMESIZE
+IGNBRK
+IGNCR
+IGNPAR
+INADDR_ANY
+INADDR_BROADCAST
+INADDR_LOOPBACK
+INADDR_NONE
+INLCR
+INPCK
+INT_MAX
+INT_MIN
+IPPROTO_ICMP
+IPPROTO_ICMPV6
+IPPROTO_IP
+IPPROTO_IPV6
+IPPROTO_TCP
+IPPROTO_UDP
+IPV6_MULTICAST_HOPS
+IPV6_MULTICAST_IF
+IPV6_MULTICAST_LOOP
+IPV6_UNICAST_HOPS
+IPV6_V6ONLY
+IP_ADD_MEMBERSHIP
+IP_DROP_MEMBERSHIP
+IP_MULTICAST_IF
+IP_MULTICAST_LOOP
+IP_MULTICAST_TTL
+IP_TTL
+ISIG
+ISTRIP
+IXANY
+IXOFF
+IXON
+LOCK_EX
+LOCK_NB
+LOCK_SH
+LOCK_UN
+LOG_ALERT
+LOG_AUTH
+LOG_CONS
+LOG_CRIT
+LOG_DAEMON
+LOG_DEBUG
+LOG_EMERG
+LOG_ERR
+LOG_FACMASK
+LOG_INFO
+LOG_KERN
+LOG_LOCAL0
+LOG_LOCAL1
+LOG_LOCAL2
+LOG_LOCAL3
+LOG_LOCAL4
+LOG_LOCAL5
+LOG_LOCAL6
+LOG_LOCAL7
+LOG_LPR
+LOG_MAIL
+LOG_NDELAY
+LOG_NEWS
+LOG_NOTICE
+LOG_NOWAIT
+LOG_ODELAY
+LOG_PID
+LOG_PRIMASK
+LOG_SYSLOG
+LOG_USER
+LOG_UUCP
+LOG_WARNING
+MAP_ANON
+MAP_ANONYMOUS
+MAP_FAILED
+MAP_FIXED
+MAP_PRIVATE
+MAP_SHARED
+MSG_CTRUNC
+MSG_DONTROUTE
+MSG_EOR
+MSG_OOB
+MSG_PEEK
+MSG_TRUNC
+MSG_WAITALL
+MS_ASYNC
+MS_INVALIDATE
+MS_SYNC
+NCCS
+NI_MAXHOST
+NOFLSH
+OCRNL
+ONLCR
+ONLRET
+ONOCR
+OPOST
+O_ACCMODE
+O_APPEND
+O_CLOEXEC
+O_CREAT
+O_DIRECTORY
+O_EXCL
+O_NOFOLLOW
+O_NONBLOCK
+O_RDONLY
+O_RDWR
+O_TRUNC
+O_WRONLY
+PARENB
+PARMRK
+PARODD
+PATH_MAX
+PF_INET
+PF_INET6
+PF_UNIX
+PF_UNSPEC
+POLLERR
+POLLHUP
+POLLIN
+POLLNVAL
+POLLOUT
+POLLPRI
+PRIO_MAX
+PRIO_MIN
+PRIO_PGRP
+PRIO_PROCESS
+PRIO_USER
+PROT_EXEC
+PROT_NONE
+PROT_READ
+PROT_WRITE
+PTHREAD_COND_INITIALIZER
+PTHREAD_MUTEX_INITIALIZER
+PTHREAD_MUTEX_NORMAL
+PTHREAD_MUTEX_RECURSIVE
+PTHREAD_RWLOCK_INITIALIZER
+RTLD_DEFAULT
+RTLD_GLOBAL
+RTLD_LAZY
+RTLD_LOCAL
+RTLD_NOW
+R_OK
+SA_NOCLDSTOP
+SA_NOCLDWAIT
+SA_NODEFER
+SA_ONSTACK
+SA_RESETHAND
+SA_RESTART
+SA_SIGINFO
+SEEK_CUR
+SEEK_END
+SEEK_SET
+SHUT_RD
+SHUT_RDWR
+SHUT_WR
+SIGABRT
+SIGALRM
+SIGBUS
+SIGCHLD
+SIGCONT
+SIGFPE
+SIGHUP
+SIGILL
+SIGINT
+SIGIOT
+SIGKILL
+SIGPIPE
+SIGPROF
+SIGQUIT
+SIGSEGV
+SIGSTOP
+SIGSYS
+SIGTERM
+SIGTRAP
+SIGTSTP
+SIGTTIN
+SIGTTOU
+SIGURG
+SIGUSR1
+SIGUSR2
+SIGVTALRM
+SIGWINCH
+SIGXCPU
+SIGXFSZ
+SIG_BLOCK
+SIG_DFL
+SIG_ERR
+SIG_IGN
+SIG_SETMASK
+SIG_UNBLOCK
+SOCK_DGRAM
+SOCK_SEQPACKET
+SOCK_STREAM
+SOL_SOCKET
+SO_ACCEPTCONN
+SO_BROADCAST
+SO_DEBUG
+SO_DONTROUTE
+SO_ERROR
+SO_KEEPALIVE
+SO_LINGER
+SO_OOBINLINE
+SO_RCVBUF
+SO_RCVLOWAT
+SO_RCVTIMEO
+SO_REUSEADDR
+SO_SNDBUF
+SO_SNDLOWAT
+SO_SNDTIMEO
+SO_TYPE
+STDERR_FILENO
+STDIN_FILENO
+STDOUT_FILENO
+S_IFBLK
+S_IFCHR
+S_IFDIR
+S_IFIFO
+S_IFLNK
+S_IFMT
+S_IFREG
+S_IFSOCK
+S_IRGRP
+S_IROTH
+S_IRUSR
+S_IRWXG
+S_IRWXO
+S_IRWXU
+S_ISGID
+S_ISUID
+S_ISVTX
+S_IWGRP
+S_IWOTH
+S_IWUSR
+S_IXGRP
+S_IXOTH
+S_IXUSR
+TCIFLUSH
+TCIOFF
+TCIOFLUSH
+TCION
+TCOFLUSH
+TCOOFF
+TCOON
+TCP_NODELAY
+TCSADRAIN
+TCSAFLUSH
+TCSANOW
+TIOCGWINSZ
+TIOCSWINSZ
+TOSTOP
+USRQUOTA
+VEOF
+VEOL
+VEOL2
+VERASE
+VINTR
+VKILL
+VMIN
+VQUIT
+VSTART
+VSTOP
+VSUSP
+VTIME
+WCONTINUED
+WCOREDUMP
+WEXITSTATUS
+WIFCONTINUED
+WIFEXITED
+WIFSIGNALED
+WIFSTOPPED
+WNOHANG
+WSTOPSIG
+WTERMSIG
+WUNTRACED
+W_OK
+X_OK
+_PC_CHOWN_RESTRICTED
+_PC_LINK_MAX
+_PC_MAX_CANON
+_PC_MAX_INPUT
+_PC_NAME_MAX
+_PC_NO_TRUNC
+_PC_PATH_MAX
+_PC_PIPE_BUF
+_PC_VDISABLE
+_SC_ARG_MAX
+_SC_CHILD_MAX
+_SC_CLK_TCK
+_SC_HOST_NAME_MAX
+_SC_NGROUPS_MAX
+_SC_OPEN_MAX
+_SC_PAGESIZE
+_SC_PAGE_SIZE
+_SC_STREAM_MAX
+_SC_SYMLOOP_MAX
+_SC_TTY_NAME_MAX
+_SC_TZNAME_MAX
+_SC_VERSION
+_exit
+abort
+accept
+access
+addrinfo
+alarm
+atexit
+atof
+atoi
+atol
+atoll
+bind
+blkcnt_t
+blksize_t
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+cc_t
+cfgetispeed
+cfgetospeed
+cfmakeraw
+cfsetispeed
+cfsetospeed
+cfsetspeed
+chdir
+chmod
+chown
+clock_gettime
+clock_t
+clockid_t
+close
+closedir
+closelog
+connect
+creat
+dev_t
+dirent
+dladdr
+dlclose
+dlerror
+dlopen
+dlsym
+dup
+dup2
+execl
+execle
+execlp
+execv
+execve
+execvp
+exit
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fd_set
+fdopen
+feof
+ferror
+fflush
+fgetc
+fgetpos
+fgets
+fileno
+flock
+fopen
+fork
+fpathconf
+fpos_t
+fprintf
+fputc
+fputs
+fread
+free
+freeaddrinfo
+freopen
+fsblkcnt_t
+fscanf
+fseek
+fseeko
+fsetpos
+fsfilcnt_t
+fstat
+fstatat
+fstatvfs
+fsync
+ftell
+ftello
+ftruncate
+futimens
+fwrite
+gai_strerror
+getaddrinfo
+getchar
+getchar_unlocked
+getcwd
+getegid
+getenv
+geteuid
+getgid
+getgroups
+gethostname
+getlogin
+getopt
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getprotobyname
+getprotobynumber
+getpwnam
+getpwuid
+getservbyname
+getsockname
+getsockopt
+gettimeofday
+getuid
+gid_t
+gmtime
+gmtime_r
+grantpt
+group
+hostent
+hstrerror
+if_indextoname
+if_nametoindex
+in6_addr
+in_addr
+in_addr_t
+in_port_t
+ino_t
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+ioctl
+iovec
+ip_mreq
+ipv6_mreq
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+itimerval
+kill
+lchown
+lconv
+linger
+link
+linkat
+listen
+locale_t
+localeconv
+localtime
+localtime_r
+lseek
+lstat
+malloc
+memchr
+memcmp
+memcpy
+memmove
+memset
+mkdir
+mkdtemp
+mkfifo
+mknod
+mkstemp
+mktime
+mlock
+mlockall
+mmap
+mode_t
+mprotect
+msync
+munlock
+munlockall
+munmap
+nanosleep
+nfds_t
+nlink_t
+off_t
+open
+opendir
+openlog
+passwd
+pathconf
+pclose
+perror
+pid_t
+pipe
+poll
+pollfd
+posix_memalign
+posix_openpt
+pread
+printf
+protoent
+pselect
+pthread_attr_destroy
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setstacksize
+pthread_attr_t
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_t
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_condattr_destroy
+pthread_condattr_init
+pthread_condattr_t
+pthread_create
+pthread_detach
+pthread_exit
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_key_t
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_t
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_init
+pthread_mutexattr_settype
+pthread_mutexattr_t
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_t
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_init
+pthread_rwlockattr_t
+pthread_self
+pthread_setspecific
+pthread_t
+ptrdiff_t
+ptsname
+putchar
+putchar_unlocked
+putenv
+puts
+pwrite
+raise
+read
+readdir
+readlink
+readv
+realloc
+realpath
+recv
+recvfrom
+remove
+rename
+renameat
+res_init
+rewind
+rewinddir
+rlim_t
+rlimit
+rmdir
+rusage
+sa_family_t
+scanf
+sched_yield
+select
+sem_post
+sem_t
+sem_trywait
+sem_wait
+send
+sendto
+servent
+setbuf
+setegid
+setenv
+seteuid
+setgid
+setlocale
+setlogmask
+setpgid
+setregid
+setreuid
+setsid
+setsockopt
+setuid
+setvbuf
+shm_open
+shm_unlink
+shutdown
+sigaction
+sigaddset
+sigdelset
+sigemptyset
+sigfillset
+sighandler_t
+sigismember
+signal
+sigpending
+sigprocmask
+sigset_t
+sigval
+size_t
+sleep
+snprintf
+sockaddr
+sockaddr_in
+sockaddr_in6
+sockaddr_storage
+sockaddr_un
+socket
+socketpair
+socklen_t
+speed_t
+sprintf
+sscanf
+ssize_t
+stat
+statvfs
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strlen
+strncat
+strncmp
+strncpy
+strnlen
+strpbrk
+strrchr
+strspn
+strstr
+strtod
+strtof
+strtok
+strtol
+strtoll
+strtoul
+strtoull
+strxfrm
+suseconds_t
+symlink
+symlinkat
+sysconf
+syslog
+system
+tcdrain
+tcflag_t
+tcflow
+tcflush
+tcgetattr
+tcgetpgrp
+tcgetsid
+tcsendbreak
+tcsetattr
+tcsetpgrp
+termios
+time
+time_t
+timegm
+times
+timespec
+timeval
+timezone
+tm
+tmpfile
+tmpnam
+tms
+tolower
+toupper
+ttyname
+uid_t
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+umask
+uname
+ungetc
+unlink
+unlinkat
+unlockpt
+unsetenv
+usleep
+utimbuf
+utime
+utimes
+utsname
+wait
+waitpid
+wchar_t
+wcslen
+wcstombs
+winsize
+wmemchr
+write
+writev
diff --git a/libc-test/semver/windows-gnu.txt b/libc-test/semver/windows-gnu.txt
new file mode 100644
index 0000000000000..de63f991ab532
--- /dev/null
+++ b/libc-test/semver/windows-gnu.txt
@@ -0,0 +1,7 @@
+STDERR_FILENO
+STDIN_FILENO
+STDOUT_FILENO
+max_align_t
+strcasecmp
+strncasecmp
+wmemchr
diff --git a/libc-test/semver/windows-msvc.txt b/libc-test/semver/windows-msvc.txt
new file mode 100644
index 0000000000000..5b5296be3e9ce
--- /dev/null
+++ b/libc-test/semver/windows-msvc.txt
@@ -0,0 +1,4 @@
+EOTHER
+memccpy
+stricmp
+strnicmp
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
new file mode 100644
index 0000000000000..70ff4df20ff94
--- /dev/null
+++ b/libc-test/semver/windows.txt
@@ -0,0 +1,355 @@
+BUFSIZ
+E2BIG
+EACCES
+EADDRINUSE
+EADDRNOTAVAIL
+EAFNOSUPPORT
+EAGAIN
+EALREADY
+EBADF
+EBADMSG
+EBUSY
+ECANCELED
+ECHILD
+ECONNABORTED
+ECONNREFUSED
+ECONNRESET
+EDEADLK
+EDEADLOCK
+EDESTADDRREQ
+EDOM
+EEXIST
+EFAULT
+EFBIG
+EHOSTUNREACH
+EIDRM
+EILSEQ
+EINPROGRESS
+EINTR
+EINVAL
+EIO
+EISCONN
+EISDIR
+ELOOP
+EMFILE
+EMLINK
+EMSGSIZE
+ENAMETOOLONG
+ENETDOWN
+ENETRESET
+ENETUNREACH
+ENFILE
+ENOBUFS
+ENODATA
+ENODEV
+ENOENT
+ENOEXEC
+ENOLCK
+ENOLINK
+ENOMEM
+ENOMSG
+ENOPROTOOPT
+ENOSPC
+ENOSR
+ENOSTR
+ENOSYS
+ENOTCONN
+ENOTDIR
+ENOTEMPTY
+ENOTRECOVERABLE
+ENOTSOCK
+ENOTSUP
+ENOTTY
+ENXIO
+EOF
+EOPNOTSUPP
+EOVERFLOW
+EOWNERDEAD
+EPERM
+EPIPE
+EPROTO
+EPROTONOSUPPORT
+EPROTOTYPE
+ERANGE
+EROFS
+ESPIPE
+ESRCH
+ETIME
+ETIMEDOUT
+ETXTBSY
+EWOULDBLOCK
+EXDEV
+EXIT_FAILURE
+EXIT_SUCCESS
+FILE
+FILENAME_MAX
+FOPEN_MAX
+INT_MAX
+INT_MIN
+LC_ALL
+LC_COLLATE
+LC_CTYPE
+LC_MONETARY
+LC_NUMERIC
+LC_TIME
+L_tmpnam
+NSIG
+O_RDONLY
+O_WRONLY
+O_RDWR
+O_APPEND
+O_CREAT
+O_TRUNC
+O_EXCL
+O_TEXT
+O_BINARY
+_O_WTEXT
+_O_U16TEXT
+_O_U8TEXT
+O_RAW
+O_NOINHERIT
+O_TEMPORARY
+_O_SHORT_LIVED
+_O_OBTAIN_DIR
+O_SEQUENTIAL
+O_RANDOM
+RAND_MAX
+SEEK_CUR
+SEEK_END
+SEEK_SET
+SIGABRT
+SIGFPE
+SIGILL
+SIGINT
+SIGSEGV
+SIGTERM
+SIG_ACK
+SIG_DFL
+SIG_ERR
+SIG_GET
+SIG_IGN
+SIG_SGE
+SOCKET
+STRUNCATE
+S_IEXEC
+S_IFCHR
+S_IFDIR
+S_IFMT
+S_IFREG
+S_IREAD
+S_IWRITE
+TMP_MAX
+_IOFBF
+_IOLBF
+_IONBF
+_exit
+abort
+abs
+accept
+access
+aligned_malloc
+aligned_free
+atexit
+atof
+atoi
+atol
+atoll
+bind
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+chdir
+chmod
+clock_t
+close
+commit
+connect
+creat
+dev_t
+dup
+dup2
+errno_t
+execl
+execle
+execlp
+execlpe
+execv
+execve
+execvp
+execvpe
+exit
+fclose
+fdopen
+feof
+ferror
+fflush
+fgetc
+fgetpos
+fgets
+fileno
+fopen
+fpos_t
+fprintf
+fputc
+fputs
+fread
+free
+freopen
+fseek
+fsetpos
+fstat
+ftell
+fwrite
+get_osfhandle
+getchar
+getcwd
+getenv
+getpeername
+getpid
+getsockname
+getsockopt
+gmtime_s
+ino_t
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+labs
+listen
+localtime_s
+lseek
+lseek64
+malloc
+memchr
+memcmp
+memcpy
+memmove
+memset
+mkdir
+off_t
+open
+open_osfhandle
+pclose
+perror
+pipe
+popen
+printf
+ptrdiff_t
+putchar
+putenv
+putenv_s
+puts
+raise
+rand
+read
+realloc
+recvfrom
+remove
+rename
+rewind
+rmdir
+sendto
+setbuf
+setlocale
+setsockopt
+setvbuf
+sighandler_t
+signal
+size_t
+sockaddr
+socket
+srand
+ssize_t
+stat
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strlen
+strncat
+strncmp
+strncpy
+strnlen
+strpbrk
+strrchr
+strspn
+strstr
+strtod
+strtof
+strtok
+strtol
+strtoll
+strtoul
+strtoull
+strxfrm
+system
+time
+time64_t
+time_t
+timespec
+timeval
+timezone
+tm
+tmpfile
+tolower
+toupper
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+ungetc
+unlink
+utimbuf
+wchar_t
+wchmod
+wcslen
+wcstombs
+wexecl
+wexecle
+wexeclp
+wexeclpe
+wexecv
+wexecve
+wexecvp
+wexecvpe
+wopen
+wputenv
+wputenv_s
+write
+wrmdir
+wsetlocale
+wstat
+wutime
diff --git a/libc-test/src/makedev.c b/libc-test/src/makedev.c
new file mode 100644
index 0000000000000..7f99d60728bb4
--- /dev/null
+++ b/libc-test/src/makedev.c
@@ -0,0 +1,13 @@
+#include
+#if defined(__linux__) || defined(__EMSCRIPTEN__)
+#include
+#endif
+
+// Since makedev is a macro instead of a function, it isn't available to FFI.
+// libc must reimplement it, which is error-prone. This file provides FFI
+// access to the actual macro so it can be tested against the Rust
+// reimplementation.
+
+dev_t makedev_ffi(unsigned major, unsigned minor) {
+ return makedev(major, minor);
+}
diff --git a/libc-test/src/sigrt.c b/libc-test/src/sigrt.c
new file mode 100644
index 0000000000000..6140e7a8baec9
--- /dev/null
+++ b/libc-test/src/sigrt.c
@@ -0,0 +1,9 @@
+#include
+
+int sigrtmax() {
+ return SIGRTMAX;
+}
+
+int sigrtmin() {
+ return SIGRTMIN;
+}
diff --git a/libc-test/test/cmsg.rs b/libc-test/test/cmsg.rs
index 38a8ce1508901..00c3c14f4ccf3 100644
--- a/libc-test/test/cmsg.rs
+++ b/libc-test/test/cmsg.rs
@@ -11,10 +11,9 @@ mod t {
extern "C" {
pub fn cmsg_firsthdr(msgh: *const msghdr) -> *mut cmsghdr;
- pub fn cmsg_nxthdr(
- mhdr: *const msghdr,
- cmsg: *const cmsghdr,
- ) -> *mut cmsghdr;
+ // see below
+ #[cfg(not(target_arch = "sparc64"))]
+ pub fn cmsg_nxthdr(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr;
pub fn cmsg_space(length: c_uint) -> usize;
pub fn cmsg_len(length: c_uint) -> usize;
pub fn cmsg_data(cmsg: *const cmsghdr) -> *mut c_uchar;
diff --git a/libc-test/test/linux_if_arp.rs b/libc-test/test/linux_if_arp.rs
new file mode 100644
index 0000000000000..50be071d45b67
--- /dev/null
+++ b/libc-test/test/linux_if_arp.rs
@@ -0,0 +1,12 @@
+#![allow(bad_style, improper_ctypes, unused, deprecated)]
+
+extern crate libc;
+use libc::*;
+
+#[cfg(any(target_os = "linux", target_os = "android"))]
+include!(concat!(env!("OUT_DIR"), "/linux_if_arp.rs"));
+
+#[cfg(not(any(target_os = "linux", target_os = "android")))]
+fn main() {
+ println!("PASSED 0 tests");
+}
diff --git a/libc-test/test/linux_kernel_version.rs b/libc-test/test/linux_kernel_version.rs
new file mode 100644
index 0000000000000..c5687edad5601
--- /dev/null
+++ b/libc-test/test/linux_kernel_version.rs
@@ -0,0 +1,17 @@
+//! Compare libc's KERNEL_VERSION macro against a specific kernel version.
+
+extern crate libc;
+
+#[cfg(
+ target_os = "linux",
+)]
+mod t {
+ use libc;
+
+ #[test]
+ fn test_kernel_version() {
+ unsafe {
+ assert_eq!(libc::KERNEL_VERSION(6, 0, 0), 393216);
+ }
+ }
+}
diff --git a/libc-test/test/makedev.rs b/libc-test/test/makedev.rs
new file mode 100644
index 0000000000000..c9a92aa83e686
--- /dev/null
+++ b/libc-test/test/makedev.rs
@@ -0,0 +1,103 @@
+//! Compare libc's makdev function against the actual C macros, for various
+//! inputs.
+
+extern crate libc;
+
+#[cfg(any(
+ target_os = "android",
+ target_os = "dragonfly",
+ target_os = "emscripten",
+ target_os = "freebsd",
+ target_os = "fuchsia",
+ target_os = "linux",
+ target_os = "netbsd",
+ target_os = "openbsd",
+))]
+mod t {
+ use libc::{self, c_uint, dev_t};
+
+ extern "C" {
+ pub fn makedev_ffi(major: c_uint, minor: c_uint) -> dev_t;
+ }
+
+ fn compare(major: c_uint, minor: c_uint) {
+ let expected = unsafe { makedev_ffi(major, minor) };
+ assert_eq!(libc::makedev(major, minor), expected);
+ }
+
+ // Every OS should be able to handle 8 bit major and minor numbers
+ #[test]
+ fn test_8bits() {
+ for major in 0..256 {
+ for minor in 0..256 {
+ compare(major, minor);
+ }
+ }
+ }
+
+ // Android allows 12 bits for major and 20 for minor
+ #[test]
+ #[cfg(target_os = "android")]
+ fn test_android_like() {
+ for major in [0, 1, 255, 256, 4095] {
+ for minor_exp in [1, 8, 16] {
+ for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
+ compare(major, minor);
+ }
+ }
+ compare(major, (1 << 20) - 1);
+ }
+ }
+
+ // These OSes allow 32 bits for minor, but only 8 for major
+ #[test]
+ #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd",))]
+ fn test_fbsd11_like() {
+ for major in [0, 1, 255] {
+ for minor_exp in [1, 8, 16, 24, 31] {
+ for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
+ compare(major, minor);
+ }
+ }
+ compare(major, c_uint::MAX);
+ }
+ }
+
+ // OpenBSD allows 8 bits for major and 24 for minor
+ #[test]
+ #[cfg(target_os = "openbsd")]
+ fn test_openbsd_like() {
+ for major in [0, 1, 255] {
+ for minor_exp in [1, 8, 16] {
+ for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
+ compare(major, minor);
+ }
+ }
+ compare(major, (1 << 24) - 1);
+ }
+ }
+
+ // These OSes allow 32 bits for both minor and major
+ #[cfg(any(
+ target_os = "empscripten",
+ target_os = "freebsd",
+ target_os = "fuchsia",
+ target_os = "linux",
+ ))]
+ #[test]
+ fn test_fbsd12_like() {
+ if std::mem::size_of::() >= 8 {
+ for major_exp in [0, 16, 24, 31] {
+ for major in [(1 << major_exp) - 1, (1 << major_exp)] {
+ for minor_exp in [1, 8, 16, 24, 31] {
+ for minor in [(1 << minor_exp) - 1, (1 << minor_exp)] {
+ compare(major, minor);
+ }
+ }
+ compare(major, c_uint::MAX);
+ }
+ compare(c_uint::MAX, c_uint::MAX);
+ }
+ }
+ }
+}
diff --git a/libc-test/test/semver.rs b/libc-test/test/semver.rs
new file mode 100644
index 0000000000000..bc7d1c9c7954c
--- /dev/null
+++ b/libc-test/test/semver.rs
@@ -0,0 +1,12 @@
+#![allow(unused_imports)]
+#![allow(deprecated)]
+
+extern crate libc;
+
+// Generated in `build.rs`.
+include!(concat!(env!("OUT_DIR"), "/semver.rs"));
+
+fn main() {
+ // The test is about the imports created in `semver.rs`.
+ println!("PASSED 1 tests");
+}
diff --git a/libc-test/test/sigrt.rs b/libc-test/test/sigrt.rs
new file mode 100644
index 0000000000000..453dcb341d073
--- /dev/null
+++ b/libc-test/test/sigrt.rs
@@ -0,0 +1,32 @@
+//! Compare libc's SIGRTMAX and SIGRTMIN functions against the actual C macros
+
+extern crate libc;
+
+#[cfg(any(
+ target_os = "linux",
+ target_os = "l4re",
+ target_os = "android",
+ target_os = "emscripten"
+))]
+mod t {
+ use libc;
+
+ extern "C" {
+ pub fn sigrtmax() -> libc::c_int;
+ pub fn sigrtmin() -> libc::c_int;
+ }
+
+ #[test]
+ fn test_sigrtmax() {
+ unsafe {
+ assert_eq!(libc::SIGRTMAX(), sigrtmax());
+ }
+ }
+
+ #[test]
+ fn test_sigrtmin() {
+ unsafe {
+ assert_eq!(libc::SIGRTMIN(), sigrtmin());
+ }
+ }
+}
diff --git a/rustfmt.toml b/rustfmt.toml
index 7ecc610f330a4..dc85c99467fcc 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -1,3 +1 @@
-max_width = 79
-comment_width = 79
-error_on_line_overflow = true
\ No newline at end of file
+error_on_line_overflow = true
diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs
index 014640855fa30..999de8f54f194 100644
--- a/src/fixed_width_ints.rs
+++ b/src/fixed_width_ints.rs
@@ -18,3 +18,82 @@ pub type uint16_t = u16;
pub type uint32_t = u32;
#[deprecated(since = "0.2.55", note = "Use u64 instead.")]
pub type uint64_t = u64;
+
+cfg_if! {
+ if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] {
+ // This introduces partial support for FFI with __int128 and
+ // equivalent types on platforms where Rust's definition is validated
+ // to match the standard C ABI of that platform.
+ //
+ // Rust does not guarantee u128/i128 are sound for FFI, and its
+ // definitions are in fact known to be incompatible. [0]
+ //
+ // However these problems aren't fundamental, and are just platform
+ // inconsistencies. Specifically at the time of this writing:
+ //
+ // * For x64 SysV ABIs (everything but Windows), the types are underaligned.
+ // * For all Windows ABIs, Microsoft doesn't actually officially define __int128,
+ // and as a result different implementations don't actually agree on its ABI.
+ //
+ // But on the other major aarch64 platforms (android, linux, ios, macos) we have
+ // validated that rustc has the right ABI for these types. This is important because
+ // aarch64 uses these types in some fundamental OS types like user_fpsimd_struct,
+ // which represents saved simd registers.
+ //
+ // Any API which uses these types will need to `#[ignore(improper_ctypes)]`
+ // until the upstream rust issue is resolved, but this at least lets us make
+ // progress on platforms where this type is important.
+ //
+ // The list of supported architectures and OSes is intentionally very restricted,
+ // as careful work needs to be done to verify that a particular platform
+ // has a conformant ABI.
+ //
+ // [0]: https://github.com/rust-lang/rust/issues/54341
+
+ /// C `__int128` (a GCC extension that's part of many ABIs)
+ pub type __int128 = i128;
+ /// C `unsigned __int128` (a GCC extension that's part of many ABIs)
+ pub type __uint128 = u128;
+ /// C __int128_t (alternate name for [__int128][])
+ pub type __int128_t = i128;
+ /// C __uint128_t (alternate name for [__uint128][])
+ pub type __uint128_t = u128;
+
+ cfg_if! {
+ if #[cfg(libc_underscore_const_names)] {
+ macro_rules! static_assert_eq {
+ ($a:expr, $b:expr) => {
+ const _: [(); $a] = [(); $b];
+ };
+ }
+
+ // NOTE: if you add more platforms to here, you may need to cfg
+ // these consts. They should always match the platform's values
+ // for `sizeof(__int128)` and `_Alignof(__int128)`.
+ const _SIZE_128: usize = 16;
+ const _ALIGN_128: usize = 16;
+
+ // Since Rust doesn't officially guarantee that these types
+ // have compatible ABIs, we const assert that these values have the
+ // known size/align of the target platform's libc. If rustc ever
+ // tries to regress things, it will cause a compilation error.
+ //
+ // This isn't a bullet-proof solution because e.g. it doesn't
+ // catch the fact that llvm and gcc disagree on how x64 __int128
+ // is actually *passed* on the stack (clang underaligns it for
+ // the same reason that rustc *never* properly aligns it).
+ static_assert_eq!(core::mem::size_of::<__int128>(), _SIZE_128);
+ static_assert_eq!(core::mem::align_of::<__int128>(), _ALIGN_128);
+
+ static_assert_eq!(core::mem::size_of::<__uint128>(), _SIZE_128);
+ static_assert_eq!(core::mem::align_of::<__uint128>(), _ALIGN_128);
+
+ static_assert_eq!(core::mem::size_of::<__int128_t>(), _SIZE_128);
+ static_assert_eq!(core::mem::align_of::<__int128_t>(), _ALIGN_128);
+
+ static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128);
+ static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128);
+ }
+ }
+ }
+}
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index d3d9e45442501..5c6aebde23b01 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -877,6 +877,11 @@ s! {
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
+
+ pub struct in6_pktinfo {
+ pub ipi6_addr: ::in6_addr,
+ pub ipi6_ifindex: ::c_uint,
+ }
}
s_no_extra_traits! {
@@ -904,8 +909,8 @@ s_no_extra_traits! {
pub struct sockaddr_storage {
pub ss_family: sa_family_t,
+ __ss_pad2: [u8; 128 - 2 - 8],
__ss_align: ::size_t,
- __ss_pad2: [u8; 128 - 2 * 8],
}
pub struct utsname {
@@ -1313,6 +1318,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;
@@ -1768,8 +1774,10 @@ pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
+pub const IP_TOS: ::c_int = 1;
pub const IP_TTL: ::c_int = 2;
pub const IP_HDRINCL: ::c_int = 3;
+pub const IP_RECVTOS: ::c_int = 13;
pub const IP_FREEBIND: ::c_int = 15;
pub const IP_TRANSPARENT: ::c_int = 19;
pub const IP_MULTICAST_IF: ::c_int = 32;
@@ -1785,6 +1793,9 @@ 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 IPV6_RECVPKTINFO: ::c_int = 49;
+pub const IPV6_RECVTCLASS: ::c_int = 66;
+pub const IPV6_TCLASS: ::c_int = 67;
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
@@ -2666,6 +2677,9 @@ pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
pub const PT_GNU_STACK: u32 = 0x6474e551;
pub const PT_GNU_RELRO: u32 = 0x6474e552;
+// Ethernet protocol IDs.
+pub const ETH_P_IP: ::c_int = 0x0800;
+
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -2717,6 +2731,7 @@ pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const RLIM_INFINITY: ::rlim_t = !0;
pub const RLIMIT_RTTIME: ::c_int = 15;
pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
@@ -3155,7 +3170,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
@@ -3220,17 +3235,6 @@ f! {
minor as ::c_uint
}
- pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
- let major = major as ::dev_t;
- let minor = minor as ::dev_t;
- let mut dev = 0;
- dev |= (major & 0x00000fff) << 8;
- dev |= (major & 0xfffff000) << 32;
- dev |= (minor & 0x000000ff) << 0;
- dev |= (minor & 0xffffff00) << 12;
- dev
- }
-
pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
cmsg.offset(1) as *mut c_uchar
}
@@ -3307,11 +3311,21 @@ safe_f! {
pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
(cmd << 8) | (type_ & 0x00ff)
}
+
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= (major & 0x00000fff) << 8;
+ dev |= (major & 0xfffff000) << 32;
+ dev |= (minor & 0x000000ff) << 0;
+ dev |= (minor & 0xffffff00) << 12;
+ dev
+ }
}
fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t {
- ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>()
- - 1)
+ ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() - 1)
& !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t
}
@@ -3320,8 +3334,7 @@ fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar {
}
fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar {
- unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }
- .cast()
+ unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast()
}
// EXTERN_FN
@@ -3363,44 +3376,24 @@ extern "C" {
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
- pub fn freopen(
- filename: *const c_char,
- mode: *const c_char,
- file: *mut FILE,
- ) -> *mut FILE;
+ 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 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 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;
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;
- pub fn fwrite(
- ptr: *const c_void,
- size: size_t,
- nobj: size_t,
- stream: *mut FILE,
- ) -> size_t;
+ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+ 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);
@@ -3409,18 +3402,16 @@ extern "C" {
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 atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
+ pub fn atol(s: *const c_char) -> c_long;
+ pub fn atoll(s: *const c_char) -> c_longlong;
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 strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
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;
@@ -3433,17 +3424,9 @@ extern "C" {
pub fn getenv(s: *const c_char) -> *mut c_char;
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 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 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;
@@ -3460,29 +3443,16 @@ extern "C" {
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 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 wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
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 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;
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);
@@ -3490,42 +3460,20 @@ extern "C" {
pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
- pub fn fprintf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
- pub fn snprintf(
- s: *mut ::c_char,
- n: ::size_t,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
- pub fn fscanf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
- pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...)
- -> ::c_int;
+ pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
- pub fn connect(
- socket: ::c_int,
- address: *const sockaddr,
- len: socklen_t,
- ) -> ::c_int;
+ pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
- pub fn accept(
- socket: ::c_int,
- address: *mut sockaddr,
- address_len: *mut socklen_t,
- ) -> ::c_int;
+ pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
pub fn getpeername(
socket: ::c_int,
address: *mut sockaddr,
@@ -3578,20 +3526,12 @@ extern "C" {
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
- pub fn readdir_r(
- dirp: *mut ::DIR,
- entry: *mut ::dirent,
- result: *mut *mut ::dirent,
- ) -> ::c_int;
+ pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+ -> ::c_int;
pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
pub fn rewinddir(dirp: *mut ::DIR);
- pub fn openat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- flags: ::c_int,
- ...
- ) -> ::c_int;
+ pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
pub fn fchmodat(
dirfd: ::c_int,
pathname: *const ::c_char,
@@ -3619,11 +3559,7 @@ extern "C" {
newpath: *const ::c_char,
flags: ::c_int,
) -> ::c_int;
- pub fn mkdirat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn readlinkat(
dirfd: ::c_int,
pathname: *const ::c_char,
@@ -3641,11 +3577,7 @@ extern "C" {
newdirfd: ::c_int,
linkpath: *const ::c_char,
) -> ::c_int;
- pub fn unlinkat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
pub fn alarm(seconds: ::c_uint) -> ::c_uint;
@@ -3656,16 +3588,8 @@ extern "C" {
pub fn dup(fd: ::c_int) -> ::c_int;
pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
- pub fn execle(
- path: *const ::c_char,
- arg0: *const ::c_char,
- ...
- ) -> ::c_int;
- pub fn execlp(
- file: *const ::c_char,
- arg0: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+ pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
pub fn execve(
prog: *const c_char,
@@ -3681,11 +3605,7 @@ extern "C" {
pub fn getgid() -> gid_t;
pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
pub fn getlogin() -> *mut c_char;
- pub fn getopt(
- argc: ::c_int,
- argv: *const *mut c_char,
- optstr: *const c_char,
- ) -> ::c_int;
+ pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
pub fn getpgid(pid: pid_t) -> pid_t;
pub fn getpgrp() -> pid_t;
pub fn getpid() -> pid_t;
@@ -3697,13 +3617,8 @@ extern "C" {
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pause() -> ::c_int;
pub fn pipe(fds: *mut ::c_int) -> ::c_int;
- pub fn posix_memalign(
- memptr: *mut *mut ::c_void,
- align: ::size_t,
- size: ::size_t,
- ) -> ::c_int;
- pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
- -> ::ssize_t;
+ pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+ pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
pub fn rmdir(path: *const c_char) -> ::c_int;
pub fn seteuid(uid: uid_t) -> ::c_int;
pub fn setegid(gid: gid_t) -> ::c_int;
@@ -3718,28 +3633,10 @@ extern "C" {
pub fn ttyname(fd: ::c_int) -> *mut c_char;
pub fn unlink(c: *const c_char) -> ::c_int;
pub fn wait(status: *mut ::c_int) -> pid_t;
- pub fn waitpid(
- pid: pid_t,
- status: *mut ::c_int,
- options: ::c_int,
- ) -> pid_t;
- pub fn write(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- ) -> ::ssize_t;
- pub fn pread(
- fd: ::c_int,
- buf: *mut ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
- pub fn pwrite(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
+ pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
+ pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
+ pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+ pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pub fn umask(mask: mode_t) -> mode_t;
pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
@@ -3762,20 +3659,13 @@ extern "C" {
pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
- pub fn if_indextoname(
- ifindex: ::c_uint,
- ifname: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
pub fn fsync(fd: ::c_int) -> ::c_int;
- pub fn setenv(
- name: *const c_char,
- val: *const c_char,
- overwrite: ::c_int,
- ) -> ::c_int;
+ pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
pub fn unsetenv(name: *const c_char) -> ::c_int;
pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
@@ -3784,10 +3674,7 @@ extern "C" {
pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
- pub fn realpath(
- pathname: *const ::c_char,
- resolved: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
@@ -3795,21 +3682,12 @@ extern "C" {
pub fn times(buf: *mut ::tms) -> ::clock_t;
pub fn pthread_self() -> ::pthread_t;
- pub fn pthread_join(
- native: ::pthread_t,
- value: *mut *mut ::c_void,
- ) -> ::c_int;
+ pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
pub fn pthread_exit(value: *mut ::c_void) -> !;
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_destroy(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_attr_setdetachstate(
- attr: *mut ::pthread_attr_t,
- state: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
+ pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
pub fn sched_yield() -> ::c_int;
pub fn pthread_key_create(
@@ -3818,10 +3696,7 @@ extern "C" {
) -> ::c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
- pub fn pthread_setspecific(
- key: pthread_key_t,
- value: *const ::c_void,
- ) -> ::c_int;
+ pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
pub fn pthread_mutex_init(
lock: *mut pthread_mutex_t,
attr: *const pthread_mutexattr_t,
@@ -3832,22 +3707,12 @@ extern "C" {
pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
- pub fn pthread_mutexattr_destroy(
- attr: *mut pthread_mutexattr_t,
- ) -> ::c_int;
- pub fn pthread_mutexattr_settype(
- attr: *mut pthread_mutexattr_t,
- _type: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
+ pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
- pub fn pthread_cond_init(
- cond: *mut pthread_cond_t,
- attr: *const pthread_condattr_t,
- ) -> ::c_int;
- pub fn pthread_cond_wait(
- cond: *mut pthread_cond_t,
- lock: *mut pthread_mutex_t,
- ) -> ::c_int;
+ pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
+ -> ::c_int;
+ pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_cond_timedwait(
cond: *mut pthread_cond_t,
lock: *mut pthread_mutex_t,
@@ -3868,16 +3733,9 @@ extern "C" {
pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
- pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t)
- -> ::c_int;
- pub fn pthread_rwlockattr_destroy(
- attr: *mut pthread_rwlockattr_t,
- ) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+ pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn getsockopt(
sockfd: ::c_int,
@@ -3887,22 +3745,12 @@ extern "C" {
optlen: *mut ::socklen_t,
) -> ::c_int;
pub fn raise(signum: ::c_int) -> ::c_int;
- pub fn sigaction(
- signum: ::c_int,
- act: *const sigaction,
- oldact: *mut sigaction,
- ) -> ::c_int;
+ pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
- pub fn utimes(
- filename: *const ::c_char,
- times: *const ::timeval,
- ) -> ::c_int;
+ pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
pub fn dlerror() -> *mut ::c_char;
- pub fn dlsym(
- handle: *mut ::c_void,
- symbol: *const ::c_char,
- ) -> *mut ::c_void;
+ pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
@@ -3923,64 +3771,36 @@ extern "C" {
pub fn gmtime(time_p: *const time_t) -> *mut tm;
pub fn localtime(time_p: *const time_t) -> *mut tm;
- pub fn mknod(
- pathname: *const ::c_char,
- mode: ::mode_t,
- dev: ::dev_t,
- ) -> ::c_int;
+ pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
- pub fn getservbyname(
- name: *const ::c_char,
- proto: *const ::c_char,
- ) -> *mut servent;
+ pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
pub fn usleep(secs: ::c_uint) -> ::c_int;
- pub fn send(
- socket: ::c_int,
- buf: *const ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recv(
- socket: ::c_int,
- buf: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+ pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
pub fn putenv(string: *mut c_char) -> ::c_int;
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
pub fn select(
nfds: ::c_int,
- readfs: *mut fd_set,
+ readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *mut timeval,
) -> ::c_int;
- pub fn setlocale(
- category: ::c_int,
- locale: *const ::c_char,
- ) -> *mut ::c_char;
+ pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
pub fn localeconv() -> *mut lconv;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
pub fn sem_post(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
- pub fn readlink(
- path: *const c_char,
- buf: *mut c_char,
- bufsz: ::size_t,
- ) -> ::ssize_t;
+ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
@@ -3988,11 +3808,7 @@ extern "C" {
pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
- pub fn sigprocmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
pub fn timegm(tm: *mut ::tm) -> time_t;
@@ -4005,17 +3821,13 @@ extern "C" {
pub fn pselect(
nfds: ::c_int,
- readfs: *mut fd_set,
+ readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *const timespec,
sigmask: *const sigset_t,
) -> ::c_int;
- pub fn fseeko(
- stream: *mut ::FILE,
- offset: ::off_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
pub fn tcdrain(fd: ::c_int) -> ::c_int;
pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
@@ -4025,11 +3837,7 @@ extern "C" {
pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
- pub fn tcsetattr(
- fd: ::c_int,
- optional_actions: ::c_int,
- termios: *const ::termios,
- ) -> ::c_int;
+ pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
@@ -4052,16 +3860,10 @@ extern "C" {
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
- pub fn clock_settime(
- clk_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
- pub fn pthread_getattr_np(
- native: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
+ pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
@@ -4072,18 +3874,9 @@ extern "C" {
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
- pub fn memrchr(
- cx: *const ::c_void,
- c: ::c_int,
- n: ::size_t,
- ) -> *mut ::c_void;
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
- pub fn posix_fadvise(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- advise: ::c_int,
- ) -> ::c_int;
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
@@ -4093,11 +3886,7 @@ extern "C" {
) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
@@ -4122,30 +3911,14 @@ extern "C" {
len: *mut ::socklen_t,
flg: ::c_int,
) -> ::c_int;
- pub fn ptsname_r(
- fd: ::c_int,
- buf: *mut ::c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn clearenv() -> ::c_int;
- pub fn waitid(
- idtype: idtype_t,
- id: id_t,
- infop: *mut ::siginfo_t,
- options: ::c_int,
- ) -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
- pub fn getresuid(
- ruid: *mut ::uid_t,
- euid: *mut ::uid_t,
- suid: *mut ::uid_t,
- ) -> ::c_int;
- pub fn getresgid(
- rgid: *mut ::gid_t,
- egid: *mut ::gid_t,
- sgid: *mut ::gid_t,
- ) -> ::c_int;
+ pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+ pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
@@ -4176,40 +3949,18 @@ extern "C" {
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
- pub fn shm_open(
- name: *const c_char,
- oflag: ::c_int,
- mode: mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
// System V IPC
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ 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;
- pub fn shmctl(
- shmid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::shmid_ds,
- ) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
- pub fn semop(
- semid: ::c_int,
- sops: *mut ::sembuf,
- nsops: ::size_t,
- ) -> ::c_int;
- pub fn semctl(
- semid: ::c_int,
- semnum: ::c_int,
- cmd: ::c_int,
- ...
- ) -> ::c_int;
- pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds)
- -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgrcv(
msqid: ::c_int,
@@ -4225,57 +3976,24 @@ extern "C" {
msgflg: ::c_int,
) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn __errno_location() -> *mut ::c_int;
- pub fn fallocate(
- fd: ::c_int,
- mode: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn readahead(
- fd: ::c_int,
- offset: ::off64_t,
- count: ::size_t,
- ) -> ::ssize_t;
- pub fn signalfd(
- fd: ::c_int,
- mask: *const ::sigset_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
+ pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
- pub fn timerfd_gettime(
- fd: ::c_int,
- curr_value: *mut itimerspec,
- ) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
pub fn timerfd_settime(
fd: ::c_int,
flags: ::c_int,
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> ::c_int;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn quotactl(
cmd: ::c_int,
special: *const ::c_char,
@@ -4284,19 +4002,14 @@ extern "C" {
) -> ::c_int;
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
- pub fn mkostemps(
- template: *mut ::c_char,
- suffixlen: ::c_int,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
- -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
@@ -4311,11 +4024,7 @@ extern "C" {
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
// Not available now on Android
- pub fn mkfifoat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn sync_file_range(
@@ -4330,35 +4039,21 @@ extern "C" {
pub fn glob(
pattern: *const c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
@@ -4372,33 +4067,13 @@ extern "C" {
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
- pub fn sendmsg(
- fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recvmsg(
- fd: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn vhangup() -> ::c_int;
@@ -4417,11 +4092,8 @@ extern "C" {
) -> ::c_int;
pub fn sync();
pub fn syscall(num: ::c_long, ...) -> ::c_long;
- pub fn sched_getaffinity(
- pid: ::pid_t,
- cpusetsize: ::size_t,
- cpuset: *mut cpu_set_t,
- ) -> ::c_int;
+ pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+ -> ::c_int;
pub fn sched_setaffinity(
pid: ::pid_t,
cpusetsize: ::size_t,
@@ -4429,16 +4101,8 @@ extern "C" {
) -> ::c_int;
pub fn umount(target: *const ::c_char) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
- pub fn tee(
- fd_in: ::c_int,
- fd_out: ::c_int,
- len: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
- pub fn settimeofday(
- tv: *const ::timeval,
- tz: *const ::timezone,
- ) -> ::c_int;
+ pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn splice(
fd_in: ::c_int,
off_in: *mut ::loff_t,
@@ -4448,17 +4112,10 @@ extern "C" {
flags: ::c_uint,
) -> ::ssize_t;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec)
- -> ::c_int;
- pub fn sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
- pub fn sched_setparam(
- pid: ::pid_t,
- param: *const ::sched_param,
- ) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
pub fn vmsplice(
fd: ::c_int,
@@ -4531,11 +4188,7 @@ extern "C" {
result: *mut *mut ::group,
) -> ::c_int;
pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
@@ -4563,6 +4216,11 @@ extern "C" {
child: ::Option,
) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+
+ pub fn setgrent();
+ pub fn endgrent();
+ pub fn getgrent() -> *mut ::group;
+
pub fn getgrouplist(
user: *const ::c_char,
group: ::gid_t,
diff --git a/src/lib.rs b/src/lib.rs
index 30c94b0969bb4..acda091592025 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -13,7 +13,9 @@
improper_ctypes,
// This lint is renamed but we run CI for old stable rustc so should be here.
redundant_semicolon,
- redundant_semicolons
+ redundant_semicolons,
+ unused_macros,
+ unused_macro_rules,
)]
#![cfg_attr(libc_deny_warnings, deny(warnings))]
// Attributes needed when building as part of the standard library
@@ -24,11 +26,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
-#![cfg_attr(
- any(feature = "rustc-dep-of-std", target_os = "redox"),
- feature(static_nobundle)
-)]
-#![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))]
+#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
#[macro_use]
mod macros;
@@ -63,7 +61,7 @@ cfg_if! {
use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
- use core::marker::Copy;
+ use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
use core::option::Option;
@@ -85,7 +83,7 @@ cfg_if! {
pub use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
- pub use core::marker::Copy;
+ pub use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::option::Option;
@@ -123,6 +121,12 @@ cfg_if! {
mod vxworks;
pub use vxworks::*;
+ } else if #[cfg(target_os = "solid_asp3")] {
+ mod fixed_width_ints;
+ pub use fixed_width_ints::*;
+
+ mod solid;
+ pub use solid::*;
} else if #[cfg(unix)] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
diff --git a/src/macros.rs b/src/macros.rs
index 1871cfafda192..fd473702f72bd 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -6,7 +6,6 @@
///
/// This allows you to conveniently provide a long list #[cfg]'d blocks of code
/// without having to rewrite each clause multiple times.
-#[allow(unused_macros)]
macro_rules! cfg_if {
// match if/else chains with a final `else`
($(
@@ -62,7 +61,6 @@ macro_rules! cfg_if {
};
}
-#[allow(unused_macros)]
macro_rules! s {
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
s!(it: $(#[$attr])* pub $t $i { $($field)* });
@@ -87,7 +85,6 @@ macro_rules! s {
);
}
-#[allow(unused_macros)]
macro_rules! s_no_extra_traits {
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* });
@@ -123,7 +120,6 @@ macro_rules! s_no_extra_traits {
);
}
-#[allow(unused_macros)]
macro_rules! e {
($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($(
__item! {
@@ -138,7 +134,6 @@ macro_rules! e {
)*);
}
-#[allow(unused_macros)]
macro_rules! s_paren {
($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($(
__item! {
@@ -182,7 +177,6 @@ macro_rules! s_paren {
// 'f!' block
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
- #[allow(unused_macros)]
macro_rules! f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -198,7 +192,6 @@ cfg_if! {
)*)
}
- #[allow(unused_macros)]
macro_rules! safe_f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -214,7 +207,6 @@ cfg_if! {
)*)
}
- #[allow(unused_macros)]
macro_rules! const_fn {
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -231,7 +223,6 @@ cfg_if! {
}
} else {
- #[allow(unused_macros)]
macro_rules! f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -247,7 +238,6 @@ cfg_if! {
)*)
}
- #[allow(unused_macros)]
macro_rules! safe_f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -263,7 +253,6 @@ cfg_if! {
)*)
}
- #[allow(unused_macros)]
macro_rules! const_fn {
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
@@ -281,14 +270,12 @@ cfg_if! {
}
}
-#[allow(unused_macros)]
macro_rules! __item {
($i:item) => {
$i
};
}
-#[allow(unused_macros)]
macro_rules! align_const {
($($(#[$attr:meta])*
pub const $name:ident : $t1:ty
@@ -307,13 +294,12 @@ macro_rules! align_const {
)*)
}
-// This macro is used to deprecate items that should be accessed via the mach crate
-#[allow(unused_macros)]
+// This macro is used to deprecate items that should be accessed via the mach2 crate
macro_rules! deprecated_mach {
(pub const $id:ident: $ty:ty = $expr:expr;) => {
#[deprecated(
since = "0.2.55",
- note = "Use the `mach` crate instead",
+ note = "Use the `mach2` crate instead",
)]
#[allow(deprecated)]
pub const $id: $ty = $expr;
@@ -328,7 +314,7 @@ macro_rules! deprecated_mach {
(pub type $id:ident = $ty:ty;) => {
#[deprecated(
since = "0.2.55",
- note = "Use the `mach` crate instead",
+ note = "Use the `mach2` crate instead",
)]
#[allow(deprecated)]
pub type $id = $ty;
@@ -341,3 +327,17 @@ macro_rules! deprecated_mach {
)*
}
}
+
+#[cfg(not(libc_ptr_addr_of))]
+macro_rules! ptr_addr_of {
+ ($place:expr) => {
+ &$place
+ };
+}
+
+#[cfg(libc_ptr_addr_of)]
+macro_rules! ptr_addr_of {
+ ($place:expr) => {
+ ::core::ptr::addr_of!($place)
+ };
+}
diff --git a/src/psp.rs b/src/psp.rs
index 9babe1c0ecd03..575232dad1f88 100644
--- a/src/psp.rs
+++ b/src/psp.rs
@@ -54,24 +54,18 @@ pub type SceKernelVTimerHandler = unsafe extern "C" fn(
arg3: *mut c_void,
) -> u32;
-pub type SceKernelVTimerHandlerWide = unsafe extern "C" fn(
- uid: SceUid,
- arg1: i64,
- arg2: i64,
- arg3: *mut c_void,
-) -> u32;
+pub type SceKernelVTimerHandlerWide =
+ unsafe extern "C" fn(uid: SceUid, arg1: i64, arg2: i64, arg3: *mut c_void) -> u32;
pub type SceKernelThreadEventHandler =
unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32;
-pub type SceKernelAlarmHandler =
- unsafe extern "C" fn(common: *mut c_void) -> u32;
+pub type SceKernelAlarmHandler = unsafe extern "C" fn(common: *mut c_void) -> u32;
pub type SceKernelCallbackFunction =
unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32;
-pub type SceKernelThreadEntry =
- unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32;
+pub type SceKernelThreadEntry = unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32;
pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32);
@@ -79,22 +73,15 @@ pub type IoPermissions = i32;
pub type UmdCallback = fn(unknown: i32, event: i32) -> i32;
-pub type SceMpegRingbufferCb = ::Option<
- unsafe extern "C" fn(
- data: *mut c_void,
- num_packets: i32,
- param: *mut c_void,
- ) -> i32,
->;
+pub type SceMpegRingbufferCb =
+ ::Option i32>;
pub type GuCallback = ::Option;
-pub type GuSwapBuffersCallback = ::Option<
- extern "C" fn(display: *mut *mut c_void, render: *mut *mut c_void),
->;
+pub type GuSwapBuffersCallback =
+ ::Option;
-pub type SceNetAdhocctlHandler = ::Option<
- unsafe extern "C" fn(flag: i32, error: i32, unknown: *mut c_void),
->;
+pub type SceNetAdhocctlHandler =
+ ::Option;
pub type AdhocMatchingCallback = ::Option<
unsafe extern "C" fn(
@@ -107,17 +94,10 @@ pub type AdhocMatchingCallback = ::Option<
>;
pub type SceNetApctlHandler = ::Option<
- unsafe extern "C" fn(
- oldState: i32,
- newState: i32,
- event: i32,
- error: i32,
- pArg: *mut c_void,
- ),
+ unsafe extern "C" fn(oldState: i32, newState: i32, event: i32, error: i32, pArg: *mut c_void),
>;
-pub type HttpMallocFunction =
- ::Option *mut c_void>;
+pub type HttpMallocFunction = ::Option *mut c_void>;
pub type HttpReallocFunction =
::Option *mut c_void>;
pub type HttpFreeFunction = ::Option;
@@ -2613,8 +2593,7 @@ pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004;
pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008;
pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010;
pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020;
-pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 =
- 0x000040;
+pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000040;
pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080;
pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100;
pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200;
@@ -2622,18 +2601,10 @@ pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400;
pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800;
extern "C" {
- pub fn sceAudioChReserve(
- channel: i32,
- sample_count: i32,
- format: AudioFormat,
- ) -> i32;
+ pub fn sceAudioChReserve(channel: i32, sample_count: i32, format: AudioFormat) -> i32;
pub fn sceAudioChRelease(channel: i32) -> i32;
pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32;
- pub fn sceAudioOutputBlocking(
- channel: i32,
- vol: i32,
- buf: *mut c_void,
- ) -> i32;
+ pub fn sceAudioOutputBlocking(channel: i32, vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioOutputPanned(
channel: i32,
left_vol: i32,
@@ -2649,15 +2620,8 @@ extern "C" {
pub fn sceAudioGetChannelRestLen(channel: i32) -> i32;
pub fn sceAudioGetChannelRestLength(channel: i32) -> i32;
pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32;
- pub fn sceAudioChangeChannelConfig(
- channel: i32,
- format: AudioFormat,
- ) -> i32;
- pub fn sceAudioChangeChannelVolume(
- channel: i32,
- left_vol: i32,
- right_vol: i32,
- ) -> i32;
+ pub fn sceAudioChangeChannelConfig(channel: i32, format: AudioFormat) -> i32;
+ pub fn sceAudioChangeChannelVolume(channel: i32, left_vol: i32, right_vol: i32) -> i32;
pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32;
pub fn sceAudioOutput2Release() -> i32;
pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32;
@@ -2672,16 +2636,8 @@ extern "C" {
pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32;
pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32;
- pub fn sceAudioInputBlocking(
- sample_count: i32,
- freq: AudioInputFrequency,
- buf: *mut c_void,
- );
- pub fn sceAudioInput(
- sample_count: i32,
- freq: AudioInputFrequency,
- buf: *mut c_void,
- );
+ pub fn sceAudioInputBlocking(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
+ pub fn sceAudioInput(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
pub fn sceAudioGetInputLength() -> i32;
pub fn sceAudioWaitInputEnd() -> i32;
pub fn sceAudioPollInputEnd() -> i32;
@@ -2695,10 +2651,7 @@ extern "C" {
out_end: *mut i32,
out_remain_frame: *mut i32,
) -> i32;
- pub fn sceAtracGetRemainFrame(
- atrac_id: i32,
- out_remain_frame: *mut i32,
- ) -> i32;
+ pub fn sceAtracGetRemainFrame(atrac_id: i32, out_remain_frame: *mut i32) -> i32;
pub fn sceAtracGetStreamDataInfo(
atrac_id: i32,
write_pointer: *mut *mut u8,
@@ -2717,19 +2670,13 @@ extern "C" {
pbuffer_info: *mut Atrac3BufferInfo,
) -> i32;
pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32;
- pub fn sceAtracGetInternalErrorInfo(
- atrac_id: i32,
- pi_result: *mut i32,
- ) -> i32;
+ pub fn sceAtracGetInternalErrorInfo(atrac_id: i32, pi_result: *mut i32) -> i32;
pub fn sceAtracGetLoopStatus(
atrac_id: i32,
pi_loop_num: *mut i32,
pui_loop_status: *mut u32,
) -> i32;
- pub fn sceAtracGetNextDecodePosition(
- atrac_id: i32,
- pui_sample_position: *mut u32,
- ) -> i32;
+ pub fn sceAtracGetNextDecodePosition(atrac_id: i32, pui_sample_position: *mut u32) -> i32;
pub fn sceAtracGetSecondBufferInfo(
atrac_id: i32,
pui_position: *mut u32,
@@ -2747,11 +2694,7 @@ extern "C" {
ui_write_byte_first_buf: u32,
ui_write_byte_second_buf: u32,
) -> i32;
- pub fn sceAtracSetData(
- atrac_id: i32,
- puc_buffer_addr: *mut u8,
- ui_buffer_byte: u32,
- ) -> i32;
+ pub fn sceAtracSetData(atrac_id: i32, puc_buffer_addr: *mut u8, ui_buffer_byte: u32) -> i32;
pub fn sceAtracSetHalfwayBuffer(
atrac_id: i32,
puc_buffer_addr: *mut u8,
@@ -2773,41 +2716,17 @@ extern "C" {
pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32;
pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32;
pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32;
- pub fn sceCtrlPeekBufferPositive(
- pad_data: *mut SceCtrlData,
- count: i32,
- ) -> i32;
- pub fn sceCtrlPeekBufferNegative(
- pad_data: *mut SceCtrlData,
- count: i32,
- ) -> i32;
- pub fn sceCtrlReadBufferPositive(
- pad_data: *mut SceCtrlData,
- count: i32,
- ) -> i32;
- pub fn sceCtrlReadBufferNegative(
- pad_data: *mut SceCtrlData,
- count: i32,
- ) -> i32;
+ pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
+ pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
+ pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
+ pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32;
pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32;
- pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32)
- -> i32;
- pub fn sceCtrlGetIdleCancelThreshold(
- idlereset: *mut i32,
- idleback: *mut i32,
- ) -> i32;
+ pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) -> i32;
+ pub fn sceCtrlGetIdleCancelThreshold(idlereset: *mut i32, idleback: *mut i32) -> i32;
- pub fn sceDisplaySetMode(
- mode: DisplayMode,
- width: usize,
- height: usize,
- ) -> u32;
- pub fn sceDisplayGetMode(
- pmode: *mut i32,
- pwidth: *mut i32,
- pheight: *mut i32,
- ) -> i32;
+ pub fn sceDisplaySetMode(mode: DisplayMode, width: usize, height: usize) -> u32;
+ pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32, pheight: *mut i32) -> i32;
pub fn sceDisplaySetFrameBuf(
top_addr: *const u8,
buffer_width: usize,
@@ -2862,10 +2781,7 @@ extern "C" {
pub fn sceKernelExitGame();
pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32;
- pub fn sceKernelLoadExec(
- file: *const u8,
- param: *mut SceKernelLoadExecParam,
- ) -> i32;
+ pub fn sceKernelLoadExec(file: *const u8, param: *mut SceKernelLoadExecParam) -> i32;
pub fn sceKernelAllocPartitionMemory(
partition: SceSysMemPartitionId,
@@ -2884,52 +2800,27 @@ extern "C" {
pub fn sceKernelLibcTime(t: *mut i32) -> i32;
pub fn sceKernelLibcClock() -> u32;
- pub fn sceKernelLibcGettimeofday(
- tp: *mut timeval,
- tzp: *mut timezone,
- ) -> i32;
+ pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone) -> i32;
pub fn sceKernelDcacheWritebackAll();
pub fn sceKernelDcacheWritebackInvalidateAll();
pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32);
- pub fn sceKernelDcacheWritebackInvalidateRange(
- p: *const c_void,
- size: u32,
- );
+ pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void, size: u32);
pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32);
pub fn sceKernelIcacheInvalidateAll();
pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32);
- pub fn sceKernelUtilsMt19937Init(
- ctx: *mut SceKernelUtilsMt19937Context,
- seed: u32,
- ) -> i32;
- pub fn sceKernelUtilsMt19937UInt(
- ctx: *mut SceKernelUtilsMt19937Context,
- ) -> u32;
- pub fn sceKernelUtilsMd5Digest(
- data: *mut u8,
- size: u32,
- digest: *mut u8,
- ) -> i32;
- pub fn sceKernelUtilsMd5BlockInit(
- ctx: *mut SceKernelUtilsMd5Context,
- ) -> i32;
+ pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context, seed: u32) -> i32;
+ pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context) -> u32;
+ pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
+ pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context) -> i32;
pub fn sceKernelUtilsMd5BlockUpdate(
ctx: *mut SceKernelUtilsMd5Context,
data: *mut u8,
size: u32,
) -> i32;
- pub fn sceKernelUtilsMd5BlockResult(
- ctx: *mut SceKernelUtilsMd5Context,
- digest: *mut u8,
- ) -> i32;
- pub fn sceKernelUtilsSha1Digest(
- data: *mut u8,
- size: u32,
- digest: *mut u8,
- ) -> i32;
- pub fn sceKernelUtilsSha1BlockInit(
- ctx: *mut SceKernelUtilsSha1Context,
- ) -> i32;
+ pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context, digest: *mut u8)
+ -> i32;
+ pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
+ pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context) -> i32;
pub fn sceKernelUtilsSha1BlockUpdate(
ctx: *mut SceKernelUtilsSha1Context,
data: *mut u8,
@@ -2997,37 +2888,22 @@ extern "C" {
option: *mut SceKernelSMOption,
) -> i32;
pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32;
- pub fn sceKernelSelfStopUnloadModule(
- unknown: i32,
- arg_size: usize,
- argp: *mut c_void,
- ) -> i32;
+ pub fn sceKernelSelfStopUnloadModule(unknown: i32, arg_size: usize, argp: *mut c_void) -> i32;
pub fn sceKernelStopUnloadSelfModule(
arg_size: usize,
argp: *mut c_void,
status: *mut i32,
option: *mut SceKernelSMOption,
) -> i32;
- pub fn sceKernelQueryModuleInfo(
- mod_id: SceUid,
- info: *mut SceKernelModuleInfo,
- ) -> i32;
+ pub fn sceKernelQueryModuleInfo(mod_id: SceUid, info: *mut SceKernelModuleInfo) -> i32;
pub fn sceKernelGetModuleIdList(
read_buf: *mut SceUid,
read_buf_size: i32,
id_count: *mut i32,
) -> i32;
- pub fn sceKernelVolatileMemLock(
- unk: i32,
- ptr: *mut *mut c_void,
- size: *mut i32,
- ) -> i32;
- pub fn sceKernelVolatileMemTryLock(
- unk: i32,
- ptr: *mut *mut c_void,
- size: *mut i32,
- ) -> i32;
+ pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
+ pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32;
pub fn sceKernelStdin() -> SceUid;
@@ -3044,11 +2920,7 @@ extern "C" {
option: *mut SceKernelThreadOptParam,
) -> SceUid;
pub fn sceKernelDeleteThread(thid: SceUid) -> i32;
- pub fn sceKernelStartThread(
- id: SceUid,
- arg_len: usize,
- arg_p: *mut c_void,
- ) -> i32;
+ pub fn sceKernelStartThread(id: SceUid, arg_len: usize, arg_p: *mut c_void) -> i32;
pub fn sceKernelExitThread(status: i32) -> i32;
pub fn sceKernelExitDeleteThread(status: i32) -> i32;
pub fn sceKernelTerminateThread(thid: SceUid) -> i32;
@@ -3066,9 +2938,7 @@ extern "C" {
pub fn sceKernelDelayThread(delay: u32) -> i32;
pub fn sceKernelDelayThreadCB(delay: u32) -> i32;
pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32;
- pub fn sceKernelDelaySysClockThreadCB(
- delay: *mut SceKernelSysClock,
- ) -> i32;
+ pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock) -> i32;
pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32;
pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32;
pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32;
@@ -3078,10 +2948,7 @@ extern "C" {
pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32;
pub fn sceKernelCheckThreadStack() -> i32;
pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32;
- pub fn sceKernelReferThreadStatus(
- thid: SceUid,
- info: *mut SceKernelThreadInfo,
- ) -> i32;
+ pub fn sceKernelReferThreadStatus(thid: SceUid, info: *mut SceKernelThreadInfo) -> i32;
pub fn sceKernelReferThreadRunStatus(
thid: SceUid,
status: *mut SceKernelThreadRunStatus,
@@ -3095,21 +2962,10 @@ extern "C" {
) -> SceUid;
pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32;
pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32;
- pub fn sceKernelWaitSema(
- sema_id: SceUid,
- signal: i32,
- timeout: *mut u32,
- ) -> i32;
- pub fn sceKernelWaitSemaCB(
- sema_id: SceUid,
- signal: i32,
- timeout: *mut u32,
- ) -> i32;
+ pub fn sceKernelWaitSema(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
+ pub fn sceKernelWaitSemaCB(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32;
- pub fn sceKernelReferSemaStatus(
- sema_id: SceUid,
- info: *mut SceKernelSemaInfo,
- ) -> i32;
+ pub fn sceKernelReferSemaStatus(sema_id: SceUid, info: *mut SceKernelSemaInfo) -> i32;
pub fn sceKernelCreateEventFlag(
name: *const u8,
attr: i32,
@@ -3118,12 +2974,7 @@ extern "C" {
) -> SceUid;
pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32;
pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32;
- pub fn sceKernelPollEventFlag(
- ev_id: SceUid,
- bits: u32,
- wait: i32,
- out_bits: *mut u32,
- ) -> i32;
+ pub fn sceKernelPollEventFlag(ev_id: SceUid, bits: u32, wait: i32, out_bits: *mut u32) -> i32;
pub fn sceKernelWaitEventFlag(
ev_id: SceUid,
bits: u32,
@@ -3139,10 +2990,8 @@ extern "C" {
timeout: *mut u32,
) -> i32;
pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32;
- pub fn sceKernelReferEventFlagStatus(
- event: SceUid,
- status: *mut SceKernelEventFlagInfo,
- ) -> i32;
+ pub fn sceKernelReferEventFlagStatus(event: SceUid, status: *mut SceKernelEventFlagInfo)
+ -> i32;
pub fn sceKernelCreateMbx(
name: *const u8,
attr: u32,
@@ -3150,23 +2999,16 @@ extern "C" {
) -> SceUid;
pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32;
pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32;
- pub fn sceKernelReceiveMbx(
- mbx_id: SceUid,
- message: *mut *mut c_void,
- timeout: *mut u32,
- ) -> i32;
+ pub fn sceKernelReceiveMbx(mbx_id: SceUid, message: *mut *mut c_void, timeout: *mut u32)
+ -> i32;
pub fn sceKernelReceiveMbxCB(
mbx_id: SceUid,
message: *mut *mut c_void,
timeout: *mut u32,
) -> i32;
- pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void)
- -> i32;
+ pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) -> i32;
pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32;
- pub fn sceKernelReferMbxStatus(
- mbx_id: SceUid,
- info: *mut SceKernelMbxInfo,
- ) -> i32;
+ pub fn sceKernelReferMbxStatus(mbx_id: SceUid, info: *mut SceKernelMbxInfo) -> i32;
pub fn sceKernelSetAlarm(
clock: u32,
handler: SceKernelAlarmHandler,
@@ -3178,19 +3020,13 @@ extern "C" {
common: *mut c_void,
) -> SceUid;
pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32;
- pub fn sceKernelReferAlarmStatus(
- alarm_id: SceUid,
- info: *mut SceKernelAlarmInfo,
- ) -> i32;
+ pub fn sceKernelReferAlarmStatus(alarm_id: SceUid, info: *mut SceKernelAlarmInfo) -> i32;
pub fn sceKernelCreateCallback(
name: *const u8,
func: SceKernelCallbackFunction,
arg: *mut c_void,
) -> SceUid;
- pub fn sceKernelReferCallbackStatus(
- cb: SceUid,
- status: *mut SceKernelCallbackInfo,
- ) -> i32;
+ pub fn sceKernelReferCallbackStatus(cb: SceUid, status: *mut SceKernelCallbackInfo) -> i32;
pub fn sceKernelDeleteCallback(cb: SceUid) -> i32;
pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32;
pub fn sceKernelCancelCallback(cb: SceUid) -> i32;
@@ -3202,9 +3038,7 @@ extern "C" {
read_buf_size: i32,
id_count: *mut i32,
) -> i32;
- pub fn sceKernelReferSystemStatus(
- status: *mut SceKernelSystemStatus,
- ) -> i32;
+ pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus) -> i32;
pub fn sceKernelCreateMsgPipe(
name: *const u8,
part: i32,
@@ -3259,15 +3093,8 @@ extern "C" {
unk1: i32,
unk2: *mut c_void,
) -> i32;
- pub fn sceKernelCancelMsgPipe(
- uid: SceUid,
- send: *mut i32,
- recv: *mut i32,
- ) -> i32;
- pub fn sceKernelReferMsgPipeStatus(
- uid: SceUid,
- info: *mut SceKernelMppInfo,
- ) -> i32;
+ pub fn sceKernelCancelMsgPipe(uid: SceUid, send: *mut i32, recv: *mut i32) -> i32;
+ pub fn sceKernelReferMsgPipeStatus(uid: SceUid, info: *mut SceKernelMppInfo) -> i32;
pub fn sceKernelCreateVpl(
name: *const u8,
part: i32,
@@ -3288,17 +3115,10 @@ extern "C" {
data: *mut *mut c_void,
timeout: *mut u32,
) -> i32;
- pub fn sceKernelTryAllocateVpl(
- uid: SceUid,
- size: u32,
- data: *mut *mut c_void,
- ) -> i32;
+ pub fn sceKernelTryAllocateVpl(uid: SceUid, size: u32, data: *mut *mut c_void) -> i32;
pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32;
pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32;
- pub fn sceKernelReferVplStatus(
- uid: SceUid,
- info: *mut SceKernelVplInfo,
- ) -> i32;
+ pub fn sceKernelReferVplStatus(uid: SceUid, info: *mut SceKernelVplInfo) -> i32;
pub fn sceKernelCreateFpl(
name: *const u8,
part: i32,
@@ -3308,61 +3128,30 @@ extern "C" {
opt: *mut SceKernelFplOptParam,
) -> i32;
pub fn sceKernelDeleteFpl(uid: SceUid) -> i32;
- pub fn sceKernelAllocateFpl(
- uid: SceUid,
- data: *mut *mut c_void,
- timeout: *mut u32,
- ) -> i32;
- pub fn sceKernelAllocateFplCB(
- uid: SceUid,
- data: *mut *mut c_void,
- timeout: *mut u32,
- ) -> i32;
- pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void)
- -> i32;
+ pub fn sceKernelAllocateFpl(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
+ pub fn sceKernelAllocateFplCB(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
+ pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) -> i32;
pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32;
pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32;
- pub fn sceKernelReferFplStatus(
- uid: SceUid,
- info: *mut SceKernelFplInfo,
- ) -> i32;
- pub fn sceKernelUSec2SysClock(
- usec: u32,
- clock: *mut SceKernelSysClock,
- ) -> i32;
+ pub fn sceKernelReferFplStatus(uid: SceUid, info: *mut SceKernelFplInfo) -> i32;
+ pub fn sceKernelUSec2SysClock(usec: u32, clock: *mut SceKernelSysClock) -> i32;
pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64;
pub fn sceKernelSysClock2USec(
clock: *mut SceKernelSysClock,
low: *mut u32,
high: *mut u32,
) -> i32;
- pub fn sceKernelSysClock2USecWide(
- clock: i64,
- low: *mut u32,
- high: *mut u32,
- ) -> i32;
+ pub fn sceKernelSysClock2USecWide(clock: i64, low: *mut u32, high: *mut u32) -> i32;
pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetSystemTimeWide() -> i64;
pub fn sceKernelGetSystemTimeLow() -> u32;
- pub fn sceKernelCreateVTimer(
- name: *const u8,
- opt: *mut SceKernelVTimerOptParam,
- ) -> SceUid;
+ pub fn sceKernelCreateVTimer(name: *const u8, opt: *mut SceKernelVTimerOptParam) -> SceUid;
pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32;
- pub fn sceKernelGetVTimerBase(
- uid: SceUid,
- base: *mut SceKernelSysClock,
- ) -> i32;
+ pub fn sceKernelGetVTimerBase(uid: SceUid, base: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64;
- pub fn sceKernelGetVTimerTime(
- uid: SceUid,
- time: *mut SceKernelSysClock,
- ) -> i32;
+ pub fn sceKernelGetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64;
- pub fn sceKernelSetVTimerTime(
- uid: SceUid,
- time: *mut SceKernelSysClock,
- ) -> i32;
+ pub fn sceKernelSetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64;
pub fn sceKernelStartVTimer(uid: SceUid) -> i32;
pub fn sceKernelStopVTimer(uid: SceUid) -> i32;
@@ -3379,10 +3168,7 @@ extern "C" {
common: *mut c_void,
) -> i32;
pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32;
- pub fn sceKernelReferVTimerStatus(
- uid: SceUid,
- info: *mut SceKernelVTimerInfo,
- ) -> i32;
+ pub fn sceKernelReferVTimerStatus(uid: SceUid, info: *mut SceKernelVTimerInfo) -> i32;
pub fn sceKernelRegisterThreadEventHandler(
name: *const u8,
thread_id: SceUid,
@@ -3398,16 +3184,8 @@ extern "C" {
pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs;
pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs;
- pub fn sceUsbStart(
- driver_name: *const u8,
- size: i32,
- args: *mut c_void,
- ) -> i32;
- pub fn sceUsbStop(
- driver_name: *const u8,
- size: i32,
- args: *mut c_void,
- ) -> i32;
+ pub fn sceUsbStart(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
+ pub fn sceUsbStop(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
pub fn sceUsbActivate(pid: u32) -> i32;
pub fn sceUsbDeactivate(pid: u32) -> i32;
pub fn sceUsbGetState() -> i32;
@@ -3452,9 +3230,7 @@ extern "C" {
pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
- pub fn sceUsbCamGetImageEffectMode(
- effect_mode: *mut UsbCamEffectMode,
- ) -> i32;
+ pub fn sceUsbCamGetImageEffectMode(effect_mode: *mut UsbCamEffectMode) -> i32;
pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32;
pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32;
pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
@@ -3486,11 +3262,7 @@ extern "C" {
pub fn scePowerGetBusClockFrequency() -> i32;
pub fn scePowerGetBusClockFrequencyInt() -> i32;
pub fn scePowerGetBusClockFrequencyFloat() -> f32;
- pub fn scePowerSetClockFrequency(
- pllfreq: i32,
- cpufreq: i32,
- busfreq: i32,
- ) -> i32;
+ pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32, busfreq: i32) -> i32;
pub fn scePowerLock(unknown: i32) -> i32;
pub fn scePowerUnlock(unknown: i32) -> i32;
pub fn scePowerTick(t: PowerTick) -> i32;
@@ -3511,14 +3283,8 @@ extern "C" {
pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32;
pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32;
pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32;
- pub fn sceRtcConvertUtcToLocalTime(
- tick_utc: *const u64,
- tick_local: *mut u64,
- ) -> i32;
- pub fn sceRtcConvertLocalTimeToUTC(
- tick_local: *const u64,
- tick_utc: *mut u64,
- ) -> i32;
+ pub fn sceRtcConvertUtcToLocalTime(tick_utc: *const u64, tick_local: *mut u64) -> i32;
+ pub fn sceRtcConvertLocalTimeToUTC(tick_local: *const u64, tick_utc: *mut u64) -> i32;
pub fn sceRtcIsLeapYear(year: i32) -> i32;
pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32;
pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32;
@@ -3526,106 +3292,43 @@ extern "C" {
pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32;
pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32;
pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32;
- pub fn sceRtcTickAddTicks(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_ticks: u64,
- ) -> i32;
- pub fn sceRtcTickAddMicroseconds(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_ms: u64,
- ) -> i32;
- pub fn sceRtcTickAddSeconds(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_seconds: u64,
- ) -> i32;
- pub fn sceRtcTickAddMinutes(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_minutes: u64,
- ) -> i32;
- pub fn sceRtcTickAddHours(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_hours: u64,
- ) -> i32;
- pub fn sceRtcTickAddDays(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_days: u64,
- ) -> i32;
- pub fn sceRtcTickAddWeeks(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_weeks: u64,
- ) -> i32;
- pub fn sceRtcTickAddMonths(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_months: u64,
- ) -> i32;
- pub fn sceRtcTickAddYears(
- dest_tick: *mut u64,
- src_tick: *const u64,
- num_years: u64,
- ) -> i32;
- pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32;
- pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32)
+ pub fn sceRtcTickAddTicks(dest_tick: *mut u64, src_tick: *const u64, num_ticks: u64) -> i32;
+ pub fn sceRtcTickAddMicroseconds(dest_tick: *mut u64, src_tick: *const u64, num_ms: u64)
+ -> i32;
+ pub fn sceRtcTickAddSeconds(dest_tick: *mut u64, src_tick: *const u64, num_seconds: u64)
+ -> i32;
+ pub fn sceRtcTickAddMinutes(dest_tick: *mut u64, src_tick: *const u64, num_minutes: u64)
-> i32;
+ pub fn sceRtcTickAddHours(dest_tick: *mut u64, src_tick: *const u64, num_hours: u64) -> i32;
+ pub fn sceRtcTickAddDays(dest_tick: *mut u64, src_tick: *const u64, num_days: u64) -> i32;
+ pub fn sceRtcTickAddWeeks(dest_tick: *mut u64, src_tick: *const u64, num_weeks: u64) -> i32;
+ pub fn sceRtcTickAddMonths(dest_tick: *mut u64, src_tick: *const u64, num_months: u64) -> i32;
+ pub fn sceRtcTickAddYears(dest_tick: *mut u64, src_tick: *const u64, num_years: u64) -> i32;
+ pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32;
+ pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32;
pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32;
- pub fn sceRtcGetTime64_t(
- date: *const ScePspDateTime,
- time: *mut u64,
- ) -> i32;
+ pub fn sceRtcGetTime64_t(date: *const ScePspDateTime, time: *mut u64) -> i32;
pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
- pub fn sceRtcSetWin32FileTime(
- date: *mut ScePspDateTime,
- time: *mut u64,
- ) -> i32;
- pub fn sceRtcGetWin32FileTime(
- date: *mut ScePspDateTime,
- time: *mut u64,
- ) -> i32;
- pub fn sceRtcParseDateTime(
- dest_tick: *mut u64,
- date_string: *const u8,
- ) -> i32;
+ pub fn sceRtcSetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
+ pub fn sceRtcGetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
+ pub fn sceRtcParseDateTime(dest_tick: *mut u64, date_string: *const u8) -> i32;
pub fn sceRtcFormatRFC3339(
psz_date_time: *mut char,
p_utc: *const u64,
time_zone_minutes: i32,
) -> i32;
- pub fn sceRtcFormatRFC3339LocalTime(
- psz_date_time: *mut char,
- p_utc: *const u64,
- ) -> i32;
- pub fn sceRtcParseRFC3339(
- p_utc: *mut u64,
- psz_date_time: *const u8,
- ) -> i32;
+ pub fn sceRtcFormatRFC3339LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
+ pub fn sceRtcParseRFC3339(p_utc: *mut u64, psz_date_time: *const u8) -> i32;
pub fn sceRtcFormatRFC2822(
psz_date_time: *mut char,
p_utc: *const u64,
time_zone_minutes: i32,
) -> i32;
- pub fn sceRtcFormatRFC2822LocalTime(
- psz_date_time: *mut char,
- p_utc: *const u64,
- ) -> i32;
+ pub fn sceRtcFormatRFC2822LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
- pub fn sceIoOpen(
- file: *const u8,
- flags: i32,
- permissions: IoPermissions,
- ) -> SceUid;
- pub fn sceIoOpenAsync(
- file: *const u8,
- flags: i32,
- permissions: IoPermissions,
- ) -> SceUid;
+ pub fn sceIoOpen(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
+ pub fn sceIoOpenAsync(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
pub fn sceIoClose(fd: SceUid) -> i32;
pub fn sceIoCloseAsync(fd: SceUid) -> i32;
pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32;
@@ -3635,8 +3338,7 @@ extern "C" {
pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64;
pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32;
pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
- pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence)
- -> i32;
+ pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
pub fn sceIoRemove(file: *const u8) -> i32;
pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32;
pub fn sceIoRmdir(path: *const u8) -> i32;
@@ -3663,11 +3365,7 @@ extern "C" {
) -> i32;
pub fn sceIoUnassign(dev: *const u8) -> i32;
pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32;
- pub fn sceIoChstat(
- file: *const u8,
- stat: *mut SceIoStat,
- bits: i32,
- ) -> i32;
+ pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat, bits: i32) -> i32;
pub fn sceIoIoctl(
fd: SceUid,
cmd: u32,
@@ -3692,22 +3390,13 @@ extern "C" {
pub fn sceIoCancel(fd: SceUid) -> i32;
pub fn sceIoGetDevType(fd: SceUid) -> i32;
pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32;
- pub fn sceIoSetAsyncCallback(
- fd: SceUid,
- cb: SceUid,
- argp: *mut c_void,
- ) -> i32;
+ pub fn sceIoSetAsyncCallback(fd: SceUid, cb: SceUid, argp: *mut c_void) -> i32;
pub fn sceJpegInitMJpeg() -> i32;
pub fn sceJpegFinishMJpeg() -> i32;
pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32;
pub fn sceJpegDeleteMJpeg() -> i32;
- pub fn sceJpegDecodeMJpeg(
- jpeg_buf: *mut u8,
- size: usize,
- rgba: *mut c_void,
- unk: u32,
- ) -> i32;
+ pub fn sceJpegDecodeMJpeg(jpeg_buf: *mut u8, size: usize, rgba: *mut c_void, unk: u32) -> i32;
pub fn sceUmdCheckMedium() -> i32;
pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32;
@@ -3736,9 +3425,7 @@ extern "C" {
cb_param: *mut c_void,
) -> i32;
pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer);
- pub fn sceMpegRingbufferAvailableSize(
- ringbuffer: *mut SceMpegRingbuffer,
- ) -> i32;
+ pub fn sceMpegRingbufferAvailableSize(ringbuffer: *mut SceMpegRingbuffer) -> i32;
pub fn sceMpegRingbufferPut(
ringbuffer: *mut SceMpegRingbuffer,
num_packets: i32,
@@ -3755,41 +3442,22 @@ extern "C" {
unk2: i32,
) -> i32;
pub fn sceMpegDelete(handle: SceMpeg);
- pub fn sceMpegQueryStreamOffset(
- handle: SceMpeg,
- buffer: *mut c_void,
- offset: *mut i32,
- ) -> i32;
+ pub fn sceMpegQueryStreamOffset(handle: SceMpeg, buffer: *mut c_void, offset: *mut i32) -> i32;
pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32;
- pub fn sceMpegRegistStream(
- handle: SceMpeg,
- stream_id: i32,
- unk: i32,
- ) -> SceMpegStream;
+ pub fn sceMpegRegistStream(handle: SceMpeg, stream_id: i32, unk: i32) -> SceMpegStream;
pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream);
pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32;
pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void;
pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void);
- pub fn sceMpegQueryAtracEsSize(
- handle: SceMpeg,
- es_size: *mut i32,
- out_size: *mut i32,
- ) -> i32;
- pub fn sceMpegInitAu(
- handle: SceMpeg,
- es_buffer: *mut c_void,
- au: *mut SceMpegAu,
- ) -> i32;
+ pub fn sceMpegQueryAtracEsSize(handle: SceMpeg, es_size: *mut i32, out_size: *mut i32) -> i32;
+ pub fn sceMpegInitAu(handle: SceMpeg, es_buffer: *mut c_void, au: *mut SceMpegAu) -> i32;
pub fn sceMpegGetAvcAu(
handle: SceMpeg,
stream: SceMpegStream,
au: *mut SceMpegAu,
unk: *mut i32,
) -> i32;
- pub fn sceMpegAvcDecodeMode(
- handle: SceMpeg,
- mode: *mut SceMpegAvcMode,
- ) -> i32;
+ pub fn sceMpegAvcDecodeMode(handle: SceMpeg, mode: *mut SceMpegAvcMode) -> i32;
pub fn sceMpegAvcDecode(
handle: SceMpeg,
au: *mut SceMpegAu,
@@ -3816,11 +3484,7 @@ extern "C" {
init: i32,
) -> i32;
- pub fn sceMpegBaseYCrCbCopyVme(
- yuv_buffer: *mut c_void,
- buffer: *mut i32,
- type_: i32,
- ) -> i32;
+ pub fn sceMpegBaseYCrCbCopyVme(yuv_buffer: *mut c_void, buffer: *mut i32, type_: i32) -> i32;
pub fn sceMpegBaseCscInit(width: i32) -> i32;
pub fn sceMpegBaseCscVme(
rgb_buffer: *mut c_void,
@@ -3838,22 +3502,9 @@ extern "C" {
pub fn sceHprmIsMicrophoneExist() -> i32;
pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32);
- pub fn sceGuDispBuffer(
- width: i32,
- height: i32,
- dispbp: *mut c_void,
- dispbw: i32,
- );
- pub fn sceGuDrawBuffer(
- psm: DisplayPixelFormat,
- fbp: *mut c_void,
- fbw: i32,
- );
- pub fn sceGuDrawBufferList(
- psm: DisplayPixelFormat,
- fbp: *mut c_void,
- fbw: i32,
- );
+ pub fn sceGuDispBuffer(width: i32, height: i32, dispbp: *mut c_void, dispbw: i32);
+ pub fn sceGuDrawBuffer(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
+ pub fn sceGuDrawBufferList(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
pub fn sceGuDisplay(state: bool) -> bool;
pub fn sceGuDepthFunc(function: DepthFunc);
pub fn sceGuDepthMask(mask: i32);
@@ -3864,10 +3515,7 @@ extern "C" {
pub fn sceGuTerm();
pub fn sceGuBreak(mode: i32);
pub fn sceGuContinue();
- pub fn sceGuSetCallback(
- signal: GuCallbackId,
- callback: GuCallback,
- ) -> GuCallback;
+ pub fn sceGuSetCallback(signal: GuCallbackId, callback: GuCallback) -> GuCallback;
pub fn sceGuSignal(behavior: SignalBehavior, signal: i32);
pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32);
pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32);
@@ -3878,16 +3526,9 @@ extern "C" {
pub fn sceGuCallList(list: *const c_void);
pub fn sceGuCallMode(mode: i32);
pub fn sceGuCheckList() -> i32;
- pub fn sceGuSendList(
- mode: GuQueueMode,
- list: *const c_void,
- context: *mut GeContext,
- );
+ pub fn sceGuSendList(mode: GuQueueMode, list: *const c_void, context: *mut GeContext);
pub fn sceGuSwapBuffers() -> *mut c_void;
- pub fn sceGuSync(
- mode: GuSyncMode,
- behavior: GuSyncBehavior,
- ) -> GeListState;
+ pub fn sceGuSync(mode: GuSyncMode, behavior: GuSyncBehavior) -> GeListState;
pub fn sceGuDrawArray(
prim: GuPrimitive,
vtype: i32,
@@ -3908,21 +3549,11 @@ extern "C" {
pub fn sceGuGetAllStatus() -> i32;
pub fn sceGuEnable(state: GuState);
pub fn sceGuDisable(state: GuState);
- pub fn sceGuLight(
- light: i32,
- type_: LightType,
- components: i32,
- position: &ScePspFVector3,
- );
+ pub fn sceGuLight(light: i32, type_: LightType, components: i32, position: &ScePspFVector3);
pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32);
pub fn sceGuLightColor(light: i32, component: i32, color: u32);
pub fn sceGuLightMode(mode: LightMode);
- pub fn sceGuLightSpot(
- light: i32,
- direction: &ScePspFVector3,
- exponent: f32,
- cutoff: f32,
- );
+ pub fn sceGuLightSpot(light: i32, direction: &ScePspFVector3, exponent: f32, cutoff: f32);
pub fn sceGuClear(flags: i32);
pub fn sceGuClearColor(color: u32);
pub fn sceGuClearDepth(depth: u32);
@@ -3934,26 +3565,11 @@ extern "C" {
pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32);
pub fn sceGuAmbient(color: u32);
pub fn sceGuAmbientColor(color: u32);
- pub fn sceGuBlendFunc(
- op: BlendOp,
- src: BlendSrc,
- dest: BlendDst,
- src_fix: u32,
- dest_fix: u32,
- );
+ pub fn sceGuBlendFunc(op: BlendOp, src: BlendSrc, dest: BlendDst, src_fix: u32, dest_fix: u32);
pub fn sceGuMaterial(components: i32, color: u32);
- pub fn sceGuModelColor(
- emissive: u32,
- ambient: u32,
- diffuse: u32,
- specular: u32,
- );
+ pub fn sceGuModelColor(emissive: u32, ambient: u32, diffuse: u32, specular: u32);
pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32);
- pub fn sceGuStencilOp(
- fail: StencilOperation,
- zfail: StencilOperation,
- zpass: StencilOperation,
- );
+ pub fn sceGuStencilOp(fail: StencilOperation, zfail: StencilOperation, zpass: StencilOperation);
pub fn sceGuSpecular(power: f32);
pub fn sceGuFrontFace(order: FrontFaceDirection);
pub fn sceGuLogicalOp(op: LogicalOperation);
@@ -3985,12 +3601,7 @@ extern "C" {
);
pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32);
pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32);
- pub fn sceGuTexMode(
- tpsm: TexturePixelFormat,
- maxmips: i32,
- a2: i32,
- swizzle: i32,
- );
+ pub fn sceGuTexMode(tpsm: TexturePixelFormat, maxmips: i32, a2: i32, swizzle: i32);
pub fn sceGuTexOffset(u: f32, v: f32);
pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode);
pub fn sceGuTexScale(u: f32, v: f32);
@@ -3998,12 +3609,7 @@ extern "C" {
pub fn sceGuTexSync();
pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode);
pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void);
- pub fn sceGuClutMode(
- cpsm: ClutPixelFormat,
- shift: u32,
- mask: u32,
- a3: u32,
- );
+ pub fn sceGuClutMode(cpsm: ClutPixelFormat, shift: u32, mask: u32, a3: u32);
pub fn sceGuOffset(x: u32, y: u32);
pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32);
pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32);
@@ -4073,21 +3679,10 @@ extern "C" {
pub fn sceGumFullInverse();
pub fn sceGumLoadIdentity();
pub fn sceGumLoadMatrix(m: &ScePspFMatrix4);
- pub fn sceGumLookAt(
- eye: &ScePspFVector3,
- center: &ScePspFVector3,
- up: &ScePspFVector3,
- );
+ pub fn sceGumLookAt(eye: &ScePspFVector3, center: &ScePspFVector3, up: &ScePspFVector3);
pub fn sceGumMatrixMode(mode: MatrixMode);
pub fn sceGumMultMatrix(m: &ScePspFMatrix4);
- pub fn sceGumOrtho(
- left: f32,
- right: f32,
- bottom: f32,
- top: f32,
- near: f32,
- far: f32,
- );
+ pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32);
pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
pub fn sceGumPopMatrix();
pub fn sceGumPushMatrix();
@@ -4124,11 +3719,7 @@ extern "C" {
pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32;
pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32;
- pub fn sceRegOpenRegistry(
- reg: *mut Key,
- mode: i32,
- handle: *mut RegHandle,
- ) -> i32;
+ pub fn sceRegOpenRegistry(reg: *mut Key, mode: i32, handle: *mut RegHandle) -> i32;
pub fn sceRegFlushRegistry(handle: RegHandle) -> i32;
pub fn sceRegCloseRegistry(handle: RegHandle) -> i32;
pub fn sceRegOpenCategory(
@@ -4172,21 +3763,13 @@ extern "C" {
size: usize,
) -> i32;
pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32;
- pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32)
- -> i32;
- pub fn sceRegCreateKey(
- dir_handle: RegHandle,
- name: *const u8,
- type_: i32,
- size: usize,
- ) -> i32;
+ pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) -> i32;
+ pub fn sceRegCreateKey(dir_handle: RegHandle, name: *const u8, type_: i32, size: usize) -> i32;
pub fn sceRegRemoveRegistry(key: *mut Key) -> i32;
pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32;
- pub fn sceUtilityMsgDialogInitStart(
- params: *mut UtilityMsgDialogParams,
- ) -> i32;
+ pub fn sceUtilityMsgDialogInitStart(params: *mut UtilityMsgDialogParams) -> i32;
pub fn sceUtilityMsgDialogShutdownStart();
pub fn sceUtilityMsgDialogGetStatus() -> i32;
pub fn sceUtilityMsgDialogUpdate(n: i32);
@@ -4196,43 +3779,23 @@ extern "C" {
pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32;
pub fn sceUtilityNetconfGetStatus() -> i32;
pub fn sceUtilityCheckNetParam(id: i32) -> i32;
- pub fn sceUtilityGetNetParam(
- conf: i32,
- param: NetParam,
- data: *mut UtilityNetData,
- ) -> i32;
- pub fn sceUtilitySavedataInitStart(
- params: *mut SceUtilitySavedataParam,
- ) -> i32;
+ pub fn sceUtilityGetNetParam(conf: i32, param: NetParam, data: *mut UtilityNetData) -> i32;
+ pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam) -> i32;
pub fn sceUtilitySavedataGetStatus() -> i32;
pub fn sceUtilitySavedataShutdownStart() -> i32;
pub fn sceUtilitySavedataUpdate(unknown: i32);
- pub fn sceUtilityGameSharingInitStart(
- params: *mut UtilityGameSharingParams,
- ) -> i32;
+ pub fn sceUtilityGameSharingInitStart(params: *mut UtilityGameSharingParams) -> i32;
pub fn sceUtilityGameSharingShutdownStart();
pub fn sceUtilityGameSharingGetStatus() -> i32;
pub fn sceUtilityGameSharingUpdate(n: i32);
- pub fn sceUtilityHtmlViewerInitStart(
- params: *mut UtilityHtmlViewerParam,
- ) -> i32;
+ pub fn sceUtilityHtmlViewerInitStart(params: *mut UtilityHtmlViewerParam) -> i32;
pub fn sceUtilityHtmlViewerShutdownStart() -> i32;
pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32;
pub fn sceUtilityHtmlViewerGetStatus() -> i32;
pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32;
- pub fn sceUtilitySetSystemParamString(
- id: SystemParamId,
- str: *const u8,
- ) -> i32;
- pub fn sceUtilityGetSystemParamInt(
- id: SystemParamId,
- value: *mut i32,
- ) -> i32;
- pub fn sceUtilityGetSystemParamString(
- id: SystemParamId,
- str: *mut u8,
- len: i32,
- ) -> i32;
+ pub fn sceUtilitySetSystemParamString(id: SystemParamId, str: *const u8) -> i32;
+ pub fn sceUtilityGetSystemParamInt(id: SystemParamId, value: *mut i32) -> i32;
+ pub fn sceUtilityGetSystemParamString(id: SystemParamId, str: *mut u8, len: i32) -> i32;
pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32;
pub fn sceUtilityOskShutdownStart() -> i32;
pub fn sceUtilityOskUpdate(n: i32) -> i32;
@@ -4291,48 +3854,29 @@ extern "C" {
timeout: u32,
unknown: i32,
) -> i32;
- pub fn sceNetAdhocctlGetGameModeInfo(
- gamemodeinfo: *mut SceNetAdhocctlGameModeInfo,
- ) -> i32;
+ pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo: *mut SceNetAdhocctlGameModeInfo) -> i32;
pub fn sceNetAdhocctlExitGameMode() -> i32;
- pub fn sceNetAdhocctlGetPeerList(
- length: *mut i32,
- buf: *mut c_void,
- ) -> i32;
+ pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void) -> i32;
pub fn sceNetAdhocctlGetPeerInfo(
mac: *mut u8,
size: i32,
peerinfo: *mut SceNetAdhocctlPeerInfo,
) -> i32;
pub fn sceNetAdhocctlScan() -> i32;
- pub fn sceNetAdhocctlGetScanInfo(
- length: *mut i32,
- buf: *mut c_void,
- ) -> i32;
- pub fn sceNetAdhocctlAddHandler(
- handler: SceNetAdhocctlHandler,
- unknown: *mut c_void,
- ) -> i32;
+ pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void) -> i32;
+ pub fn sceNetAdhocctlAddHandler(handler: SceNetAdhocctlHandler, unknown: *mut c_void) -> i32;
pub fn sceNetAdhocctlDelHandler(id: i32) -> i32;
- pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8)
- -> i32;
+ pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) -> i32;
pub fn sceNetAdhocctlGetAddrByName(
nickname: *mut u8,
length: *mut i32,
buf: *mut c_void,
) -> i32;
- pub fn sceNetAdhocctlGetParameter(
- params: *mut SceNetAdhocctlParams,
- ) -> i32;
+ pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams) -> i32;
pub fn sceNetAdhocInit() -> i32;
pub fn sceNetAdhocTerm() -> i32;
- pub fn sceNetAdhocPdpCreate(
- mac: *mut u8,
- port: u16,
- buf_size: u32,
- unk1: i32,
- ) -> i32;
+ pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16, buf_size: u32, unk1: i32) -> i32;
pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32;
pub fn sceNetAdhocPdpSend(
id: i32,
@@ -4352,19 +3896,9 @@ extern "C" {
timeout: u32,
nonblock: i32,
) -> i32;
- pub fn sceNetAdhocGetPdpStat(
- size: *mut i32,
- stat: *mut SceNetAdhocPdpStat,
- ) -> i32;
- pub fn sceNetAdhocGameModeCreateMaster(
- data: *mut c_void,
- size: i32,
- ) -> i32;
- pub fn sceNetAdhocGameModeCreateReplica(
- mac: *mut u8,
- data: *mut c_void,
- size: i32,
- ) -> i32;
+ pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut SceNetAdhocPdpStat) -> i32;
+ pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32) -> i32;
+ pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8, data: *mut c_void, size: i32) -> i32;
pub fn sceNetAdhocGameModeUpdateMaster() -> i32;
pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32;
pub fn sceNetAdhocGameModeDeleteMaster() -> i32;
@@ -4412,10 +3946,7 @@ extern "C" {
) -> i32;
pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32;
pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32;
- pub fn sceNetAdhocGetPtpStat(
- size: *mut i32,
- stat: *mut SceNetAdhocPtpStat,
- ) -> i32;
+ pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut SceNetAdhocPtpStat) -> i32;
}
extern "C" {
@@ -4449,10 +3980,7 @@ extern "C" {
opt_len: i32,
opt_data: *mut c_void,
) -> i32;
- pub fn sceNetAdhocMatchingCancelTarget(
- matching_id: i32,
- mac: *mut u8,
- ) -> i32;
+ pub fn sceNetAdhocMatchingCancelTarget(matching_id: i32, mac: *mut u8) -> i32;
pub fn sceNetAdhocMatchingCancelTargetWithOpt(
matching_id: i32,
mac: *mut u8,
@@ -4465,10 +3993,7 @@ extern "C" {
data_len: i32,
data: *mut c_void,
) -> i32;
- pub fn sceNetAdhocMatchingAbortSendData(
- matching_id: i32,
- mac: *mut u8,
- ) -> i32;
+ pub fn sceNetAdhocMatchingAbortSendData(matching_id: i32, mac: *mut u8) -> i32;
pub fn sceNetAdhocMatchingSetHelloOpt(
matching_id: i32,
opt_len: i32,
@@ -4485,21 +4010,14 @@ extern "C" {
buf: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32;
- pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat)
- -> i32;
+ pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) -> i32;
}
extern "C" {
pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32;
pub fn sceNetApctlTerm() -> i32;
- pub fn sceNetApctlGetInfo(
- code: ApctlInfo,
- pinfo: *mut SceNetApctlInfo,
- ) -> i32;
- pub fn sceNetApctlAddHandler(
- handler: SceNetApctlHandler,
- parg: *mut c_void,
- ) -> i32;
+ pub fn sceNetApctlGetInfo(code: ApctlInfo, pinfo: *mut SceNetApctlInfo) -> i32;
+ pub fn sceNetApctlAddHandler(handler: SceNetApctlHandler, parg: *mut c_void) -> i32;
pub fn sceNetApctlDelHandler(handler_id: i32) -> i32;
pub fn sceNetApctlConnect(conn_index: i32) -> i32;
pub fn sceNetApctlDisconnect() -> i32;
@@ -4507,21 +4025,9 @@ extern "C" {
pub fn sceNetInetInit() -> i32;
pub fn sceNetInetTerm() -> i32;
- pub fn sceNetInetAccept(
- s: i32,
- addr: *mut sockaddr,
- addr_len: *mut socklen_t,
- ) -> i32;
- pub fn sceNetInetBind(
- s: i32,
- my_addr: *const sockaddr,
- addr_len: socklen_t,
- ) -> i32;
- pub fn sceNetInetConnect(
- s: i32,
- serv_addr: *const sockaddr,
- addr_len: socklen_t,
- ) -> i32;
+ pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr, addr_len: *mut socklen_t) -> i32;
+ pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr, addr_len: socklen_t) -> i32;
+ pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr, addr_len: socklen_t) -> i32;
pub fn sceNetInetGetsockopt(
s: i32,
level: i32,
@@ -4530,12 +4036,7 @@ extern "C" {
optl_en: *mut socklen_t,
) -> i32;
pub fn sceNetInetListen(s: i32, backlog: i32) -> i32;
- pub fn sceNetInetRecv(
- s: i32,
- buf: *mut c_void,
- len: usize,
- flags: i32,
- ) -> usize;
+ pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize, flags: i32) -> usize;
pub fn sceNetInetRecvfrom(
s: i32,
buf: *mut c_void,
@@ -4544,12 +4045,7 @@ extern "C" {
from: *mut sockaddr,
from_len: *mut socklen_t,
) -> usize;
- pub fn sceNetInetSend(
- s: i32,
- buf: *const c_void,
- len: usize,
- flags: i32,
- ) -> usize;
+ pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize, flags: i32) -> usize;
pub fn sceNetInetSendto(
s: i32,
buf: *const c_void,
@@ -4577,11 +4073,7 @@ extern "C" {
pub fn sceHttpInit(unknown1: u32) -> i32;
pub fn sceHttpEnd() -> i32;
- pub fn sceHttpCreateTemplate(
- agent: *mut u8,
- unknown1: i32,
- unknown2: i32,
- ) -> i32;
+ pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32, unknown2: i32) -> i32;
pub fn sceHttpDeleteTemplate(templateid: i32) -> i32;
pub fn sceHttpCreateConnection(
templateid: i32,
@@ -4590,11 +4082,7 @@ extern "C" {
port: u16,
unknown2: i32,
) -> i32;
- pub fn sceHttpCreateConnectionWithURL(
- templateid: i32,
- url: *const u8,
- unknown1: i32,
- ) -> i32;
+ pub fn sceHttpCreateConnectionWithURL(templateid: i32, url: *const u8, unknown1: i32) -> i32;
pub fn sceHttpDeleteConnection(connection_id: i32) -> i32;
pub fn sceHttpCreateRequest(
connection_id: i32,
@@ -4609,23 +4097,11 @@ extern "C" {
content_length: u64,
) -> i32;
pub fn sceHttpDeleteRequest(request_id: i32) -> i32;
- pub fn sceHttpSendRequest(
- request_id: i32,
- data: *mut c_void,
- data_size: u32,
- ) -> i32;
+ pub fn sceHttpSendRequest(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
pub fn sceHttpAbortRequest(request_id: i32) -> i32;
- pub fn sceHttpReadData(
- request_id: i32,
- data: *mut c_void,
- data_size: u32,
- ) -> i32;
- pub fn sceHttpGetContentLength(
- request_id: i32,
- content_length: *mut u64,
- ) -> i32;
- pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32)
- -> i32;
+ pub fn sceHttpReadData(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
+ pub fn sceHttpGetContentLength(request_id: i32, content_length: *mut u64) -> i32;
+ pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) -> i32;
pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32;
pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32;
pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32;
@@ -4639,19 +4115,9 @@ extern "C" {
pub fn sceHttpDisableCookie(id: i32) -> i32;
pub fn sceHttpSaveSystemCookie() -> i32;
pub fn sceHttpLoadSystemCookie() -> i32;
- pub fn sceHttpAddExtraHeader(
- id: i32,
- name: *mut u8,
- value: *mut u8,
- unknown1: i32,
- ) -> i32;
+ pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8, value: *mut u8, unknown1: i32) -> i32;
pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32;
- pub fn sceHttpsInit(
- unknown1: i32,
- unknown2: i32,
- unknown3: i32,
- unknown4: i32,
- ) -> i32;
+ pub fn sceHttpsInit(unknown1: i32, unknown2: i32, unknown3: i32, unknown4: i32) -> i32;
pub fn sceHttpsEnd() -> i32;
pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32;
pub fn sceHttpDisableAuth(id: i32) -> i32;
@@ -4659,11 +4125,7 @@ extern "C" {
pub fn sceHttpEnableAuth(id: i32) -> i32;
pub fn sceHttpEnableCache(id: i32) -> i32;
pub fn sceHttpEndCache() -> i32;
- pub fn sceHttpGetAllHeader(
- request: i32,
- header: *mut *mut u8,
- header_size: *mut u32,
- ) -> i32;
+ pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8, header_size: *mut u32) -> i32;
pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32;
pub fn sceHttpGetProxy(
id: i32,
@@ -4690,11 +4152,7 @@ extern "C" {
) -> i32;
pub fn sceNetResolverInit() -> i32;
- pub fn sceNetResolverCreate(
- rid: *mut i32,
- buf: *mut c_void,
- buf_length: u32,
- ) -> i32;
+ pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void, buf_length: u32) -> i32;
pub fn sceNetResolverDelete(rid: i32) -> i32;
pub fn sceNetResolverStartNtoA(
rid: i32,
diff --git a/src/solid/aarch64.rs b/src/solid/aarch64.rs
new file mode 100644
index 0000000000000..ceabea397b804
--- /dev/null
+++ b/src/solid/aarch64.rs
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff --git a/src/solid/arm.rs b/src/solid/arm.rs
new file mode 100644
index 0000000000000..04cc1542deaeb
--- /dev/null
+++ b/src/solid/arm.rs
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff --git a/src/solid/mod.rs b/src/solid/mod.rs
new file mode 100644
index 0000000000000..f0f2ae89bde90
--- /dev/null
+++ b/src/solid/mod.rs
@@ -0,0 +1,904 @@
+//! Interface to the [SOLID] C library
+//!
+//! [SOLID]: https://solid.kmckk.com/
+
+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 uintptr_t = usize;
+pub type intptr_t = isize;
+pub type ptrdiff_t = isize;
+pub type size_t = ::uintptr_t;
+pub type ssize_t = ::intptr_t;
+
+pub type clock_t = c_uint;
+pub type time_t = i64;
+pub type clockid_t = c_int;
+pub type timer_t = c_int;
+pub type suseconds_t = c_int;
+pub type useconds_t = c_uint;
+
+pub type sighandler_t = size_t;
+
+// sys/ansi.h
+pub type __caddr_t = *mut c_char;
+pub type __gid_t = u32;
+pub type __in_addr_t = u32;
+pub type __in_port_t = u16;
+pub type __mode_t = u32;
+pub type __off_t = i64;
+pub type __pid_t = i32;
+pub type __sa_family_t = u8;
+pub type __socklen_t = c_uint;
+pub type __uid_t = u32;
+pub type __fsblkcnt_t = u64;
+pub type __fsfilcnt_t = u64;
+
+// locale.h
+pub type locale_t = usize;
+
+// nl_types.h
+pub type nl_item = c_long;
+
+// sys/types.h
+pub type __va_list = *mut c_char;
+pub type u_int8_t = u8;
+pub type u_int16_t = u16;
+pub type u_int32_t = u32;
+pub type u_int64_t = u64;
+pub type u_char = c_uchar;
+pub type u_short = c_ushort;
+pub type u_int = c_uint;
+pub type u_long = c_ulong;
+pub type unchar = c_uchar;
+pub type ushort = c_ushort;
+pub type uint = c_uint;
+pub type ulong = c_ulong;
+pub type u_quad_t = u64;
+pub type quad_t = i64;
+pub type qaddr_t = *mut quad_t;
+pub type longlong_t = i64;
+pub type u_longlong_t = u64;
+pub type blkcnt_t = i64;
+pub type blksize_t = i32;
+pub type fsblkcnt_t = __fsblkcnt_t;
+pub type fsfilcnt_t = __fsfilcnt_t;
+pub type caddr_t = __caddr_t;
+pub type daddr_t = i64;
+pub type dev_t = u64;
+pub type fixpt_t = u32;
+pub type gid_t = __gid_t;
+pub type idtype_t = c_int;
+pub type id_t = u32;
+pub type ino_t = u64;
+pub type key_t = c_long;
+pub type mode_t = __mode_t;
+pub type nlink_t = u32;
+pub type off_t = __off_t;
+pub type pid_t = __pid_t;
+pub type lwpid_t = i32;
+pub type rlim_t = u64;
+pub type segsz_t = i32;
+pub type swblk_t = i32;
+pub type mqd_t = c_int;
+pub type cpuid_t = c_ulong;
+pub type psetid_t = c_int;
+
+s! {
+ // stat.h
+ pub struct stat {
+ pub st_dev: dev_t,
+ pub st_ino: ino_t,
+ pub st_mode: c_short,
+ pub st_nlink: c_short,
+ pub st_uid: c_short,
+ pub st_gid: c_short,
+ pub st_rdev: dev_t,
+ pub st_size: off_t,
+ pub st_atime: time_t,
+ pub st_mtime: time_t,
+ pub st_ctime: time_t,
+ pub st_blksize: blksize_t,
+ }
+
+ // time.h
+ pub struct tm {
+ pub tm_sec: c_int,
+ pub tm_min: c_int,
+ pub tm_hour: c_int,
+ pub tm_mday: c_int,
+ pub tm_mon: c_int,
+ pub tm_year: c_int,
+ pub tm_wday: c_int,
+ pub tm_yday: c_int,
+ pub tm_isdst: c_int,
+ pub tm_gmtoff: c_long,
+ pub tm_zone: *mut c_char,
+ }
+
+ // stdlib.h
+ pub struct qdiv_t {
+ pub quot: quad_t,
+ pub rem: quad_t,
+ }
+ pub struct lldiv_t {
+ pub quot: c_longlong,
+ pub rem: c_longlong,
+ }
+ pub struct div_t {
+ pub quot: c_int,
+ pub rem: c_int,
+ }
+ pub struct ldiv_t {
+ pub quot: c_long,
+ pub rem: c_long,
+ }
+
+ // locale.h
+ pub struct lconv {
+ pub decimal_point: *mut c_char,
+ pub thousands_sep: *mut c_char,
+ pub grouping: *mut c_char,
+ pub int_curr_symbol: *mut c_char,
+ pub currency_symbol: *mut c_char,
+ pub mon_decimal_point: *mut c_char,
+ pub mon_thousands_sep: *mut c_char,
+ pub mon_grouping: *mut c_char,
+ pub positive_sign: *mut c_char,
+ pub negative_sign: *mut c_char,
+ pub int_frac_digits: c_char,
+ pub frac_digits: c_char,
+ pub p_cs_precedes: c_char,
+ pub p_sep_by_space: c_char,
+ pub n_cs_precedes: c_char,
+ pub n_sep_by_space: c_char,
+ pub p_sign_posn: c_char,
+ pub n_sign_posn: c_char,
+ pub int_p_cs_precedes: c_char,
+ pub int_n_cs_precedes: c_char,
+ pub int_p_sep_by_space: c_char,
+ pub int_n_sep_by_space: c_char,
+ pub int_p_sign_posn: c_char,
+ pub int_n_sign_posn: c_char,
+ }
+
+ pub struct iovec {
+ pub iov_base: *mut c_void,
+ pub iov_len: size_t,
+ }
+
+ pub struct timeval {
+ pub tv_sec: c_long,
+ pub tv_usec: c_long,
+ }
+}
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const EXIT_FAILURE: c_int = 1;
+pub const EXIT_SUCCESS: c_int = 0;
+pub const RAND_MAX: c_int = 0x7fffffff;
+pub const EOF: c_int = -1;
+pub const SEEK_SET: c_int = 0;
+pub const SEEK_CUR: c_int = 1;
+pub const SEEK_END: c_int = 2;
+pub const _IOFBF: c_int = 0;
+pub const _IONBF: c_int = 2;
+pub const _IOLBF: c_int = 1;
+pub const BUFSIZ: c_uint = 1024;
+pub const FOPEN_MAX: c_uint = 20;
+pub const FILENAME_MAX: c_uint = 1024;
+
+pub const O_RDONLY: c_int = 1;
+pub const O_WRONLY: c_int = 2;
+pub const O_RDWR: c_int = 4;
+pub const O_APPEND: c_int = 8;
+pub const O_CREAT: c_int = 0x10;
+pub const O_EXCL: c_int = 0x400;
+pub const O_TEXT: c_int = 0x100;
+pub const O_BINARY: c_int = 0x200;
+pub const O_TRUNC: c_int = 0x20;
+pub const S_IEXEC: c_short = 0x0040;
+pub const S_IWRITE: c_short = 0x0080;
+pub const S_IREAD: c_short = 0x0100;
+pub const S_IFCHR: c_short = 0x2000;
+pub const S_IFDIR: c_short = 0x4000;
+pub const S_IFMT: c_short = 0o160000;
+pub const S_IFIFO: c_short = 0o0010000;
+pub const S_IFBLK: c_short = 0o0060000;
+pub const S_IFREG: c_short = 0o0100000;
+
+pub const LC_ALL: c_int = 0;
+pub const LC_COLLATE: c_int = 1;
+pub const LC_CTYPE: c_int = 2;
+pub const LC_MONETARY: c_int = 3;
+pub const LC_NUMERIC: c_int = 4;
+pub const LC_TIME: c_int = 5;
+pub const LC_MESSAGES: c_int = 6;
+pub const _LC_LAST: c_int = 7;
+
+pub const EPERM: c_int = 1;
+pub const ENOENT: c_int = 2;
+pub const ESRCH: c_int = 3;
+pub const EINTR: c_int = 4;
+pub const EIO: c_int = 5;
+pub const ENXIO: c_int = 6;
+pub const E2BIG: c_int = 7;
+pub const ENOEXEC: c_int = 8;
+pub const EBADF: c_int = 9;
+pub const ECHILD: c_int = 10;
+pub const EAGAIN: c_int = 11;
+pub const ENOMEM: c_int = 12;
+pub const EACCES: c_int = 13;
+pub const EFAULT: c_int = 14;
+pub const ENOTBLK: c_int = 15;
+pub const EBUSY: c_int = 16;
+pub const EEXIST: c_int = 17;
+pub const EXDEV: c_int = 18;
+pub const ENODEV: c_int = 19;
+pub const ENOTDIR: c_int = 20;
+pub const EISDIR: c_int = 21;
+pub const EINVAL: c_int = 22;
+pub const ENFILE: c_int = 23;
+pub const EMFILE: c_int = 24;
+pub const ENOTTY: c_int = 25;
+pub const ETXTBSY: c_int = 26;
+pub const EFBIG: c_int = 27;
+pub const ENOSPC: c_int = 28;
+pub const ESPIPE: c_int = 29;
+pub const EROFS: c_int = 30;
+pub const EMLINK: c_int = 31;
+pub const EPIPE: c_int = 32;
+pub const EDOM: c_int = 33;
+pub const ERANGE: c_int = 34;
+
+pub const EDEADLK: c_int = 35;
+pub const ENAMETOOLONG: c_int = 36;
+pub const ENOLCK: c_int = 37;
+pub const ENOSYS: c_int = 38;
+pub const ENOTEMPTY: c_int = 39;
+pub const ELOOP: c_int = 40;
+pub const EWOULDBLOCK: c_int = EAGAIN;
+pub const ENOMSG: c_int = 42;
+pub const EIDRM: c_int = 43;
+pub const ECHRNG: c_int = 44;
+pub const EL2NSYNC: c_int = 45;
+pub const EL3HLT: c_int = 46;
+pub const EL3RST: c_int = 47;
+pub const ELNRNG: c_int = 48;
+pub const EUNATCH: c_int = 49;
+pub const ENOCSI: c_int = 50;
+pub const EL2HLT: c_int = 51;
+pub const EBADE: c_int = 52;
+pub const EBADR: c_int = 53;
+pub const EXFULL: c_int = 54;
+pub const ENOANO: c_int = 55;
+pub const EBADRQC: c_int = 56;
+pub const EBADSLT: c_int = 57;
+
+pub const EDEADLOCK: c_int = EDEADLK;
+
+pub const EBFONT: c_int = 59;
+pub const ENOSTR: c_int = 60;
+pub const ENODATA: c_int = 61;
+pub const ETIME: c_int = 62;
+pub const ENOSR: c_int = 63;
+pub const ENONET: c_int = 64;
+pub const ENOPKG: c_int = 65;
+pub const EREMOTE: c_int = 66;
+pub const ENOLINK: c_int = 67;
+pub const EADV: c_int = 68;
+pub const ESRMNT: c_int = 69;
+pub const ECOMM: c_int = 70;
+pub const EPROTO: c_int = 71;
+pub const EMULTIHOP: c_int = 72;
+pub const EDOTDOT: c_int = 73;
+pub const EBADMSG: c_int = 74;
+pub const EOVERFLOW: c_int = 75;
+pub const ENOTUNIQ: c_int = 76;
+pub const EBADFD: c_int = 77;
+pub const EREMCHG: c_int = 78;
+pub const ELIBACC: c_int = 79;
+pub const ELIBBAD: c_int = 80;
+pub const ELIBSCN: c_int = 81;
+pub const ELIBMAX: c_int = 82;
+pub const ELIBEXEC: c_int = 83;
+pub const EILSEQ: c_int = 84;
+pub const ERESTART: c_int = 85;
+pub const ESTRPIPE: c_int = 86;
+pub const EUSERS: c_int = 87;
+pub const ENOTSOCK: c_int = 88;
+pub const EDESTADDRREQ: c_int = 89;
+pub const EMSGSIZE: c_int = 90;
+pub const EPROTOTYPE: c_int = 91;
+pub const ENOPROTOOPT: c_int = 92;
+pub const EPROTONOSUPPORT: c_int = 93;
+pub const ESOCKTNOSUPPORT: c_int = 94;
+pub const EOPNOTSUPP: c_int = 95;
+pub const EPFNOSUPPORT: c_int = 96;
+pub const EAFNOSUPPORT: c_int = 97;
+pub const EADDRINUSE: c_int = 98;
+pub const EADDRNOTAVAIL: c_int = 99;
+pub const ENETDOWN: c_int = 100;
+pub const ENETUNREACH: c_int = 101;
+pub const ENETRESET: c_int = 102;
+pub const ECONNABORTED: c_int = 103;
+pub const ECONNRESET: c_int = 104;
+pub const ENOBUFS: c_int = 105;
+pub const EISCONN: c_int = 106;
+pub const ENOTCONN: c_int = 107;
+pub const ESHUTDOWN: c_int = 108;
+pub const ETOOMANYREFS: c_int = 109;
+pub const ETIMEDOUT: c_int = 110;
+pub const ECONNREFUSED: c_int = 111;
+pub const EHOSTDOWN: c_int = 112;
+pub const EHOSTUNREACH: c_int = 113;
+pub const EALREADY: c_int = 114;
+pub const EINPROGRESS: c_int = 115;
+pub const ESTALE: c_int = 116;
+pub const EUCLEAN: c_int = 117;
+pub const ENOTNAM: c_int = 118;
+pub const ENAVAIL: c_int = 119;
+pub const EISNAM: c_int = 120;
+pub const EREMOTEIO: c_int = 121;
+pub const EDQUOT: c_int = 122;
+
+pub const ENOMEDIUM: c_int = 123;
+pub const EMEDIUMTYPE: c_int = 124;
+pub const ECANCELED: c_int = 125;
+pub const ENOKEY: c_int = 126;
+pub const EKEYEXPIRED: c_int = 127;
+pub const EKEYREVOKED: c_int = 128;
+pub const EKEYREJECTED: c_int = 129;
+
+pub const EOWNERDEAD: c_int = 130;
+pub const ENOTRECOVERABLE: c_int = 131;
+
+pub const ENOTSUP: c_int = 132;
+pub const EFTYPE: c_int = 133;
+
+// signal codes
+pub const SIGHUP: c_int = 1;
+pub const SIGINT: c_int = 2;
+pub const SIGQUIT: c_int = 3;
+pub const SIGILL: c_int = 4;
+pub const SIGTRAP: c_int = 5;
+pub const SIGABRT: c_int = 6;
+pub const SIGIOT: c_int = SIGABRT;
+pub const SIGEMT: c_int = 7;
+pub const SIGFPE: c_int = 8;
+pub const SIGKILL: c_int = 9;
+pub const SIGBUS: c_int = 10;
+pub const SIGSEGV: c_int = 11;
+pub const SIGSYS: c_int = 12;
+pub const SIGPIPE: c_int = 13;
+pub const SIGALRM: c_int = 14;
+pub const SIGTERM: c_int = 15;
+pub const SIGURG: c_int = 16;
+pub const SIGSTOP: c_int = 17;
+pub const SIGTSTP: c_int = 18;
+pub const SIGCONT: c_int = 19;
+pub const SIGCHLD: c_int = 20;
+pub const SIGTTIN: c_int = 21;
+pub const SIGTTOU: c_int = 22;
+pub const SIGIO: c_int = 23;
+pub const SIGXCPU: c_int = 24;
+pub const SIGXFSZ: c_int = 25;
+pub const SIGVTALRM: c_int = 26;
+pub const SIGPROF: c_int = 27;
+pub const SIGWINCH: c_int = 28;
+pub const SIGINFO: c_int = 29;
+pub const SIGUSR1: c_int = 30;
+pub const SIGUSR2: c_int = 31;
+pub const SIGPWR: c_int = 32;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+impl ::Copy for FILE {}
+impl ::Clone for FILE {
+ fn clone(&self) -> FILE {
+ *self
+ }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos_t {}
+impl ::Copy for fpos_t {}
+impl ::Clone for fpos_t {
+ fn clone(&self) -> fpos_t {
+ *self
+ }
+}
+
+extern "C" {
+ // ctype.h
+ 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 isblank(c: c_int) -> c_int;
+ pub fn tolower(c: c_int) -> c_int;
+ pub fn toupper(c: c_int) -> c_int;
+
+ // stdio.h
+ pub fn __get_stdio_file(fileno: c_int) -> *mut FILE;
+ pub fn clearerr(arg1: *mut FILE);
+ pub fn fclose(arg1: *mut FILE) -> c_int;
+ pub fn feof(arg1: *mut FILE) -> c_int;
+ pub fn ferror(arg1: *mut FILE) -> c_int;
+ pub fn fflush(arg1: *mut FILE) -> c_int;
+ pub fn fgetc(arg1: *mut FILE) -> c_int;
+ pub fn fgets(arg1: *mut c_char, arg2: c_int, arg3: *mut FILE) -> *mut c_char;
+ pub fn fopen(arg1: *const c_char, arg2: *const c_char) -> *mut FILE;
+ pub fn fprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+ pub fn fputc(arg1: c_int, arg2: *mut FILE) -> c_int;
+ pub fn fputs(arg1: *const c_char, arg2: *mut FILE) -> c_int;
+ pub fn fread(arg1: *mut c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
+ pub fn freopen(arg1: *const c_char, arg2: *const c_char, arg3: *mut FILE) -> *mut FILE;
+ pub fn fscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+ pub fn fseek(arg1: *mut FILE, arg2: c_long, arg3: c_int) -> c_int;
+ pub fn ftell(arg1: *mut FILE) -> c_long;
+ pub fn fwrite(arg1: *const c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
+ pub fn getc(arg1: *mut FILE) -> c_int;
+ pub fn getchar() -> c_int;
+ pub fn perror(arg1: *const c_char);
+ pub fn printf(arg1: *const c_char, ...) -> c_int;
+ pub fn putc(arg1: c_int, arg2: *mut FILE) -> c_int;
+ pub fn putchar(arg1: c_int) -> c_int;
+ pub fn puts(arg1: *const c_char) -> c_int;
+ pub fn remove(arg1: *const c_char) -> c_int;
+ pub fn rewind(arg1: *mut FILE);
+ pub fn scanf(arg1: *const c_char, ...) -> c_int;
+ pub fn setbuf(arg1: *mut FILE, arg2: *mut c_char);
+ pub fn setvbuf(arg1: *mut FILE, arg2: *mut c_char, arg3: c_int, arg4: size_t) -> c_int;
+ pub fn sscanf(arg1: *const c_char, arg2: *const c_char, ...) -> c_int;
+ pub fn tmpfile() -> *mut FILE;
+ pub fn ungetc(arg1: c_int, arg2: *mut FILE) -> c_int;
+ pub fn vfprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn vprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
+ pub fn gets(arg1: *mut c_char) -> *mut c_char;
+ pub fn sprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+ pub fn tmpnam(arg1: *const c_char) -> *mut c_char;
+ pub fn vsprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn rename(arg1: *const c_char, arg2: *const c_char) -> c_int;
+ pub fn asiprintf(arg1: *mut *mut c_char, arg2: *const c_char, ...) -> c_int;
+ pub fn fiprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+ pub fn fiscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+ pub fn iprintf(arg1: *const c_char, ...) -> c_int;
+ pub fn iscanf(arg1: *const c_char, ...) -> c_int;
+ pub fn siprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+ pub fn siscanf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+ pub fn sniprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
+ pub fn vasiprintf(arg1: *mut *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn vfiprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn vfiscanf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn viprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
+ pub fn viscanf(arg1: *const c_char, arg2: __va_list) -> c_int;
+ pub fn vsiprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn vsiscanf(arg1: *const c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn vsniprintf(
+ arg1: *mut c_char,
+ arg2: size_t,
+ arg3: *const c_char,
+ arg4: __va_list,
+ ) -> c_int;
+ pub fn vdiprintf(arg1: c_int, arg2: *const c_char, arg3: __va_list) -> c_int;
+ pub fn diprintf(arg1: c_int, arg2: *const c_char, ...) -> c_int;
+ pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> c_int;
+ pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> c_int;
+ pub fn fdopen(arg1: c_int, arg2: *const c_char) -> *mut FILE;
+ pub fn fileno(arg1: *mut FILE) -> c_int;
+ pub fn flockfile(arg1: *mut FILE);
+ pub fn ftrylockfile(arg1: *mut FILE) -> c_int;
+ pub fn funlockfile(arg1: *mut FILE);
+ pub fn getc_unlocked(arg1: *mut FILE) -> c_int;
+ pub fn getchar_unlocked() -> c_int;
+ pub fn putc_unlocked(arg1: c_int, arg2: *mut FILE) -> c_int;
+ pub fn putchar_unlocked(arg1: c_int) -> c_int;
+ pub fn snprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
+ pub fn vsnprintf(
+ arg1: *mut c_char,
+ arg2: size_t,
+ arg3: *const c_char,
+ arg4: __va_list,
+ ) -> c_int;
+ pub fn getw(arg1: *mut FILE) -> c_int;
+ pub fn putw(arg1: c_int, arg2: *mut FILE) -> c_int;
+ pub fn tempnam(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn fseeko(stream: *mut FILE, offset: off_t, whence: c_int) -> c_int;
+ pub fn ftello(stream: *mut FILE) -> off_t;
+
+ // stdlib.h
+ pub fn atof(arg1: *const c_char) -> f64;
+ pub fn strtod(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
+ pub fn drand48() -> f64;
+ pub fn erand48(arg1: *mut c_ushort) -> f64;
+ pub fn strtof(arg1: *const c_char, arg2: *mut *mut c_char) -> f32;
+ pub fn strtold(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
+ pub fn strtod_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
+ pub fn strtof_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f32;
+ pub fn strtold_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
+ pub fn _Exit(arg1: c_int) -> !;
+ pub fn abort() -> !;
+ pub fn abs(arg1: c_int) -> c_int;
+ pub fn atexit(arg1: ::Option) -> c_int;
+ pub fn atoi(arg1: *const c_char) -> c_int;
+ pub fn atol(arg1: *const c_char) -> c_long;
+ pub fn itoa(arg1: c_int, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+ pub fn ltoa(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+ pub fn ultoa(arg1: c_ulong, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+ pub fn bsearch(
+ arg1: *const c_void,
+ arg2: *const c_void,
+ arg3: size_t,
+ arg4: size_t,
+ arg5: ::Option c_int>,
+ ) -> *mut c_void;
+ pub fn calloc(arg1: size_t, arg2: size_t) -> *mut c_void;
+ pub fn div(arg1: c_int, arg2: c_int) -> div_t;
+ pub fn exit(arg1: c_int) -> !;
+ pub fn free(arg1: *mut c_void);
+ pub fn getenv(arg1: *const c_char) -> *mut c_char;
+ pub fn labs(arg1: c_long) -> c_long;
+ pub fn ldiv(arg1: c_long, arg2: c_long) -> ldiv_t;
+ pub fn malloc(arg1: size_t) -> *mut c_void;
+ pub fn qsort(
+ arg1: *mut c_void,
+ arg2: size_t,
+ arg3: size_t,
+ arg4: ::Option c_int>,
+ );
+ pub fn rand() -> c_int;
+ pub fn realloc(arg1: *mut c_void, arg2: size_t) -> *mut c_void;
+ pub fn srand(arg1: c_uint);
+ pub fn strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long;
+ pub fn strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong;
+ pub fn mblen(arg1: *const c_char, arg2: size_t) -> c_int;
+ pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> size_t;
+ pub fn wctomb(arg1: *mut c_char, arg2: wchar_t) -> c_int;
+ pub fn mbtowc(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> c_int;
+ pub fn wcstombs(arg1: *mut c_char, arg2: *const wchar_t, arg3: size_t) -> size_t;
+ pub fn rand_r(arg1: *mut c_uint) -> c_int;
+ pub fn jrand48(arg1: *mut c_ushort) -> c_long;
+ pub fn lcong48(arg1: *mut c_ushort);
+ pub fn lrand48() -> c_long;
+ pub fn mrand48() -> c_long;
+ pub fn nrand48(arg1: *mut c_ushort) -> c_long;
+ pub fn seed48(arg1: *mut c_ushort) -> *mut c_ushort;
+ pub fn srand48(arg1: c_long);
+ pub fn putenv(arg1: *mut c_char) -> c_int;
+ pub fn a64l(arg1: *const c_char) -> c_long;
+ pub fn l64a(arg1: c_long) -> *mut c_char;
+ pub fn random() -> c_long;
+ pub fn setstate(arg1: *mut c_char) -> *mut c_char;
+ pub fn initstate(arg1: c_uint, arg2: *mut c_char, arg3: size_t) -> *mut c_char;
+ pub fn srandom(arg1: c_uint);
+ pub fn mkostemp(arg1: *mut c_char, arg2: c_int) -> c_int;
+ pub fn mkostemps(arg1: *mut c_char, arg2: c_int, arg3: c_int) -> c_int;
+ pub fn mkdtemp(arg1: *mut c_char) -> *mut c_char;
+ pub fn mkstemp(arg1: *mut c_char) -> c_int;
+ pub fn mktemp(arg1: *mut c_char) -> *mut c_char;
+ pub fn atoll(arg1: *const c_char) -> c_longlong;
+ pub fn llabs(arg1: c_longlong) -> c_longlong;
+ pub fn lldiv(arg1: c_longlong, arg2: c_longlong) -> lldiv_t;
+ pub fn strtoll(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_longlong;
+ pub fn strtoull(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulonglong;
+ pub fn aligned_alloc(arg1: size_t, arg2: size_t) -> *mut c_void;
+ pub fn at_quick_exit(arg1: ::Option) -> c_int;
+ pub fn quick_exit(arg1: c_int);
+ pub fn setenv(arg1: *const c_char, arg2: *const c_char, arg3: c_int) -> c_int;
+ pub fn unsetenv(arg1: *const c_char) -> c_int;
+ pub fn humanize_number(
+ arg1: *mut c_char,
+ arg2: size_t,
+ arg3: i64,
+ arg4: *const c_char,
+ arg5: c_int,
+ arg6: c_int,
+ ) -> c_int;
+ pub fn dehumanize_number(arg1: *const c_char, arg2: *mut i64) -> c_int;
+ pub fn getenv_r(arg1: *const c_char, arg2: *mut c_char, arg3: size_t) -> c_int;
+ pub fn heapsort(
+ arg1: *mut c_void,
+ arg2: size_t,
+ arg3: size_t,
+ arg4: ::Option c_int>,
+ ) -> c_int;
+ pub fn mergesort(
+ arg1: *mut c_void,
+ arg2: size_t,
+ arg3: size_t,
+ arg4: ::Option c_int>,
+ ) -> c_int;
+ pub fn radixsort(
+ arg1: *mut *const c_uchar,
+ arg2: c_int,
+ arg3: *const c_uchar,
+ arg4: c_uint,
+ ) -> c_int;
+ pub fn sradixsort(
+ arg1: *mut *const c_uchar,
+ arg2: c_int,
+ arg3: *const c_uchar,
+ arg4: c_uint,
+ ) -> c_int;
+ pub fn getprogname() -> *const c_char;
+ pub fn setprogname(arg1: *const c_char);
+ pub fn qabs(arg1: quad_t) -> quad_t;
+ pub fn strtoq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> quad_t;
+ pub fn strtouq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> u_quad_t;
+ pub fn strsuftoll(
+ arg1: *const c_char,
+ arg2: *const c_char,
+ arg3: c_longlong,
+ arg4: c_longlong,
+ ) -> c_longlong;
+ pub fn strsuftollx(
+ arg1: *const c_char,
+ arg2: *const c_char,
+ arg3: c_longlong,
+ arg4: c_longlong,
+ arg5: *mut c_char,
+ arg6: size_t,
+ ) -> c_longlong;
+ pub fn l64a_r(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> c_int;
+ pub fn qdiv(arg1: quad_t, arg2: quad_t) -> qdiv_t;
+ pub fn strtol_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> c_long;
+ pub fn strtoul_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> c_ulong;
+ pub fn strtoll_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> c_longlong;
+ pub fn strtoull_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> c_ulonglong;
+ pub fn strtoq_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> quad_t;
+ pub fn strtouq_l(
+ arg1: *const c_char,
+ arg2: *mut *mut c_char,
+ arg3: c_int,
+ arg4: locale_t,
+ ) -> u_quad_t;
+ pub fn _mb_cur_max_l(arg1: locale_t) -> size_t;
+ pub fn mblen_l(arg1: *const c_char, arg2: size_t, arg3: locale_t) -> c_int;
+ pub fn mbstowcs_l(
+ arg1: *mut wchar_t,
+ arg2: *const c_char,
+ arg3: size_t,
+ arg4: locale_t,
+ ) -> size_t;
+ pub fn wctomb_l(arg1: *mut c_char, arg2: wchar_t, arg3: locale_t) -> c_int;
+ pub fn mbtowc_l(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t, arg4: locale_t)
+ -> c_int;
+ pub fn wcstombs_l(
+ arg1: *mut c_char,
+ arg2: *const wchar_t,
+ arg3: size_t,
+ arg4: locale_t,
+ ) -> size_t;
+
+ // string.h
+ pub fn memchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+ pub fn memcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+ pub fn memcpy(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
+ pub fn memmove(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
+ pub fn memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+ pub fn strcat(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+ pub fn strcmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
+ pub fn strcoll(arg1: *const c_char, arg2: *const c_char) -> c_int;
+ pub fn strcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strcspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
+ pub fn strerror(arg1: c_int) -> *mut c_char;
+ pub fn strlen(arg1: *const c_char) -> size_t;
+ pub fn strncat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+ pub fn strncmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
+ pub fn strncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+ pub fn strpbrk(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strrchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+ pub fn strspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
+ pub fn strstr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strtok(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strtok_r(arg1: *mut c_char, arg2: *const c_char, arg3: *mut *mut c_char) -> *mut c_char;
+ pub fn strerror_r(arg1: c_int, arg2: *mut c_char, arg3: size_t) -> c_int;
+ pub fn strxfrm(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+ pub fn memccpy(
+ arg1: *mut c_void,
+ arg2: *const c_void,
+ arg3: c_int,
+ arg4: size_t,
+ ) -> *mut c_void;
+ pub fn strdup(arg1: *const c_char) -> *mut c_char;
+ pub fn stpcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn stpncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+ pub fn strnlen(arg1: *const c_char, arg2: size_t) -> size_t;
+ pub fn memmem(
+ arg1: *const c_void,
+ arg2: size_t,
+ arg3: *const c_void,
+ arg4: size_t,
+ ) -> *mut c_void;
+ pub fn strcasestr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn strlcat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+ pub fn strlcpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+ pub fn strsep(arg1: *mut *mut c_char, arg2: *const c_char) -> *mut c_char;
+ pub fn stresep(arg1: *mut *mut c_char, arg2: *const c_char, arg3: c_int) -> *mut c_char;
+ pub fn strndup(arg1: *const c_char, arg2: size_t) -> *mut c_char;
+ pub fn memrchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+ pub fn explicit_memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+ pub fn consttime_memequal(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+ pub fn strcoll_l(arg1: *const c_char, arg2: *const c_char, arg3: locale_t) -> c_int;
+ pub fn strxfrm_l(
+ arg1: *mut c_char,
+ arg2: *const c_char,
+ arg3: size_t,
+ arg4: locale_t,
+ ) -> size_t;
+ pub fn strerror_l(arg1: c_int, arg2: locale_t) -> *mut c_char;
+
+ // strings.h
+ pub fn bcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+ pub fn bcopy(arg1: *const c_void, arg2: *mut c_void, arg3: size_t);
+ pub fn bzero(arg1: *mut c_void, arg2: size_t);
+ pub fn ffs(arg1: c_int) -> c_int;
+ pub fn popcount(arg1: c_uint) -> c_uint;
+ pub fn popcountl(arg1: c_ulong) -> c_uint;
+ pub fn popcountll(arg1: c_ulonglong) -> c_uint;
+ pub fn popcount32(arg1: u32) -> c_uint;
+ pub fn popcount64(arg1: u64) -> c_uint;
+ pub fn rindex(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+ pub fn strcasecmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
+ pub fn strncasecmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
+
+ // signal.h
+ pub fn signal(arg1: c_int, arg2: sighandler_t) -> sighandler_t;
+ pub fn raise(arg1: c_int) -> c_int;
+
+ // time.h
+ pub fn asctime(arg1: *const tm) -> *mut c_char;
+ pub fn clock() -> clock_t;
+ pub fn ctime(arg1: *const time_t) -> *mut c_char;
+ pub fn difftime(arg1: time_t, arg2: time_t) -> f64;
+ pub fn gmtime(arg1: *const time_t) -> *mut tm;
+ pub fn localtime(arg1: *const time_t) -> *mut tm;
+ pub fn time(arg1: *mut time_t) -> time_t;
+ pub fn mktime(arg1: *mut tm) -> time_t;
+ pub fn strftime(
+ arg1: *mut c_char,
+ arg2: size_t,
+ arg3: *const c_char,
+ arg4: *const tm,
+ ) -> size_t;
+ pub fn utime(arg1: *const c_char, arg2: *mut time_t) -> c_int;
+ pub fn asctime_r(arg1: *const tm, arg2: *mut c_char) -> *mut c_char;
+ pub fn ctime_r(arg1: *const time_t, arg2: *mut c_char) -> *mut c_char;
+ pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
+ pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
+
+ // sys/stat.h
+ pub fn stat(arg1: *const c_char, arg2: *mut stat) -> c_int;
+ pub fn lstat(arg1: *const c_char, arg2: *mut stat) -> c_int;
+ pub fn fstat(arg1: c_int, arg2: *mut stat) -> c_int;
+ pub fn chmod(arg1: *const c_char, arg2: __mode_t) -> c_int;
+ pub fn mkdir(arg1: *const c_char, arg2: __mode_t) -> c_int;
+
+ // fcntl.h
+ pub fn open(arg1: *const c_char, arg2: c_int, ...) -> c_int;
+ pub fn creat(arg1: *const c_char, arg2: c_int) -> c_int;
+ pub fn close(arg1: c_int) -> c_int;
+ pub fn read(arg1: c_int, arg2: *mut c_void, arg3: c_int) -> c_int;
+ pub fn write(arg1: c_int, arg2: *const c_void, arg3: c_int) -> c_int;
+ pub fn unlink(arg1: *const c_char) -> c_int;
+ pub fn tell(arg1: c_int) -> c_long;
+ pub fn dup(arg1: c_int) -> c_int;
+ pub fn dup2(arg1: c_int, arg2: c_int) -> c_int;
+ pub fn access(arg1: *const c_char, arg2: c_int) -> c_int;
+ pub fn rmdir(arg1: *const c_char) -> c_int;
+ pub fn chdir(arg1: *const c_char) -> c_int;
+ pub fn _exit(arg1: c_int);
+ pub fn getwd(arg1: *mut c_char) -> *mut c_char;
+ pub fn getcwd(arg1: *mut c_char, arg2: size_t) -> *mut c_char;
+ pub static mut optarg: *mut c_char;
+ pub static mut opterr: c_int;
+ pub static mut optind: c_int;
+ pub static mut optopt: c_int;
+ pub static mut optreset: c_int;
+ pub fn getopt(arg1: c_int, arg2: *mut *mut c_char, arg3: *const c_char) -> c_int;
+ pub static mut suboptarg: *mut c_char;
+ pub fn getsubopt(
+ arg1: *mut *mut c_char,
+ arg2: *const *mut c_char,
+ arg3: *mut *mut c_char,
+ ) -> c_int;
+ pub fn fcntl(arg1: c_int, arg2: c_int, ...) -> c_int;
+ pub fn getpid() -> pid_t;
+ pub fn sleep(arg1: c_uint) -> c_uint;
+ pub fn usleep(arg1: useconds_t) -> c_int;
+
+ // locale.h
+ pub fn localeconv() -> *mut lconv;
+ pub fn setlocale(arg1: c_int, arg2: *const c_char) -> *mut c_char;
+ pub fn duplocale(arg1: locale_t) -> locale_t;
+ pub fn freelocale(arg1: locale_t);
+ pub fn localeconv_l(arg1: locale_t) -> *mut lconv;
+ pub fn newlocale(arg1: c_int, arg2: *const c_char, arg3: locale_t) -> locale_t;
+
+ // langinfo.h
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: locale_t) -> *mut ::c_char;
+
+ // malloc.h
+ pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ // sys/types.h
+ pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t;
+}
+
+cfg_if! {
+ if #[cfg(libc_core_cvoid)] {
+ pub use ::ffi::c_void;
+ } else {
+ // 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)]
+ #[allow(missing_copy_implementations)]
+ #[allow(missing_debug_implementations)]
+ pub enum c_void {
+ // Two dummy variants so the #[repr] attribute can be used.
+ #[doc(hidden)]
+ __variant1,
+ #[doc(hidden)]
+ __variant2,
+ }
+ }
+}
+
+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 {
+ // Unknown target_arch
+ }
+}
diff --git a/src/unix/bsd/apple/b32/mod.rs b/src/unix/bsd/apple/b32/mod.rs
index 9248e3adf2853..0f1722f975744 100644
--- a/src/unix/bsd/apple/b32/mod.rs
+++ b/src/unix/bsd/apple/b32/mod.rs
@@ -43,6 +43,10 @@ s! {
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
+
+ pub struct malloc_zone_t {
+ __private: [::uintptr_t; 18], // FIXME: keeping private for now
+ }
}
s_no_extra_traits! {
diff --git a/src/unix/bsd/apple/b64/aarch64/align.rs b/src/unix/bsd/apple/b64/aarch64/align.rs
index 10d55039dfa7a..29db97ec7c473 100644
--- a/src/unix/bsd/apple/b64/aarch64/align.rs
+++ b/src/unix/bsd/apple/b64/aarch64/align.rs
@@ -15,6 +15,7 @@ s! {
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
+ __mcontext_data: __darwin_mcontext64,
}
pub struct __darwin_mcontext64 {
@@ -39,8 +40,15 @@ s! {
pub __pad: u32,
}
- #[repr(align(16))]
+ // This type natively uses a uint128, but for a while we hacked
+ // it in with repr(align) and `[u64; 2]`. uint128 isn't available
+ // all the way back to our earliest supported versions so we
+ // preserver the old shim.
+ #[cfg_attr(not(libc_int128), repr(align(16)))]
pub struct __darwin_arm_neon_state64 {
+ #[cfg(libc_int128)]
+ pub __v: [::__uint128_t; 32],
+ #[cfg(not(libc_int128))]
pub __v: [[u64; 2]; 32],
pub __fpsr: u32,
pub __fpcr: u32,
diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs
index 83b62e97cf256..79e9ac842f9ca 100644
--- a/src/unix/bsd/apple/b64/aarch64/mod.rs
+++ b/src/unix/bsd/apple/b64/aarch64/mod.rs
@@ -1,5 +1,11 @@
pub type boolean_t = ::c_int;
+s! {
+ pub struct malloc_zone_t {
+ __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
+ }
+}
+
cfg_if! {
if #[cfg(libc_align)] {
mod align;
diff --git a/src/unix/bsd/apple/b64/x86_64/mod.rs b/src/unix/bsd/apple/b64/x86_64/mod.rs
index 078666658ceac..653650c26289f 100644
--- a/src/unix/bsd/apple/b64/x86_64/mod.rs
+++ b/src/unix/bsd/apple/b64/x86_64/mod.rs
@@ -102,6 +102,74 @@ s! {
pub struct __darwin_xmm_reg {
pub __xmm_reg: [::c_char; 16],
}
+
+ pub struct malloc_introspection_t {
+ _private: [::uintptr_t; 16], // FIXME: keeping private for now
+ }
+
+ pub struct malloc_zone_t {
+ _reserved1: *mut ::c_void,
+ _reserved2: *mut ::c_void,
+ pub size: ::Option ::size_t>,
+ pub malloc: ::Option *mut ::c_void>,
+ pub calloc: ::Option *mut ::c_void>,
+ pub valloc: ::Option *mut ::c_void>,
+ pub free: ::Option,
+ pub realloc: ::Option *mut ::c_void>,
+ pub destroy: ::Option,
+ pub zone_name: *const ::c_char,
+ pub batch_malloc: ::Option ::c_uint>,
+ pub batch_free: ::Option,
+ pub introspect: *mut malloc_introspection_t,
+ pub version: ::c_uint,
+ pub memalign: ::Option *mut ::c_void>,
+ pub free_definite_size: ::Option,
+ pub pressure_relief: ::Option ::size_t>,
+ pub claimed_address: ::Option ::boolean_t>,
+ }
}
cfg_if! {
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 4c48221135f98..6b391893a3bcd 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -28,6 +28,15 @@ pub type cpu_type_t = integer_t;
pub type cpu_subtype_t = integer_t;
pub type natural_t = u32;
pub type mach_msg_type_number_t = natural_t;
+pub type kern_return_t = ::c_int;
+pub type uuid_t = [u8; 16];
+pub type task_info_t = *mut integer_t;
+pub type host_info_t = *mut integer_t;
+pub type task_flavor_t = natural_t;
+pub type rusage_info_t = *mut ::c_void;
+pub type vm_offset_t = ::uintptr_t;
+pub type vm_size_t = ::uintptr_t;
+pub type vm_address_t = vm_offset_t;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
@@ -38,7 +47,27 @@ pub type sae_associd_t = u32;
pub type sae_connid_t = u32;
pub type mach_port_t = ::c_uint;
+pub type host_t = ::c_uint;
+pub type host_flavor_t = integer_t;
+pub type host_info64_t = *mut integer_t;
pub type processor_flavor_t = ::c_int;
+pub type thread_flavor_t = natural_t;
+pub type thread_inspect_t = ::mach_port_t;
+pub type thread_act_t = ::mach_port_t;
+pub type thread_act_array_t = *mut ::thread_act_t;
+pub type policy_t = ::c_int;
+pub type mach_vm_address_t = u64;
+pub type mach_vm_offset_t = u64;
+pub type mach_vm_size_t = u64;
+pub type vm_map_t = ::mach_port_t;
+pub type mem_entry_name_port_t = ::mach_port_t;
+pub type memory_object_t = ::mach_port_t;
+pub type memory_object_offset_t = ::c_ulonglong;
+pub type vm_inherit_t = ::c_uint;
+pub type vm_prot_t = ::c_int;
+
+pub type ledger_t = ::mach_port_t;
+pub type ledger_array_t = *mut ::ledger_t;
pub type iconv_t = *mut ::c_void;
@@ -53,9 +82,74 @@ pub type processor_set_load_info_t = *mut processor_set_load_info;
pub type processor_info_t = *mut integer_t;
pub type processor_info_array_t = *mut integer_t;
+pub type mach_task_basic_info_data_t = mach_task_basic_info;
+pub type mach_task_basic_info_t = *mut mach_task_basic_info;
+pub type task_thread_times_info_data_t = task_thread_times_info;
+pub type task_thread_times_info_t = *mut task_thread_times_info;
+
+pub type thread_info_t = *mut integer_t;
+pub type thread_basic_info_t = *mut thread_basic_info;
+pub type thread_basic_info_data_t = thread_basic_info;
+pub type thread_identifier_info_t = *mut thread_identifier_info;
+pub type thread_identifier_info_data_t = thread_identifier_info;
+pub type thread_extended_info_t = *mut thread_extended_info;
+pub type thread_extended_info_data_t = thread_extended_info;
+
+pub type thread_t = ::mach_port_t;
+pub type thread_policy_flavor_t = natural_t;
+pub type thread_policy_t = *mut integer_t;
+pub type thread_latency_qos_t = integer_t;
+pub type thread_throughput_qos_t = integer_t;
+pub type thread_standard_policy_data_t = thread_standard_policy;
+pub type thread_standard_policy_t = *mut thread_standard_policy;
+pub type thread_extended_policy_data_t = thread_extended_policy;
+pub type thread_extended_policy_t = *mut thread_extended_policy;
+pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
+pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
+pub type thread_precedence_policy_data_t = thread_precedence_policy;
+pub type thread_precedence_policy_t = *mut thread_precedence_policy;
+pub type thread_affinity_policy_data_t = thread_affinity_policy;
+pub type thread_affinity_policy_t = *mut thread_affinity_policy;
+pub type thread_background_policy_data_t = thread_background_policy;
+pub type thread_background_policy_t = *mut thread_background_policy;
+pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
+pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
+pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
+pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
+
+pub type pthread_introspection_hook_t =
+ extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
+pub type pthread_jit_write_callback_t = ::Option ::c_int>;
+
+pub type os_unfair_lock = os_unfair_lock_s;
+pub type os_unfair_lock_t = *mut os_unfair_lock;
+
+pub type os_log_t = *mut ::c_void;
+pub type os_log_type_t = u8;
+pub type os_signpost_id_t = u64;
+pub type os_signpost_type_t = u8;
+
+pub type vm_statistics_t = *mut vm_statistics;
+pub type vm_statistics_data_t = vm_statistics;
+pub type vm_statistics64_t = *mut vm_statistics64;
+pub type vm_statistics64_data_t = vm_statistics64;
+
+pub type task_t = ::mach_port_t;
+pub type task_inspect_t = ::mach_port_t;
+
+pub type sysdir_search_path_enumeration_state = ::c_uint;
+
+pub type CCStatus = i32;
+pub type CCCryptorStatus = i32;
+pub type CCRNGStatus = ::CCCryptorStatus;
+
+pub type copyfile_state_t = *mut ::c_void;
+pub type copyfile_flags_t = u32;
+
+pub type attrgroup_t = u32;
+pub type vol_capabilities_set_t = [u32; 4];
+
deprecated_mach! {
- pub type vm_prot_t = ::c_int;
- pub type vm_size_t = ::uintptr_t;
pub type mach_timebase_info_data_t = mach_timebase_info;
}
@@ -68,12 +162,92 @@ impl ::Clone for timezone {
}
}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum qos_class_t {
+ QOS_CLASS_USER_INTERACTIVE = 0x21,
+ QOS_CLASS_USER_INITIATED = 0x19,
+ QOS_CLASS_DEFAULT = 0x15,
+ QOS_CLASS_UTILITY = 0x11,
+ QOS_CLASS_BACKGROUND = 0x09,
+ QOS_CLASS_UNSPECIFIED = 0x00,
+}
+impl ::Copy for qos_class_t {}
+impl ::Clone for qos_class_t {
+ fn clone(&self) -> qos_class_t {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum sysdir_search_path_directory_t {
+ SYSDIR_DIRECTORY_APPLICATION = 1,
+ SYSDIR_DIRECTORY_DEMO_APPLICATION = 2,
+ SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3,
+ SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4,
+ SYSDIR_DIRECTORY_LIBRARY = 5,
+ SYSDIR_DIRECTORY_DEVELOPER = 6,
+ SYSDIR_DIRECTORY_USER = 7,
+ SYSDIR_DIRECTORY_DOCUMENTATION = 8,
+ SYSDIR_DIRECTORY_DOCUMENT = 9,
+ SYSDIR_DIRECTORY_CORESERVICE = 10,
+ SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11,
+ SYSDIR_DIRECTORY_DESKTOP = 12,
+ SYSDIR_DIRECTORY_CACHES = 13,
+ SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14,
+ SYSDIR_DIRECTORY_DOWNLOADS = 15,
+ SYSDIR_DIRECTORY_INPUT_METHODS = 16,
+ SYSDIR_DIRECTORY_MOVIES = 17,
+ SYSDIR_DIRECTORY_MUSIC = 18,
+ SYSDIR_DIRECTORY_PICTURES = 19,
+ SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20,
+ SYSDIR_DIRECTORY_SHARED_PUBLIC = 21,
+ SYSDIR_DIRECTORY_PREFERENCE_PANES = 22,
+ SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100,
+ SYSDIR_DIRECTORY_ALL_LIBRARIES = 101,
+}
+impl ::Copy for sysdir_search_path_directory_t {}
+impl ::Clone for sysdir_search_path_directory_t {
+ fn clone(&self) -> sysdir_search_path_directory_t {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum sysdir_search_path_domain_mask_t {
+ SYSDIR_DOMAIN_MASK_USER = (1 << 0),
+ SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1),
+ SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2),
+ SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3),
+ SYSDIR_DOMAIN_MASK_ALL = 0x0ffff,
+}
+impl ::Copy for sysdir_search_path_domain_mask_t {}
+impl ::Clone for sysdir_search_path_domain_mask_t {
+ fn clone(&self) -> sysdir_search_path_domain_mask_t {
+ *self
+ }
+}
+
s! {
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
+ pub struct ip_mreqn {
+ pub imr_multiaddr: in_addr,
+ pub imr_address: in_addr,
+ pub imr_ifindex: ::c_int,
+ }
+
+ pub struct ip_mreq_source {
+ pub imr_multiaddr: in_addr,
+ pub imr_sourceaddr: in_addr,
+ pub imr_interface: in_addr,
+ }
+
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
@@ -113,7 +287,7 @@ s! {
#[deprecated(
since = "0.2.55",
- note = "Use the `mach` crate instead",
+ note = "Use the `mach2` crate instead",
)]
pub struct mach_timebase_info {
pub numer: u32,
@@ -381,7 +555,7 @@ s! {
#[deprecated(
since = "0.2.55",
- note = "Use the `mach` crate instead",
+ note = "Use the `mach2` crate instead",
)]
pub struct mach_header {
pub magic: u32,
@@ -395,7 +569,7 @@ s! {
#[deprecated(
since = "0.2.55",
- note = "Use the `mach` crate instead",
+ note = "Use the `mach2` crate instead",
)]
pub struct mach_header_64 {
pub magic: u32,
@@ -516,6 +690,13 @@ s! {
pub s_addr: ::in_addr_t,
}
+ // net/ndrv.h
+ pub struct sockaddr_ndrv {
+ pub snd_len: ::c_uchar,
+ pub snd_family: ::c_uchar,
+ pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h
+ }
+
// sys/socket.h
pub struct sa_endpoints_t {
@@ -553,6 +734,298 @@ s! {
pub tai: ::c_long,
pub time_state: ::c_int,
}
+
+ pub struct thread_standard_policy {
+ pub no_data: natural_t,
+ }
+
+ pub struct thread_extended_policy {
+ pub timeshare: boolean_t,
+ }
+
+ pub struct thread_time_constraint_policy {
+ pub period: u32,
+ pub computation: u32,
+ pub constraint: u32,
+ pub preemptible: boolean_t,
+ }
+
+ pub struct thread_precedence_policy {
+ pub importance: integer_t,
+ }
+
+ pub struct thread_affinity_policy {
+ pub affinity_tag: integer_t,
+ }
+
+ pub struct thread_background_policy {
+ pub priority: integer_t,
+ }
+
+ pub struct thread_latency_qos_policy {
+ pub thread_latency_qos_tier: thread_latency_qos_t,
+ }
+
+ pub struct thread_throughput_qos_policy {
+ pub thread_throughput_qos_tier: thread_throughput_qos_t,
+ }
+
+ // malloc/malloc.h
+ pub struct malloc_statistics_t {
+ pub blocks_in_use: ::c_uint,
+ pub size_in_use: ::size_t,
+ pub max_size_in_use: ::size_t,
+ pub size_allocated: ::size_t,
+ }
+
+ pub struct mstats {
+ pub bytes_total: ::size_t,
+ pub chunks_used: ::size_t,
+ pub bytes_used: ::size_t,
+ pub chunks_free: ::size_t,
+ pub bytes_free: ::size_t,
+ }
+
+ pub struct vm_range_t {
+ pub address: ::vm_address_t,
+ pub size: ::vm_size_t,
+ }
+
+ // sched.h
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ __opaque: [::c_char; 4],
+ }
+
+ pub struct vinfo_stat {
+ pub vst_dev: u32,
+ pub vst_mode: u16,
+ pub vst_nlink: u16,
+ pub vst_ino: u64,
+ pub vst_uid: ::uid_t,
+ pub vst_gid: ::gid_t,
+ pub vst_atime: i64,
+ pub vst_atimensec: i64,
+ pub vst_mtime: i64,
+ pub vst_mtimensec: i64,
+ pub vst_ctime: i64,
+ pub vst_ctimensec: i64,
+ pub vst_birthtime: i64,
+ pub vst_birthtimensec: i64,
+ pub vst_size: ::off_t,
+ pub vst_blocks: i64,
+ pub vst_blksize: i32,
+ pub vst_flags: u32,
+ pub vst_gen: u32,
+ pub vst_rdev: u32,
+ pub vst_qspare: [i64; 2],
+ }
+
+ pub struct vnode_info {
+ pub vi_stat: vinfo_stat,
+ pub vi_type: ::c_int,
+ pub vi_pad: ::c_int,
+ pub vi_fsid: ::fsid_t,
+ }
+
+ pub struct vnode_info_path {
+ pub vip_vi: vnode_info,
+ // Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc
+ // version, we go around this limitation like this.
+ pub vip_path: [[::c_char; 32]; 32],
+ }
+
+ pub struct proc_vnodepathinfo {
+ pub pvi_cdir: vnode_info_path,
+ pub pvi_rdir: vnode_info_path,
+ }
+
+ pub struct vm_statistics {
+ pub free_count: natural_t,
+ pub active_count: natural_t,
+ pub inactive_count: natural_t,
+ pub wire_count: natural_t,
+ pub zero_fill_count: natural_t,
+ pub reactivations: natural_t,
+ pub pageins: natural_t,
+ pub pageouts: natural_t,
+ pub faults: natural_t,
+ pub cow_faults: natural_t,
+ pub lookups: natural_t,
+ pub hits: natural_t,
+ pub purgeable_count: natural_t,
+ pub purges: natural_t,
+ pub speculative_count: natural_t,
+ }
+
+ pub struct task_thread_times_info {
+ pub user_time: time_value_t,
+ pub system_time: time_value_t,
+ }
+
+ pub struct rusage_info_v0 {
+ pub ri_uuid: [u8; 16],
+ pub ri_user_time: u64,
+ pub ri_system_time: u64,
+ pub ri_pkg_idle_wkups: u64,
+ pub ri_interrupt_wkups: u64,
+ pub ri_pageins: u64,
+ pub ri_wired_size: u64,
+ pub ri_resident_size: u64,
+ pub ri_phys_footprint: u64,
+ pub ri_proc_start_abstime: u64,
+ pub ri_proc_exit_abstime: u64,
+ }
+
+ pub struct rusage_info_v1 {
+ pub ri_uuid: [u8; 16],
+ pub ri_user_time: u64,
+ pub ri_system_time: u64,
+ pub ri_pkg_idle_wkups: u64,
+ pub ri_interrupt_wkups: u64,
+ pub ri_pageins: u64,
+ pub ri_wired_size: u64,
+ pub ri_resident_size: u64,
+ pub ri_phys_footprint: u64,
+ pub ri_proc_start_abstime: u64,
+ pub ri_proc_exit_abstime: u64,
+ pub ri_child_user_time: u64,
+ pub ri_child_system_time: u64,
+ pub ri_child_pkg_idle_wkups: u64,
+ pub ri_child_interrupt_wkups: u64,
+ pub ri_child_pageins: u64,
+ pub ri_child_elapsed_abstime: u64,
+ }
+
+ pub struct rusage_info_v2 {
+ pub ri_uuid: [u8; 16],
+ pub ri_user_time: u64,
+ pub ri_system_time: u64,
+ pub ri_pkg_idle_wkups: u64,
+ pub ri_interrupt_wkups: u64,
+ pub ri_pageins: u64,
+ pub ri_wired_size: u64,
+ pub ri_resident_size: u64,
+ pub ri_phys_footprint: u64,
+ pub ri_proc_start_abstime: u64,
+ pub ri_proc_exit_abstime: u64,
+ pub ri_child_user_time: u64,
+ pub ri_child_system_time: u64,
+ pub ri_child_pkg_idle_wkups: u64,
+ pub ri_child_interrupt_wkups: u64,
+ pub ri_child_pageins: u64,
+ pub ri_child_elapsed_abstime: u64,
+ pub ri_diskio_bytesread: u64,
+ pub ri_diskio_byteswritten: u64,
+ }
+
+ pub struct rusage_info_v3 {
+ pub ri_uuid: [u8; 16],
+ pub ri_user_time: u64,
+ pub ri_system_time: u64,
+ pub ri_pkg_idle_wkups: u64,
+ pub ri_interrupt_wkups: u64,
+ pub ri_pageins: u64,
+ pub ri_wired_size: u64,
+ pub ri_resident_size: u64,
+ pub ri_phys_footprint: u64,
+ pub ri_proc_start_abstime: u64,
+ pub ri_proc_exit_abstime: u64,
+ pub ri_child_user_time: u64,
+ pub ri_child_system_time: u64,
+ pub ri_child_pkg_idle_wkups: u64,
+ pub ri_child_interrupt_wkups: u64,
+ pub ri_child_pageins: u64,
+ pub ri_child_elapsed_abstime: u64,
+ pub ri_diskio_bytesread: u64,
+ pub ri_diskio_byteswritten: u64,
+ pub ri_cpu_time_qos_default: u64,
+ pub ri_cpu_time_qos_maintenance: u64,
+ pub ri_cpu_time_qos_background: u64,
+ pub ri_cpu_time_qos_utility: u64,
+ pub ri_cpu_time_qos_legacy: u64,
+ pub ri_cpu_time_qos_user_initiated: u64,
+ pub ri_cpu_time_qos_user_interactive: u64,
+ pub ri_billed_system_time: u64,
+ pub ri_serviced_system_time: u64,
+ }
+
+ pub struct rusage_info_v4 {
+ pub ri_uuid: [u8; 16],
+ pub ri_user_time: u64,
+ pub ri_system_time: u64,
+ pub ri_pkg_idle_wkups: u64,
+ pub ri_interrupt_wkups: u64,
+ pub ri_pageins: u64,
+ pub ri_wired_size: u64,
+ pub ri_resident_size: u64,
+ pub ri_phys_footprint: u64,
+ pub ri_proc_start_abstime: u64,
+ pub ri_proc_exit_abstime: u64,
+ pub ri_child_user_time: u64,
+ pub ri_child_system_time: u64,
+ pub ri_child_pkg_idle_wkups: u64,
+ pub ri_child_interrupt_wkups: u64,
+ pub ri_child_pageins: u64,
+ pub ri_child_elapsed_abstime: u64,
+ pub ri_diskio_bytesread: u64,
+ pub ri_diskio_byteswritten: u64,
+ pub ri_cpu_time_qos_default: u64,
+ pub ri_cpu_time_qos_maintenance: u64,
+ pub ri_cpu_time_qos_background: u64,
+ pub ri_cpu_time_qos_utility: u64,
+ pub ri_cpu_time_qos_legacy: u64,
+ pub ri_cpu_time_qos_user_initiated: u64,
+ pub ri_cpu_time_qos_user_interactive: u64,
+ pub ri_billed_system_time: u64,
+ pub ri_serviced_system_time: u64,
+ pub ri_logical_writes: u64,
+ pub ri_lifetime_max_phys_footprint: u64,
+ pub ri_instructions: u64,
+ pub ri_cycles: u64,
+ pub ri_billed_energy: u64,
+ pub ri_serviced_energy: u64,
+ pub ri_interval_max_phys_footprint: u64,
+ pub ri_runnable_time: u64,
+ }
+
+ pub struct image_offset {
+ pub uuid: ::uuid_t,
+ pub offset: u32,
+ }
+
+ pub struct attrlist {
+ pub bitmapcount: ::c_ushort,
+ pub reserved: u16,
+ pub commonattr: attrgroup_t,
+ pub volattr: attrgroup_t,
+ pub dirattr: attrgroup_t,
+ pub fileattr: attrgroup_t,
+ pub forkattr: attrgroup_t,
+ }
+
+ pub struct attrreference_t {
+ pub attr_dataoffset: i32,
+ pub attr_length: u32,
+ }
+
+ pub struct vol_capabilities_attr_t {
+ pub capabilities: vol_capabilities_set_t,
+ pub valid: vol_capabilities_set_t,
+ }
+
+ pub struct attribute_set_t {
+ pub commonattr: attrgroup_t,
+ pub volattr: attrgroup_t,
+ pub dirattr: attrgroup_t,
+ pub fileattr: attrgroup_t,
+ pub forkattr: attrgroup_t,
+ }
+
+ pub struct vol_attributes_attr_t {
+ pub validattr: attribute_set_t,
+ pub nativeattr: attribute_set_t,
+ }
}
s_no_extra_traits! {
@@ -623,7 +1096,8 @@ s_no_extra_traits! {
pub f_fstypename: [::c_char; 16],
pub f_mntonname: [::c_char; 1024],
pub f_mntfromname: [::c_char; 1024],
- pub f_reserved: [u32; 8],
+ pub f_flags_ext: u32,
+ pub f_reserved: [u32; 7],
}
pub struct dirent {
@@ -700,6 +1174,139 @@ s_no_extra_traits! {
pub load_average: integer_t,
pub mach_factor: integer_t,
}
+
+ pub struct time_value_t {
+ pub seconds: integer_t,
+ pub microseconds: integer_t,
+ }
+
+ pub struct thread_basic_info {
+ pub user_time: time_value_t,
+ pub system_time: time_value_t,
+ pub cpu_usage: ::integer_t,
+ pub policy: ::policy_t,
+ pub run_state: ::integer_t,
+ pub flags: ::integer_t,
+ pub suspend_count: ::integer_t,
+ pub sleep_time: ::integer_t,
+ }
+
+ pub struct thread_identifier_info {
+ pub thread_id: u64,
+ pub thread_handle: u64,
+ pub dispatch_qaddr: u64,
+ }
+
+ pub struct thread_extended_info {
+ pub pth_user_time: u64,
+ pub pth_system_time: u64,
+ pub pth_cpu_usage: i32,
+ pub pth_policy: i32,
+ pub pth_run_state: i32,
+ pub pth_flags: i32,
+ pub pth_sleep_time: i32,
+ pub pth_curpri: i32,
+ pub pth_priority: i32,
+ pub pth_maxpriority: i32,
+ pub pth_name: [::c_char; MAXTHREADNAMESIZE],
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct if_data64 {
+ pub ifi_type: ::c_uchar,
+ pub ifi_typelen: ::c_uchar,
+ pub ifi_physical: ::c_uchar,
+ pub ifi_addrlen: ::c_uchar,
+ pub ifi_hdrlen: ::c_uchar,
+ pub ifi_recvquota: ::c_uchar,
+ pub ifi_xmitquota: ::c_uchar,
+ pub ifi_unused1: ::c_uchar,
+ pub ifi_mtu: u32,
+ pub ifi_metric: u32,
+ pub ifi_baudrate: u64,
+ pub ifi_ipackets: u64,
+ pub ifi_ierrors: u64,
+ pub ifi_opackets: u64,
+ pub ifi_oerrors: u64,
+ pub ifi_collisions: u64,
+ pub ifi_ibytes: u64,
+ pub ifi_obytes: u64,
+ pub ifi_imcasts: u64,
+ pub ifi_omcasts: u64,
+ pub ifi_iqdrops: u64,
+ pub ifi_noproto: u64,
+ pub ifi_recvtiming: u32,
+ pub ifi_xmittiming: u32,
+ #[cfg(target_pointer_width = "32")]
+ pub ifi_lastchange: ::timeval,
+ #[cfg(not(target_pointer_width = "32"))]
+ pub ifi_lastchange: timeval32,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct if_msghdr2 {
+ pub ifm_msglen: ::c_ushort,
+ pub ifm_version: ::c_uchar,
+ pub ifm_type: ::c_uchar,
+ pub ifm_addrs: ::c_int,
+ pub ifm_flags: ::c_int,
+ pub ifm_index: ::c_ushort,
+ pub ifm_snd_len: ::c_int,
+ pub ifm_snd_maxlen: ::c_int,
+ pub ifm_snd_drops: ::c_int,
+ pub ifm_timer: ::c_int,
+ pub ifm_data: if_data64,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(8)))]
+ pub struct vm_statistics64 {
+ pub free_count: natural_t,
+ pub active_count: natural_t,
+ pub inactive_count: natural_t,
+ pub wire_count: natural_t,
+ pub zero_fill_count: u64,
+ pub reactivations: u64,
+ pub pageins: u64,
+ pub pageouts: u64,
+ pub faults: u64,
+ pub cow_faults: u64,
+ pub lookups: u64,
+ pub hits: u64,
+ pub purges: u64,
+ pub purgeable_count: natural_t,
+ pub speculative_count: natural_t,
+ pub decompressions: u64,
+ pub compressions: u64,
+ pub swapins: u64,
+ pub swapouts: u64,
+ pub compressor_page_count: natural_t,
+ pub throttled_count: natural_t,
+ pub external_page_count: natural_t,
+ pub internal_page_count: natural_t,
+ pub total_uncompressed_pages_in_compressor: u64,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct mach_task_basic_info {
+ pub virtual_size: mach_vm_size_t,
+ pub resident_size: mach_vm_size_t,
+ pub resident_size_max: mach_vm_size_t,
+ pub user_time: time_value_t,
+ pub system_time: time_value_t,
+ pub policy: ::policy_t,
+ pub suspend_count: integer_t,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct log2phys {
+ pub l2p_flags: ::c_uint,
+ pub l2p_contigbytes: ::off_t,
+ pub l2p_devoffset: ::off_t,
+ }
+
+ pub struct os_unfair_lock_s {
+ _os_unfair_lock_opaque: u32,
+ }
}
impl siginfo_t {
@@ -1414,6 +2021,594 @@ cfg_if! {
self.mach_factor.hash(state);
}
}
+
+ impl PartialEq for time_value_t {
+ fn eq(&self, other: &time_value_t) -> bool {
+ self.seconds == other.seconds
+ && self.microseconds == other.microseconds
+ }
+ }
+ impl Eq for time_value_t {}
+ impl ::fmt::Debug for time_value_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("time_value_t")
+ .field("seconds", &self.seconds)
+ .field("microseconds", &self.microseconds)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for time_value_t {
+ fn hash(&self, state: &mut H) {
+ self.seconds.hash(state);
+ self.microseconds.hash(state);
+ }
+ }
+ impl PartialEq for thread_basic_info {
+ fn eq(&self, other: &thread_basic_info) -> bool {
+ self.user_time == other.user_time
+ && self.system_time == other.system_time
+ && self.cpu_usage == other.cpu_usage
+ && self.policy == other.policy
+ && self.run_state == other.run_state
+ && self.flags == other.flags
+ && self.suspend_count == other.suspend_count
+ && self.sleep_time == other.sleep_time
+ }
+ }
+ impl Eq for thread_basic_info {}
+ impl ::fmt::Debug for thread_basic_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("thread_basic_info")
+ .field("user_time", &self.user_time)
+ .field("system_time", &self.system_time)
+ .field("cpu_usage", &self.cpu_usage)
+ .field("policy", &self.policy)
+ .field("run_state", &self.run_state)
+ .field("flags", &self.flags)
+ .field("suspend_count", &self.suspend_count)
+ .field("sleep_time", &self.sleep_time)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for thread_basic_info {
+ fn hash(&self, state: &mut H) {
+ self.user_time.hash(state);
+ self.system_time.hash(state);
+ self.cpu_usage.hash(state);
+ self.policy.hash(state);
+ self.run_state.hash(state);
+ self.flags.hash(state);
+ self.suspend_count.hash(state);
+ self.sleep_time.hash(state);
+ }
+ }
+ impl PartialEq for thread_extended_info {
+ fn eq(&self, other: &thread_extended_info) -> bool {
+ self.pth_user_time == other.pth_user_time
+ && self.pth_system_time == other.pth_system_time
+ && self.pth_cpu_usage == other.pth_cpu_usage
+ && self.pth_policy == other.pth_policy
+ && self.pth_run_state == other.pth_run_state
+ && self.pth_flags == other.pth_flags
+ && self.pth_sleep_time == other.pth_sleep_time
+ && self.pth_curpri == other.pth_curpri
+ && self.pth_priority == other.pth_priority
+ && self.pth_maxpriority == other.pth_maxpriority
+ && self.pth_name
+ .iter()
+ .zip(other.pth_name.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for thread_extended_info {}
+ impl ::fmt::Debug for thread_extended_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("proc_threadinfo")
+ .field("pth_user_time", &self.pth_user_time)
+ .field("pth_system_time", &self.pth_system_time)
+ .field("pth_cpu_usage", &self.pth_cpu_usage)
+ .field("pth_policy", &self.pth_policy)
+ .field("pth_run_state", &self.pth_run_state)
+ .field("pth_flags", &self.pth_flags)
+ .field("pth_sleep_time", &self.pth_sleep_time)
+ .field("pth_curpri", &self.pth_curpri)
+ .field("pth_priority", &self.pth_priority)
+ .field("pth_maxpriority", &self.pth_maxpriority)
+ // FIXME: .field("pth_name", &self.pth_name)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for thread_extended_info {
+ fn hash(&self, state: &mut H) {
+ self.pth_user_time.hash(state);
+ self.pth_system_time.hash(state);
+ self.pth_cpu_usage.hash(state);
+ self.pth_policy.hash(state);
+ self.pth_run_state.hash(state);
+ self.pth_flags.hash(state);
+ self.pth_sleep_time.hash(state);
+ self.pth_curpri.hash(state);
+ self.pth_priority.hash(state);
+ self.pth_maxpriority.hash(state);
+ self.pth_name.hash(state);
+ }
+ }
+ impl PartialEq for thread_identifier_info {
+ fn eq(&self, other: &thread_identifier_info) -> bool {
+ self.thread_id == other.thread_id
+ && self.thread_handle == other.thread_handle
+ && self.dispatch_qaddr == other.dispatch_qaddr
+ }
+ }
+ impl Eq for thread_identifier_info {}
+ impl ::fmt::Debug for thread_identifier_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("thread_identifier_info")
+ .field("thread_id", &self.thread_id)
+ .field("thread_handle", &self.thread_handle)
+ .field("dispatch_qaddr", &self.dispatch_qaddr)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for thread_identifier_info {
+ fn hash(&self, state: &mut H) {
+ self.thread_id.hash(state);
+ self.thread_handle.hash(state);
+ self.dispatch_qaddr.hash(state);
+ }
+ }
+ impl PartialEq for if_data64 {
+ fn eq(&self, other: &if_data64) -> bool {
+ self.ifi_type == other.ifi_type &&
+ self.ifi_typelen == other.ifi_typelen &&
+ self.ifi_physical == other.ifi_physical &&
+ self.ifi_addrlen == other.ifi_addrlen &&
+ self.ifi_hdrlen == other.ifi_hdrlen &&
+ self.ifi_recvquota == other.ifi_recvquota &&
+ self.ifi_xmitquota == other.ifi_xmitquota &&
+ self.ifi_unused1 == other.ifi_unused1 &&
+ self.ifi_mtu == other.ifi_mtu &&
+ self.ifi_metric == other.ifi_metric &&
+ self.ifi_baudrate == other.ifi_baudrate &&
+ self.ifi_ipackets == other.ifi_ipackets &&
+ self.ifi_ierrors == other.ifi_ierrors &&
+ self.ifi_opackets == other.ifi_opackets &&
+ self.ifi_oerrors == other.ifi_oerrors &&
+ self.ifi_collisions == other.ifi_collisions &&
+ self.ifi_ibytes == other.ifi_ibytes &&
+ self.ifi_obytes == other.ifi_obytes &&
+ self.ifi_imcasts == other.ifi_imcasts &&
+ self.ifi_omcasts == other.ifi_omcasts &&
+ self.ifi_iqdrops == other.ifi_iqdrops &&
+ self.ifi_noproto == other.ifi_noproto &&
+ self.ifi_recvtiming == other.ifi_recvtiming &&
+ self.ifi_xmittiming == other.ifi_xmittiming &&
+ self.ifi_lastchange == other.ifi_lastchange
+ }
+ }
+ impl Eq for if_data64 {}
+ impl ::fmt::Debug for if_data64 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let ifi_type = self.ifi_type;
+ let ifi_typelen = self.ifi_typelen;
+ let ifi_physical = self.ifi_physical;
+ let ifi_addrlen = self.ifi_addrlen;
+ let ifi_hdrlen = self.ifi_hdrlen;
+ let ifi_recvquota = self.ifi_recvquota;
+ let ifi_xmitquota = self.ifi_xmitquota;
+ let ifi_unused1 = self.ifi_unused1;
+ let ifi_mtu = self.ifi_mtu;
+ let ifi_metric = self.ifi_metric;
+ let ifi_baudrate = self.ifi_baudrate;
+ let ifi_ipackets = self.ifi_ipackets;
+ let ifi_ierrors = self.ifi_ierrors;
+ let ifi_opackets = self.ifi_opackets;
+ let ifi_oerrors = self.ifi_oerrors;
+ let ifi_collisions = self.ifi_collisions;
+ let ifi_ibytes = self.ifi_ibytes;
+ let ifi_obytes = self.ifi_obytes;
+ let ifi_imcasts = self.ifi_imcasts;
+ let ifi_omcasts = self.ifi_omcasts;
+ let ifi_iqdrops = self.ifi_iqdrops;
+ let ifi_noproto = self.ifi_noproto;
+ let ifi_recvtiming = self.ifi_recvtiming;
+ let ifi_xmittiming = self.ifi_xmittiming;
+ let ifi_lastchange = self.ifi_lastchange;
+ f.debug_struct("if_data64")
+ .field("ifi_type", &ifi_type)
+ .field("ifi_typelen", &ifi_typelen)
+ .field("ifi_physical", &ifi_physical)
+ .field("ifi_addrlen", &ifi_addrlen)
+ .field("ifi_hdrlen", &ifi_hdrlen)
+ .field("ifi_recvquota", &ifi_recvquota)
+ .field("ifi_xmitquota", &ifi_xmitquota)
+ .field("ifi_unused1", &ifi_unused1)
+ .field("ifi_mtu", &ifi_mtu)
+ .field("ifi_metric", &ifi_metric)
+ .field("ifi_baudrate", &ifi_baudrate)
+ .field("ifi_ipackets", &ifi_ipackets)
+ .field("ifi_ierrors", &ifi_ierrors)
+ .field("ifi_opackets", &ifi_opackets)
+ .field("ifi_oerrors", &ifi_oerrors)
+ .field("ifi_collisions", &ifi_collisions)
+ .field("ifi_ibytes", &ifi_ibytes)
+ .field("ifi_obytes", &ifi_obytes)
+ .field("ifi_imcasts", &ifi_imcasts)
+ .field("ifi_omcasts", &ifi_omcasts)
+ .field("ifi_iqdrops", &ifi_iqdrops)
+ .field("ifi_noproto", &ifi_noproto)
+ .field("ifi_recvtiming", &ifi_recvtiming)
+ .field("ifi_xmittiming", &ifi_xmittiming)
+ .field("ifi_lastchange", &ifi_lastchange)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for if_data64 {
+ fn hash(&self, state: &mut H) {
+ let ifi_type = self.ifi_type;
+ let ifi_typelen = self.ifi_typelen;
+ let ifi_physical = self.ifi_physical;
+ let ifi_addrlen = self.ifi_addrlen;
+ let ifi_hdrlen = self.ifi_hdrlen;
+ let ifi_recvquota = self.ifi_recvquota;
+ let ifi_xmitquota = self.ifi_xmitquota;
+ let ifi_unused1 = self.ifi_unused1;
+ let ifi_mtu = self.ifi_mtu;
+ let ifi_metric = self.ifi_metric;
+ let ifi_baudrate = self.ifi_baudrate;
+ let ifi_ipackets = self.ifi_ipackets;
+ let ifi_ierrors = self.ifi_ierrors;
+ let ifi_opackets = self.ifi_opackets;
+ let ifi_oerrors = self.ifi_oerrors;
+ let ifi_collisions = self.ifi_collisions;
+ let ifi_ibytes = self.ifi_ibytes;
+ let ifi_obytes = self.ifi_obytes;
+ let ifi_imcasts = self.ifi_imcasts;
+ let ifi_omcasts = self.ifi_omcasts;
+ let ifi_iqdrops = self.ifi_iqdrops;
+ let ifi_noproto = self.ifi_noproto;
+ let ifi_recvtiming = self.ifi_recvtiming;
+ let ifi_xmittiming = self.ifi_xmittiming;
+ let ifi_lastchange = self.ifi_lastchange;
+ ifi_type.hash(state);
+ ifi_typelen.hash(state);
+ ifi_physical.hash(state);
+ ifi_addrlen.hash(state);
+ ifi_hdrlen.hash(state);
+ ifi_recvquota.hash(state);
+ ifi_xmitquota.hash(state);
+ ifi_unused1.hash(state);
+ ifi_mtu.hash(state);
+ ifi_metric.hash(state);
+ ifi_baudrate.hash(state);
+ ifi_ipackets.hash(state);
+ ifi_ierrors.hash(state);
+ ifi_opackets.hash(state);
+ ifi_oerrors.hash(state);
+ ifi_collisions.hash(state);
+ ifi_ibytes.hash(state);
+ ifi_obytes.hash(state);
+ ifi_imcasts.hash(state);
+ ifi_omcasts.hash(state);
+ ifi_iqdrops.hash(state);
+ ifi_noproto.hash(state);
+ ifi_recvtiming.hash(state);
+ ifi_xmittiming.hash(state);
+ ifi_lastchange.hash(state);
+ }
+ }
+ impl PartialEq for if_msghdr2 {
+ fn eq(&self, other: &if_msghdr2) -> bool {
+ self.ifm_msglen == other.ifm_msglen &&
+ self.ifm_version == other.ifm_version &&
+ self.ifm_type == other.ifm_type &&
+ self.ifm_addrs == other.ifm_addrs &&
+ self.ifm_flags == other.ifm_flags &&
+ self.ifm_index == other.ifm_index &&
+ self.ifm_snd_len == other.ifm_snd_len &&
+ self.ifm_snd_maxlen == other.ifm_snd_maxlen &&
+ self.ifm_snd_drops == other.ifm_snd_drops &&
+ self.ifm_timer == other.ifm_timer &&
+ self.ifm_data == other.ifm_data
+ }
+ }
+ impl Eq for if_msghdr2 {}
+ impl ::fmt::Debug for if_msghdr2 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let ifm_msglen = self.ifm_msglen;
+ let ifm_version = self.ifm_version;
+ let ifm_type = self.ifm_type;
+ let ifm_addrs = self.ifm_addrs;
+ let ifm_flags = self.ifm_flags;
+ let ifm_index = self.ifm_index;
+ let ifm_snd_len = self.ifm_snd_len;
+ let ifm_snd_maxlen = self.ifm_snd_maxlen;
+ let ifm_snd_drops = self.ifm_snd_drops;
+ let ifm_timer = self.ifm_timer;
+ let ifm_data = self.ifm_data;
+ f.debug_struct("if_msghdr2")
+ .field("ifm_msglen", &ifm_msglen)
+ .field("ifm_version", &ifm_version)
+ .field("ifm_type", &ifm_type)
+ .field("ifm_addrs", &ifm_addrs)
+ .field("ifm_flags", &ifm_flags)
+ .field("ifm_index", &ifm_index)
+ .field("ifm_snd_len", &ifm_snd_len)
+ .field("ifm_snd_maxlen", &ifm_snd_maxlen)
+ .field("ifm_snd_drops", &ifm_snd_drops)
+ .field("ifm_timer", &ifm_timer)
+ .field("ifm_data", &ifm_data)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for if_msghdr2 {
+ fn hash(&self, state: &mut H) {
+ let ifm_msglen = self.ifm_msglen;
+ let ifm_version = self.ifm_version;
+ let ifm_type = self.ifm_type;
+ let ifm_addrs = self.ifm_addrs;
+ let ifm_flags = self.ifm_flags;
+ let ifm_index = self.ifm_index;
+ let ifm_snd_len = self.ifm_snd_len;
+ let ifm_snd_maxlen = self.ifm_snd_maxlen;
+ let ifm_snd_drops = self.ifm_snd_drops;
+ let ifm_timer = self.ifm_timer;
+ let ifm_data = self.ifm_data;
+ ifm_msglen.hash(state);
+ ifm_version.hash(state);
+ ifm_type.hash(state);
+ ifm_addrs.hash(state);
+ ifm_flags.hash(state);
+ ifm_index.hash(state);
+ ifm_snd_len.hash(state);
+ ifm_snd_maxlen.hash(state);
+ ifm_snd_drops.hash(state);
+ ifm_timer.hash(state);
+ ifm_data.hash(state);
+ }
+ }
+ impl PartialEq for vm_statistics64 {
+ fn eq(&self, other: &vm_statistics64) -> bool {
+ // Otherwise rustfmt crashes...
+ let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+ self.free_count == other.free_count &&
+ self.active_count == other.active_count &&
+ self.inactive_count == other.inactive_count &&
+ self.wire_count == other.wire_count &&
+ self.zero_fill_count == other.zero_fill_count &&
+ self.reactivations == other.reactivations &&
+ self.pageins == other.pageins &&
+ self.pageouts == other.pageouts &&
+ self.faults == other.faults &&
+ self.cow_faults == other.cow_faults &&
+ self.lookups == other.lookups &&
+ self.hits == other.hits &&
+ self.purges == other.purges &&
+ self.purgeable_count == other.purgeable_count &&
+ self.speculative_count == other.speculative_count &&
+ self.decompressions == other.decompressions &&
+ self.compressions == other.compressions &&
+ self.swapins == other.swapins &&
+ self.swapouts == other.swapouts &&
+ self.compressor_page_count == other.compressor_page_count &&
+ self.throttled_count == other.throttled_count &&
+ self.external_page_count == other.external_page_count &&
+ self.internal_page_count == other.internal_page_count &&
+ total_uncompressed == other.total_uncompressed_pages_in_compressor
+ }
+ }
+ impl Eq for vm_statistics64 {}
+ impl ::fmt::Debug for vm_statistics64 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let free_count = self.free_count;
+ let active_count = self.active_count;
+ let inactive_count = self.inactive_count;
+ let wire_count = self.wire_count;
+ let zero_fill_count = self.zero_fill_count;
+ let reactivations = self.reactivations;
+ let pageins = self.pageins;
+ let pageouts = self.pageouts;
+ let faults = self.faults;
+ let cow_faults = self.cow_faults;
+ let lookups = self.lookups;
+ let hits = self.hits;
+ let purges = self.purges;
+ let purgeable_count = self.purgeable_count;
+ let speculative_count = self.speculative_count;
+ let decompressions = self.decompressions;
+ let compressions = self.compressions;
+ let swapins = self.swapins;
+ let swapouts = self.swapouts;
+ let compressor_page_count = self.compressor_page_count;
+ let throttled_count = self.throttled_count;
+ let external_page_count = self.external_page_count;
+ let internal_page_count = self.internal_page_count;
+ // Otherwise rustfmt crashes...
+ let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+ f.debug_struct("vm_statistics64")
+ .field("free_count", &free_count)
+ .field("active_count", &active_count)
+ .field("inactive_count", &inactive_count)
+ .field("wire_count", &wire_count)
+ .field("zero_fill_count", &zero_fill_count)
+ .field("reactivations", &reactivations)
+ .field("pageins", &pageins)
+ .field("pageouts", &pageouts)
+ .field("faults", &faults)
+ .field("cow_faults", &cow_faults)
+ .field("lookups", &lookups)
+ .field("hits", &hits)
+ .field("purges", &purges)
+ .field("purgeable_count", &purgeable_count)
+ .field("speculative_count", &speculative_count)
+ .field("decompressions", &decompressions)
+ .field("compressions", &compressions)
+ .field("swapins", &swapins)
+ .field("swapouts", &swapouts)
+ .field("compressor_page_count", &compressor_page_count)
+ .field("throttled_count", &throttled_count)
+ .field("external_page_count", &external_page_count)
+ .field("internal_page_count", &internal_page_count)
+ .field("total_uncompressed_pages_in_compressor", &total_uncompressed)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for vm_statistics64 {
+ fn hash(&self, state: &mut H) {
+ let free_count = self.free_count;
+ let active_count = self.active_count;
+ let inactive_count = self.inactive_count;
+ let wire_count = self.wire_count;
+ let zero_fill_count = self.zero_fill_count;
+ let reactivations = self.reactivations;
+ let pageins = self.pageins;
+ let pageouts = self.pageouts;
+ let faults = self.faults;
+ let cow_faults = self.cow_faults;
+ let lookups = self.lookups;
+ let hits = self.hits;
+ let purges = self.purges;
+ let purgeable_count = self.purgeable_count;
+ let speculative_count = self.speculative_count;
+ let decompressions = self.decompressions;
+ let compressions = self.compressions;
+ let swapins = self.swapins;
+ let swapouts = self.swapouts;
+ let compressor_page_count = self.compressor_page_count;
+ let throttled_count = self.throttled_count;
+ let external_page_count = self.external_page_count;
+ let internal_page_count = self.internal_page_count;
+ // Otherwise rustfmt crashes...
+ let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+ free_count.hash(state);
+ active_count.hash(state);
+ inactive_count.hash(state);
+ wire_count.hash(state);
+ zero_fill_count.hash(state);
+ reactivations.hash(state);
+ pageins.hash(state);
+ pageouts.hash(state);
+ faults.hash(state);
+ cow_faults.hash(state);
+ lookups.hash(state);
+ hits.hash(state);
+ purges.hash(state);
+ purgeable_count.hash(state);
+ speculative_count.hash(state);
+ decompressions.hash(state);
+ compressions.hash(state);
+ swapins.hash(state);
+ swapouts.hash(state);
+ compressor_page_count.hash(state);
+ throttled_count.hash(state);
+ external_page_count.hash(state);
+ internal_page_count.hash(state);
+ total_uncompressed.hash(state);
+ }
+ }
+
+ impl PartialEq for mach_task_basic_info {
+ fn eq(&self, other: &mach_task_basic_info) -> bool {
+ self.virtual_size == other.virtual_size
+ && self.resident_size == other.resident_size
+ && self.resident_size_max == other.resident_size_max
+ && self.user_time == other.user_time
+ && self.system_time == other.system_time
+ && self.policy == other.policy
+ && self.suspend_count == other.suspend_count
+ }
+ }
+ impl Eq for mach_task_basic_info {}
+ impl ::fmt::Debug for mach_task_basic_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let virtual_size = self.virtual_size;
+ let resident_size = self.resident_size;
+ let resident_size_max = self.resident_size_max;
+ let user_time = self.user_time;
+ let system_time = self.system_time;
+ let policy = self.policy;
+ let suspend_count = self.suspend_count;
+ f.debug_struct("mach_task_basic_info")
+ .field("virtual_size", &virtual_size)
+ .field("resident_size", &resident_size)
+ .field("resident_size_max", &resident_size_max)
+ .field("user_time", &user_time)
+ .field("system_time", &system_time)
+ .field("policy", &policy)
+ .field("suspend_count", &suspend_count)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mach_task_basic_info {
+ fn hash(&self, state: &mut H) {
+ let virtual_size = self.virtual_size;
+ let resident_size = self.resident_size;
+ let resident_size_max = self.resident_size_max;
+ let user_time = self.user_time;
+ let system_time = self.system_time;
+ let policy = self.policy;
+ let suspend_count = self.suspend_count;
+ virtual_size.hash(state);
+ resident_size.hash(state);
+ resident_size_max.hash(state);
+ user_time.hash(state);
+ system_time.hash(state);
+ policy.hash(state);
+ suspend_count.hash(state);
+ }
+ }
+
+ impl PartialEq for log2phys {
+ fn eq(&self, other: &log2phys) -> bool {
+ self.l2p_flags == other.l2p_flags
+ && self.l2p_contigbytes == other.l2p_contigbytes
+ && self.l2p_devoffset == other.l2p_devoffset
+ }
+ }
+ impl Eq for log2phys {}
+ impl ::fmt::Debug for log2phys {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let l2p_flags = self.l2p_flags;
+ let l2p_contigbytes = self.l2p_contigbytes;
+ let l2p_devoffset = self.l2p_devoffset;
+ f.debug_struct("log2phys")
+ .field("l2p_flags", &l2p_flags)
+ .field("l2p_contigbytes", &l2p_contigbytes)
+ .field("l2p_devoffset", &l2p_devoffset)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for log2phys {
+ fn hash(&self, state: &mut H) {
+ let l2p_flags = self.l2p_flags;
+ let l2p_contigbytes = self.l2p_contigbytes;
+ let l2p_devoffset = self.l2p_devoffset;
+ l2p_flags.hash(state);
+ l2p_contigbytes.hash(state);
+ l2p_devoffset.hash(state);
+ }
+ }
+ impl PartialEq for os_unfair_lock {
+ fn eq(&self, other: &os_unfair_lock) -> bool {
+ self._os_unfair_lock_opaque == other._os_unfair_lock_opaque
+ }
+ }
+
+ impl Eq for os_unfair_lock {}
+
+ impl ::fmt::Debug for os_unfair_lock {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("os_unfair_lock")
+ .field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for os_unfair_lock {
+ fn hash(&self, state: &mut H) {
+ self._os_unfair_lock_opaque.hash(state);
+ }
+ }
}
}
@@ -1499,7 +2694,11 @@ pub const ABMON_11: ::nl_item = 43;
pub const ABMON_12: ::nl_item = 44;
pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_MONOTONIC_RAW_APPROX: ::clockid_t = 5;
pub const CLOCK_MONOTONIC: ::clockid_t = 6;
+pub const CLOCK_UPTIME_RAW: ::clockid_t = 8;
+pub const CLOCK_UPTIME_RAW_APPROX: ::clockid_t = 9;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
@@ -1529,6 +2728,8 @@ pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
+pub const SEEK_HOLE: ::c_int = 3;
+pub const SEEK_DATA: ::c_int = 4;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
@@ -1546,11 +2747,13 @@ pub const _PC_PIPE_BUF: ::c_int = 6;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
pub const _PC_NO_TRUNC: ::c_int = 8;
pub const _PC_VDISABLE: ::c_int = 9;
-pub const O_DSYNC: ::c_int = 0x400000;
-pub const O_NOCTTY: ::c_int = 0x20000;
-pub const O_CLOEXEC: ::c_int = 0x1000000;
-pub const O_DIRECTORY: ::c_int = 0x100000;
-pub const O_SYMLINK: ::c_int = 0x200000;
+pub const O_EVTONLY: ::c_int = 0x00008000;
+pub const O_NOCTTY: ::c_int = 0x00020000;
+pub const O_DIRECTORY: ::c_int = 0x00100000;
+pub const O_SYMLINK: ::c_int = 0x00200000;
+pub const O_DSYNC: ::c_int = 0x00400000;
+pub const O_CLOEXEC: ::c_int = 0x01000000;
+pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
@@ -1890,12 +3093,16 @@ pub const F_PREALLOCATE: ::c_int = 42;
pub const F_RDADVISE: ::c_int = 44;
pub const F_RDAHEAD: ::c_int = 45;
pub const F_NOCACHE: ::c_int = 48;
+pub const F_LOG2PHYS: ::c_int = 49;
pub const F_GETPATH: ::c_int = 50;
pub const F_FULLFSYNC: ::c_int = 51;
pub const F_FREEZE_FS: ::c_int = 53;
pub const F_THAW_FS: ::c_int = 54;
pub const F_GLOBAL_NOCACHE: ::c_int = 55;
pub const F_NODIRECT: ::c_int = 62;
+pub const F_LOG2PHYS_EXT: ::c_int = 65;
+pub const F_BARRIERFSYNC: ::c_int = 85;
+pub const F_GETPATH_NOFIRMLINK: ::c_int = 102;
pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
pub const F_ALLOCATEALL: ::c_uint = 0x04;
@@ -1909,6 +3116,11 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
pub const AT_REMOVEDIR: ::c_int = 0x0080;
+pub const PTHREAD_INTROSPECTION_THREAD_CREATE: ::c_uint = 1;
+pub const PTHREAD_INTROSPECTION_THREAD_START: ::c_uint = 2;
+pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: ::c_uint = 3;
+pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: ::c_uint = 4;
+
pub const TIOCMODG: ::c_ulong = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCM_LE: ::c_int = 0x1;
@@ -2346,6 +3558,7 @@ pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_SIP: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
+pub const AF_NDRV: ::c_int = 27;
pub const AF_ISDN: ::c_int = 28;
pub const AF_E164: ::c_int = AF_ISDN;
pub const pseudo_AF_KEY: ::c_int = 29;
@@ -2388,6 +3601,7 @@ pub const PF_SIP: ::c_int = AF_SIP;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
+pub const PF_NDRV: ::c_int = AF_NDRV;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_INET6: ::c_int = AF_INET6;
@@ -2415,8 +3629,10 @@ pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IP_RECVIF: ::c_int = 20;
+pub const IP_BOUND_IF: ::c_int = 25;
pub const IP_PKTINFO: ::c_int = 26;
pub const IP_RECVTOS: ::c_int = 27;
+pub const IP_DONTFRAG: ::c_int = 28;
pub const IPV6_JOIN_GROUP: ::c_int = 12;
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const IPV6_CHECKSUM: ::c_int = 26;
@@ -2425,6 +3641,12 @@ pub const IPV6_TCLASS: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVPKTINFO: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
+pub const IP_BLOCK_SOURCE: ::c_int = 72;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
+pub const IPV6_BOUND_IF: ::c_int = 125;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
@@ -2652,6 +3874,11 @@ pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
pub const _SC_PASS_MAX: ::c_int = 131;
+// `confstr` keys (only the values guaranteed by `man confstr`).
+pub const _CS_PATH: ::c_int = 1;
+pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
+pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
+pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
@@ -2673,6 +3900,20 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
__opaque: [0; __PTHREAD_RWLOCK_SIZE__],
};
+pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
+ _os_unfair_lock_opaque: 0,
+};
+
+pub const OS_LOG_TYPE_DEFAULT: ::os_log_type_t = 0x00;
+pub const OS_LOG_TYPE_INFO: ::os_log_type_t = 0x01;
+pub const OS_LOG_TYPE_DEBUG: ::os_log_type_t = 0x02;
+pub const OS_LOG_TYPE_ERROR: ::os_log_type_t = 0x10;
+pub const OS_LOG_TYPE_FAULT: ::os_log_type_t = 0x11;
+
+pub const OS_SIGNPOST_EVENT: ::os_signpost_type_t = 0x00;
+pub const OS_SIGNPOST_INTERVAL_BEGIN: ::os_signpost_type_t = 0x01;
+pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
+
pub const MINSIGSTKSZ: ::size_t = 32768;
pub const SIGSTKSZ: ::size_t = 131072;
@@ -2680,6 +3921,10 @@ pub const FD_SETSIZE: usize = 1024;
pub const ST_NOSUID: ::c_ulong = 2;
+pub const SCHED_OTHER: ::c_int = 1;
+pub const SCHED_FIFO: ::c_int = 4;
+pub const SCHED_RR: ::c_int = 2;
+
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
@@ -2960,6 +4205,59 @@ pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_LCID: ::c_int = 7;
+pub const KERN_SUCCESS: ::c_int = 0;
+pub const KERN_INVALID_ADDRESS: ::c_int = 1;
+pub const KERN_PROTECTION_FAILURE: ::c_int = 2;
+pub const KERN_NO_SPACE: ::c_int = 3;
+pub const KERN_INVALID_ARGUMENT: ::c_int = 4;
+pub const KERN_FAILURE: ::c_int = 5;
+pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6;
+pub const KERN_NOT_RECEIVER: ::c_int = 7;
+pub const KERN_NO_ACCESS: ::c_int = 8;
+pub const KERN_MEMORY_FAILURE: ::c_int = 9;
+pub const KERN_MEMORY_ERROR: ::c_int = 10;
+pub const KERN_ALREADY_IN_SET: ::c_int = 11;
+pub const KERN_NOT_IN_SET: ::c_int = 12;
+pub const KERN_NAME_EXISTS: ::c_int = 13;
+pub const KERN_ABORTED: ::c_int = 14;
+pub const KERN_INVALID_NAME: ::c_int = 15;
+pub const KERN_INVALID_TASK: ::c_int = 16;
+pub const KERN_INVALID_RIGHT: ::c_int = 17;
+pub const KERN_INVALID_VALUE: ::c_int = 18;
+pub const KERN_UREFS_OVERFLOW: ::c_int = 19;
+pub const KERN_INVALID_CAPABILITY: ::c_int = 20;
+pub const KERN_RIGHT_EXISTS: ::c_int = 21;
+pub const KERN_INVALID_HOST: ::c_int = 22;
+pub const KERN_MEMORY_PRESENT: ::c_int = 23;
+pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24;
+pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25;
+pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26;
+pub const KERN_POLICY_LIMIT: ::c_int = 27;
+pub const KERN_INVALID_POLICY: ::c_int = 28;
+pub const KERN_INVALID_OBJECT: ::c_int = 29;
+pub const KERN_ALREADY_WAITING: ::c_int = 30;
+pub const KERN_DEFAULT_SET: ::c_int = 31;
+pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32;
+pub const KERN_INVALID_LEDGER: ::c_int = 33;
+pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34;
+pub const KERN_INVALID_SECURITY: ::c_int = 35;
+pub const KERN_NOT_DEPRESSED: ::c_int = 36;
+pub const KERN_TERMINATED: ::c_int = 37;
+pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38;
+pub const KERN_LOCK_UNSTABLE: ::c_int = 39;
+pub const KERN_LOCK_OWNED: ::c_int = 40;
+pub const KERN_LOCK_OWNED_SELF: ::c_int = 41;
+pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42;
+pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43;
+pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44;
+pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45;
+pub const KERN_NOT_SUPPORTED: ::c_int = 46;
+pub const KERN_NODE_DOWN: ::c_int = 47;
+pub const KERN_NOT_WAITING: ::c_int = 48;
+pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49;
+pub const KERN_CODESIGN_ERROR: ::c_int = 50;
+pub const KERN_POLICY_STATIC: ::c_int = 51;
+pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52;
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
@@ -2975,6 +4273,11 @@ pub const VM_LOADAVG: ::c_int = 2;
pub const VM_MACHFACTOR: ::c_int = 4;
pub const VM_SWAPUSAGE: ::c_int = 5;
pub const VM_MAXID: ::c_int = 6;
+pub const VM_PROT_NONE: ::vm_prot_t = 0x00;
+pub const VM_PROT_READ: ::vm_prot_t = 0x01;
+pub const VM_PROT_WRITE: ::vm_prot_t = 0x02;
+pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04;
+pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0;
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
@@ -3039,11 +4342,8 @@ pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00001000;
-pub const AI_MASK: ::c_int = AI_PASSIVE
- | AI_CANONNAME
- | AI_NUMERICHOST
- | AI_NUMERICSERV
- | AI_ADDRCONFIG;
+pub const AI_MASK: ::c_int =
+ AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
pub const AI_ALL: ::c_int = 0x00000100;
pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
@@ -3119,6 +4419,8 @@ 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 RTF_DEAD: ::c_int = 0x20000000;
+pub const RTF_GLOBAL: ::c_int = 0x40000000;
pub const RTM_VERSION: ::c_int = 5;
@@ -3177,8 +4479,14 @@ pub const RTAX_MAX: ::c_int = 8;
pub const KERN_PROCARGS2: ::c_int = 49;
pub const PROC_PIDTASKALLINFO: ::c_int = 2;
+pub const PROC_PIDTBSDINFO: ::c_int = 3;
pub const PROC_PIDTASKINFO: ::c_int = 4;
pub const PROC_PIDTHREADINFO: ::c_int = 5;
+pub const PROC_PIDVNODEPATHINFO: ::c_int = 9;
+pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096;
+pub const PROC_CSM_ALL: ::c_uint = 0x0001;
+pub const PROC_CSM_NOSMT: ::c_uint = 0x0002;
+pub const PROC_CSM_TECS: ::c_uint = 0x0004;
pub const MAXCOMLEN: usize = 16;
pub const MAXTHREADNAMESIZE: usize = 64;
@@ -3215,18 +4523,10 @@ pub const DLT_LOOP: ::c_uint = 108;
pub const BPF_ALIGNMENT: ::c_int = 4;
// sys/mount.h
-pub const MNT_RDONLY: ::c_int = 0x00000001;
-pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
-pub const MNT_NOEXEC: ::c_int = 0x00000004;
-pub const MNT_NOSUID: ::c_int = 0x00000008;
pub const MNT_NODEV: ::c_int = 0x00000010;
pub const MNT_UNION: ::c_int = 0x00000020;
-pub const MNT_ASYNC: ::c_int = 0x00000040;
pub const MNT_CPROTECT: ::c_int = 0x00000080;
-// NFS export related mount flags.
-pub const MNT_EXPORTED: ::c_int = 0x00000100;
-
// MAC labeled / "quarantined" flag
pub const MNT_QUARANTINE: ::c_int = 0x00000400;
@@ -3247,9 +4547,7 @@ pub const MNT_NOATIME: ::c_int = 0x10000000;
pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
// External filesystem command modifier flags.
-pub const MNT_UPDATE: ::c_int = 0x00010000;
pub const MNT_NOBLOCK: ::c_int = 0x00020000;
-pub const MNT_RELOAD: ::c_int = 0x00040000;
// sys/spawn.h:
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
@@ -3365,6 +4663,257 @@ pub const TIME_ERROR: ::c_int = 5;
pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
+//
+pub const THREAD_STANDARD_POLICY: ::c_int = 1;
+pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0;
+pub const THREAD_EXTENDED_POLICY: ::c_int = 1;
+pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2;
+pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3;
+pub const THREAD_AFFINITY_POLICY: ::c_int = 4;
+pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0;
+pub const THREAD_BACKGROUND_POLICY: ::c_int = 5;
+pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000;
+pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7;
+pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8;
+
+//
+pub const TH_STATE_RUNNING: ::c_int = 1;
+pub const TH_STATE_STOPPED: ::c_int = 2;
+pub const TH_STATE_WAITING: ::c_int = 3;
+pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4;
+pub const TH_STATE_HALTED: ::c_int = 5;
+pub const TH_FLAGS_SWAPPED: ::c_int = 0x1;
+pub const TH_FLAGS_IDLE: ::c_int = 0x2;
+pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4;
+pub const THREAD_BASIC_INFO: ::c_int = 3;
+pub const THREAD_IDENTIFIER_INFO: ::c_int = 4;
+pub const THREAD_EXTENDED_INFO: ::c_int = 5;
+
+// CommonCrypto/CommonCryptoError.h
+pub const kCCSuccess: i32 = 0;
+pub const kCCParamError: i32 = -4300;
+pub const kCCBufferTooSmall: i32 = -4301;
+pub const kCCMemoryFailure: i32 = -4302;
+pub const kCCAlignmentError: i32 = -4303;
+pub const kCCDecodeError: i32 = -4304;
+pub const kCCUnimplemented: i32 = -4305;
+pub const kCCOverflow: i32 = -4306;
+pub const kCCRNGFailure: i32 = -4307;
+pub const kCCUnspecifiedError: i32 = -4308;
+pub const kCCCallSequenceError: i32 = -4309;
+pub const kCCKeySizeError: i32 = -4310;
+pub const kCCInvalidKey: i32 = -4311;
+
+// mach/host_info.h
+pub const HOST_LOAD_INFO: i32 = 1;
+pub const HOST_VM_INFO: i32 = 2;
+pub const HOST_CPU_LOAD_INFO: i32 = 3;
+pub const HOST_VM_INFO64: i32 = 4;
+pub const HOST_EXTMOD_INFO64: i32 = 5;
+pub const HOST_EXPIRED_TASK_INFO: i32 = 6;
+
+// mach/vm_statistics.h
+pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1;
+pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2;
+pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4;
+pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8;
+pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10;
+pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20;
+pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40;
+pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80;
+pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100;
+pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200;
+pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;
+
+// mach/task_info.h
+pub const TASK_THREAD_TIMES_INFO: u32 = 3;
+pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;
+pub const MACH_TASK_BASIC_INFO: u32 = 20;
+
+pub const MACH_PORT_NULL: i32 = 0;
+
+pub const RUSAGE_INFO_V0: ::c_int = 0;
+pub const RUSAGE_INFO_V1: ::c_int = 1;
+pub const RUSAGE_INFO_V2: ::c_int = 2;
+pub const RUSAGE_INFO_V3: ::c_int = 3;
+pub const RUSAGE_INFO_V4: ::c_int = 4;
+
+// copyfile.h
+pub const COPYFILE_ACL: ::copyfile_flags_t = 1 << 0;
+pub const COPYFILE_STAT: ::copyfile_flags_t = 1 << 1;
+pub const COPYFILE_XATTR: ::copyfile_flags_t = 1 << 2;
+pub const COPYFILE_DATA: ::copyfile_flags_t = 1 << 3;
+pub const COPYFILE_SECURITY: ::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
+pub const COPYFILE_METADATA: ::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
+pub const COPYFILE_RECURSIVE: ::copyfile_flags_t = 1 << 15;
+pub const COPYFILE_CHECK: ::copyfile_flags_t = 1 << 16;
+pub const COPYFILE_EXCL: ::copyfile_flags_t = 1 << 17;
+pub const COPYFILE_NOFOLLOW_SRC: ::copyfile_flags_t = 1 << 18;
+pub const COPYFILE_NOFOLLOW_DST: ::copyfile_flags_t = 1 << 19;
+pub const COPYFILE_MOVE: ::copyfile_flags_t = 1 << 20;
+pub const COPYFILE_UNLINK: ::copyfile_flags_t = 1 << 21;
+pub const COPYFILE_NOFOLLOW: ::copyfile_flags_t = COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
+pub const COPYFILE_PACK: ::copyfile_flags_t = 1 << 22;
+pub const COPYFILE_UNPACK: ::copyfile_flags_t = 1 << 23;
+pub const COPYFILE_CLONE: ::copyfile_flags_t = 1 << 24;
+pub const COPYFILE_CLONE_FORCE: ::copyfile_flags_t = 1 << 25;
+pub const COPYFILE_RUN_IN_PLACE: ::copyfile_flags_t = 1 << 26;
+pub const COPYFILE_DATA_SPARSE: ::copyfile_flags_t = 1 << 27;
+pub const COPYFILE_PRESERVE_DST_TRACKED: ::copyfile_flags_t = 1 << 28;
+pub const COPYFILE_VERBOSE: ::copyfile_flags_t = 1 << 30;
+pub const COPYFILE_RECURSE_ERROR: ::c_int = 0;
+pub const COPYFILE_RECURSE_FILE: ::c_int = 1;
+pub const COPYFILE_RECURSE_DIR: ::c_int = 2;
+pub const COPYFILE_RECURSE_DIR_CLEANUP: ::c_int = 3;
+pub const COPYFILE_COPY_DATA: ::c_int = 4;
+pub const COPYFILE_COPY_XATTR: ::c_int = 5;
+pub const COPYFILE_START: ::c_int = 1;
+pub const COPYFILE_FINISH: ::c_int = 2;
+pub const COPYFILE_ERR: ::c_int = 3;
+pub const COPYFILE_PROGRESS: ::c_int = 4;
+pub const COPYFILE_CONTINUE: ::c_int = 0;
+pub const COPYFILE_SKIP: ::c_int = 1;
+pub const COPYFILE_QUIT: ::c_int = 2;
+
+//
+pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5;
+pub const FSOPT_NOFOLLOW: u32 = 0x1;
+pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
+pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
+pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8;
+pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20;
+pub const FSOPT_RETURN_REALDEV: u32 = 0x200;
+pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001;
+pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002;
+pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004;
+pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008;
+pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010;
+pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020;
+pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040;
+pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080;
+pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100;
+pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200;
+pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400;
+pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800;
+pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000;
+pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000;
+pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000;
+pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000;
+pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000;
+pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000;
+pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000;
+pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000;
+pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000;
+pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000;
+pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000;
+pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000;
+pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000;
+pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000;
+pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000;
+pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000;
+pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000;
+pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000;
+pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000;
+pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001;
+pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002;
+pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004;
+pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008;
+pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010;
+pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020;
+pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040;
+pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080;
+pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100;
+pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200;
+pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400;
+pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800;
+pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000;
+pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000;
+pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000;
+pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000;
+pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000;
+pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000;
+pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000;
+pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000;
+pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000;
+pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000;
+pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000;
+pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000;
+pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001;
+pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002;
+pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004;
+pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008;
+pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010;
+pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020;
+pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001;
+pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002;
+pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004;
+pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008;
+pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020;
+pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080;
+pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100;
+pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200;
+pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400;
+pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000;
+pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000;
+pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004;
+pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008;
+pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010;
+pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020;
+pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040;
+pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080;
+pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100;
+pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200;
+pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400;
+pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1;
+pub const VOL_CAPABILITIES_FORMAT: usize = 0;
+pub const VOL_CAPABILITIES_INTERFACES: usize = 1;
+pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001;
+pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002;
+pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004;
+pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008;
+pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010;
+pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020;
+pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040;
+pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080;
+pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100;
+pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200;
+pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400;
+pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800;
+pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000;
+pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000;
+pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000;
+pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000;
+pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000;
+pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000;
+pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000;
+pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000;
+pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000;
+pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000;
+pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000;
+pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000;
+pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000;
+pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000;
+pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001;
+pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002;
+pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004;
+pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008;
+pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010;
+pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020;
+pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040;
+pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080;
+pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100;
+pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200;
+pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400;
+pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800;
+pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000;
+pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000;
+pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000;
+pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000;
+pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000;
+pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
+pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
+pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
const fn __DARWIN_ALIGN32(p: usize) -> usize {
@@ -3384,6 +4933,64 @@ cfg_if! {
}
}
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() /
+ ::mem::size_of::()) as mach_msg_type_number_t;
+ pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() /
+ ::mem::size_of::()) as mach_msg_type_number_t;
+ pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+
+ pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
+ (::mem::size_of::()
+ / ::mem::size_of::()) as u32;
+ pub const MACH_TASK_BASIC_INFO_COUNT: u32 = (::mem::size_of::()
+ / ::mem::size_of::()) as u32;
+ pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
+ (::mem::size_of::() / ::mem::size_of::())
+ as mach_msg_type_number_t;
+ } else {
+ pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
+ pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+ pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10;
+ pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6;
+ pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28;
+ pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = 4;
+ pub const MACH_TASK_BASIC_INFO_COUNT: u32 = 12;
+ pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = 38;
+ }
+}
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
@@ -3416,6 +5023,22 @@ f! {
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
+
+ pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
+ (id as u32) << 24u32
+ }
+
+ pub fn major(dev: dev_t) -> i32 {
+ (dev >> 24) & 0xff
+ }
+
+ pub fn minor(dev: dev_t) -> i32 {
+ dev & 0xffffff
+ }
+
+ pub fn makedev(major: i32, minor: i32) -> dev_t {
+ (major << 24) | minor
+ }
}
safe_f! {
@@ -3451,11 +5074,7 @@ extern "C" {
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
@@ -3475,6 +5094,11 @@ extern "C" {
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "confstr$UNIX2003"
+ )]
+ pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
@@ -3504,11 +5128,7 @@ extern "C" {
sevlen: ::socklen_t,
flags: ::c_int,
) -> ::c_int;
- pub fn mincore(
- addr: *const ::c_void,
- len: ::size_t,
- vec: *mut ::c_char,
- ) -> ::c_int;
+ pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn sysctlnametomib(
name: *const ::c_char,
mibp: *mut ::c_int,
@@ -3518,44 +5138,23 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "mprotect$UNIX2003"
)]
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "semctl$UNIX2003"
)]
- pub fn semctl(
- semid: ::c_int,
- semnum: ::c_int,
- cmd: ::c_int,
- ...
- ) -> ::c_int;
- pub fn semop(
- semid: ::c_int,
- sops: *mut sembuf,
- nsops: ::size_t,
- ) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ 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 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,
@@ -3572,24 +5171,26 @@ extern "C" {
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn mach_absolute_time() -> u64;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
#[allow(deprecated)]
pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
+ pub fn mach_host_self() -> mach_port_t;
+ pub fn mach_thread_self() -> mach_port_t;
pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
- pub fn pthread_getname_np(
- thread: ::pthread_t,
- name: *mut ::c_char,
- len: ::size_t,
- ) -> ::c_int;
+ pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+ pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
+ pub fn pthread_create_from_mach_thread(
+ thread: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
- pub fn pthread_condattr_setpshared(
- attr: *mut pthread_condattr_t,
- pshared: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_condattr_getpshared(
attr: *const pthread_condattr_t,
pshared: *mut ::c_int,
@@ -3606,12 +5207,126 @@ extern "C" {
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
- pub fn pthread_rwlockattr_setpshared(
- attr: *mut pthread_rwlockattr_t,
- val: ::c_int,
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int;
+ pub fn pthread_attr_set_qos_class_np(
+ attr: *mut pthread_attr_t,
+ class: qos_class_t,
+ priority: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_get_qos_class_np(
+ attr: *mut pthread_attr_t,
+ class: *mut qos_class_t,
+ priority: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int;
+ pub fn pthread_get_qos_class_np(
+ thread: ::pthread_t,
+ class: *mut qos_class_t,
+ priority: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_getschedparam(
+ attr: *const ::pthread_attr_t,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_attr_setschedparam(
+ attr: *mut ::pthread_attr_t,
+ param: *const sched_param,
) -> ::c_int;
+ pub fn pthread_getschedparam(
+ thread: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_setschedparam(
+ thread: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+
+ // Available from Big Sur
+ pub fn pthread_introspection_hook_install(
+ hook: ::pthread_introspection_hook_t,
+ ) -> ::pthread_introspection_hook_t;
+ pub fn pthread_introspection_setspecific_np(
+ thread: ::pthread_t,
+ key: ::pthread_key_t,
+ value: *const ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_introspection_getspecific_np(
+ thread: ::pthread_t,
+ key: ::pthread_key_t,
+ ) -> *mut ::c_void;
+ pub fn pthread_jit_write_protect_np(enabled: ::c_int);
+ pub fn pthread_jit_write_protect_supported_np() -> ::c_int;
+ // An array of pthread_jit_write_with_callback_np must declare
+ // the list of callbacks e.g.
+ // #[link_section = "__DATA_CONST,__pth_jit_func"]
+ // static callbacks: [libc::pthread_jit_write_callback_t; 2] = [native_jit_write_cb,
+ // std::mem::transmute::(std::ptr::null())];
+ // (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages).
+ pub fn pthread_jit_write_with_callback_np(
+ callback: ::pthread_jit_write_callback_t,
+ ctx: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_jit_write_freeze_callbacks_np();
+ pub fn pthread_cpu_number_np(cpu_number_out: *mut ::size_t) -> ::c_int;
+
+ pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
+ pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
+
+ pub fn os_log_create(subsystem: *const ::c_char, category: *const ::c_char) -> ::os_log_t;
+ pub fn os_log_type_enabled(oslog: ::os_log_t, tpe: ::os_log_type_t) -> bool;
+ pub fn os_signpost_id_make_with_pointer(
+ log: ::os_log_t,
+ ptr: *const ::c_void,
+ ) -> ::os_signpost_id_t;
+ pub fn os_signpost_id_generate(log: ::os_log_t) -> ::os_signpost_id_t;
+ pub fn os_signpost_enabled(log: ::os_log_t) -> bool;
+
+ pub fn thread_policy_set(
+ thread: thread_t,
+ flavor: thread_policy_flavor_t,
+ policy_info: thread_policy_t,
+ count: mach_msg_type_number_t,
+ ) -> kern_return_t;
+ pub fn thread_policy_get(
+ thread: thread_t,
+ flavor: thread_policy_flavor_t,
+ policy_info: thread_policy_t,
+ count: *mut mach_msg_type_number_t,
+ get_default: *mut boolean_t,
+ ) -> kern_return_t;
+ pub fn thread_info(
+ target_act: thread_inspect_t,
+ flavor: thread_flavor_t,
+ thread_info_out: thread_info_t,
+ thread_info_outCnt: *mut mach_msg_type_number_t,
+ ) -> kern_return_t;
+ #[cfg_attr(doc, doc(alias = "__errno_location"))]
+ #[cfg_attr(doc, doc(alias = "errno"))]
pub fn __error() -> *mut ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
+ pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char;
+ pub fn backtrace_symbols_fd(addrs: *const *mut ::c_void, sz: ::c_int, fd: ::c_int);
+ pub fn backtrace_from_fp(
+ startfp: *mut ::c_void,
+ array: *mut *mut ::c_void,
+ size: ::c_int,
+ ) -> ::c_int;
+ pub fn backtrace_image_offsets(
+ array: *const *mut ::c_void,
+ image_offsets: *mut image_offset,
+ size: ::c_int,
+ );
+ pub fn backtrace_async(
+ array: *mut *mut ::c_void,
+ length: ::size_t,
+ task_id: *mut u32,
+ ) -> ::size_t;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "statfs$INODE64"
@@ -3645,12 +5360,13 @@ extern "C" {
flags: ::c_int,
data: *mut ::c_void,
) -> ::c_int;
- pub fn ptrace(
- request: ::c_int,
- pid: ::pid_t,
- addr: *mut ::c_char,
- data: ::c_int,
+ pub fn fmount(
+ src: *const ::c_char,
+ fd: ::c_int,
+ flags: ::c_int,
+ data: *mut ::c_void,
) -> ::c_int;
+ pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
pub fn quotactl(
special: *const ::c_char,
cmd: ::c_int,
@@ -3690,29 +5406,16 @@ extern "C" {
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t) -> ::c_int;
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
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 preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
pub fn getxattr(
path: *const ::c_char,
name: *const ::c_char,
@@ -3757,16 +5460,8 @@ extern "C" {
size: ::size_t,
flags: ::c_int,
) -> ::ssize_t;
- pub fn removexattr(
- path: *const ::c_char,
- name: *const ::c_char,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn renamex_np(
- from: *const ::c_char,
- to: *const ::c_char,
- flags: ::c_uint,
- ) -> ::c_int;
+ pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int;
+ pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn renameatx_np(
fromfd: ::c_int,
from: *const ::c_char,
@@ -3774,11 +5469,7 @@ extern "C" {
to: *const ::c_char,
flags: ::c_uint,
) -> ::c_int;
- pub fn fremovexattr(
- filedes: ::c_int,
- name: *const ::c_char,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
name: *const ::c_char,
@@ -3792,26 +5483,19 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "waitid$UNIX2003"
)]
- pub fn waitid(
- idtype: idtype_t,
- id: id_t,
- infop: *mut ::siginfo_t,
- options: ::c_int,
- ) -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
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;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_image_count() -> u32;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
#[allow(deprecated)]
pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
- #[deprecated(since = "0.2.55", note = "Use the mach crate")]
+ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
pub fn posix_spawn(
@@ -3852,25 +5536,29 @@ extern "C" {
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_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(
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+ pub fn posix_spawnattr_setarchpref_np(
attr: *mut posix_spawnattr_t,
- flags: ::pid_t,
- ) -> ::c_int;
-
- pub fn posix_spawn_file_actions_init(
- actions: *mut posix_spawn_file_actions_t,
+ count: ::size_t,
+ pref: *mut ::cpu_type_t,
+ subpref: *mut ::cpu_subtype_t,
+ ocount: *mut ::size_t,
) -> ::c_int;
- pub fn posix_spawn_file_actions_destroy(
- actions: *mut posix_spawn_file_actions_t,
+ pub fn posix_spawnattr_getarchpref_np(
+ attr: *const posix_spawnattr_t,
+ count: ::size_t,
+ pref: *mut ::cpu_type_t,
+ subpref: *mut ::cpu_subtype_t,
+ ocount: *mut ::size_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,
@@ -3899,11 +5587,7 @@ extern "C" {
len: *mut ::size_t,
connid: *mut sae_connid_t,
) -> ::c_int;
- pub fn disconnectx(
- socket: ::c_int,
- associd: sae_associd_t,
- connid: sae_connid_t,
- ) -> ::c_int;
+ pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int;
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
@@ -3917,16 +5601,315 @@ extern "C" {
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "getfsstat$INODE64"
)]
- pub fn getfsstat(
- mntbufp: *mut statfs,
- bufsize: ::c_int,
+ pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int;
+
+ // Copy-on-write functions.
+ // According to the man page `flags` is an `int` but in the header
+ // this is a `uint32_t`.
+ pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int;
+ pub fn clonefileat(
+ src_dirfd: ::c_int,
+ src: *const ::c_char,
+ dst_dirfd: ::c_int,
+ dst: *const ::c_char,
+ flags: u32,
+ ) -> ::c_int;
+ pub fn fclonefileat(
+ srcfd: ::c_int,
+ dst_dirfd: ::c_int,
+ dst: *const ::c_char,
+ flags: u32,
+ ) -> ::c_int;
+
+ pub fn copyfile(
+ from: *const ::c_char,
+ to: *const ::c_char,
+ state: copyfile_state_t,
+ flags: copyfile_flags_t,
+ ) -> ::c_int;
+ pub fn fcopyfile(
+ from: ::c_int,
+ to: ::c_int,
+ state: copyfile_state_t,
+ flags: copyfile_flags_t,
+ ) -> ::c_int;
+
+ // Added in macOS 10.13
+ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+ // Added in macOS 10.5
+ pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t);
+ pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t);
+ pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
+
+ // Inherited from BSD but available from Big Sur only
+ pub fn strtonum(
+ __numstr: *const ::c_char,
+ __minval: ::c_longlong,
+ __maxval: ::c_longlong,
+ errstrp: *mut *const ::c_char,
+ ) -> ::c_longlong;
+
+ pub fn mstats() -> mstats;
+ pub fn malloc_printf(format: *const ::c_char, ...);
+ pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
+ pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
+ pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
+ pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
+ pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
+ pub fn malloc_default_zone() -> *mut ::malloc_zone_t;
+ pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t;
+ pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+ pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+ pub fn malloc_zone_calloc(
+ zone: *mut ::malloc_zone_t,
+ num_items: ::size_t,
+ size: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn malloc_zone_realloc(
+ zone: *mut ::malloc_zone_t,
+ ptr: *mut ::c_void,
+ size: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void);
+
+ pub fn proc_listpids(
+ t: u32,
+ typeinfo: u32,
+ buffer: *mut ::c_void,
+ buffersize: ::c_int,
+ ) -> ::c_int;
+ pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int;
+ pub fn proc_listpgrppids(
+ pgrpid: ::pid_t,
+ buffer: *mut ::c_void,
+ buffersize: ::c_int,
+ ) -> ::c_int;
+ pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int)
+ -> ::c_int;
+ pub fn proc_pidinfo(
+ pid: ::c_int,
+ flavor: ::c_int,
+ arg: u64,
+ buffer: *mut ::c_void,
+ buffersize: ::c_int,
+ ) -> ::c_int;
+ pub fn proc_pidfdinfo(
+ pid: ::c_int,
+ fd: ::c_int,
+ flavor: ::c_int,
+ buffer: *mut ::c_void,
+ buffersize: ::c_int,
+ ) -> ::c_int;
+ pub fn proc_pidfileportinfo(
+ pid: ::c_int,
+ fileport: u32,
+ flavor: ::c_int,
+ buffer: *mut ::c_void,
+ buffersize: ::c_int,
+ ) -> ::c_int;
+ pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+ pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+ pub fn proc_regionfilename(
+ pid: ::c_int,
+ address: u64,
+ buffer: *mut ::c_void,
+ buffersize: u32,
+ ) -> ::c_int;
+ pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+ pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
+ pub fn proc_pid_rusage(pid: ::c_int, flavor: ::c_int, buffer: *mut rusage_info_t) -> ::c_int;
+
+ // Available from Big Sur
+ pub fn proc_set_no_smt() -> ::c_int;
+ pub fn proc_setthread_no_smt() -> ::c_int;
+ pub fn proc_set_csm(flags: u32) -> ::c_int;
+ pub fn proc_setthread_csm(flags: u32) -> ::c_int;
+ /// # Notes
+ ///
+ /// `id` is of type [`uuid_t`].
+ pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
+
+ pub fn gethostid() -> ::c_long;
+ pub fn sethostid(hostid: ::c_long);
+
+ pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
+
+ pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;
+ pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;
+
+ pub fn mach_vm_map(
+ target_task: ::vm_map_t,
+ address: *mut ::mach_vm_address_t,
+ size: ::mach_vm_size_t,
+ mask: ::mach_vm_offset_t,
flags: ::c_int,
+ object: ::mem_entry_name_port_t,
+ offset: ::memory_object_offset_t,
+ copy: ::boolean_t,
+ cur_protection: ::vm_prot_t,
+ max_protection: ::vm_prot_t,
+ inheritance: ::vm_inherit_t,
+ ) -> ::kern_return_t;
+
+ pub fn vm_deallocate(
+ target_task: vm_map_t,
+ address: vm_address_t,
+ size: vm_size_t,
+ ) -> ::kern_return_t;
+
+ pub fn host_statistics64(
+ host_priv: host_t,
+ flavor: host_flavor_t,
+ host_info64_out: host_info64_t,
+ host_info64_outCnt: *mut mach_msg_type_number_t,
+ ) -> ::kern_return_t;
+ pub fn host_processor_info(
+ host: host_t,
+ flavor: processor_flavor_t,
+ out_processor_count: *mut natural_t,
+ out_processor_info: *mut processor_info_array_t,
+ out_processor_infoCnt: *mut mach_msg_type_number_t,
+ ) -> ::kern_return_t;
+
+ pub static mut mach_task_self_: ::mach_port_t;
+ pub fn task_for_pid(
+ host: ::mach_port_t,
+ pid: ::pid_t,
+ task: *mut ::mach_port_t,
+ ) -> ::kern_return_t;
+ pub fn task_info(
+ host: ::mach_port_t,
+ flavor: task_flavor_t,
+ task_info_out: task_info_t,
+ task_info_count: *mut mach_msg_type_number_t,
+ ) -> ::kern_return_t;
+ pub fn task_create(
+ target_task: ::task_t,
+ ledgers: ::ledger_array_t,
+ ledgersCnt: ::mach_msg_type_number_t,
+ inherit_memory: ::boolean_t,
+ child_task: *mut ::task_t,
+ ) -> ::kern_return_t;
+ pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t;
+ pub fn task_threads(
+ target_task: ::task_inspect_t,
+ act_list: *mut ::thread_act_array_t,
+ act_listCnt: *mut ::mach_msg_type_number_t,
+ ) -> ::kern_return_t;
+ pub fn host_statistics(
+ host_priv: host_t,
+ flavor: host_flavor_t,
+ host_info_out: host_info_t,
+ host_info_outCnt: *mut mach_msg_type_number_t,
+ ) -> ::kern_return_t;
+
+ // sysdir.h
+ pub fn sysdir_start_search_path_enumeration(
+ dir: sysdir_search_path_directory_t,
+ domainMask: sysdir_search_path_domain_mask_t,
+ ) -> ::sysdir_search_path_enumeration_state;
+ pub fn sysdir_get_next_search_path_enumeration(
+ state: ::sysdir_search_path_enumeration_state,
+ path: *mut ::c_char,
+ ) -> ::sysdir_search_path_enumeration_state;
+
+ pub static vm_page_size: vm_size_t;
+
+ pub fn getattrlist(
+ path: *const ::c_char,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u32,
) -> ::c_int;
+ pub fn fgetattrlist(
+ fd: ::c_int,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u32,
+ ) -> ::c_int;
+ pub fn getattrlistat(
+ fd: ::c_int,
+ path: *const ::c_char,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: ::c_ulong,
+ ) -> ::c_int;
+ pub fn setattrlist(
+ path: *const ::c_char,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u32,
+ ) -> ::c_int;
+ pub fn fsetattrlist(
+ fd: ::c_int,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u32,
+ ) -> ::c_int;
+ pub fn setattrlistat(
+ dir_fd: ::c_int,
+ path: *const ::c_char,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u32,
+ ) -> ::c_int;
+ pub fn getattrlistbulk(
+ dirfd: ::c_int,
+ attrList: *mut ::c_void,
+ attrBuf: *mut ::c_void,
+ attrBufSize: ::size_t,
+ options: u64,
+ ) -> ::c_int;
+
+ pub fn malloc_size(ptr: *const ::c_void) -> ::size_t;
+ pub fn malloc_good_size(size: ::size_t) -> ::size_t;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
- pub fn iconv_open(
- tocode: *const ::c_char,
- fromcode: *const ::c_char,
- ) -> iconv_t;
+pub unsafe fn mach_task_self() -> ::mach_port_t {
+ mach_task_self_
+}
+
+cfg_if! {
+ if #[cfg(target_os = "macos")] {
+ extern "C" {
+ pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ }
+ }
+}
+cfg_if! {
+ if #[cfg(any(target_os = "macos", target_os = "ios"))] {
+ extern "C" {
+ pub fn memmem(
+ haystack: *const ::c_void,
+ haystacklen: ::size_t,
+ needle: *const ::c_void,
+ needlelen: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn task_set_info(target_task: ::task_t,
+ flavor: ::task_flavor_t,
+ task_info_in: ::task_info_t,
+ task_info_inCnt: ::mach_msg_type_number_t
+ ) -> ::kern_return_t;
+ }
+ }
+}
+
+// These require a dependency on `libiconv`, and including this when built as
+// part of `std` means every Rust program gets it. Ideally we would have a link
+// modifier to only include these if they are used, but we do not.
+#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
+extern "C" {
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
@@ -3938,10 +5921,10 @@ extern "C" {
}
cfg_if! {
- if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
+ if #[cfg(target_pointer_width = "32")] {
mod b32;
pub use self::b32::*;
- } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
+ } else if #[cfg(target_pointer_width = "64")] {
mod b64;
pub use self::b64::*;
} else {
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 2a803bd197343..70fe6e2edd03b 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -18,10 +18,33 @@ pub type uuid_t = ::uuid;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
+pub type shmatt_t = ::c_uint;
pub type mqd_t = ::c_int;
pub type sem_t = *mut sem;
+pub type cpuset_t = cpumask_t;
+pub type cpu_set_t = cpumask_t;
+
+pub type register_t = ::c_long;
+pub type umtx_t = ::c_int;
+pub type pthread_barrierattr_t = ::c_int;
+pub type pthread_barrier_t = ::uintptr_t;
+pub type pthread_spinlock_t = ::uintptr_t;
+
+pub type segsz_t = usize;
+
+pub type vm_prot_t = u8;
+pub type vm_maptype_t = u8;
+pub type vm_inherit_t = i8;
+pub type vm_subsys_t = ::c_int;
+pub type vm_eflags_t = ::c_uint;
+
+pub type vm_map_t = *mut __c_anonymous_vm_map;
+pub type vm_map_entry_t = *mut vm_map_entry;
+
+pub type pmap = __c_anonymous_pmap;
+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
impl ::Copy for sem {}
@@ -31,6 +54,24 @@ impl ::Clone for sem {
}
}
+e! {
+ #[repr(u32)]
+ pub enum lwpstat {
+ LSRUN = 1,
+ LSSTOP = 2,
+ LSSLEEP = 3,
+ }
+
+ #[repr(u32)]
+ pub enum procstat {
+ SIDL = 1,
+ SACTIVE = 2,
+ SSTOP = 3,
+ SZOMB = 4,
+ SCORE = 5,
+ }
+}
+
s! {
pub struct kevent {
pub ident: ::uintptr_t,
@@ -113,11 +154,11 @@ s! {
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: i64,
- pub st_blksize: u32,
+ pub __old_st_blksize: u32,
pub st_flags: u32,
pub st_gen: u32,
pub st_lspare: i32,
- pub st_qspare1: i64,
+ pub st_blksize: i64,
pub st_qspare2: i64,
}
@@ -180,10 +221,196 @@ s! {
}
pub struct stack_t {
- pub ss_sp: *mut ::c_char,
+ pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
+
+ pub struct cpumask_t {
+ ary: [u64; 4],
+ }
+
+ 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,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ shm_internal: *mut ::c_void,
+ }
+
+ pub struct kinfo_file {
+ pub f_size: ::size_t,
+ pub f_pid: ::pid_t,
+ pub f_uid: ::uid_t,
+ pub f_fd: ::c_int,
+ pub f_file: *mut ::c_void,
+ pub f_type: ::c_short,
+ pub f_count: ::c_int,
+ pub f_msgcount: ::c_int,
+ pub f_offset: ::off_t,
+ pub f_data: *mut ::c_void,
+ pub f_flag: ::c_uint,
+ }
+
+ pub struct kinfo_cputime {
+ pub cp_user: u64,
+ pub cp_nice: u64,
+ pub cp_sys: u64,
+ pub cp_intr: u64,
+ pub cp_idel: u64,
+ cp_unused01: u64,
+ cp_unused02: u64,
+ pub cp_sample_pc: u64,
+ pub cp_sample_sp: u64,
+ pub cp_msg: [::c_char; 32],
+ }
+
+ pub struct kinfo_lwp {
+ pub kl_pid: ::pid_t,
+ pub kl_tid: ::lwpid_t,
+ pub kl_flags: ::c_int,
+ pub kl_stat: ::lwpstat,
+ pub kl_lock: ::c_int,
+ pub kl_tdflags: ::c_int,
+ pub kl_mpcount: ::c_int,
+ pub kl_prio: ::c_int,
+ pub kl_tdprio: ::c_int,
+ pub kl_rtprio: ::rtprio,
+ pub kl_uticks: u64,
+ pub kl_sticks: u64,
+ pub kl_iticks: u64,
+ pub kl_cpticks: u64,
+ pub kl_pctcpu: ::c_uint,
+ pub kl_slptime: ::c_uint,
+ pub kl_origcpu: ::c_int,
+ pub kl_estcpu: ::c_int,
+ pub kl_cpuid: ::c_int,
+ pub kl_ru: ::rusage,
+ pub kl_siglist: ::sigset_t,
+ pub kl_sigmask: ::sigset_t,
+ pub kl_wchan: ::uintptr_t,
+ pub kl_wmesg: [::c_char; 9],
+ pub kl_comm: [::c_char; MAXCOMLEN+1],
+ }
+
+ pub struct kinfo_proc {
+ pub kp_paddr: ::uintptr_t,
+ pub kp_flags: ::c_int,
+ pub kp_stat: ::procstat,
+ pub kp_lock: ::c_int,
+ pub kp_acflag: ::c_int,
+ pub kp_traceflag: ::c_int,
+ pub kp_fd: ::uintptr_t,
+ pub kp_siglist: ::sigset_t,
+ pub kp_sigignore: ::sigset_t,
+ pub kp_sigcatch: ::sigset_t,
+ pub kp_sigflag: ::c_int,
+ pub kp_start: ::timeval,
+ pub kp_comm: [::c_char; MAXCOMLEN+1],
+ pub kp_uid: ::uid_t,
+ pub kp_ngroups: ::c_short,
+ pub kp_groups: [::gid_t; NGROUPS],
+ pub kp_ruid: ::uid_t,
+ pub kp_svuid: ::uid_t,
+ pub kp_rgid: ::gid_t,
+ pub kp_svgid: ::gid_t,
+ pub kp_pid: ::pid_t,
+ pub kp_ppid: ::pid_t,
+ pub kp_pgid: ::pid_t,
+ pub kp_jobc: ::c_int,
+ pub kp_sid: ::pid_t,
+ pub kp_login: [::c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long)
+ pub kp_tdev: ::dev_t,
+ pub kp_tpgid: ::pid_t,
+ pub kp_tsid: ::pid_t,
+ pub kp_exitstat: ::c_ushort,
+ pub kp_nthreads: ::c_int,
+ pub kp_nice: ::c_int,
+ pub kp_swtime: ::c_uint,
+ pub kp_vm_map_size: ::size_t,
+ pub kp_vm_rssize: ::segsz_t,
+ pub kp_vm_swrss: ::segsz_t,
+ pub kp_vm_tsize: ::segsz_t,
+ pub kp_vm_dsize: ::segsz_t,
+ pub kp_vm_ssize: ::segsz_t,
+ pub kp_vm_prssize: ::c_uint,
+ pub kp_jailid: ::c_int,
+ pub kp_ru: ::rusage,
+ pub kp_cru: ::rusage,
+ pub kp_auxflags: ::c_int,
+ pub kp_lwp: ::kinfo_lwp,
+ pub kp_ktaddr: ::uintptr_t,
+ kp_spare: [::c_int; 2],
+ }
+
+ pub struct __c_anonymous_vm_map {
+ _priv: [::uintptr_t; 36],
+ }
+
+ pub struct vm_map_entry {
+ _priv: [::uintptr_t; 15],
+ pub eflags: ::vm_eflags_t,
+ pub maptype: ::vm_maptype_t,
+ pub protection: ::vm_prot_t,
+ pub max_protection: ::vm_prot_t,
+ pub inheritance: ::vm_inherit_t,
+ pub wired_count: ::c_int,
+ pub id: ::vm_subsys_t,
+ }
+
+ pub struct __c_anonymous_pmap {
+ _priv1: [::uintptr_t; 32],
+ _priv2: [::uintptr_t; 32],
+ _priv3: [::uintptr_t; 32],
+ _priv4: [::uintptr_t; 32],
+ _priv5: [::uintptr_t; 8],
+ }
+
+ pub struct vmspace {
+ vm_map: __c_anonymous_vm_map,
+ vm_pmap: __c_anonymous_pmap,
+ pub vm_flags: ::c_int,
+ pub vm_shm: *mut ::c_char,
+ pub vm_rssize: ::segsz_t,
+ pub vm_swrss: ::segsz_t,
+ pub vm_tsize: ::segsz_t,
+ pub vm_dsize: ::segsz_t,
+ pub vm_ssize: ::segsz_t,
+ pub vm_taddr: *mut ::c_char,
+ pub vm_daddr: *mut ::c_char,
+ pub vm_maxsaddr: *mut ::c_char,
+ pub vm_minsaddr: *mut ::c_char,
+ _unused1: ::c_int,
+ _unused2: ::c_int,
+ pub vm_pagesupply: ::c_int,
+ pub vm_holdcnt: ::c_uint,
+ pub vm_refcnt: ::c_uint,
+ }
+
+ pub struct cpuctl_msr_args_t {
+ pub msr: ::c_int,
+ pub data: u64,
+ }
+
+ pub struct cpuctl_cpuid_args_t {
+ pub level: ::c_int,
+ pub data: [u32; 4],
+ }
+
+ pub struct cpuctl_cpuid_count_args_t {
+ pub level: ::c_int,
+ pub level_type: ::c_int,
+ pub data: [u32; 4],
+ }
+
+ pub struct cpuctl_update_args_t {
+ pub data: *mut ::c_void,
+ pub size: ::size_t,
+ }
}
s_no_extra_traits! {
@@ -204,6 +431,13 @@ s_no_extra_traits! {
pub ut_unused2: [u8; 16],
}
+ pub struct lastlogx {
+ pub ll_tv: ::timeval,
+ pub ll_line: [::c_char; _UTX_LINESIZE],
+ pub ll_host: [::c_char; _UTX_HOSTSIZE],
+ pub ll_ss: ::sockaddr_storage,
+ }
+
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_namlen: u16,
@@ -214,6 +448,7 @@ s_no_extra_traits! {
}
pub struct statfs {
+ __spare2: ::c_long,
pub f_bsize: ::c_long,
pub f_iosize: ::c_long,
pub f_blocks: ::c_long,
@@ -223,15 +458,18 @@ s_no_extra_traits! {
pub f_ffree: ::c_long,
pub f_fsid: ::fsid_t,
pub f_owner: ::uid_t,
- pub f_type: i32,
- pub f_flags: i32,
+ pub f_type: ::c_int,
+ pub f_flags: ::c_int,
pub f_syncwrites: ::c_long,
pub f_asyncwrites: ::c_long,
pub f_fstypename: [::c_char; 16],
- pub f_mntonname: [::c_char; 90],
+ pub f_mntonname: [::c_char; 80],
pub f_syncreads: ::c_long,
pub f_asyncreads: ::c_long,
- pub f_mntfromname: [::c_char; 90],
+ __spares1: ::c_short,
+ pub f_mntfromname: [::c_char; 80],
+ __spares2: ::c_short,
+ __spare: [::c_long; 2],
}
pub struct sigevent {
@@ -246,6 +484,51 @@ s_no_extra_traits! {
pub sigev_value: ::sigval,
__unused3: *mut ::c_void //actually a function pointer
}
+
+ pub struct mcontext_t {
+ pub mc_onstack: register_t,
+ pub mc_rdi: register_t,
+ pub mc_rsi: register_t,
+ pub mc_rdx: register_t,
+ pub mc_rcx: register_t,
+ pub mc_r8: register_t,
+ pub mc_r9: register_t,
+ pub mc_rax: register_t,
+ pub mc_rbx: register_t,
+ pub mc_rbp: register_t,
+ pub mc_r10: register_t,
+ pub mc_r11: register_t,
+ pub mc_r12: register_t,
+ pub mc_r13: register_t,
+ pub mc_r14: register_t,
+ pub mc_r15: register_t,
+ pub mc_xflags: register_t,
+ pub mc_trapno: register_t,
+ pub mc_addr: register_t,
+ pub mc_flags: register_t,
+ pub mc_err: register_t,
+ pub mc_rip: register_t,
+ pub mc_cs: register_t,
+ pub mc_rflags: register_t,
+ pub mc_rsp: register_t,
+ pub mc_ss: register_t,
+ pub mc_len: ::c_uint,
+ pub mc_fpformat: ::c_uint,
+ pub mc_ownedfp: ::c_uint,
+ __reserved: ::c_uint,
+ __unused: [::c_uint; 8],
+ pub mc_fpregs: [[::c_uint; 8]; 32],
+ }
+
+ pub struct ucontext_t {
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: mcontext_t,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: stack_t,
+ pub uc_cofunc: ::Option,
+ pub uc_arg: *mut ::c_void,
+ __pad: [::c_int; 4],
+ }
}
cfg_if! {
@@ -305,6 +588,33 @@ cfg_if! {
self.ut_unused2.hash(state);
}
}
+ impl PartialEq for lastlogx {
+ fn eq(&self, other: &lastlogx) -> bool {
+ self.ll_tv == other.ll_tv
+ && self.ll_line == other.ll_line
+ && self.ll_host == other.ll_host
+ && self.ll_ss == other.ll_ss
+ }
+ }
+ impl Eq for lastlogx {}
+ impl ::fmt::Debug for lastlogx {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("lastlogx")
+ .field("ll_tv", &self.ll_tv)
+ .field("ll_line", &self.ll_line)
+ .field("ll_host", &self.ll_host)
+ .field("ll_ss", &self.ll_ss)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for lastlogx {
+ fn hash(&self, state: &mut H) {
+ self.ll_tv.hash(state);
+ self.ll_line.hash(state);
+ self.ll_host.hash(state);
+ self.ll_ss.hash(state);
+ }
+ }
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
@@ -445,12 +755,157 @@ cfg_if! {
self.sigev_value.hash(state);
}
}
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_onstack == other.mc_onstack &&
+ self.mc_rdi == other.mc_rdi &&
+ self.mc_rsi == other.mc_rsi &&
+ self.mc_rdx == other.mc_rdx &&
+ self.mc_rcx == other.mc_rcx &&
+ self.mc_r8 == other.mc_r8 &&
+ self.mc_r9 == other.mc_r9 &&
+ self.mc_rax == other.mc_rax &&
+ self.mc_rbx == other.mc_rbx &&
+ self.mc_rbp == other.mc_rbp &&
+ self.mc_r10 == other.mc_r10 &&
+ self.mc_r11 == other.mc_r11 &&
+ self.mc_r12 == other.mc_r12 &&
+ self.mc_r13 == other.mc_r13 &&
+ self.mc_r14 == other.mc_r14 &&
+ self.mc_r15 == other.mc_r15 &&
+ self.mc_xflags == other.mc_xflags &&
+ self.mc_trapno == other.mc_trapno &&
+ self.mc_addr == other.mc_addr &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_err == other.mc_err &&
+ self.mc_rip == other.mc_rip &&
+ self.mc_cs == other.mc_cs &&
+ self.mc_rflags == other.mc_rflags &&
+ self.mc_rsp == other.mc_rsp &&
+ self.mc_ss == other.mc_ss &&
+ self.mc_len == other.mc_len &&
+ self.mc_fpformat == other.mc_fpformat &&
+ self.mc_ownedfp == other.mc_ownedfp &&
+ self.mc_fpregs.iter().zip(other.mc_fpregs.iter()).
+ all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_onstack", &self.mc_onstack)
+ .field("mc_rdi", &self.mc_rdi)
+ .field("mc_rsi", &self.mc_rsi)
+ .field("mc_rdx", &self.mc_rdx)
+ .field("mc_rcx", &self.mc_rcx)
+ .field("mc_r8", &self.mc_r8)
+ .field("mc_r9", &self.mc_r9)
+ .field("mc_rax", &self.mc_rax)
+ .field("mc_rbx", &self.mc_rbx)
+ .field("mc_rbp", &self.mc_rbp)
+ .field("mc_r10", &self.mc_r10)
+ .field("mc_r11", &self.mc_r11)
+ .field("mc_r12", &self.mc_r12)
+ .field("mc_r13", &self.mc_r13)
+ .field("mc_r14", &self.mc_r14)
+ .field("mc_r15", &self.mc_r15)
+ .field("mc_xflags", &self.mc_xflags)
+ .field("mc_trapno", &self.mc_trapno)
+ .field("mc_addr", &self.mc_addr)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_err", &self.mc_err)
+ .field("mc_rip", &self.mc_rip)
+ .field("mc_cs", &self.mc_cs)
+ .field("mc_rflags", &self.mc_rflags)
+ .field("mc_rsp", &self.mc_rsp)
+ .field("mc_ss", &self.mc_ss)
+ .field("mc_len", &self.mc_len)
+ .field("mc_fpformat", &self.mc_fpformat)
+ .field("mc_ownedfp", &self.mc_ownedfp)
+ .field("mc_fpregs", &self.mc_fpregs)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash(&self, state: &mut H) {
+ self.mc_onstack.hash(state);
+ self.mc_rdi.hash(state);
+ self.mc_rsi.hash(state);
+ self.mc_rdx.hash(state);
+ self.mc_rcx.hash(state);
+ self.mc_r8.hash(state);
+ self.mc_r9.hash(state);
+ self.mc_rax.hash(state);
+ self.mc_rbx.hash(state);
+ self.mc_rbp.hash(state);
+ self.mc_r10.hash(state);
+ self.mc_r11.hash(state);
+ self.mc_r10.hash(state);
+ self.mc_r11.hash(state);
+ self.mc_r12.hash(state);
+ self.mc_r13.hash(state);
+ self.mc_r14.hash(state);
+ self.mc_r15.hash(state);
+ self.mc_xflags.hash(state);
+ self.mc_trapno.hash(state);
+ self.mc_addr.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_err.hash(state);
+ self.mc_rip.hash(state);
+ self.mc_cs.hash(state);
+ self.mc_rflags.hash(state);
+ self.mc_rsp.hash(state);
+ self.mc_ss.hash(state);
+ self.mc_len.hash(state);
+ self.mc_fpformat.hash(state);
+ self.mc_ownedfp.hash(state);
+ self.mc_fpregs.hash(state);
+ }
+ }
+ impl PartialEq for ucontext_t {
+ fn eq(&self, other: &ucontext_t) -> bool {
+ self.uc_sigmask == other.uc_sigmask
+ && self.uc_mcontext == other.uc_mcontext
+ && self.uc_link == other.uc_link
+ && self.uc_stack == other.uc_stack
+ && self.uc_cofunc == other.uc_cofunc
+ && self.uc_arg == other.uc_arg
+ }
+ }
+ impl Eq for ucontext_t {}
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_sigmask", &self.uc_sigmask)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_link", &self.uc_link)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_cofunc", &self.uc_cofunc)
+ .field("uc_arg", &self.uc_arg)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ucontext_t {
+ fn hash(&self, state: &mut H) {
+ self.uc_sigmask.hash(state);
+ self.uc_mcontext.hash(state);
+ self.uc_link.hash(state);
+ self.uc_stack.hash(state);
+ self.uc_cofunc.hash(state);
+ self.uc_arg.hash(state);
+ }
+ }
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
pub const SIGSTKSZ: ::size_t = 40960;
+pub const SIGCKPT: ::c_int = 33;
+pub const SIGCKPTEXIT: ::c_int = 34;
+pub const CKPT_FREEZE: ::c_int = 0x1;
+pub const CKPT_THAW: ::c_int = 0x2;
pub const MADV_INVAL: ::c_int = 10;
pub const MADV_SETMAP: ::c_int = 11;
pub const O_CLOEXEC: ::c_int = 0x00020000;
@@ -458,7 +913,10 @@ pub const O_DIRECTORY: ::c_int = 0x08000000;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
+pub const F_GETPATH: ::c_int = 19;
pub const ENOMEDIUM: ::c_int = 93;
+pub const ENOTRECOVERABLE: ::c_int = 94;
+pub const EOWNERDEAD: ::c_int = 95;
pub const EASYNC: ::c_int = 99;
pub const ELAST: ::c_int = 99;
pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
@@ -600,6 +1058,16 @@ pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
pub const CTL_P1003_1B_MAXID: ::c_int = 26;
+pub const CPUCTL_RSMSR: ::c_int = 0xc0106301;
+pub const CPUCTL_WRMSR: ::c_int = 0xc0106302;
+pub const CPUCTL_CPUID: ::c_int = 0xc0106303;
+pub const CPUCTL_UPDATE: ::c_int = 0xc0106304;
+pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305;
+pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306;
+pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307;
+
+pub const CPU_SETSIZE: ::size_t = ::mem::size_of::<::cpumask_t>() * 8;
+
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
@@ -625,6 +1093,8 @@ pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
+pub const FIODNAME: ::c_ulong = 0x80106678;
+
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
@@ -652,9 +1122,16 @@ pub const NOTE_CHILD: u32 = 0x00000004;
pub const SO_SNDSPACE: ::c_int = 0x100a;
pub const SO_CPUHINT: ::c_int = 0x1030;
+pub const SO_PASSCRED: ::c_int = 0x4000;
pub const PT_FIRSTMACH: ::c_int = 32;
+pub const PROC_REAP_ACQUIRE: ::c_int = 0x0001;
+pub const PROC_REAP_RELEASE: ::c_int = 0x0002;
+pub const PROC_REAP_STATUS: ::c_int = 0x0003;
+pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004;
+pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005;
+
// 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
@@ -932,6 +1409,16 @@ pub const MSG_FBLOCKING: ::c_int = 0x00010000;
pub const MSG_FNONBLOCKING: ::c_int = 0x00020000;
pub const MSG_FMASK: ::c_int = 0xFFFF0000;
+// sys/mount.h
+pub const MNT_NODEV: ::c_int = 0x00000010;
+pub const MNT_AUTOMOUNTED: ::c_int = 0x00000020;
+pub const MNT_TRIM: ::c_int = 0x01000000;
+pub const MNT_LOCAL: ::c_int = 0x00001000;
+pub const MNT_QUOTA: ::c_int = 0x00002000;
+pub const MNT_ROOTFS: ::c_int = 0x00004000;
+pub const MNT_USER: ::c_int = 0x00008000;
+pub const MNT_IGNORE: ::c_int = 0x00800000;
+
// utmpx entry types
pub const EMPTY: ::c_short = 0;
pub const RUN_LVL: ::c_short = 1;
@@ -949,6 +1436,10 @@ pub const DOWNTIME: ::c_short = 11;
pub const UTX_DB_UTMPX: ::c_uint = 0;
pub const UTX_DB_WTMPX: ::c_uint = 1;
pub const UTX_DB_LASTLOG: ::c_uint = 2;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_USERSIZE: usize = 32;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 256;
pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
@@ -963,11 +1454,11 @@ pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK;
-pub const TIOCSIG: ::c_uint = 0x2000745f;
+pub const TIOCSIG: ::c_ulong = 0x2000745f;
pub const BTUARTDISC: ::c_int = 0x7;
-pub const TIOCDCDTIMESTAMP: ::c_uint = 0x40107458;
-pub const TIOCISPTMASTER: ::c_uint = 0x20007455;
-pub const TIOCMODG: ::c_uint = 0x40047403;
+pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
+pub const TIOCISPTMASTER: ::c_ulong = 0x20007455;
+pub const TIOCMODG: ::c_ulong = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
@@ -1020,9 +1511,16 @@ pub const SF_XLINK: ::c_ulong = 0x01000000;
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;
+pub const MINCORE_SUPER: ::c_int = 0x20;
+
+// kinfo_proc constants
+pub const MAXCOMLEN: usize = 16;
+pub const MAXLOGNAME: usize = 33;
+pub const NGROUPS: usize = 16;
+
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
- (n + 3) & !3
+ (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
}
}
@@ -1056,29 +1554,61 @@ f! {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) +
_CMSG_ALIGN(length as usize)) as ::c_uint
}
+
+ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+ for slot in cpuset.ary.iter_mut() {
+ *slot = 0;
+ }
+ }
+
+ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+ cpuset.ary[idx] |= 1 << offset;
+ ()
+ }
+
+ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+ cpuset.ary[idx] &= !(1 << offset);
+ ()
+ }
+
+ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+ 0 != cpuset.ary[idx] & (1 << offset)
+ }
}
safe_f! {
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
(status & 0o177) != 0o177 && (status & 0o177) != 0
}
+
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= major << 8;
+ dev |= minor;
+ dev
+ }
}
extern "C" {
pub fn __errno_location() -> *mut ::c_int;
pub fn setgrent();
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
- pub fn aio_waitcomplete(
- iocbp: *mut *mut aiocb,
- timeout: *mut ::timespec,
- ) -> ::c_int;
+ pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int;
+
+ pub fn devname_r(
+ dev: ::dev_t,
+ mode: ::mode_t,
+ buf: *mut ::c_char,
+ len: ::size_t,
+ ) -> *mut ::c_char;
pub fn waitid(
idtype: idtype_t,
@@ -1105,6 +1635,37 @@ extern "C" {
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
+ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+
+ pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int;
+ pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t)
+ -> ::c_int;
+ pub fn sched_getcpu() -> ::c_int;
+ pub fn setproctitle(fmt: *const ::c_char, ...);
+
+ pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::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;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+ pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
+
+ pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
+ pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+ pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
+ pub fn getutxuser(name: *const ::c_char) -> utmpx;
+ pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+
+ pub fn sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int;
+
+ pub fn umtx_sleep(ptr: *const ::c_int, value: ::c_int, timeout: ::c_int) -> ::c_int;
+ pub fn umtx_wakeup(ptr: *const ::c_int, count: ::c_int) -> ::c_int;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "rt")]
@@ -1126,6 +1687,23 @@ extern "C" {
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
+
+ pub fn reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void;
+ pub fn freezero(ptr: *mut ::c_void, size: ::size_t);
+}
+
+#[link(name = "kvm")]
+extern "C" {
+ pub fn kvm_vm_map_entry_first(
+ kvm: *mut ::kvm_t,
+ map: vm_map_t,
+ entry: vm_map_entry_t,
+ ) -> vm_map_entry_t;
+ pub fn kvm_vm_map_entry_next(
+ kvm: *mut ::kvm_t,
+ map: vm_map_entry_t,
+ entry: vm_map_entry_t,
+ ) -> vm_map_entry_t;
}
cfg_if! {
diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
index db0093a529df1..e8be8815c028e 100644
--- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
@@ -6,6 +6,33 @@ pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
+s_no_extra_traits! {
+ pub struct gpregs {
+ pub gp_x: [::register_t; 30],
+ pub gp_lr: ::register_t,
+ pub gp_sp: ::register_t,
+ pub gp_elr: ::register_t,
+ pub gp_spsr: u32,
+ pub gp_pad: ::c_int,
+ }
+
+ pub struct fpregs {
+ pub fp_q: u128,
+ pub fp_sr: u32,
+ pub fp_cr: u32,
+ pub fp_flags: ::c_int,
+ pub fp_pad: ::c_int,
+ }
+
+ pub struct mcontext_t {
+ pub mc_gpregs: gpregs,
+ pub mc_fpregs: fpregs,
+ pub mc_flags: ::c_int,
+ pub mc_pad: ::c_int,
+ pub mc_spare: [u64; 8],
+ }
+}
+
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
@@ -17,5 +44,103 @@ cfg_if! {
}
}
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for gpregs {
+ fn eq(&self, other: &gpregs) -> bool {
+ self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) &&
+ self.gp_lr == other.gp_lr &&
+ self.gp_sp == other.gp_sp &&
+ self.gp_elr == other.gp_elr &&
+ self.gp_spsr == other.gp_spsr &&
+ self.gp_pad == other.gp_pad
+ }
+ }
+ impl Eq for gpregs {}
+ impl ::fmt::Debug for gpregs {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("gpregs")
+ .field("gp_x", &self.gp_x)
+ .field("gp_lr", &self.gp_lr)
+ .field("gp_sp", &self.gp_sp)
+ .field("gp_elr", &self.gp_elr)
+ .field("gp_spsr", &self.gp_spsr)
+ .field("gp_pad", &self.gp_pad)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for gpregs {
+ fn hash(&self, state: &mut H) {
+ self.gp_x.hash(state);
+ self.gp_lr.hash(state);
+ self.gp_sp.hash(state);
+ self.gp_elr.hash(state);
+ self.gp_spsr.hash(state);
+ self.gp_pad.hash(state);
+ }
+ }
+ impl PartialEq for fpregs {
+ fn eq(&self, other: &fpregs) -> bool {
+ self.fp_q == other.fp_q &&
+ self.fp_sr == other.fp_sr &&
+ self.fp_cr == other.fp_cr &&
+ self.fp_flags == other.fp_flags &&
+ self.fp_pad == other.fp_pad
+ }
+ }
+ impl Eq for fpregs {}
+ impl ::fmt::Debug for fpregs {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("fpregs")
+ .field("fp_q", &self.fp_q)
+ .field("fp_sr", &self.fp_sr)
+ .field("fp_cr", &self.fp_cr)
+ .field("fp_flags", &self.fp_flags)
+ .field("fp_pad", &self.fp_pad)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for fpregs {
+ fn hash(&self, state: &mut H) {
+ self.fp_q.hash(state);
+ self.fp_sr.hash(state);
+ self.fp_cr.hash(state);
+ self.fp_flags.hash(state);
+ self.fp_pad.hash(state);
+ }
+ }
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_gpregs == other.mc_gpregs &&
+ self.mc_fpregs == other.mc_fpregs &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_pad == other.mc_pad &&
+ self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_gpregs", &self.mc_gpregs)
+ .field("mc_fpregs", &self.mc_fpregs)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_pad", &self.mc_pad)
+ .field("mc_spare", &self.mc_spare)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash(&self, state: &mut H) {
+ self.mc_gpregs.hash(state);
+ self.mc_fpregs.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_pad.hash(state);
+ self.mc_spare.hash(state);
+ }
+ }
+ }
+}
+
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
index a88e56cc6e96d..563c0f936ffef 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -29,6 +29,186 @@ s! {
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
+
+ pub struct kinfo_proc {
+ /// Size of this structure.
+ pub ki_structsize: ::c_int,
+ /// Reserved: layout identifier.
+ pub ki_layout: ::c_int,
+ /// Address of command arguments.
+ pub ki_args: *mut ::pargs,
+ // This is normally "struct proc".
+ /// Address of proc.
+ pub ki_paddr: *mut ::c_void,
+ // This is normally "struct user".
+ /// Kernel virtual address of u-area.
+ pub ki_addr: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to trace file.
+ pub ki_tracep: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to executable file.
+ pub ki_textvp: *mut ::c_void,
+ // This is normally "struct filedesc".
+ /// Pointer to open file info.
+ pub ki_fd: *mut ::c_void,
+ // This is normally "struct vmspace".
+ /// Pointer to kernel vmspace struct.
+ pub ki_vmspace: *mut ::c_void,
+ /// Sleep address.
+ pub ki_wchan: *mut ::c_void,
+ /// Process identifier.
+ pub ki_pid: ::pid_t,
+ /// Parent process ID.
+ pub ki_ppid: ::pid_t,
+ /// Process group ID.
+ pub ki_pgid: ::pid_t,
+ /// tty process group ID.
+ pub ki_tpgid: ::pid_t,
+ /// Process session ID.
+ pub ki_sid: ::pid_t,
+ /// Terminal session ID.
+ pub ki_tsid: ::pid_t,
+ /// Job control counter.
+ pub ki_jobc: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short1: ::c_short,
+ /// Controlling tty dev.
+ pub ki_tdev: ::dev_t,
+ /// Signals arrived but not delivered.
+ pub ki_siglist: ::sigset_t,
+ /// Current signal mask.
+ pub ki_sigmask: ::sigset_t,
+ /// Signals being ignored.
+ pub ki_sigignore: ::sigset_t,
+ /// Signals being caught by user.
+ pub ki_sigcatch: ::sigset_t,
+ /// Effective user ID.
+ pub ki_uid: ::uid_t,
+ /// Real user ID.
+ pub ki_ruid: ::uid_t,
+ /// Saved effective user ID.
+ pub ki_svuid: ::uid_t,
+ /// Real group ID.
+ pub ki_rgid: ::gid_t,
+ /// Saved effective group ID.
+ pub ki_svgid: ::gid_t,
+ /// Number of groups.
+ pub ki_ngroups: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short2: ::c_short,
+ /// Groups.
+ pub ki_groups: [::gid_t; ::KI_NGROUPS],
+ /// Virtual size.
+ pub ki_size: ::vm_size_t,
+ /// Current resident set size in pages.
+ pub ki_rssize: ::segsz_t,
+ /// Resident set size before last swap.
+ pub ki_swrss: ::segsz_t,
+ /// Text size (pages) XXX.
+ pub ki_tsize: ::segsz_t,
+ /// Data size (pages) XXX.
+ pub ki_dsize: ::segsz_t,
+ /// Stack size (pages).
+ pub ki_ssize: ::segsz_t,
+ /// Exit status for wait & stop signal.
+ pub ki_xstat: ::u_short,
+ /// Accounting flags.
+ pub ki_acflag: ::u_short,
+ /// %cpu for process during `ki_swtime`.
+ pub ki_pctcpu: ::fixpt_t,
+ /// Time averaged value of `ki_cpticks`.
+ pub ki_estcpu: ::u_int,
+ /// Time since last blocked.
+ pub ki_slptime: ::u_int,
+ /// Time swapped in or out.
+ pub ki_swtime: ::u_int,
+ /// Number of copy-on-write faults.
+ pub ki_cow: ::u_int,
+ /// Real time in microsec.
+ pub ki_runtime: u64,
+ /// Starting time.
+ pub ki_start: ::timeval,
+ /// Time used by process children.
+ pub ki_childtime: ::timeval,
+ /// P_* flags.
+ pub ki_flag: ::c_long,
+ /// KI_* flags (below).
+ pub ki_kiflag: ::c_long,
+ /// Kernel trace points.
+ pub ki_traceflag: ::c_int,
+ /// S* process status.
+ pub ki_stat: ::c_char,
+ /// Process "nice" value.
+ pub ki_nice: i8, // signed char
+ /// Process lock (prevent swap) count.
+ pub ki_lock: ::c_char,
+ /// Run queue index.
+ pub ki_rqindex: ::c_char,
+ /// Which cpu we are on.
+ pub ki_oncpu_old: ::c_uchar,
+ /// Last cpu we were on.
+ pub ki_lastcpu_old: ::c_uchar,
+ /// Thread name.
+ pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+ /// Wchan message.
+ pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+ /// Setlogin name.
+ pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+ /// Lock name.
+ pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+ /// Command name.
+ pub ki_comm: [::c_char; ::COMMLEN + 1],
+ /// Emulation name.
+ pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+ /// Login class.
+ pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+ /// More thread name.
+ pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+ /// Spare string space.
+ pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+ /// Spare room for growth.
+ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+ /// Which cpu we are on.
+ pub ki_oncpu: ::c_int,
+ /// Last cpu we were on.
+ pub ki_lastcpu: ::c_int,
+ /// PID of tracing process.
+ pub ki_tracer: ::c_int,
+ /// P2_* flags.
+ pub ki_flag2: ::c_int,
+ /// Default FIB number.
+ pub ki_fibnum: ::c_int,
+ /// Credential flags.
+ pub ki_cr_flags: ::u_int,
+ /// Process jail ID.
+ pub ki_jid: ::c_int,
+ /// Number of threads in total.
+ pub ki_numthreads: ::c_int,
+ /// Thread ID.
+ pub ki_tid: ::lwpid_t,
+ /// Process priority.
+ pub ki_pri: ::priority,
+ /// Process rusage statistics.
+ pub ki_rusage: ::rusage,
+ /// rusage of children processes.
+ pub ki_rusage_ch: ::rusage,
+ // This is normally "struct pcb".
+ /// Kernel virtual addr of pcb.
+ pub ki_pcb: *mut ::c_void,
+ /// Kernel virtual addr of stack.
+ pub ki_kstack: *mut ::c_void,
+ /// User convenience pointer.
+ pub ki_udata: *mut ::c_void,
+ // This is normally "struct thread".
+ pub ki_tdaddr: *mut ::c_void,
+ pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+ pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+ /// PS_* flags.
+ pub ki_sflag: ::c_long,
+ /// kthread flag.
+ pub ki_tdflags: ::c_long,
+ }
}
s_no_extra_traits! {
@@ -67,6 +247,17 @@ s_no_extra_traits! {
// Array length changed from 88 to 1024 in FreeBSD 12:
pub f_mntonname: [::c_char; 88],
}
+
+ pub struct vnstat {
+ pub vn_fileid: u64,
+ pub vn_size: u64,
+ pub vn_mntdir: *mut ::c_char,
+ pub vn_dev: u32,
+ pub vn_fsid: u32,
+ pub vn_type: ::c_int,
+ pub vn_mode: u16,
+ pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+ }
}
cfg_if! {
@@ -186,11 +377,70 @@ cfg_if! {
self.d_name[..self.d_namlen as _].hash(state);
}
}
+
+ impl PartialEq for vnstat {
+ fn eq(&self, other: &vnstat) -> bool {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+ let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+ self.vn_fileid == other.vn_fileid &&
+ self.vn_size == other.vn_size &&
+ self.vn_mntdir == other.vn_mntdir &&
+ self.vn_dev == other.vn_dev &&
+ self.vn_fsid == other.vn_fsid &&
+ self.vn_type == other.vn_type &&
+ self.vn_mode == other.vn_mode &&
+ self_vn_devname == other_vn_devname
+ }
+ }
+ impl Eq for vnstat {}
+ impl ::fmt::Debug for vnstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ f.debug_struct("vnstat")
+ .field("vn_fileid", &self.vn_fileid)
+ .field("vn_size", &self.vn_size)
+ .field("vn_mntdir", &self.vn_mntdir)
+ .field("vn_dev", &self.vn_dev)
+ .field("vn_fsid", &self.vn_fsid)
+ .field("vn_type", &self.vn_type)
+ .field("vn_mode", &self.vn_mode)
+ .field("vn_devname", &self_vn_devname)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for vnstat {
+ fn hash(&self, state: &mut H) {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ self.vn_fileid.hash(state);
+ self.vn_size.hash(state);
+ self.vn_mntdir.hash(state);
+ self.vn_dev.hash(state);
+ self.vn_fsid.hash(state);
+ self.vn_type.hash(state);
+ self.vn_mode.hash(state);
+ self_vn_devname.hash(state);
+ }
+ }
}
}
pub const ELAST: ::c_int = 96;
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
+pub const KI_NSPARE_PTR: usize = 6;
+pub const MINCORE_SUPER: ::c_int = 0x20;
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 63;
+
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ (major << 8) | minor
+ }
+}
extern "C" {
// Return type ::c_int was removed in FreeBSD 12
@@ -198,11 +448,7 @@ extern "C" {
// Type of `addr` argument changed from `const void*` to `void*`
// in FreeBSD 12
- pub fn mprotect(
- addr: *const ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
// Return type ::c_int was removed in FreeBSD 12
pub fn freelocale(loc: ::locale_t) -> ::c_int;
@@ -217,11 +463,15 @@ extern "C" {
) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
+
+ pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *const ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
- target_arch = "aarch64"))] {
+ target_arch = "aarch64",
+ target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 647e11e6b798c..df00b6c1d63fe 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -22,10 +22,202 @@ s! {
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
- pub data: ::intptr_t,
+ pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
+
+ pub struct kvm_page {
+ pub version: ::c_uint,
+ pub paddr: ::c_ulong,
+ pub kmap_vaddr: ::c_ulong,
+ pub dmap_vaddr: ::c_ulong,
+ pub prot: ::vm_prot_t,
+ pub offset: ::u_long,
+ pub len: ::size_t,
+ }
+
+ pub struct kinfo_proc {
+ /// Size of this structure.
+ pub ki_structsize: ::c_int,
+ /// Reserved: layout identifier.
+ pub ki_layout: ::c_int,
+ /// Address of command arguments.
+ pub ki_args: *mut ::pargs,
+ // This is normally "struct proc".
+ /// Address of proc.
+ pub ki_paddr: *mut ::c_void,
+ // This is normally "struct user".
+ /// Kernel virtual address of u-area.
+ pub ki_addr: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to trace file.
+ pub ki_tracep: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to executable file.
+ pub ki_textvp: *mut ::c_void,
+ // This is normally "struct filedesc".
+ /// Pointer to open file info.
+ pub ki_fd: *mut ::c_void,
+ // This is normally "struct vmspace".
+ /// Pointer to kernel vmspace struct.
+ pub ki_vmspace: *mut ::c_void,
+ /// Sleep address.
+ pub ki_wchan: *mut ::c_void,
+ /// Process identifier.
+ pub ki_pid: ::pid_t,
+ /// Parent process ID.
+ pub ki_ppid: ::pid_t,
+ /// Process group ID.
+ pub ki_pgid: ::pid_t,
+ /// tty process group ID.
+ pub ki_tpgid: ::pid_t,
+ /// Process session ID.
+ pub ki_sid: ::pid_t,
+ /// Terminal session ID.
+ pub ki_tsid: ::pid_t,
+ /// Job control counter.
+ pub ki_jobc: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short1: ::c_short,
+ /// Controlling tty dev.
+ pub ki_tdev_freebsd11: u32,
+ /// Signals arrived but not delivered.
+ pub ki_siglist: ::sigset_t,
+ /// Current signal mask.
+ pub ki_sigmask: ::sigset_t,
+ /// Signals being ignored.
+ pub ki_sigignore: ::sigset_t,
+ /// Signals being caught by user.
+ pub ki_sigcatch: ::sigset_t,
+ /// Effective user ID.
+ pub ki_uid: ::uid_t,
+ /// Real user ID.
+ pub ki_ruid: ::uid_t,
+ /// Saved effective user ID.
+ pub ki_svuid: ::uid_t,
+ /// Real group ID.
+ pub ki_rgid: ::gid_t,
+ /// Saved effective group ID.
+ pub ki_svgid: ::gid_t,
+ /// Number of groups.
+ pub ki_ngroups: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short2: ::c_short,
+ /// Groups.
+ pub ki_groups: [::gid_t; ::KI_NGROUPS],
+ /// Virtual size.
+ pub ki_size: ::vm_size_t,
+ /// Current resident set size in pages.
+ pub ki_rssize: ::segsz_t,
+ /// Resident set size before last swap.
+ pub ki_swrss: ::segsz_t,
+ /// Text size (pages) XXX.
+ pub ki_tsize: ::segsz_t,
+ /// Data size (pages) XXX.
+ pub ki_dsize: ::segsz_t,
+ /// Stack size (pages).
+ pub ki_ssize: ::segsz_t,
+ /// Exit status for wait & stop signal.
+ pub ki_xstat: ::u_short,
+ /// Accounting flags.
+ pub ki_acflag: ::u_short,
+ /// %cpu for process during `ki_swtime`.
+ pub ki_pctcpu: ::fixpt_t,
+ /// Time averaged value of `ki_cpticks`.
+ pub ki_estcpu: ::u_int,
+ /// Time since last blocked.
+ pub ki_slptime: ::u_int,
+ /// Time swapped in or out.
+ pub ki_swtime: ::u_int,
+ /// Number of copy-on-write faults.
+ pub ki_cow: ::u_int,
+ /// Real time in microsec.
+ pub ki_runtime: u64,
+ /// Starting time.
+ pub ki_start: ::timeval,
+ /// Time used by process children.
+ pub ki_childtime: ::timeval,
+ /// P_* flags.
+ pub ki_flag: ::c_long,
+ /// KI_* flags (below).
+ pub ki_kiflag: ::c_long,
+ /// Kernel trace points.
+ pub ki_traceflag: ::c_int,
+ /// S* process status.
+ pub ki_stat: ::c_char,
+ /// Process "nice" value.
+ pub ki_nice: i8, // signed char
+ /// Process lock (prevent swap) count.
+ pub ki_lock: ::c_char,
+ /// Run queue index.
+ pub ki_rqindex: ::c_char,
+ /// Which cpu we are on.
+ pub ki_oncpu_old: ::c_uchar,
+ /// Last cpu we were on.
+ pub ki_lastcpu_old: ::c_uchar,
+ /// Thread name.
+ pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+ /// Wchan message.
+ pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+ /// Setlogin name.
+ pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+ /// Lock name.
+ pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+ /// Command name.
+ pub ki_comm: [::c_char; ::COMMLEN + 1],
+ /// Emulation name.
+ pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+ /// Login class.
+ pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+ /// More thread name.
+ pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+ /// Spare string space.
+ pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+ /// Spare room for growth.
+ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+ /// Controlling tty dev.
+ pub ki_tdev: ::dev_t,
+ /// Which cpu we are on.
+ pub ki_oncpu: ::c_int,
+ /// Last cpu we were on.
+ pub ki_lastcpu: ::c_int,
+ /// PID of tracing process.
+ pub ki_tracer: ::c_int,
+ /// P2_* flags.
+ pub ki_flag2: ::c_int,
+ /// Default FIB number.
+ pub ki_fibnum: ::c_int,
+ /// Credential flags.
+ pub ki_cr_flags: ::u_int,
+ /// Process jail ID.
+ pub ki_jid: ::c_int,
+ /// Number of threads in total.
+ pub ki_numthreads: ::c_int,
+ /// Thread ID.
+ pub ki_tid: ::lwpid_t,
+ /// Process priority.
+ pub ki_pri: ::priority,
+ /// Process rusage statistics.
+ pub ki_rusage: ::rusage,
+ /// rusage of children processes.
+ pub ki_rusage_ch: ::rusage,
+ // This is normally "struct pcb".
+ /// Kernel virtual addr of pcb.
+ pub ki_pcb: *mut ::c_void,
+ /// Kernel virtual addr of stack.
+ pub ki_kstack: *mut ::c_void,
+ /// User convenience pointer.
+ pub ki_udata: *mut ::c_void,
+ // This is normally "struct thread".
+ pub ki_tdaddr: *mut ::c_void,
+ pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+ pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+ /// PS_* flags.
+ pub ki_sflag: ::c_long,
+ /// kthread flag.
+ pub ki_tdflags: ::c_long,
+ }
}
s_no_extra_traits! {
@@ -64,6 +256,17 @@ s_no_extra_traits! {
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
+
+ pub struct vnstat {
+ pub vn_fileid: u64,
+ pub vn_size: u64,
+ pub vn_dev: u64,
+ pub vn_fsid: u64,
+ pub vn_mntdir: *mut ::c_char,
+ pub vn_type: ::c_int,
+ pub vn_mode: u16,
+ pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+ }
}
cfg_if! {
@@ -187,32 +390,81 @@ cfg_if! {
self.d_name[..self.d_namlen as _].hash(state);
}
}
- }
-}
-pub const F_ADD_SEALS: ::c_int = 19;
-pub const F_GET_SEALS: ::c_int = 20;
-pub const F_SEAL_SEAL: ::c_int = 0x0001;
-pub const F_SEAL_SHRINK: ::c_int = 0x0002;
-pub const F_SEAL_GROW: ::c_int = 0x0004;
-pub const F_SEAL_WRITE: ::c_int = 0x0008;
+ impl PartialEq for vnstat {
+ fn eq(&self, other: &vnstat) -> bool {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+ let other_vn_devname: &[::c_char] = &other.vn_devname;
-pub const GRND_NONBLOCK: ::c_uint = 0x1;
-pub const GRND_RANDOM: ::c_uint = 0x2;
+ self.vn_fileid == other.vn_fileid &&
+ self.vn_size == other.vn_size &&
+ self.vn_dev == other.vn_dev &&
+ self.vn_fsid == other.vn_fsid &&
+ self.vn_mntdir == other.vn_mntdir &&
+ self.vn_type == other.vn_type &&
+ self.vn_mode == other.vn_mode &&
+ self_vn_devname == other_vn_devname
+ }
+ }
+ impl Eq for vnstat {}
+ impl ::fmt::Debug for vnstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ f.debug_struct("vnstat")
+ .field("vn_fileid", &self.vn_fileid)
+ .field("vn_size", &self.vn_size)
+ .field("vn_dev", &self.vn_dev)
+ .field("vn_fsid", &self.vn_fsid)
+ .field("vn_mntdir", &self.vn_mntdir)
+ .field("vn_type", &self.vn_type)
+ .field("vn_mode", &self.vn_mode)
+ .field("vn_devname", &self_vn_devname)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for vnstat {
+ fn hash(&self, state: &mut H) {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ self.vn_fileid.hash(state);
+ self.vn_size.hash(state);
+ self.vn_dev.hash(state);
+ self.vn_fsid.hash(state);
+ self.vn_mntdir.hash(state);
+ self.vn_type.hash(state);
+ self.vn_mode.hash(state);
+ self_vn_devname.hash(state);
+ }
+ }
+ }
+}
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
+pub const ELAST: ::c_int = 97;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 63;
+pub const KI_NSPARE_PTR: usize = 6;
-pub const SO_DOMAIN: ::c_int = 0x1019;
+pub const MINCORE_SUPER: ::c_int = 0x20;
-pub const ELAST: ::c_int = 96;
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= ((major & 0xffffff00) as dev_t) << 32;
+ dev |= ((major & 0x000000ff) as dev_t) << 8;
+ dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+ dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+ dev
+ }
+}
extern "C" {
pub fn setgrent();
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
@@ -230,17 +482,28 @@ extern "C" {
pub fn fdatasync(fd: ::c_int) -> ::c_int;
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+ pub fn setproctitle_fast(fmt: *const ::c_char, ...);
+ pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+ pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
- target_arch = "aarch64"))] {
+ target_arch = "aarch64",
+ target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
+ }
+}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
new file mode 100644
index 0000000000000..7bf2534455bf9
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
index a974146d69577..72a38dc226851 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -1,9 +1,12 @@
-// APIs in FreeBSD 13 that have changed since 11.
+// APIs in FreeBSD 14 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
+pub type kpaddr_t = u64;
+pub type kssize_t = i64;
+pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
@@ -22,10 +25,209 @@ s! {
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
- pub data: ::intptr_t,
+ pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
+
+ pub struct kvm_page {
+ pub kp_version: ::u_int,
+ pub kp_paddr: ::kpaddr_t,
+ pub kp_kmap_vaddr: ::kvaddr_t,
+ pub kp_dmap_vaddr: ::kvaddr_t,
+ pub kp_prot: ::vm_prot_t,
+ pub kp_offset: ::off_t,
+ pub kp_len: ::size_t,
+ }
+
+ pub struct __c_anonymous_domainset {
+ _priv: [::uintptr_t; 4],
+ }
+
+ pub struct kinfo_proc {
+ /// Size of this structure.
+ pub ki_structsize: ::c_int,
+ /// Reserved: layout identifier.
+ pub ki_layout: ::c_int,
+ /// Address of command arguments.
+ pub ki_args: *mut ::pargs,
+ // This is normally "struct proc".
+ /// Address of proc.
+ pub ki_paddr: *mut ::c_void,
+ // This is normally "struct user".
+ /// Kernel virtual address of u-area.
+ pub ki_addr: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to trace file.
+ pub ki_tracep: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to executable file.
+ pub ki_textvp: *mut ::c_void,
+ // This is normally "struct filedesc".
+ /// Pointer to open file info.
+ pub ki_fd: *mut ::c_void,
+ // This is normally "struct vmspace".
+ /// Pointer to kernel vmspace struct.
+ pub ki_vmspace: *mut ::c_void,
+ /// Sleep address.
+ pub ki_wchan: *const ::c_void,
+ /// Process identifier.
+ pub ki_pid: ::pid_t,
+ /// Parent process ID.
+ pub ki_ppid: ::pid_t,
+ /// Process group ID.
+ pub ki_pgid: ::pid_t,
+ /// tty process group ID.
+ pub ki_tpgid: ::pid_t,
+ /// Process session ID.
+ pub ki_sid: ::pid_t,
+ /// Terminal session ID.
+ pub ki_tsid: ::pid_t,
+ /// Job control counter.
+ pub ki_jobc: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short1: ::c_short,
+ /// Controlling tty dev.
+ pub ki_tdev_freebsd11: u32,
+ /// Signals arrived but not delivered.
+ pub ki_siglist: ::sigset_t,
+ /// Current signal mask.
+ pub ki_sigmask: ::sigset_t,
+ /// Signals being ignored.
+ pub ki_sigignore: ::sigset_t,
+ /// Signals being caught by user.
+ pub ki_sigcatch: ::sigset_t,
+ /// Effective user ID.
+ pub ki_uid: ::uid_t,
+ /// Real user ID.
+ pub ki_ruid: ::uid_t,
+ /// Saved effective user ID.
+ pub ki_svuid: ::uid_t,
+ /// Real group ID.
+ pub ki_rgid: ::gid_t,
+ /// Saved effective group ID.
+ pub ki_svgid: ::gid_t,
+ /// Number of groups.
+ pub ki_ngroups: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short2: ::c_short,
+ /// Groups.
+ pub ki_groups: [::gid_t; ::KI_NGROUPS],
+ /// Virtual size.
+ pub ki_size: ::vm_size_t,
+ /// Current resident set size in pages.
+ pub ki_rssize: ::segsz_t,
+ /// Resident set size before last swap.
+ pub ki_swrss: ::segsz_t,
+ /// Text size (pages) XXX.
+ pub ki_tsize: ::segsz_t,
+ /// Data size (pages) XXX.
+ pub ki_dsize: ::segsz_t,
+ /// Stack size (pages).
+ pub ki_ssize: ::segsz_t,
+ /// Exit status for wait & stop signal.
+ pub ki_xstat: ::u_short,
+ /// Accounting flags.
+ pub ki_acflag: ::u_short,
+ /// %cpu for process during `ki_swtime`.
+ pub ki_pctcpu: ::fixpt_t,
+ /// Time averaged value of `ki_cpticks`.
+ pub ki_estcpu: ::u_int,
+ /// Time since last blocked.
+ pub ki_slptime: ::u_int,
+ /// Time swapped in or out.
+ pub ki_swtime: ::u_int,
+ /// Number of copy-on-write faults.
+ pub ki_cow: ::u_int,
+ /// Real time in microsec.
+ pub ki_runtime: u64,
+ /// Starting time.
+ pub ki_start: ::timeval,
+ /// Time used by process children.
+ pub ki_childtime: ::timeval,
+ /// P_* flags.
+ pub ki_flag: ::c_long,
+ /// KI_* flags (below).
+ pub ki_kiflag: ::c_long,
+ /// Kernel trace points.
+ pub ki_traceflag: ::c_int,
+ /// S* process status.
+ pub ki_stat: ::c_char,
+ /// Process "nice" value.
+ pub ki_nice: i8, // signed char
+ /// Process lock (prevent swap) count.
+ pub ki_lock: ::c_char,
+ /// Run queue index.
+ pub ki_rqindex: ::c_char,
+ /// Which cpu we are on.
+ pub ki_oncpu_old: ::c_uchar,
+ /// Last cpu we were on.
+ pub ki_lastcpu_old: ::c_uchar,
+ /// Thread name.
+ pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+ /// Wchan message.
+ pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+ /// Setlogin name.
+ pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+ /// Lock name.
+ pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+ /// Command name.
+ pub ki_comm: [::c_char; ::COMMLEN + 1],
+ /// Emulation name.
+ pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+ /// Login class.
+ pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+ /// More thread name.
+ pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+ /// Spare string space.
+ pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+ /// Spare room for growth.
+ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+ /// Controlling tty dev.
+ pub ki_tdev: u64,
+ /// Which cpu we are on.
+ pub ki_oncpu: ::c_int,
+ /// Last cpu we were on.
+ pub ki_lastcpu: ::c_int,
+ /// PID of tracing process.
+ pub ki_tracer: ::c_int,
+ /// P2_* flags.
+ pub ki_flag2: ::c_int,
+ /// Default FIB number.
+ pub ki_fibnum: ::c_int,
+ /// Credential flags.
+ pub ki_cr_flags: ::u_int,
+ /// Process jail ID.
+ pub ki_jid: ::c_int,
+ /// Number of threads in total.
+ pub ki_numthreads: ::c_int,
+ /// Thread ID.
+ pub ki_tid: ::lwpid_t,
+ /// Process priority.
+ pub ki_pri: ::priority,
+ /// Process rusage statistics.
+ pub ki_rusage: ::rusage,
+ /// rusage of children processes.
+ pub ki_rusage_ch: ::rusage,
+ // This is normally "struct pcb".
+ /// Kernel virtual addr of pcb.
+ pub ki_pcb: *mut ::c_void,
+ /// Kernel virtual addr of stack.
+ pub ki_kstack: *mut ::c_void,
+ /// User convenience pointer.
+ pub ki_udata: *mut ::c_void,
+ // This is normally "struct thread".
+ pub ki_tdaddr: *mut ::c_void,
+ // This is normally "struct pwddesc".
+ /// Pointer to process paths info.
+ pub ki_pd: *mut ::c_void,
+ pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+ pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+ /// PS_* flags.
+ pub ki_sflag: ::c_long,
+ /// kthread flag.
+ pub ki_tdflags: ::c_long,
+ }
}
s_no_extra_traits! {
@@ -64,6 +266,17 @@ s_no_extra_traits! {
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
+
+ pub struct vnstat {
+ pub vn_fileid: u64,
+ pub vn_size: u64,
+ pub vn_dev: u64,
+ pub vn_fsid: u64,
+ pub vn_mntdir: *mut ::c_char,
+ pub vn_type: ::c_int,
+ pub vn_mode: u16,
+ pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+ }
}
cfg_if! {
@@ -187,36 +400,90 @@ cfg_if! {
self.d_name[..self.d_namlen as _].hash(state);
}
}
+
+ impl PartialEq for vnstat {
+ fn eq(&self, other: &vnstat) -> bool {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+ let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+ self.vn_fileid == other.vn_fileid &&
+ self.vn_size == other.vn_size &&
+ self.vn_dev == other.vn_dev &&
+ self.vn_fsid == other.vn_fsid &&
+ self.vn_mntdir == other.vn_mntdir &&
+ self.vn_type == other.vn_type &&
+ self.vn_mode == other.vn_mode &&
+ self_vn_devname == other_vn_devname
+ }
+ }
+ impl Eq for vnstat {}
+ impl ::fmt::Debug for vnstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ f.debug_struct("vnstat")
+ .field("vn_fileid", &self.vn_fileid)
+ .field("vn_size", &self.vn_size)
+ .field("vn_dev", &self.vn_dev)
+ .field("vn_fsid", &self.vn_fsid)
+ .field("vn_mntdir", &self.vn_mntdir)
+ .field("vn_type", &self.vn_type)
+ .field("vn_mode", &self.vn_mode)
+ .field("vn_devname", &self_vn_devname)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for vnstat {
+ fn hash(&self, state: &mut H) {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ self.vn_fileid.hash(state);
+ self.vn_size.hash(state);
+ self.vn_dev.hash(state);
+ self.vn_fsid.hash(state);
+ self.vn_mntdir.hash(state);
+ self.vn_type.hash(state);
+ self.vn_mode.hash(state);
+ self_vn_devname.hash(state);
+ }
+ }
}
}
-pub const F_ADD_SEALS: ::c_int = 19;
-pub const F_GET_SEALS: ::c_int = 20;
-pub const F_SEAL_SEAL: ::c_int = 0x0001;
-pub const F_SEAL_SHRINK: ::c_int = 0x0002;
-pub const F_SEAL_GROW: ::c_int = 0x0004;
-pub const F_SEAL_WRITE: ::c_int = 0x0008;
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const ELAST: ::c_int = 97;
-pub const GRND_NONBLOCK: ::c_uint = 0x1;
-pub const GRND_RANDOM: ::c_uint = 0x2;
+pub const KF_TYPE_EVENTFD: ::c_int = 13;
-pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 255;
+pub const KI_NSPARE_PTR: usize = 5;
-pub const SO_DOMAIN: ::c_int = 0x1019;
+/// domainset policies
+pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
+pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
+pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
+pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
+pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
-pub const EINTEGRITY: ::c_int = 97;
-pub const ELAST: ::c_int = 97;
-pub const GRND_INSECURE: ::c_uint = 0x4;
+pub const MINCORE_SUPER: ::c_int = 0x20;
+
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= ((major & 0xffffff00) as dev_t) << 32;
+ dev |= ((major & 0x000000ff) as dev_t) << 8;
+ dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+ dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+ dev
+ }
+}
extern "C" {
- pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int;
- pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int;
pub fn setgrent();
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
@@ -232,19 +499,55 @@ extern "C" {
rmtp: *mut ::timespec,
) -> ::c_int;
+ pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+
pub fn fdatasync(fd: ::c_int) -> ::c_int;
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+ pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+ pub fn setproctitle_fast(fmt: *const ::c_char, ...);
+ pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+ pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+ pub fn cpuset_getdomain(
+ level: ::cpulevel_t,
+ which: ::cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *mut ::domainset_t,
+ policy: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn cpuset_setdomain(
+ level: ::cpulevel_t,
+ which: ::cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *const ::domainset_t,
+ policy: ::c_int,
+ ) -> ::c_int;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+ pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
- target_arch = "aarch64"))] {
+ target_arch = "aarch64",
+ target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
+ }
+}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
new file mode 100644
index 0000000000000..7bf2534455bf9
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
new file mode 100644
index 0000000000000..80c6fa1684530
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ st_padding0: i16,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ st_padding1: i32,
+ pub st_rdev: ::dev_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,
+ pub st_birthtime: ::time_t,
+ pub st_birthtime_nsec: ::c_long,
+ pub st_size: ::off_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_blksize: ::blksize_t,
+ pub st_flags: ::fflags_t,
+ pub st_gen: u64,
+ pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+ fn clone(&self) -> ::stat {
+ *self
+ }
+}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
new file mode 100644
index 0000000000000..115b47764e69e
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
@@ -0,0 +1,553 @@
+// APIs in FreeBSD 13 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+pub type kpaddr_t = u64;
+pub type kssize_t = i64;
+pub type domainset_t = __c_anonymous_domainset;
+
+s! {
+ 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,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ }
+
+ pub struct kevent {
+ pub ident: ::uintptr_t,
+ pub filter: ::c_short,
+ pub flags: ::c_ushort,
+ pub fflags: ::c_uint,
+ pub data: i64,
+ pub udata: *mut ::c_void,
+ pub ext: [u64; 4],
+ }
+
+ pub struct kvm_page {
+ pub kp_version: ::u_int,
+ pub kp_paddr: ::kpaddr_t,
+ pub kp_kmap_vaddr: ::kvaddr_t,
+ pub kp_dmap_vaddr: ::kvaddr_t,
+ pub kp_prot: ::vm_prot_t,
+ pub kp_offset: ::off_t,
+ pub kp_len: ::size_t,
+ }
+
+ pub struct __c_anonymous_domainset {
+ _priv: [::uintptr_t; 4],
+ }
+
+ pub struct kinfo_proc {
+ /// Size of this structure.
+ pub ki_structsize: ::c_int,
+ /// Reserved: layout identifier.
+ pub ki_layout: ::c_int,
+ /// Address of command arguments.
+ pub ki_args: *mut ::pargs,
+ // This is normally "struct proc".
+ /// Address of proc.
+ pub ki_paddr: *mut ::c_void,
+ // This is normally "struct user".
+ /// Kernel virtual address of u-area.
+ pub ki_addr: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to trace file.
+ pub ki_tracep: *mut ::c_void,
+ // This is normally "struct vnode".
+ /// Pointer to executable file.
+ pub ki_textvp: *mut ::c_void,
+ // This is normally "struct filedesc".
+ /// Pointer to open file info.
+ pub ki_fd: *mut ::c_void,
+ // This is normally "struct vmspace".
+ /// Pointer to kernel vmspace struct.
+ pub ki_vmspace: *mut ::c_void,
+ /// Sleep address.
+ pub ki_wchan: *const ::c_void,
+ /// Process identifier.
+ pub ki_pid: ::pid_t,
+ /// Parent process ID.
+ pub ki_ppid: ::pid_t,
+ /// Process group ID.
+ pub ki_pgid: ::pid_t,
+ /// tty process group ID.
+ pub ki_tpgid: ::pid_t,
+ /// Process session ID.
+ pub ki_sid: ::pid_t,
+ /// Terminal session ID.
+ pub ki_tsid: ::pid_t,
+ /// Job control counter.
+ pub ki_jobc: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short1: ::c_short,
+ /// Controlling tty dev.
+ pub ki_tdev_freebsd11: u32,
+ /// Signals arrived but not delivered.
+ pub ki_siglist: ::sigset_t,
+ /// Current signal mask.
+ pub ki_sigmask: ::sigset_t,
+ /// Signals being ignored.
+ pub ki_sigignore: ::sigset_t,
+ /// Signals being caught by user.
+ pub ki_sigcatch: ::sigset_t,
+ /// Effective user ID.
+ pub ki_uid: ::uid_t,
+ /// Real user ID.
+ pub ki_ruid: ::uid_t,
+ /// Saved effective user ID.
+ pub ki_svuid: ::uid_t,
+ /// Real group ID.
+ pub ki_rgid: ::gid_t,
+ /// Saved effective group ID.
+ pub ki_svgid: ::gid_t,
+ /// Number of groups.
+ pub ki_ngroups: ::c_short,
+ /// Unused (just here for alignment).
+ pub ki_spare_short2: ::c_short,
+ /// Groups.
+ pub ki_groups: [::gid_t; ::KI_NGROUPS],
+ /// Virtual size.
+ pub ki_size: ::vm_size_t,
+ /// Current resident set size in pages.
+ pub ki_rssize: ::segsz_t,
+ /// Resident set size before last swap.
+ pub ki_swrss: ::segsz_t,
+ /// Text size (pages) XXX.
+ pub ki_tsize: ::segsz_t,
+ /// Data size (pages) XXX.
+ pub ki_dsize: ::segsz_t,
+ /// Stack size (pages).
+ pub ki_ssize: ::segsz_t,
+ /// Exit status for wait & stop signal.
+ pub ki_xstat: ::u_short,
+ /// Accounting flags.
+ pub ki_acflag: ::u_short,
+ /// %cpu for process during `ki_swtime`.
+ pub ki_pctcpu: ::fixpt_t,
+ /// Time averaged value of `ki_cpticks`.
+ pub ki_estcpu: ::u_int,
+ /// Time since last blocked.
+ pub ki_slptime: ::u_int,
+ /// Time swapped in or out.
+ pub ki_swtime: ::u_int,
+ /// Number of copy-on-write faults.
+ pub ki_cow: ::u_int,
+ /// Real time in microsec.
+ pub ki_runtime: u64,
+ /// Starting time.
+ pub ki_start: ::timeval,
+ /// Time used by process children.
+ pub ki_childtime: ::timeval,
+ /// P_* flags.
+ pub ki_flag: ::c_long,
+ /// KI_* flags (below).
+ pub ki_kiflag: ::c_long,
+ /// Kernel trace points.
+ pub ki_traceflag: ::c_int,
+ /// S* process status.
+ pub ki_stat: ::c_char,
+ /// Process "nice" value.
+ pub ki_nice: i8, // signed char
+ /// Process lock (prevent swap) count.
+ pub ki_lock: ::c_char,
+ /// Run queue index.
+ pub ki_rqindex: ::c_char,
+ /// Which cpu we are on.
+ pub ki_oncpu_old: ::c_uchar,
+ /// Last cpu we were on.
+ pub ki_lastcpu_old: ::c_uchar,
+ /// Thread name.
+ pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+ /// Wchan message.
+ pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+ /// Setlogin name.
+ pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+ /// Lock name.
+ pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+ /// Command name.
+ pub ki_comm: [::c_char; ::COMMLEN + 1],
+ /// Emulation name.
+ pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+ /// Login class.
+ pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+ /// More thread name.
+ pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+ /// Spare string space.
+ pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+ /// Spare room for growth.
+ pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+ /// Controlling tty dev.
+ pub ki_tdev: u64,
+ /// Which cpu we are on.
+ pub ki_oncpu: ::c_int,
+ /// Last cpu we were on.
+ pub ki_lastcpu: ::c_int,
+ /// PID of tracing process.
+ pub ki_tracer: ::c_int,
+ /// P2_* flags.
+ pub ki_flag2: ::c_int,
+ /// Default FIB number.
+ pub ki_fibnum: ::c_int,
+ /// Credential flags.
+ pub ki_cr_flags: ::u_int,
+ /// Process jail ID.
+ pub ki_jid: ::c_int,
+ /// Number of threads in total.
+ pub ki_numthreads: ::c_int,
+ /// Thread ID.
+ pub ki_tid: ::lwpid_t,
+ /// Process priority.
+ pub ki_pri: ::priority,
+ /// Process rusage statistics.
+ pub ki_rusage: ::rusage,
+ /// rusage of children processes.
+ pub ki_rusage_ch: ::rusage,
+ // This is normally "struct pcb".
+ /// Kernel virtual addr of pcb.
+ pub ki_pcb: *mut ::c_void,
+ /// Kernel virtual addr of stack.
+ pub ki_kstack: *mut ::c_void,
+ /// User convenience pointer.
+ pub ki_udata: *mut ::c_void,
+ // This is normally "struct thread".
+ pub ki_tdaddr: *mut ::c_void,
+ // This is normally "struct pwddesc".
+ /// Pointer to process paths info.
+ pub ki_pd: *mut ::c_void,
+ pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+ pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+ /// PS_* flags.
+ pub ki_sflag: ::c_long,
+ /// kthread flag.
+ pub ki_tdflags: ::c_long,
+ }
+}
+
+s_no_extra_traits! {
+ pub struct dirent {
+ pub d_fileno: ::ino_t,
+ pub d_off: ::off_t,
+ pub d_reclen: u16,
+ pub d_type: u8,
+ d_pad0: u8,
+ pub d_namlen: u16,
+ d_pad1: u16,
+ pub d_name: [::c_char; 256],
+ }
+
+ pub struct statfs {
+ pub f_version: u32,
+ pub f_type: u32,
+ pub f_flags: u64,
+ pub f_bsize: u64,
+ pub f_iosize: u64,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: i64,
+ pub f_files: u64,
+ pub f_ffree: i64,
+ pub f_syncwrites: u64,
+ pub f_asyncwrites: u64,
+ pub f_syncreads: u64,
+ pub f_asyncreads: u64,
+ f_spare: [u64; 10],
+ pub f_namemax: u32,
+ pub f_owner: ::uid_t,
+ pub f_fsid: ::fsid_t,
+ f_charspare: [::c_char; 80],
+ pub f_fstypename: [::c_char; 16],
+ pub f_mntfromname: [::c_char; 1024],
+ pub f_mntonname: [::c_char; 1024],
+ }
+
+ pub struct vnstat {
+ pub vn_fileid: u64,
+ pub vn_size: u64,
+ pub vn_dev: u64,
+ pub vn_fsid: u64,
+ pub vn_mntdir: *mut ::c_char,
+ pub vn_type: ::c_int,
+ pub vn_mode: u16,
+ pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for statfs {
+ fn eq(&self, other: &statfs) -> bool {
+ self.f_version == other.f_version
+ && self.f_type == other.f_type
+ && self.f_flags == other.f_flags
+ && self.f_bsize == other.f_bsize
+ && self.f_iosize == other.f_iosize
+ && self.f_blocks == other.f_blocks
+ && self.f_bfree == other.f_bfree
+ && self.f_bavail == other.f_bavail
+ && self.f_files == other.f_files
+ && self.f_ffree == other.f_ffree
+ && self.f_syncwrites == other.f_syncwrites
+ && self.f_asyncwrites == other.f_asyncwrites
+ && self.f_syncreads == other.f_syncreads
+ && self.f_asyncreads == other.f_asyncreads
+ && self.f_namemax == other.f_namemax
+ && self.f_owner == other.f_owner
+ && self.f_fsid == other.f_fsid
+ && self.f_fstypename == other.f_fstypename
+ && self
+ .f_mntfromname
+ .iter()
+ .zip(other.f_mntfromname.iter())
+ .all(|(a,b)| a == b)
+ && self
+ .f_mntonname
+ .iter()
+ .zip(other.f_mntonname.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for statfs {}
+ impl ::fmt::Debug for statfs {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("statfs")
+ .field("f_bsize", &self.f_bsize)
+ .field("f_iosize", &self.f_iosize)
+ .field("f_blocks", &self.f_blocks)
+ .field("f_bfree", &self.f_bfree)
+ .field("f_bavail", &self.f_bavail)
+ .field("f_files", &self.f_files)
+ .field("f_ffree", &self.f_ffree)
+ .field("f_syncwrites", &self.f_syncwrites)
+ .field("f_asyncwrites", &self.f_asyncwrites)
+ .field("f_syncreads", &self.f_syncreads)
+ .field("f_asyncreads", &self.f_asyncreads)
+ .field("f_namemax", &self.f_namemax)
+ .field("f_owner", &self.f_owner)
+ .field("f_fsid", &self.f_fsid)
+ .field("f_fstypename", &self.f_fstypename)
+ .field("f_mntfromname", &&self.f_mntfromname[..])
+ .field("f_mntonname", &&self.f_mntonname[..])
+ .finish()
+ }
+ }
+ impl ::hash::Hash for statfs {
+ fn hash(&self, state: &mut H) {
+ self.f_version.hash(state);
+ self.f_type.hash(state);
+ self.f_flags.hash(state);
+ self.f_bsize.hash(state);
+ self.f_iosize.hash(state);
+ self.f_blocks.hash(state);
+ self.f_bfree.hash(state);
+ self.f_bavail.hash(state);
+ self.f_files.hash(state);
+ self.f_ffree.hash(state);
+ self.f_syncwrites.hash(state);
+ self.f_asyncwrites.hash(state);
+ self.f_syncreads.hash(state);
+ self.f_asyncreads.hash(state);
+ self.f_namemax.hash(state);
+ self.f_owner.hash(state);
+ self.f_fsid.hash(state);
+ self.f_charspare.hash(state);
+ self.f_fstypename.hash(state);
+ self.f_mntfromname.hash(state);
+ self.f_mntonname.hash(state);
+ }
+ }
+
+ impl PartialEq for dirent {
+ fn eq(&self, other: &dirent) -> bool {
+ self.d_fileno == other.d_fileno
+ && self.d_off == other.d_off
+ && self.d_reclen == other.d_reclen
+ && self.d_type == other.d_type
+ && self.d_namlen == other.d_namlen
+ && self
+ .d_name[..self.d_namlen as _]
+ .iter()
+ .zip(other.d_name.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for dirent {}
+ impl ::fmt::Debug for dirent {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("dirent")
+ .field("d_fileno", &self.d_fileno)
+ .field("d_off", &self.d_off)
+ .field("d_reclen", &self.d_reclen)
+ .field("d_type", &self.d_type)
+ .field("d_namlen", &self.d_namlen)
+ .field("d_name", &&self.d_name[..self.d_namlen as _])
+ .finish()
+ }
+ }
+ impl ::hash::Hash for dirent {
+ fn hash(&self, state: &mut H) {
+ self.d_fileno.hash(state);
+ self.d_off.hash(state);
+ self.d_reclen.hash(state);
+ self.d_type.hash(state);
+ self.d_namlen.hash(state);
+ self.d_name[..self.d_namlen as _].hash(state);
+ }
+ }
+
+ impl PartialEq for vnstat {
+ fn eq(&self, other: &vnstat) -> bool {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+ let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+ self.vn_fileid == other.vn_fileid &&
+ self.vn_size == other.vn_size &&
+ self.vn_dev == other.vn_dev &&
+ self.vn_fsid == other.vn_fsid &&
+ self.vn_mntdir == other.vn_mntdir &&
+ self.vn_type == other.vn_type &&
+ self.vn_mode == other.vn_mode &&
+ self_vn_devname == other_vn_devname
+ }
+ }
+ impl Eq for vnstat {}
+ impl ::fmt::Debug for vnstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ f.debug_struct("vnstat")
+ .field("vn_fileid", &self.vn_fileid)
+ .field("vn_size", &self.vn_size)
+ .field("vn_dev", &self.vn_dev)
+ .field("vn_fsid", &self.vn_fsid)
+ .field("vn_mntdir", &self.vn_mntdir)
+ .field("vn_type", &self.vn_type)
+ .field("vn_mode", &self.vn_mode)
+ .field("vn_devname", &self_vn_devname)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for vnstat {
+ fn hash(&self, state: &mut H) {
+ let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+ self.vn_fileid.hash(state);
+ self.vn_size.hash(state);
+ self.vn_dev.hash(state);
+ self.vn_fsid.hash(state);
+ self.vn_mntdir.hash(state);
+ self.vn_type.hash(state);
+ self.vn_mode.hash(state);
+ self_vn_devname.hash(state);
+ }
+ }
+ }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const ELAST: ::c_int = 97;
+
+pub const KF_TYPE_EVENTFD: ::c_int = 13;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 255;
+pub const KI_NSPARE_PTR: usize = 5;
+
+/// domainset policies
+pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
+pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
+pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
+pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
+pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
+
+pub const MINCORE_SUPER: ::c_int = 0x60;
+
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= ((major & 0xffffff00) as dev_t) << 32;
+ dev |= ((major & 0x000000ff) as dev_t) << 8;
+ dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+ dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+ dev
+ }
+}
+
+extern "C" {
+ pub fn setgrent();
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+ pub fn freelocale(loc: ::locale_t);
+ pub fn msgrcv(
+ msqid: ::c_int,
+ msgp: *mut ::c_void,
+ msgsz: ::size_t,
+ msgtyp: ::c_long,
+ msgflg: ::c_int,
+ ) -> ::ssize_t;
+ pub fn clock_nanosleep(
+ clk_id: ::clockid_t,
+ flags: ::c_int,
+ rqtp: *const ::timespec,
+ rmtp: *mut ::timespec,
+ ) -> ::c_int;
+
+ pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+
+ pub fn fdatasync(fd: ::c_int) -> ::c_int;
+
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+ pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+ pub fn setproctitle_fast(fmt: *const ::c_char, ...);
+ pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+ pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+ pub fn cpuset_getdomain(
+ level: ::cpulevel_t,
+ which: ::cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *mut ::domainset_t,
+ policy: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn cpuset_setdomain(
+ level: ::cpulevel_t,
+ which: ::cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *const ::domainset_t,
+ policy: ::c_int,
+ ) -> ::c_int;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+ pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+ if #[cfg(any(target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "riscv64"))] {
+ mod b64;
+ pub use self::b64::*;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
+ }
+}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
new file mode 100644
index 0000000000000..7bf2534455bf9
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 6a6033dc08987..2a4fbbf05f3a7 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -1,23 +1,237 @@
pub type fflags_t = u32;
pub type clock_t = i32;
-pub type lwpid_t = i32;
+pub type vm_prot_t = u_char;
+pub type kvaddr_t = u64;
+pub type segsz_t = isize;
+pub type __fixpt_t = u32;
+pub type fixpt_t = __fixpt_t;
+pub type __lwpid_t = i32;
+pub type lwpid_t = __lwpid_t;
pub type blksize_t = i32;
pub type clockid_t = ::c_int;
pub type sem_t = _sem;
+pub type timer_t = *mut __c_anonymous__timer;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
-pub type key_t = ::c_long;
pub type msglen_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
+pub type cpulevel_t = ::c_int;
+pub type cpuwhich_t = ::c_int;
+
pub type mqd_t = *mut ::c_void;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
+pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
+pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
+
+pub type uuid_t = ::uuid;
+pub type u_int = ::c_uint;
+pub type u_char = ::c_uchar;
+pub type u_long = ::c_ulong;
+pub type u_short = ::c_ushort;
+
+pub type caddr_t = *mut ::c_char;
+
+pub type fhandle_t = fhandle;
+
+pub type au_id_t = ::uid_t;
+pub type au_asid_t = ::pid_t;
+
+pub type cpusetid_t = ::c_int;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_support_flags {
+ DEVSTAT_ALL_SUPPORTED = 0x00,
+ DEVSTAT_NO_BLOCKSIZE = 0x01,
+ DEVSTAT_NO_ORDERED_TAGS = 0x02,
+ DEVSTAT_BS_UNAVAILABLE = 0x04,
+}
+impl ::Copy for devstat_support_flags {}
+impl ::Clone for devstat_support_flags {
+ fn clone(&self) -> devstat_support_flags {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_trans_flags {
+ DEVSTAT_NO_DATA = 0x00,
+ DEVSTAT_READ = 0x01,
+ DEVSTAT_WRITE = 0x02,
+ DEVSTAT_FREE = 0x03,
+}
+
+impl ::Copy for devstat_trans_flags {}
+impl ::Clone for devstat_trans_flags {
+ fn clone(&self) -> devstat_trans_flags {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_tag_type {
+ DEVSTAT_TAG_SIMPLE = 0x00,
+ DEVSTAT_TAG_HEAD = 0x01,
+ DEVSTAT_TAG_ORDERED = 0x02,
+ DEVSTAT_TAG_NONE = 0x03,
+}
+impl ::Copy for devstat_tag_type {}
+impl ::Clone for devstat_tag_type {
+ fn clone(&self) -> devstat_tag_type {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_match_flags {
+ DEVSTAT_MATCH_NONE = 0x00,
+ DEVSTAT_MATCH_TYPE = 0x01,
+ DEVSTAT_MATCH_IF = 0x02,
+ DEVSTAT_MATCH_PASS = 0x04,
+}
+impl ::Copy for devstat_match_flags {}
+impl ::Clone for devstat_match_flags {
+ fn clone(&self) -> devstat_match_flags {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_priority {
+ DEVSTAT_PRIORITY_MIN = 0x000,
+ DEVSTAT_PRIORITY_OTHER = 0x020,
+ DEVSTAT_PRIORITY_PASS = 0x030,
+ DEVSTAT_PRIORITY_FD = 0x040,
+ DEVSTAT_PRIORITY_WFD = 0x050,
+ DEVSTAT_PRIORITY_TAPE = 0x060,
+ DEVSTAT_PRIORITY_CD = 0x090,
+ DEVSTAT_PRIORITY_DISK = 0x110,
+ DEVSTAT_PRIORITY_ARRAY = 0x120,
+ DEVSTAT_PRIORITY_MAX = 0xfff,
+}
+impl ::Copy for devstat_priority {}
+impl ::Clone for devstat_priority {
+ fn clone(&self) -> devstat_priority {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_type_flags {
+ DEVSTAT_TYPE_DIRECT = 0x000,
+ DEVSTAT_TYPE_SEQUENTIAL = 0x001,
+ DEVSTAT_TYPE_PRINTER = 0x002,
+ DEVSTAT_TYPE_PROCESSOR = 0x003,
+ DEVSTAT_TYPE_WORM = 0x004,
+ DEVSTAT_TYPE_CDROM = 0x005,
+ DEVSTAT_TYPE_SCANNER = 0x006,
+ DEVSTAT_TYPE_OPTICAL = 0x007,
+ DEVSTAT_TYPE_CHANGER = 0x008,
+ DEVSTAT_TYPE_COMM = 0x009,
+ DEVSTAT_TYPE_ASC0 = 0x00a,
+ DEVSTAT_TYPE_ASC1 = 0x00b,
+ DEVSTAT_TYPE_STORARRAY = 0x00c,
+ DEVSTAT_TYPE_ENCLOSURE = 0x00d,
+ DEVSTAT_TYPE_FLOPPY = 0x00e,
+ DEVSTAT_TYPE_MASK = 0x00f,
+ DEVSTAT_TYPE_IF_SCSI = 0x010,
+ DEVSTAT_TYPE_IF_IDE = 0x020,
+ DEVSTAT_TYPE_IF_OTHER = 0x030,
+ DEVSTAT_TYPE_IF_MASK = 0x0f0,
+ DEVSTAT_TYPE_PASS = 0x100,
+}
+impl ::Copy for devstat_type_flags {}
+impl ::Clone for devstat_type_flags {
+ fn clone(&self) -> devstat_type_flags {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_metric {
+ DSM_NONE,
+ DSM_TOTAL_BYTES,
+ DSM_TOTAL_BYTES_READ,
+ DSM_TOTAL_BYTES_WRITE,
+ DSM_TOTAL_TRANSFERS,
+ DSM_TOTAL_TRANSFERS_READ,
+ DSM_TOTAL_TRANSFERS_WRITE,
+ DSM_TOTAL_TRANSFERS_OTHER,
+ DSM_TOTAL_BLOCKS,
+ DSM_TOTAL_BLOCKS_READ,
+ DSM_TOTAL_BLOCKS_WRITE,
+ DSM_KB_PER_TRANSFER,
+ DSM_KB_PER_TRANSFER_READ,
+ DSM_KB_PER_TRANSFER_WRITE,
+ DSM_TRANSFERS_PER_SECOND,
+ DSM_TRANSFERS_PER_SECOND_READ,
+ DSM_TRANSFERS_PER_SECOND_WRITE,
+ DSM_TRANSFERS_PER_SECOND_OTHER,
+ DSM_MB_PER_SECOND,
+ DSM_MB_PER_SECOND_READ,
+ DSM_MB_PER_SECOND_WRITE,
+ DSM_BLOCKS_PER_SECOND,
+ DSM_BLOCKS_PER_SECOND_READ,
+ DSM_BLOCKS_PER_SECOND_WRITE,
+ DSM_MS_PER_TRANSACTION,
+ DSM_MS_PER_TRANSACTION_READ,
+ DSM_MS_PER_TRANSACTION_WRITE,
+ DSM_SKIP,
+ DSM_TOTAL_BYTES_FREE,
+ DSM_TOTAL_TRANSFERS_FREE,
+ DSM_TOTAL_BLOCKS_FREE,
+ DSM_KB_PER_TRANSFER_FREE,
+ DSM_MB_PER_SECOND_FREE,
+ DSM_TRANSFERS_PER_SECOND_FREE,
+ DSM_BLOCKS_PER_SECOND_FREE,
+ DSM_MS_PER_TRANSACTION_OTHER,
+ DSM_MS_PER_TRANSACTION_FREE,
+ DSM_BUSY_PCT,
+ DSM_QUEUE_LENGTH,
+ DSM_TOTAL_DURATION,
+ DSM_TOTAL_DURATION_READ,
+ DSM_TOTAL_DURATION_WRITE,
+ DSM_TOTAL_DURATION_FREE,
+ DSM_TOTAL_DURATION_OTHER,
+ DSM_TOTAL_BUSY_TIME,
+ DSM_MAX,
+}
+impl ::Copy for devstat_metric {}
+impl ::Clone for devstat_metric {
+ fn clone(&self) -> devstat_metric {
+ *self
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_select_mode {
+ DS_SELECT_ADD,
+ DS_SELECT_ONLY,
+ DS_SELECT_REMOVE,
+ DS_SELECT_ADDONLY,
+}
+impl ::Copy for devstat_select_mode {}
+impl ::Clone for devstat_select_mode {
+ fn clone(&self) -> devstat_select_mode {
+ *self
+ }
+}
+
s! {
pub struct aiocb {
pub aio_fildes: ::c_int,
@@ -64,15 +278,10 @@ s! {
pub struct _sem {
data: [u32; 4],
}
-
- pub struct ipc_perm {
- pub cuid: ::uid_t,
- pub cgid: ::gid_t,
- pub uid: ::uid_t,
- pub gid: ::gid_t,
- pub mode: ::mode_t,
- pub seq: ::c_ushort,
- pub key: ::key_t,
+ pub struct sembuf {
+ pub sem_num: ::c_ushort,
+ pub sem_op: ::c_short,
+ pub sem_flg: ::c_short,
}
pub struct msqid_ds {
@@ -121,6 +330,683 @@ s! {
pub pve_fsid: u32,
pub pve_path: *mut ::c_char,
}
+
+ pub struct ptrace_lwpinfo {
+ pub pl_lwpid: lwpid_t,
+ pub pl_event: ::c_int,
+ pub pl_flags: ::c_int,
+ pub pl_sigmask: ::sigset_t,
+ pub pl_siglist: ::sigset_t,
+ pub pl_siginfo: ::siginfo_t,
+ pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
+ pub pl_child_pid: ::pid_t,
+ pub pl_syscall_code: ::c_uint,
+ pub pl_syscall_narg: ::c_uint,
+ }
+
+ pub struct ptrace_sc_ret {
+ pub sr_retval: [::register_t; 2],
+ pub sr_error: ::c_int,
+ }
+
+ pub struct ptrace_coredump {
+ pub pc_fd: ::c_int,
+ pub pc_flags: u32,
+ pub pc_limit: ::off_t,
+ }
+
+ pub struct cpuset_t {
+ #[cfg(target_pointer_width = "64")]
+ __bits: [::c_long; 4],
+ #[cfg(target_pointer_width = "32")]
+ __bits: [::c_long; 8],
+ }
+
+ pub struct cap_rights_t {
+ cr_rights: [u64; 2],
+ }
+
+ pub struct umutex {
+ m_owner: ::lwpid_t,
+ m_flags: u32,
+ m_ceilings: [u32; 2],
+ m_rb_link: ::uintptr_t,
+ #[cfg(target_pointer_width = "32")]
+ m_pad: u32,
+ m_spare: [u32; 2],
+
+ }
+
+ pub struct ucond {
+ c_has_waiters: u32,
+ c_flags: u32,
+ c_clockid: u32,
+ c_spare: [u32; 1],
+ }
+
+ pub struct uuid {
+ pub time_low: u32,
+ pub time_mid: u16,
+ pub time_hi_and_version: u16,
+ pub clock_seq_hi_and_reserved: u8,
+ pub clock_seq_low: u8,
+ pub node: [u8; _UUID_NODE_LEN],
+ }
+
+ pub struct __c_anonymous_pthread_spinlock {
+ s_clock: umutex,
+ }
+
+ pub struct __c_anonymous_pthread_barrierattr {
+ pshared: ::c_int,
+ }
+
+ pub struct __c_anonymous_pthread_barrier {
+ b_lock: umutex,
+ b_cv: ucond,
+ b_cycle: i64,
+ b_count: ::c_int,
+ b_waiters: ::c_int,
+ b_refcount: ::c_int,
+ b_destroying: ::c_int,
+ }
+
+ pub struct kinfo_vmentry {
+ pub kve_structsize: ::c_int,
+ pub kve_type: ::c_int,
+ pub kve_start: u64,
+ pub kve_end: u64,
+ pub kve_offset: u64,
+ pub kve_vn_fileid: u64,
+ #[cfg(not(freebsd11))]
+ pub kve_vn_fsid_freebsd11: u32,
+ #[cfg(freebsd11)]
+ pub kve_vn_fsid: u32,
+ pub kve_flags: ::c_int,
+ pub kve_resident: ::c_int,
+ pub kve_private_resident: ::c_int,
+ pub kve_protection: ::c_int,
+ pub kve_ref_count: ::c_int,
+ pub kve_shadow_count: ::c_int,
+ pub kve_vn_type: ::c_int,
+ pub kve_vn_size: u64,
+ #[cfg(not(freebsd11))]
+ pub kve_vn_rdev_freebsd11: u32,
+ #[cfg(freebsd11)]
+ pub kve_vn_rdev: u32,
+ pub kve_vn_mode: u16,
+ pub kve_status: u16,
+ #[cfg(not(freebsd11))]
+ pub kve_vn_fsid: u64,
+ #[cfg(not(freebsd11))]
+ pub kve_vn_rdev: u64,
+ #[cfg(not(freebsd11))]
+ _kve_is_spare: [::c_int; 8],
+ #[cfg(freebsd11)]
+ _kve_is_spare: [::c_int; 12],
+ pub kve_path: [[::c_char; 32]; 32],
+ }
+
+ pub struct __c_anonymous_filestat {
+ pub stqe_next: *mut filestat,
+ }
+
+ pub struct filestat {
+ pub fs_type: ::c_int,
+ pub fs_flags: ::c_int,
+ pub fs_fflags: ::c_int,
+ pub fs_uflags: ::c_int,
+ pub fs_fd: ::c_int,
+ pub fs_ref_count: ::c_int,
+ pub fs_offset: ::off_t,
+ pub fs_typedep: *mut ::c_void,
+ pub fs_path: *mut ::c_char,
+ pub next: __c_anonymous_filestat,
+ pub fs_cap_rights: cap_rights_t,
+ }
+
+ pub struct filestat_list {
+ pub stqh_first: *mut filestat,
+ pub stqh_last: *mut *mut filestat,
+ }
+
+ pub struct procstat {
+ pub tpe: ::c_int,
+ pub kd: ::uintptr_t,
+ pub vmentries: *mut ::c_void,
+ pub files: *mut ::c_void,
+ pub argv: *mut ::c_void,
+ pub envv: *mut ::c_void,
+ pub core: ::uintptr_t,
+ }
+
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
+
+ pub struct __c_anonymous__timer {
+ _priv: [::c_int; 3],
+ }
+
+ /// Used to hold a copy of the command line, if it had a sane length.
+ pub struct pargs {
+ /// Reference count.
+ pub ar_ref: u_int,
+ /// Length.
+ pub ar_length: u_int,
+ /// Arguments.
+ pub ar_args: [::c_uchar; 1],
+ }
+
+ pub struct priority {
+ /// Scheduling class.
+ pub pri_class: u_char,
+ /// Normal priority level.
+ pub pri_level: u_char,
+ /// Priority before propagation.
+ pub pri_native: u_char,
+ /// User priority based on p_cpu and p_nice.
+ pub pri_user: u_char,
+ }
+
+ pub struct kvm_swap {
+ pub ksw_devname: [::c_char; 32],
+ pub ksw_used: u_int,
+ pub ksw_total: u_int,
+ pub ksw_flags: ::c_int,
+ pub ksw_reserved1: u_int,
+ pub ksw_reserved2: u_int,
+ }
+
+ pub struct nlist {
+ /// symbol name (in memory)
+ pub n_name: *const ::c_char,
+ /// type defines
+ pub n_type: ::c_uchar,
+ /// "type" and binding information
+ pub n_other: ::c_char,
+ /// used by stab entries
+ pub n_desc: ::c_short,
+ pub n_value: ::c_ulong,
+ }
+
+ pub struct kvm_nlist {
+ pub n_name: *const ::c_char,
+ pub n_type: ::c_uchar,
+ pub n_value: ::kvaddr_t,
+ }
+
+ pub struct __c_anonymous_sem {
+ _priv: ::uintptr_t,
+ }
+
+ pub struct semid_ds {
+ pub sem_perm: ::ipc_perm,
+ pub __sem_base: *mut __c_anonymous_sem,
+ pub sem_nsems: ::c_ushort,
+ pub sem_otime: ::time_t,
+ pub sem_ctime: ::time_t,
+ }
+
+ pub struct vmtotal {
+ pub t_vm: u64,
+ pub t_avm: u64,
+ pub t_rm: u64,
+ pub t_arm: u64,
+ pub t_vmshr: u64,
+ pub t_avmshr: u64,
+ pub t_rmshr: u64,
+ pub t_armshr: u64,
+ pub t_free: u64,
+ pub t_rq: i16,
+ pub t_dw: i16,
+ pub t_pw: i16,
+ pub t_sl: i16,
+ pub t_sw: i16,
+ pub t_pad: [u16; 3],
+ }
+
+ pub struct sockstat {
+ pub inp_ppcb: u64,
+ pub so_addr: u64,
+ pub so_pcb: u64,
+ pub unp_conn: u64,
+ pub dom_family: ::c_int,
+ pub proto: ::c_int,
+ pub so_rcv_sb_state: ::c_int,
+ pub so_snd_sb_state: ::c_int,
+ /// Socket address.
+ pub sa_local: ::sockaddr_storage,
+ /// Peer address.
+ pub sa_peer: ::sockaddr_storage,
+ pub type_: ::c_int,
+ pub dname: [::c_char; 32],
+ #[cfg(any(freebsd12, freebsd13, freebsd14))]
+ pub sendq: ::c_uint,
+ #[cfg(any(freebsd12, freebsd13, freebsd14))]
+ pub recvq: ::c_uint,
+ }
+
+ pub struct shmstat {
+ pub size: u64,
+ pub mode: u16,
+ }
+
+ pub struct spacectl_range {
+ pub r_offset: ::off_t,
+ pub r_len: ::off_t
+ }
+
+ pub struct rusage_ext {
+ pub rux_runtime: u64,
+ pub rux_uticks: u64,
+ pub rux_sticks: u64,
+ pub rux_iticks: u64,
+ pub rux_uu: u64,
+ pub rux_su: u64,
+ pub rux_tu: u64,
+ }
+
+ pub struct if_clonereq {
+ pub ifcr_total: ::c_int,
+ pub ifcr_count: ::c_int,
+ pub ifcr_buffer: *mut ::c_char,
+ }
+
+ pub struct if_msghdr {
+ /// to skip over non-understood messages
+ pub ifm_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifm_version: ::c_uchar,
+ /// message type
+ pub ifm_type: ::c_uchar,
+ /// like rtm_addrs
+ pub ifm_addrs: ::c_int,
+ /// value of if_flags
+ pub ifm_flags: ::c_int,
+ /// index for associated ifp
+ pub ifm_index: ::c_ushort,
+ pub _ifm_spare1: ::c_ushort,
+ /// statistics and other data about if
+ pub ifm_data: if_data,
+ }
+
+ pub struct if_msghdrl {
+ /// to skip over non-understood messages
+ pub ifm_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifm_version: ::c_uchar,
+ /// message type
+ pub ifm_type: ::c_uchar,
+ /// like rtm_addrs
+ pub ifm_addrs: ::c_int,
+ /// value of if_flags
+ pub ifm_flags: ::c_int,
+ /// index for associated ifp
+ pub ifm_index: ::c_ushort,
+ /// spare space to grow if_index, see if_var.h
+ pub _ifm_spare1: ::c_ushort,
+ /// length of if_msghdrl incl. if_data
+ pub ifm_len: ::c_ushort,
+ /// offset of if_data from beginning
+ pub ifm_data_off: ::c_ushort,
+ pub _ifm_spare2: ::c_int,
+ /// statistics and other data about if
+ pub ifm_data: if_data,
+ }
+
+ pub struct ifa_msghdr {
+ /// to skip over non-understood messages
+ pub ifam_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifam_version: ::c_uchar,
+ /// message type
+ pub ifam_type: ::c_uchar,
+ /// like rtm_addrs
+ pub ifam_addrs: ::c_int,
+ /// value of ifa_flags
+ pub ifam_flags: ::c_int,
+ /// index for associated ifp
+ pub ifam_index: ::c_ushort,
+ pub _ifam_spare1: ::c_ushort,
+ /// value of ifa_ifp->if_metric
+ pub ifam_metric: ::c_int,
+ }
+
+ pub struct ifa_msghdrl {
+ /// to skip over non-understood messages
+ pub ifam_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifam_version: ::c_uchar,
+ /// message type
+ pub ifam_type: ::c_uchar,
+ /// like rtm_addrs
+ pub ifam_addrs: ::c_int,
+ /// value of ifa_flags
+ pub ifam_flags: ::c_int,
+ /// index for associated ifp
+ pub ifam_index: ::c_ushort,
+ /// spare space to grow if_index, see if_var.h
+ pub _ifam_spare1: ::c_ushort,
+ /// length of ifa_msghdrl incl. if_data
+ pub ifam_len: ::c_ushort,
+ /// offset of if_data from beginning
+ pub ifam_data_off: ::c_ushort,
+ /// value of ifa_ifp->if_metric
+ pub ifam_metric: ::c_int,
+ /// statistics and other data about if or address
+ pub ifam_data: if_data,
+ }
+
+ pub struct ifma_msghdr {
+ /// to skip over non-understood messages
+ pub ifmam_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifmam_version: ::c_uchar,
+ /// message type
+ pub ifmam_type: ::c_uchar,
+ /// like rtm_addrs
+ pub ifmam_addrs: ::c_int,
+ /// value of ifa_flags
+ pub ifmam_flags: ::c_int,
+ /// index for associated ifp
+ pub ifmam_index: ::c_ushort,
+ pub _ifmam_spare1: ::c_ushort,
+ }
+
+ pub struct if_announcemsghdr {
+ /// to skip over non-understood messages
+ pub ifan_msglen: ::c_ushort,
+ /// future binary compatibility
+ pub ifan_version: ::c_uchar,
+ /// message type
+ pub ifan_type: ::c_uchar,
+ /// index for associated ifp
+ pub ifan_index: ::c_ushort,
+ /// if name, e.g. "en0"
+ pub ifan_name: [::c_char; ::IFNAMSIZ as usize],
+ /// what type of announcement
+ pub ifan_what: ::c_ushort,
+ }
+
+ pub struct ifreq_buffer {
+ pub length: ::size_t,
+ pub buffer: *mut ::c_void,
+ }
+
+ pub struct ifaliasreq {
+ /// if name, e.g. "en0"
+ pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
+ pub ifra_addr: ::sockaddr,
+ pub ifra_broadaddr: ::sockaddr,
+ pub ifra_mask: ::sockaddr,
+ pub ifra_vhid: ::c_int,
+ }
+
+ /// 9.x compat
+ pub struct oifaliasreq {
+ /// if name, e.g. "en0"
+ pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
+ pub ifra_addr: ::sockaddr,
+ pub ifra_broadaddr: ::sockaddr,
+ pub ifra_mask: ::sockaddr,
+ }
+
+ pub struct ifmediareq {
+ /// if name, e.g. "en0"
+ pub ifm_name: [::c_char; ::IFNAMSIZ as usize],
+ /// current media options
+ pub ifm_current: ::c_int,
+ /// don't care mask
+ pub ifm_mask: ::c_int,
+ /// media status
+ pub ifm_status: ::c_int,
+ /// active options
+ pub ifm_active: ::c_int,
+ /// # entries in ifm_ulist array
+ pub ifm_count: ::c_int,
+ /// media words
+ pub ifm_ulist: *mut ::c_int,
+ }
+
+ pub struct ifdrv {
+ /// if name, e.g. "en0"
+ pub ifd_name: [::c_char; ::IFNAMSIZ as usize],
+ pub ifd_cmd: ::c_ulong,
+ pub ifd_len: ::size_t,
+ pub ifd_data: *mut ::c_void,
+ }
+
+ pub struct ifi2creq {
+ /// i2c address (0xA0, 0xA2)
+ pub dev_addr: u8,
+ /// read offset
+ pub offset: u8,
+ /// read length
+ pub len: u8,
+ pub spare0: u8,
+ pub spare1: u32,
+ /// read buffer
+ pub data: [u8; 8],
+ }
+
+ pub struct ifrsshash {
+ /// if name, e.g. "en0"
+ pub ifrh_name: [::c_char; ::IFNAMSIZ as usize],
+ /// RSS_FUNC_
+ pub ifrh_func: u8,
+ pub ifrh_spare0: u8,
+ pub ifrh_spare1: u16,
+ /// RSS_TYPE_
+ pub ifrh_types: u32,
+ }
+
+ pub struct ifmibdata {
+ /// name of interface
+ pub ifmd_name: [::c_char; ::IFNAMSIZ as usize],
+ /// number of promiscuous listeners
+ pub ifmd_pcount: ::c_int,
+ /// interface flags
+ pub ifmd_flags: ::c_int,
+ /// instantaneous length of send queue
+ pub ifmd_snd_len: ::c_int,
+ /// maximum length of send queue
+ pub ifmd_snd_maxlen: ::c_int,
+ /// number of drops in send queue
+ pub ifmd_snd_drops: ::c_int,
+ /// for future expansion
+ pub ifmd_filler: [::c_int; 4],
+ /// generic information and statistics
+ pub ifmd_data: if_data,
+ }
+
+ pub struct ifmib_iso_8802_3 {
+ pub dot3StatsAlignmentErrors: u32,
+ pub dot3StatsFCSErrors: u32,
+ pub dot3StatsSingleCollisionFrames: u32,
+ pub dot3StatsMultipleCollisionFrames: u32,
+ pub dot3StatsSQETestErrors: u32,
+ pub dot3StatsDeferredTransmissions: u32,
+ pub dot3StatsLateCollisions: u32,
+ pub dot3StatsExcessiveCollisions: u32,
+ pub dot3StatsInternalMacTransmitErrors: u32,
+ pub dot3StatsCarrierSenseErrors: u32,
+ pub dot3StatsFrameTooLongs: u32,
+ pub dot3StatsInternalMacReceiveErrors: u32,
+ pub dot3StatsEtherChipSet: u32,
+ pub dot3StatsMissedFrames: u32,
+ pub dot3StatsCollFrequencies: [u32; 16],
+ pub dot3Compliance: u32,
+ }
+
+ pub struct __c_anonymous_ph {
+ pub ph1: u64,
+ pub ph2: u64,
+ }
+
+ pub struct fid {
+ pub fid_len: ::c_ushort,
+ pub fid_data0: ::c_ushort,
+ pub fid_data: [::c_char; ::MAXFIDSZ as usize],
+ }
+
+ pub struct fhandle {
+ pub fh_fsid: ::fsid_t,
+ pub fh_fid: fid,
+ }
+
+ pub struct bintime {
+ pub sec: ::time_t,
+ pub frac: u64,
+ }
+
+ pub struct clockinfo {
+ /// clock frequency
+ pub hz: ::c_int,
+ /// micro-seconds per hz tick
+ pub tick: ::c_int,
+ pub spare: ::c_int,
+ /// statistics clock frequency
+ pub stathz: ::c_int,
+ /// profiling clock frequency
+ pub profhz: ::c_int,
+ }
+
+ pub struct __c_anonymous_stailq_entry_devstat {
+ pub stqe_next: *mut devstat,
+ }
+
+ pub struct devstat {
+ /// Update sequence
+ pub sequence0: ::u_int,
+ /// Allocated entry
+ pub allocated: ::c_int,
+ /// started ops
+ pub start_count: ::u_int,
+ /// completed ops
+ pub end_count: ::u_int,
+ /// busy time unaccounted for since this time
+ pub busy_from: bintime,
+ pub dev_links: __c_anonymous_stailq_entry_devstat,
+ /// Devstat device number.
+ pub device_number: u32,
+ pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
+ pub unit_number: ::c_int,
+ pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
+ pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
+ pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize],
+ pub busy_time: bintime,
+ /// Time the device was created.
+ pub creation_time: bintime,
+ /// Block size, bytes
+ pub block_size: u32,
+ /// The number of simple, ordered, and head of queue tags sent.
+ pub tag_types: [u64; 3],
+ /// Which statistics are supported by a given device.
+ pub flags: devstat_support_flags,
+ /// Device type
+ pub device_type: devstat_type_flags,
+ /// Controls list pos.
+ pub priority: devstat_priority,
+ /// Identification for GEOM nodes
+ pub id: *const ::c_void,
+ /// Update sequence
+ pub sequence1: ::u_int,
+ }
+
+ pub struct devstat_match {
+ pub match_fields: devstat_match_flags,
+ pub device_type: devstat_type_flags,
+ pub num_match_categories: ::c_int,
+ }
+
+ pub struct devstat_match_table {
+ pub match_str: *const ::c_char,
+ pub type_: devstat_type_flags,
+ pub match_field: devstat_match_flags,
+ }
+
+ pub struct device_selection {
+ pub device_number: u32,
+ pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
+ pub unit_number: ::c_int,
+ pub selected: ::c_int,
+ pub bytes: u64,
+ pub position: ::c_int,
+ }
+
+ pub struct devinfo {
+ pub devices: *mut devstat,
+ pub mem_ptr: *mut u8,
+ pub generation: ::c_long,
+ pub numdevs: ::c_int,
+ }
+
+ pub struct sockcred2 {
+ pub sc_version: ::c_int,
+ 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 ifconf {
+ pub ifc_len: ::c_int,
+ #[cfg(libc_union)]
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ }
+
+ pub struct au_mask_t {
+ pub am_success: ::c_uint,
+ pub am_failure: ::c_uint,
+ }
+
+ pub struct au_tid_t {
+ pub port: u32,
+ pub machine: u32,
+ }
+
+ pub struct auditinfo_t {
+ pub ai_auid: ::au_id_t,
+ pub ai_mask: ::au_mask_t,
+ pub ai_termid: au_tid_t,
+ pub ai_asid: ::au_asid_t,
+ }
+
+ pub struct tcp_fastopen {
+ pub enable: ::c_int,
+ pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
+ }
+
+ pub struct tcp_function_set {
+ pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize],
+ pub pcbcnt: u32,
+ }
+
+ pub struct _umtx_time {
+ pub _timeout: ::timespec,
+ pub _flags: u32,
+ pub _clockid: u32,
+ }
+
+ pub struct shm_largepage_conf {
+ pub psind: ::c_int,
+ pub alloc_policy: ::c_int,
+ __pad: [::c_int; 10],
+ }
+
+ pub struct memory_type {
+ __priva: [::uintptr_t; 32],
+ __privb: [::uintptr_t; 26],
+ }
+
+ pub struct memory_type_list {
+ __priv: [::uintptr_t; 2],
+ }
}
s_no_extra_traits! {
@@ -182,6 +1068,155 @@ s_no_extra_traits! {
__unused1: ::c_int,
__unused2: [::c_long; 7]
}
+
+ pub struct ptsstat {
+ #[cfg(any(freebsd12, freebsd13, freebsd14))]
+ pub dev: u64,
+ #[cfg(not(any(freebsd12, freebsd13, freebsd14)))]
+ pub dev: u32,
+ pub devname: [::c_char; SPECNAMELEN as usize + 1],
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_elf32_auxv_union {
+ pub a_val: ::c_int,
+ }
+
+ pub struct Elf32_Auxinfo {
+ pub a_type: ::c_int,
+ #[cfg(libc_union)]
+ pub a_un: __c_anonymous_elf32_auxv_union,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifi_epoch {
+ pub tt: ::time_t,
+ pub ph: u64,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifi_lastchange {
+ pub tv: ::timeval,
+ pub ph: __c_anonymous_ph,
+ }
+
+ pub struct if_data {
+ /// ethernet, tokenring, etc
+ pub ifi_type: u8,
+ /// e.g., AUI, Thinnet, 10base-T, etc
+ pub ifi_physical: u8,
+ /// media address length
+ pub ifi_addrlen: u8,
+ /// media header length
+ pub ifi_hdrlen: u8,
+ /// current link state
+ pub ifi_link_state: u8,
+ /// carp vhid
+ pub ifi_vhid: u8,
+ /// length of this data struct
+ pub ifi_datalen: u16,
+ /// maximum transmission unit
+ pub ifi_mtu: u32,
+ /// routing metric (external only)
+ pub ifi_metric: u32,
+ /// linespeed
+ pub ifi_baudrate: u64,
+ /// packets received on interface
+ pub ifi_ipackets: u64,
+ /// input errors on interface
+ pub ifi_ierrors: u64,
+ /// packets sent on interface
+ pub ifi_opackets: u64,
+ /// output errors on interface
+ pub ifi_oerrors: u64,
+ /// collisions on csma interfaces
+ pub ifi_collisions: u64,
+ /// total number of octets received
+ pub ifi_ibytes: u64,
+ /// total number of octets sent
+ pub ifi_obytes: u64,
+ /// packets received via multicast
+ pub ifi_imcasts: u64,
+ /// packets sent via multicast
+ pub ifi_omcasts: u64,
+ /// dropped on input
+ pub ifi_iqdrops: u64,
+ /// dropped on output
+ pub ifi_oqdrops: u64,
+ /// destined for unsupported protocol
+ pub ifi_noproto: u64,
+ /// HW offload capabilities, see IFCAP
+ pub ifi_hwassist: u64,
+ /// uptime at attach or stat reset
+ #[cfg(libc_union)]
+ pub __ifi_epoch: __c_anonymous_ifi_epoch,
+ /// uptime at attach or stat reset
+ #[cfg(not(libc_union))]
+ pub __ifi_epoch: u64,
+ /// time of last administrative change
+ #[cfg(libc_union)]
+ pub __ifi_lastchange: __c_anonymous_ifi_lastchange,
+ /// time of last administrative change
+ #[cfg(not(libc_union))]
+ pub __ifi_lastchange: ::timeval,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifr_ifru {
+ pub ifru_addr: ::sockaddr,
+ pub ifru_dstaddr: ::sockaddr,
+ pub ifru_broadaddr: ::sockaddr,
+ pub ifru_buffer: ifreq_buffer,
+ pub ifru_flags: [::c_short; 2],
+ pub ifru_index: ::c_short,
+ pub ifru_jid: ::c_int,
+ pub ifru_metric: ::c_int,
+ pub ifru_mtu: ::c_int,
+ pub ifru_phys: ::c_int,
+ pub ifru_media: ::c_int,
+ pub ifru_data: ::caddr_t,
+ pub ifru_cap: [::c_int; 2],
+ pub ifru_fib: ::c_uint,
+ pub ifru_vlan_pcp: ::c_uchar,
+ }
+
+ pub struct ifreq {
+ /// if name, e.g. "en0"
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ #[cfg(libc_union)]
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
+ #[cfg(not(libc_union))]
+ pub ifr_ifru: ::sockaddr,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifc_ifcu {
+ pub ifcu_buf: ::caddr_t,
+ pub ifcu_req: *mut ifreq,
+ }
+
+ pub struct ifstat {
+ /// if name, e.g. "en0"
+ pub ifs_name: [::c_char; ::IFNAMSIZ as usize],
+ pub ascii: [::c_char; ::IFSTATMAX as usize + 1],
+ }
+
+ pub struct ifrsskey {
+ /// if name, e.g. "en0"
+ pub ifrk_name: [::c_char; ::IFNAMSIZ as usize],
+ /// RSS_FUNC_
+ pub ifrk_func: u8,
+ pub ifrk_spare0: u8,
+ pub ifrk_keylen: u16,
+ pub ifrk_key: [u8; ::RSS_KEYLEN as usize],
+ }
+
+ pub struct ifdownreason {
+ pub ifdr_name: [::c_char; ::IFNAMSIZ as usize],
+ pub ifdr_reason: u32,
+ pub ifdr_vendor: u32,
+ pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
+ }
}
cfg_if! {
@@ -402,9 +1437,479 @@ cfg_if! {
self.sigev_notify_thread_id.hash(state);
}
}
+
+ impl PartialEq for ptsstat {
+ fn eq(&self, other: &ptsstat) -> bool {
+ let self_devname: &[::c_char] = &self.devname;
+ let other_devname: &[::c_char] = &other.devname;
+
+ self.dev == other.dev && self_devname == other_devname
+ }
+ }
+ impl Eq for ptsstat {}
+ impl ::fmt::Debug for ptsstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let self_devname: &[::c_char] = &self.devname;
+
+ f.debug_struct("ptsstat")
+ .field("dev", &self.dev)
+ .field("devname", &self_devname)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ptsstat {
+ fn hash(&self, state: &mut H) {
+ let self_devname: &[::c_char] = &self.devname;
+
+ self.dev.hash(state);
+ self_devname.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_elf32_auxv_union {
+ fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
+ unsafe { self.a_val == other.a_val}
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_elf32_auxv_union {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("a_val")
+ .field("a_val", unsafe { &self.a_val })
+ .finish()
+ }
+ }
+ #[cfg(not(libc_union))]
+ impl PartialEq for Elf32_Auxinfo {
+ fn eq(&self, other: &Elf32_Auxinfo) -> bool {
+ self.a_type == other.a_type
+ }
+ }
+ #[cfg(libc_union)]
+ impl PartialEq for Elf32_Auxinfo {
+ fn eq(&self, other: &Elf32_Auxinfo) -> bool {
+ self.a_type == other.a_type
+ && self.a_un == other.a_un
+ }
+ }
+ impl Eq for Elf32_Auxinfo {}
+ #[cfg(not(libc_union))]
+ impl ::fmt::Debug for Elf32_Auxinfo {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("Elf32_Auxinfo")
+ .field("a_type", &self.a_type)
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for Elf32_Auxinfo {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("Elf32_Auxinfo")
+ .field("a_type", &self.a_type)
+ .field("a_un", &self.a_un)
+ .finish()
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifr_ifru {
+ fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
+ unsafe {
+ self.ifru_addr == other.ifru_addr &&
+ self.ifru_dstaddr == other.ifru_dstaddr &&
+ self.ifru_broadaddr == other.ifru_broadaddr &&
+ self.ifru_buffer == other.ifru_buffer &&
+ self.ifru_flags == other.ifru_flags &&
+ self.ifru_index == other.ifru_index &&
+ self.ifru_jid == other.ifru_jid &&
+ self.ifru_metric == other.ifru_metric &&
+ self.ifru_mtu == other.ifru_mtu &&
+ self.ifru_phys == other.ifru_phys &&
+ self.ifru_media == other.ifru_media &&
+ self.ifru_data == other.ifru_data &&
+ self.ifru_cap == other.ifru_cap &&
+ self.ifru_fib == other.ifru_fib &&
+ self.ifru_vlan_pcp == other.ifru_vlan_pcp
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifr_ifru {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifr_ifru")
+ .field("ifru_addr", unsafe { &self.ifru_addr })
+ .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+ .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+ .field("ifru_buffer", unsafe { &self.ifru_buffer })
+ .field("ifru_flags", unsafe { &self.ifru_flags })
+ .field("ifru_index", unsafe { &self.ifru_index })
+ .field("ifru_jid", unsafe { &self.ifru_jid })
+ .field("ifru_metric", unsafe { &self.ifru_metric })
+ .field("ifru_mtu", unsafe { &self.ifru_mtu })
+ .field("ifru_phys", unsafe { &self.ifru_phys })
+ .field("ifru_media", unsafe { &self.ifru_media })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_cap", unsafe { &self.ifru_cap })
+ .field("ifru_fib", unsafe { &self.ifru_fib })
+ .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp })
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifr_ifru {
+ fn hash(&self, state: &mut H) {
+ unsafe { self.ifru_addr.hash(state) };
+ unsafe { self.ifru_dstaddr.hash(state) };
+ unsafe { self.ifru_broadaddr.hash(state) };
+ unsafe { self.ifru_buffer.hash(state) };
+ unsafe { self.ifru_flags.hash(state) };
+ unsafe { self.ifru_index.hash(state) };
+ unsafe { self.ifru_jid.hash(state) };
+ unsafe { self.ifru_metric.hash(state) };
+ unsafe { self.ifru_mtu.hash(state) };
+ unsafe { self.ifru_phys.hash(state) };
+ unsafe { self.ifru_media.hash(state) };
+ unsafe { self.ifru_data.hash(state) };
+ unsafe { self.ifru_cap.hash(state) };
+ unsafe { self.ifru_fib.hash(state) };
+ unsafe { self.ifru_vlan_pcp.hash(state) };
+ }
+ }
+
+ impl PartialEq for ifreq {
+ fn eq(&self, other: &ifreq) -> bool {
+ self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
+ }
+ }
+ impl Eq for ifreq {}
+ impl ::fmt::Debug for ifreq {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifreq")
+ .field("ifr_name", &self.ifr_name)
+ .field("ifr_ifru", &self.ifr_ifru)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ifreq {
+ fn hash(&self, state: &mut H) {
+ self.ifr_name.hash(state);
+ self.ifr_ifru.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifc_ifcu {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifc_ifcu {
+ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+ unsafe {
+ self.ifcu_buf == other.ifcu_buf &&
+ self.ifcu_req == other.ifcu_req
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifc_ifcu")
+ .field("ifcu_buf", unsafe { &self.ifcu_buf })
+ .field("ifcu_req", unsafe { &self.ifcu_req })
+ .finish()
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+ fn hash(&self, state: &mut H) {
+ unsafe { self.ifcu_buf.hash(state) };
+ unsafe { self.ifcu_req.hash(state) };
+ }
+ }
+
+ impl PartialEq for ifstat {
+ fn eq(&self, other: &ifstat) -> bool {
+ let self_ascii: &[::c_char] = &self.ascii;
+ let other_ascii: &[::c_char] = &other.ascii;
+
+ self.ifs_name == other.ifs_name && self_ascii == other_ascii
+ }
+ }
+ impl Eq for ifstat {}
+ impl ::fmt::Debug for ifstat {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let ascii: &[::c_char] = &self.ascii;
+
+ f.debug_struct("ifstat")
+ .field("ifs_name", &self.ifs_name)
+ .field("ascii", &ascii)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ifstat {
+ fn hash(&self, state: &mut H) {
+ self.ifs_name.hash(state);
+ self.ascii.hash(state);
+ }
+ }
+
+ impl PartialEq for ifrsskey {
+ fn eq(&self, other: &ifrsskey) -> bool {
+ let self_ifrk_key: &[u8] = &self.ifrk_key;
+ let other_ifrk_key: &[u8] = &other.ifrk_key;
+
+ self.ifrk_name == other.ifrk_name &&
+ self.ifrk_func == other.ifrk_func &&
+ self.ifrk_spare0 == other.ifrk_spare0 &&
+ self.ifrk_keylen == other.ifrk_keylen &&
+ self_ifrk_key == other_ifrk_key
+ }
+ }
+ impl Eq for ifrsskey {}
+ impl ::fmt::Debug for ifrsskey {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let ifrk_key: &[u8] = &self.ifrk_key;
+
+ f.debug_struct("ifrsskey")
+ .field("ifrk_name", &self.ifrk_name)
+ .field("ifrk_func", &self.ifrk_func)
+ .field("ifrk_spare0", &self.ifrk_spare0)
+ .field("ifrk_keylen", &self.ifrk_keylen)
+ .field("ifrk_key", &ifrk_key)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ifrsskey {
+ fn hash(&self, state: &mut H) {
+ self.ifrk_name.hash(state);
+ self.ifrk_func.hash(state);
+ self.ifrk_spare0.hash(state);
+ self.ifrk_keylen.hash(state);
+ self.ifrk_key.hash(state);
+ }
+ }
+
+ impl PartialEq for ifdownreason {
+ fn eq(&self, other: &ifdownreason) -> bool {
+ let self_ifdr_msg: &[::c_char] = &self.ifdr_msg;
+ let other_ifdr_msg: &[::c_char] = &other.ifdr_msg;
+
+ self.ifdr_name == other.ifdr_name &&
+ self.ifdr_reason == other.ifdr_reason &&
+ self.ifdr_vendor == other.ifdr_vendor &&
+ self_ifdr_msg == other_ifdr_msg
+ }
+ }
+ impl Eq for ifdownreason {}
+ impl ::fmt::Debug for ifdownreason {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ let ifdr_msg: &[::c_char] = &self.ifdr_msg;
+
+ f.debug_struct("ifdownreason")
+ .field("ifdr_name", &self.ifdr_name)
+ .field("ifdr_reason", &self.ifdr_reason)
+ .field("ifdr_vendor", &self.ifdr_vendor)
+ .field("ifdr_msg", &ifdr_msg)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ifdownreason {
+ fn hash(&self, state: &mut H) {
+ self.ifdr_name.hash(state);
+ self.ifdr_reason.hash(state);
+ self.ifdr_vendor.hash(state);
+ self.ifdr_msg.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifi_epoch {
+ fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool {
+ unsafe {
+ self.tt == other.tt &&
+ self.ph == other.ph
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifi_epoch {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifi_epoch {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifi_epoch")
+ .field("tt", unsafe { &self.tt })
+ .field("ph", unsafe { &self.ph })
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifi_epoch {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.tt.hash(state);
+ self.ph.hash(state);
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifi_lastchange {
+ fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool {
+ unsafe {
+ self.tv == other.tv &&
+ self.ph == other.ph
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifi_lastchange {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifi_lastchange {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifi_lastchange")
+ .field("tv", unsafe { &self.tv })
+ .field("ph", unsafe { &self.ph })
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifi_lastchange {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.tv.hash(state);
+ self.ph.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for if_data {
+ fn eq(&self, other: &if_data) -> bool {
+ self.ifi_type == other.ifi_type &&
+ self.ifi_physical == other.ifi_physical &&
+ self.ifi_addrlen == other.ifi_addrlen &&
+ self.ifi_hdrlen == other.ifi_hdrlen &&
+ self.ifi_link_state == other.ifi_link_state &&
+ self.ifi_vhid == other.ifi_vhid &&
+ self.ifi_datalen == other.ifi_datalen &&
+ self.ifi_mtu == other.ifi_mtu &&
+ self.ifi_metric == other.ifi_metric &&
+ self.ifi_baudrate == other.ifi_baudrate &&
+ self.ifi_ipackets == other.ifi_ipackets &&
+ self.ifi_ierrors == other.ifi_ierrors &&
+ self.ifi_opackets == other.ifi_opackets &&
+ self.ifi_oerrors == other.ifi_oerrors &&
+ self.ifi_collisions == other.ifi_collisions &&
+ self.ifi_ibytes == other.ifi_ibytes &&
+ self.ifi_obytes == other.ifi_obytes &&
+ self.ifi_imcasts == other.ifi_imcasts &&
+ self.ifi_omcasts == other.ifi_omcasts &&
+ self.ifi_iqdrops == other.ifi_iqdrops &&
+ self.ifi_oqdrops == other.ifi_oqdrops &&
+ self.ifi_noproto == other.ifi_noproto &&
+ self.ifi_hwassist == other.ifi_hwassist &&
+ self.__ifi_epoch == other.__ifi_epoch &&
+ self.__ifi_lastchange == other.__ifi_lastchange
+ }
+ }
+ impl Eq for if_data {}
+ impl ::fmt::Debug for if_data {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("if_data")
+ .field("ifi_type", &self.ifi_type)
+ .field("ifi_physical", &self.ifi_physical)
+ .field("ifi_addrlen", &self.ifi_addrlen)
+ .field("ifi_hdrlen", &self.ifi_hdrlen)
+ .field("ifi_link_state", &self.ifi_link_state)
+ .field("ifi_vhid", &self.ifi_vhid)
+ .field("ifi_datalen", &self.ifi_datalen)
+ .field("ifi_mtu", &self.ifi_mtu)
+ .field("ifi_metric", &self.ifi_metric)
+ .field("ifi_baudrate", &self.ifi_baudrate)
+ .field("ifi_ipackets", &self.ifi_ipackets)
+ .field("ifi_ierrors", &self.ifi_ierrors)
+ .field("ifi_opackets", &self.ifi_opackets)
+ .field("ifi_oerrors", &self.ifi_oerrors)
+ .field("ifi_collisions", &self.ifi_collisions)
+ .field("ifi_ibytes", &self.ifi_ibytes)
+ .field("ifi_obytes", &self.ifi_obytes)
+ .field("ifi_imcasts", &self.ifi_imcasts)
+ .field("ifi_omcasts", &self.ifi_omcasts)
+ .field("ifi_iqdrops", &self.ifi_iqdrops)
+ .field("ifi_oqdrops", &self.ifi_oqdrops)
+ .field("ifi_noproto", &self.ifi_noproto)
+ .field("ifi_hwassist", &self.ifi_hwassist)
+ .field("__ifi_epoch", &self.__ifi_epoch)
+ .field("__ifi_lastchange", &self.__ifi_lastchange)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for if_data {
+ fn hash(&self, state: &mut H) {
+ self.ifi_type.hash(state);
+ self.ifi_physical.hash(state);
+ self.ifi_addrlen.hash(state);
+ self.ifi_hdrlen.hash(state);
+ self.ifi_link_state.hash(state);
+ self.ifi_vhid.hash(state);
+ self.ifi_datalen.hash(state);
+ self.ifi_mtu.hash(state);
+ self.ifi_metric.hash(state);
+ self.ifi_baudrate.hash(state);
+ self.ifi_ipackets.hash(state);
+ self.ifi_ierrors.hash(state);
+ self.ifi_opackets.hash(state);
+ self.ifi_oerrors.hash(state);
+ self.ifi_collisions.hash(state);
+ self.ifi_ibytes.hash(state);
+ self.ifi_obytes.hash(state);
+ self.ifi_imcasts.hash(state);
+ self.ifi_omcasts.hash(state);
+ self.ifi_iqdrops.hash(state);
+ self.ifi_oqdrops.hash(state);
+ self.ifi_noproto.hash(state);
+ self.ifi_hwassist.hash(state);
+ self.__ifi_epoch.hash(state);
+ self.__ifi_lastchange.hash(state);
+ }
+ }
+ }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum dot3Vendors {
+ dot3VendorAMD = 1,
+ dot3VendorIntel = 2,
+ dot3VendorNational = 4,
+ dot3VendorFujitsu = 5,
+ dot3VendorDigital = 6,
+ dot3VendorWesternDigital = 7,
+}
+impl ::Copy for dot3Vendors {}
+impl ::Clone for dot3Vendors {
+ fn clone(&self) -> dot3Vendors {
+ *self
}
}
+// aio.h
+pub const LIO_VECTORED: ::c_int = 4;
+pub const LIO_WRITEV: ::c_int = 5;
+pub const LIO_READV: ::c_int = 6;
+
+// sys/devicestat.h
+pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
+pub const DEVSTAT_NAME_LEN: ::c_int = 16;
+
+// sys/cpuset.h
+pub const CPU_SETSIZE: ::c_int = 256;
+
pub const SIGEV_THREAD_ID: ::c_int = 4;
pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
@@ -413,6 +1918,8 @@ pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
pub const SF_NODISKIO: ::c_int = 0x00000001;
pub const SF_MNOWAIT: ::c_int = 0x00000002;
@@ -430,12 +1937,22 @@ 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 EINTEGRITY: ::c_int = 97;
pub const RLIMIT_NPTS: ::c_int = 11;
pub const RLIMIT_SWAP: ::c_int = 12;
pub const RLIMIT_KQUEUES: ::c_int = 13;
pub const RLIMIT_UMTXP: ::c_int = 14;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::rlim_t = 15;
+pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
+
+pub const CP_USER: ::c_int = 0;
+pub const CP_NICE: ::c_int = 1;
+pub const CP_SYS: ::c_int = 2;
+pub const CP_INTR: ::c_int = 3;
+pub const CP_IDLE: ::c_int = 4;
+pub const CPUSTATES: ::c_int = 5;
pub const NI_NOFQDN: ::c_int = 0x00000001;
pub const NI_NUMERICHOST: ::c_int = 0x00000002;
@@ -444,10 +1961,15 @@ pub const NI_NUMERICSERV: ::c_int = 0x00000008;
pub const NI_DGRAM: ::c_int = 0x00000010;
pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
+pub const XU_NGROUPS: ::c_int = 16;
+
pub const Q_GETQUOTA: ::c_int = 0x700;
pub const Q_SETQUOTA: ::c_int = 0x800;
pub const MAP_GUARD: ::c_int = 0x00002000;
+pub const MAP_EXCL: ::c_int = 0x00004000;
+pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
+pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -515,7 +2037,6 @@ pub const NOTE_USECONDS: u32 = 0x00000004;
pub const NOTE_NSECONDS: u32 = 0x00000008;
pub const MADV_PROTECT: ::c_int = 10;
-pub const RUSAGE_THREAD: ::c_int = 1;
#[doc(hidden)]
#[deprecated(
@@ -533,6 +2054,58 @@ pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_P1003_1B: ::c_int = 9;
+
+// sys/sysctl.h
+pub const CTL_MAXNAME: ::c_int = 24;
+
+pub const CTLTYPE: ::c_int = 0xf;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_S64: ::c_int = 4;
+pub const CTLTYPE_OPAQUE: ::c_int = 5;
+pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
+pub const CTLTYPE_UINT: ::c_int = 6;
+pub const CTLTYPE_LONG: ::c_int = 7;
+pub const CTLTYPE_ULONG: ::c_int = 8;
+pub const CTLTYPE_U64: ::c_int = 9;
+pub const CTLTYPE_U8: ::c_int = 0xa;
+pub const CTLTYPE_U16: ::c_int = 0xb;
+pub const CTLTYPE_S8: ::c_int = 0xc;
+pub const CTLTYPE_S16: ::c_int = 0xd;
+pub const CTLTYPE_S32: ::c_int = 0xe;
+pub const CTLTYPE_U32: ::c_int = 0xf;
+
+pub const CTLFLAG_RD: ::c_int = 0x80000000;
+pub const CTLFLAG_WR: ::c_int = 0x40000000;
+pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
+pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
+pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
+pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
+pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
+pub const CTLFLAG_DYN: ::c_int = 0x02000000;
+pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
+pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
+pub const CTLFLAG_TUN: ::c_int = 0x00080000;
+pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
+pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
+pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
+pub const CTLFLAG_VNET: ::c_int = 0x00020000;
+pub const CTLFLAG_DYING: ::c_int = 0x00010000;
+pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
+pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
+pub const CTLFLAG_STATS: ::c_int = 0x00002000;
+pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
+pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
+pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
+
+pub const CTLSHIFT_SECURE: ::c_int = 20;
+pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
+pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
+pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
+
+pub const OID_AUTO: ::c_int = -1;
+
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
pub const CTL_SYSCTL_NAME: ::c_int = 1;
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
@@ -540,6 +2113,8 @@ pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
+pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
+
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
@@ -577,6 +2152,8 @@ pub const KERN_LOGSIGEXIT: ::c_int = 34;
pub const KERN_IOV_MAX: ::c_int = 35;
pub const KERN_HOSTUUID: ::c_int = 36;
pub const KERN_ARND: ::c_int = 37;
+pub const KERN_MAXPHYS: ::c_int = 38;
+
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
@@ -604,6 +2181,10 @@ pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
pub const KERN_PROC_UMASK: ::c_int = 39;
pub const KERN_PROC_OSREL: ::c_int = 40;
pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
+pub const KERN_PROC_CWD: ::c_int = 42;
+pub const KERN_PROC_NFDS: ::c_int = 43;
+pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
+
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
@@ -611,6 +2192,7 @@ pub const KIPC_MAX_LINKHDR: ::c_int = 4;
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
pub const KIPC_MAX_HDR: ::c_int = 6;
pub const KIPC_MAX_DATALEN: ::c_int = 7;
+
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
@@ -623,6 +2205,7 @@ pub const HW_DISKSTATS: ::c_int = 9;
pub const HW_FLOATINGPT: ::c_int = 10;
pub const HW_MACHINE_ARCH: ::c_int = 11;
pub const HW_REALMEM: ::c_int = 12;
+
pub const USER_CS_PATH: ::c_int = 1;
pub const USER_BC_BASE_MAX: ::c_int = 2;
pub const USER_BC_DIM_MAX: ::c_int = 3;
@@ -643,6 +2226,8 @@ pub const USER_POSIX2_SW_DEV: ::c_int = 17;
pub const USER_POSIX2_UPE: ::c_int = 18;
pub const USER_STREAM_MAX: ::c_int = 19;
pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_LOCALBASE: ::c_int = 21;
+
pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
@@ -668,18 +2253,23 @@ pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
-pub const TIOCGPTN: ::c_uint = 0x4004740f;
-pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
-pub const TIOCSIG: ::c_uint = 0x2004745f;
+
+pub const TIOCGPTN: ::c_ulong = 0x4004740f;
+pub const TIOCPTMASTER: ::c_ulong = 0x2000741c;
+pub const TIOCSIG: ::c_ulong = 0x2004745f;
pub const TIOCM_DCD: ::c_int = 0x40;
pub const H4DISC: ::c_int = 0x7;
+pub const VM_TOTAL: ::c_int = 1;
+
pub const BIOCSETFNR: ::c_ulong = 0x80104282;
+pub const FIODGNAME: ::c_ulong = 0x80106678;
pub const FIONWRITE: ::c_ulong = 0x40046677;
pub const FIONSPACE: ::c_ulong = 0x40046676;
pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
+pub const FIOSSHMLPGCNF: ::c_ulong = 0x80306664;
pub const JAIL_API_VERSION: u32 = 2;
pub const JAIL_CREATE: ::c_int = 0x01;
@@ -692,6 +2282,17 @@ pub const JAIL_SYS_DISABLE: ::c_int = 0;
pub const JAIL_SYS_NEW: ::c_int = 1;
pub const JAIL_SYS_INHERIT: ::c_int = 2;
+pub const MNT_ACLS: ::c_int = 0x08000000;
+pub const MNT_BYFSID: ::c_int = 0x08000000;
+pub const MNT_GJOURNAL: ::c_int = 0x02000000;
+pub const MNT_MULTILABEL: ::c_int = 0x04000000;
+pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
+pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
+pub const MNT_UNION: ::c_int = 0x00000020;
+pub const MNT_NONBUSY: ::c_int = 0x04000000;
+
+pub const SCM_CREDS2: ::c_int = 0x08;
+
pub const SO_BINTIME: ::c_int = 0x2000;
pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
pub const SO_NO_DDP: ::c_int = 0x8000;
@@ -705,12 +2306,29 @@ pub const SO_SETFIB: ::c_int = 0x1014;
pub const SO_USER_COOKIE: ::c_int = 0x1015;
pub const SO_PROTOCOL: ::c_int = 0x1016;
pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
+pub const SO_DOMAIN: ::c_int = 0x1019;
pub const SO_VENDOR: ::c_int = 0x80000000;
pub const LOCAL_CREDS: ::c_int = 2;
+pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
pub const LOCAL_CONNWAIT: ::c_int = 4;
pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
+pub const PL_EVENT_NONE: ::c_int = 0;
+pub const PL_EVENT_SIGNAL: ::c_int = 1;
+pub const PL_FLAG_SA: ::c_int = 0x01;
+pub const PL_FLAG_BOUND: ::c_int = 0x02;
+pub const PL_FLAG_SCE: ::c_int = 0x04;
+pub const PL_FLAG_SCX: ::c_int = 0x08;
+pub const PL_FLAG_EXEC: ::c_int = 0x10;
+pub const PL_FLAG_SI: ::c_int = 0x20;
+pub const PL_FLAG_FORKED: ::c_int = 0x40;
+pub const PL_FLAG_CHILD: ::c_int = 0x80;
+pub const PL_FLAG_BORN: ::c_int = 0x100;
+pub const PL_FLAG_EXITED: ::c_int = 0x200;
+pub const PL_FLAG_VFORKED: ::c_int = 0x400;
+pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800;
+
pub const PT_LWPINFO: ::c_int = 13;
pub const PT_GETNUMLWPS: ::c_int = 14;
pub const PT_GETLWPLIST: ::c_int = 15;
@@ -725,6 +2343,9 @@ pub const PT_FOLLOW_FORK: ::c_int = 23;
pub const PT_LWP_EVENTS: ::c_int = 24;
pub const PT_GET_EVENT_MASK: ::c_int = 25;
pub const PT_SET_EVENT_MASK: ::c_int = 26;
+pub const PT_GET_SC_ARGS: ::c_int = 27;
+pub const PT_GET_SC_RET: ::c_int = 28;
+pub const PT_COREDUMP: ::c_int = 29;
pub const PT_GETREGS: ::c_int = 33;
pub const PT_SETREGS: ::c_int = 34;
pub const PT_GETFPREGS: ::c_int = 35;
@@ -733,6 +2354,8 @@ pub const PT_GETDBREGS: ::c_int = 37;
pub const PT_SETDBREGS: ::c_int = 38;
pub const PT_VM_TIMESTAMP: ::c_int = 40;
pub const PT_VM_ENTRY: ::c_int = 41;
+pub const PT_GETREGSET: ::c_int = 42;
+pub const PT_SETREGSET: ::c_int = 43;
pub const PT_FIRSTMACH: ::c_int = 64;
pub const PTRACE_EXEC: ::c_int = 0x0001;
@@ -744,6 +2367,67 @@ pub const PTRACE_LWP: ::c_int = 0x0010;
pub const PTRACE_VFORK: ::c_int = 0x0020;
pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
+pub const PC_COMPRESS: u32 = 0x00000001;
+pub const PC_ALL: u32 = 0x00000002;
+
+pub const PROC_SPROTECT: ::c_int = 1;
+pub const PROC_REAP_ACQUIRE: ::c_int = 2;
+pub const PROC_REAP_RELEASE: ::c_int = 3;
+pub const PROC_REAP_STATUS: ::c_int = 4;
+pub const PROC_REAP_GETPIDS: ::c_int = 5;
+pub const PROC_REAP_KILL: ::c_int = 6;
+pub const PROC_TRACE_CTL: ::c_int = 7;
+pub const PROC_TRACE_STATUS: ::c_int = 8;
+pub const PROC_TRAPCAP_CTL: ::c_int = 9;
+pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
+pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
+pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
+pub const PROC_ASLR_CTL: ::c_int = 13;
+pub const PROC_ASLR_STATUS: ::c_int = 14;
+pub const PROC_PROTMAX_CTL: ::c_int = 15;
+pub const PROC_PROTMAX_STATUS: ::c_int = 16;
+pub const PROC_STACKGAP_CTL: ::c_int = 17;
+pub const PROC_STACKGAP_STATUS: ::c_int = 18;
+pub const PROC_NO_NEW_PRIVS_CTL: ::c_int = 19;
+pub const PROC_NO_NEW_PRIVS_STATUS: ::c_int = 20;
+pub const PROC_WXMAP_CTL: ::c_int = 21;
+pub const PROC_WXMAP_STATUS: ::c_int = 22;
+pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;
+
+pub const PPROT_SET: ::c_int = 1;
+pub const PPROT_CLEAR: ::c_int = 2;
+pub const PPROT_DESCEND: ::c_int = 0x10;
+pub const PPROT_INHERIT: ::c_int = 0x20;
+
+pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1;
+pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2;
+pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3;
+
+pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1;
+pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2;
+
+pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1;
+pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2;
+pub const PROC_ASLR_NOFORCE: ::c_int = 3;
+pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000;
+
+pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1;
+pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2;
+pub const PROC_PROTMAX_NOFORCE: ::c_int = 3;
+pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000;
+
+pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001;
+pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
+pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
+pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;
+
+pub const PROC_NO_NEW_PRIVS_ENABLE: ::c_int = 1;
+pub const PROC_NO_NEW_PRIVS_DISABLE: ::c_int = 2;
+
+pub const PROC_WX_MAPPINGS_PERMIT: ::c_int = 0x0001;
+pub const PROC_WX_MAPPINGS_DISALLOW_EXEC: ::c_int = 0x0002;
+pub const PROC_WXORX_ENFORCE: ::c_int = 0x80000000;
+
pub const AF_SLOW: ::c_int = 33;
pub const AF_SCLUSTER: ::c_int = 34;
pub const AF_ARP: ::c_int = 35;
@@ -752,43 +2436,220 @@ pub const AF_IEEE80211: ::c_int = 37;
pub const AF_INET_SDP: ::c_int = 40;
pub const AF_INET6_SDP: ::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
+// sys/net/if.h
+pub const IF_MAXUNIT: ::c_int = 0x7fff;
+/// (n) interface is up
+pub const IFF_UP: ::c_int = 0x1;
+/// (i) broadcast address valid
+pub const IFF_BROADCAST: ::c_int = 0x2;
+/// (n) turn on debugging
+pub const IFF_DEBUG: ::c_int = 0x4;
+/// (i) is a loopback net
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+/// (i) is a point-to-point link
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+/// (i) calls if_input in net epoch
+pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
+/// (d) resources allocated
+pub const IFF_RUNNING: ::c_int = 0x40;
#[doc(hidden)]
#[deprecated(
since = "0.2.54",
note = "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)]
-#[deprecated(
- since = "0.2.54",
- note = "Use the portable `IFF_OACTIVE` instead"
-)]
+/// (d) resources allocate
+pub const IFF_DRV_RUNNING: ::c_int = 0x40;
+/// (n) no address resolution protocol
+pub const IFF_NOARP: ::c_int = 0x80;
+/// (n) receive all packets
+pub const IFF_PROMISC: ::c_int = 0x100;
+/// (n) receive all multicast packets
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+/// (d) tx hardware queue is full
+pub const IFF_OACTIVE: ::c_int = 0x400;
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
+/// (d) tx hardware queue is full
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)
+/// (i) can't hear own transmissions
+pub const IFF_SIMPLEX: ::c_int = 0x800;
+/// per link layer defined bit
+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;
+/// use alternate physical connection
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;
+/// (i) supports multicast
+pub const IFF_MULTICAST: ::c_int = 0x8000;
+/// (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
+/// (n) user-requested promisc mode
+pub const IFF_PPROMISC: ::c_int = 0x20000;
+/// (n) user-requested monitor mode
+pub const IFF_MONITOR: ::c_int = 0x40000;
+/// (n) static ARP
+pub const IFF_STATICARP: ::c_int = 0x80000;
+/// (n) interface is winding down
+pub const IFF_DYING: ::c_int = 0x200000;
+/// (n) interface is being renamed
+pub const IFF_RENAMING: ::c_int = 0x400000;
+/// interface is not part of any groups
+pub const IFF_NOGROUP: ::c_int = 0x800000;
+
+/// link invalid/unknown
+pub const LINK_STATE_UNKNOWN: ::c_int = 0;
+/// link is down
+pub const LINK_STATE_DOWN: ::c_int = 1;
+/// link is up
+pub const LINK_STATE_UP: ::c_int = 2;
+
+/// can offload checksum on RX
+pub const IFCAP_RXCSUM: ::c_int = 0x00001;
+/// can offload checksum on TX
+pub const IFCAP_TXCSUM: ::c_int = 0x00002;
+/// can be a network console
+pub const IFCAP_NETCONS: ::c_int = 0x00004;
+/// VLAN-compatible MTU
+pub const IFCAP_VLAN_MTU: ::c_int = 0x00008;
+/// hardware VLAN tag support
+pub const IFCAP_VLAN_HWTAGGING: ::c_int = 0x00010;
+/// 9000 byte MTU supported
+pub const IFCAP_JUMBO_MTU: ::c_int = 0x00020;
+/// driver supports polling
+pub const IFCAP_POLLING: ::c_int = 0x00040;
+/// can do IFCAP_HWCSUM on VLANs
+pub const IFCAP_VLAN_HWCSUM: ::c_int = 0x00080;
+/// can do TCP Segmentation Offload
+pub const IFCAP_TSO4: ::c_int = 0x00100;
+/// can do TCP6 Segmentation Offload
+pub const IFCAP_TSO6: ::c_int = 0x00200;
+/// can do Large Receive Offload
+pub const IFCAP_LRO: ::c_int = 0x00400;
+/// wake on any unicast frame
+pub const IFCAP_WOL_UCAST: ::c_int = 0x00800;
+/// wake on any multicast frame
+pub const IFCAP_WOL_MCAST: ::c_int = 0x01000;
+/// wake on any Magic Packet
+pub const IFCAP_WOL_MAGIC: ::c_int = 0x02000;
+/// interface can offload TCP
+pub const IFCAP_TOE4: ::c_int = 0x04000;
+/// interface can offload TCP6
+pub const IFCAP_TOE6: ::c_int = 0x08000;
+/// interface hw can filter vlan tag
+pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
+/// can do SIOCGIFCAPNV/SIOCSIFCAPNV
+pub const IFCAP_NV: ::c_int = 0x20000;
+/// can do IFCAP_TSO on VLANs
+pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
+/// the runtime link state is dynamic
+pub const IFCAP_LINKSTATE: ::c_int = 0x80000;
+/// netmap mode supported/enabled
+pub const IFCAP_NETMAP: ::c_int = 0x100000;
+/// can offload checksum on IPv6 RX
+pub const IFCAP_RXCSUM_IPV6: ::c_int = 0x200000;
+/// can offload checksum on IPv6 TX
+pub const IFCAP_TXCSUM_IPV6: ::c_int = 0x400000;
+/// manages counters internally
+pub const IFCAP_HWSTATS: ::c_int = 0x800000;
+/// hardware supports TX rate limiting
+pub const IFCAP_TXRTLMT: ::c_int = 0x1000000;
+/// hardware rx timestamping
+pub const IFCAP_HWRXTSTMP: ::c_int = 0x2000000;
+/// understands M_EXTPG mbufs
+pub const IFCAP_MEXTPG: ::c_int = 0x4000000;
+/// can do TLS encryption and segmentation for TCP
+pub const IFCAP_TXTLS4: ::c_int = 0x8000000;
+/// can do TLS encryption and segmentation for TCP6
+pub const IFCAP_TXTLS6: ::c_int = 0x10000000;
+/// can do IFCAN_HWCSUM on VXLANs
+pub const IFCAP_VXLAN_HWCSUM: ::c_int = 0x20000000;
+/// can do IFCAP_TSO on VXLANs
+pub const IFCAP_VXLAN_HWTSO: ::c_int = 0x40000000;
+/// can do TLS with rate limiting
+pub const IFCAP_TXTLS_RTLMT: ::c_int = 0x80000000;
+
+pub const IFCAP_HWCSUM_IPV6: ::c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6;
+pub const IFCAP_HWCSUM: ::c_int = IFCAP_RXCSUM | IFCAP_TXCSUM;
+pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
+pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
+pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
+pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
+pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP | IFCAP_NV;
+
+pub const IFQ_MAXLEN: ::c_int = 50;
+pub const IFNET_SLOWHZ: ::c_int = 1;
+
+pub const IFAN_ARRIVAL: ::c_int = 0;
+pub const IFAN_DEPARTURE: ::c_int = 1;
+
+pub const IFSTATMAX: ::c_int = 800;
+
+pub const RSS_FUNC_NONE: ::c_int = 0;
+pub const RSS_FUNC_PRIVATE: ::c_int = 1;
+pub const RSS_FUNC_TOEPLITZ: ::c_int = 2;
+
+pub const RSS_TYPE_IPV4: ::c_int = 0x00000001;
+pub const RSS_TYPE_TCP_IPV4: ::c_int = 0x00000002;
+pub const RSS_TYPE_IPV6: ::c_int = 0x00000004;
+pub const RSS_TYPE_IPV6_EX: ::c_int = 0x00000008;
+pub const RSS_TYPE_TCP_IPV6: ::c_int = 0x00000010;
+pub const RSS_TYPE_TCP_IPV6_EX: ::c_int = 0x00000020;
+pub const RSS_TYPE_UDP_IPV4: ::c_int = 0x00000040;
+pub const RSS_TYPE_UDP_IPV6: ::c_int = 0x00000080;
+pub const RSS_TYPE_UDP_IPV6_EX: ::c_int = 0x00000100;
+pub const RSS_KEYLEN: ::c_int = 128;
+
+pub const IFNET_PCP_NONE: ::c_int = 0xff;
+pub const IFDR_MSG_SIZE: ::c_int = 64;
+pub const IFDR_REASON_MSG: ::c_int = 1;
+pub const IFDR_REASON_VENDOR: ::c_int = 2;
+
+// sys/net/if_mib.h
+
+/// non-interface-specific
+pub const IFMIB_SYSTEM: ::c_int = 1;
+/// per-interface data table
+pub const IFMIB_IFDATA: ::c_int = 2;
+
+/// generic stats for all kinds of ifaces
+pub const IFDATA_GENERAL: ::c_int = 1;
+/// specific to the type of interface
+pub const IFDATA_LINKSPECIFIC: ::c_int = 2;
+/// driver name and unit
+pub const IFDATA_DRIVERNAME: ::c_int = 3;
+
+/// number of interfaces configured
+pub const IFMIB_IFCOUNT: ::c_int = 1;
+
+/// functions not specific to a type of iface
+pub const NETLINK_GENERIC: ::c_int = 0;
+
+pub const DOT3COMPLIANCE_STATS: ::c_int = 1;
+pub const DOT3COMPLIANCE_COLLS: ::c_int = 2;
+
+pub const dot3ChipSetAMD7990: ::c_int = 1;
+pub const dot3ChipSetAMD79900: ::c_int = 2;
+pub const dot3ChipSetAMD79C940: ::c_int = 3;
+
+pub const dot3ChipSetIntel82586: ::c_int = 1;
+pub const dot3ChipSetIntel82596: ::c_int = 2;
+pub const dot3ChipSetIntel82557: ::c_int = 3;
+
+pub const dot3ChipSetNational8390: ::c_int = 1;
+pub const dot3ChipSetNationalSonic: ::c_int = 2;
+
+pub const dot3ChipSetFujitsu86950: ::c_int = 1;
+
+pub const dot3ChipSetDigitalDC21040: ::c_int = 1;
+pub const dot3ChipSetDigitalDC21140: ::c_int = 2;
+pub const dot3ChipSetDigitalDC21041: ::c_int = 3;
+pub const dot3ChipSetDigitalDC21140A: ::c_int = 4;
+pub const dot3ChipSetDigitalDC21142: ::c_int = 5;
+
+pub const dot3ChipSetWesternDigital83C690: ::c_int = 1;
+pub const dot3ChipSetWesternDigital83C790: ::c_int = 2;
// sys/netinet/in.h
// Protocols (RFC 1700)
@@ -1040,10 +2901,24 @@ pub const TCP_MD5SIG: ::c_int = 16;
pub const TCP_INFO: ::c_int = 32;
pub const TCP_CONGESTION: ::c_int = 64;
pub const TCP_CCALGOOPT: ::c_int = 65;
+pub const TCP_MAXUNACKTIME: ::c_int = 68;
+pub const TCP_MAXPEAKRATE: ::c_int = 69;
+pub const TCP_IDLE_REDUCE: ::c_int = 70;
+pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
+pub const TCP_DELACK: ::c_int = 72;
+pub const TCP_FIN_IS_RST: ::c_int = 73;
+pub const TCP_LOG_LIMIT: ::c_int = 74;
+pub const TCP_SHARED_CWND_ALLOWED: ::c_int = 75;
+pub const TCP_PROC_ACCOUNTING: ::c_int = 76;
+pub const TCP_USE_CMP_ACKS: ::c_int = 77;
+pub const TCP_PERF_INFO: ::c_int = 78;
+pub const TCP_LRD: ::c_int = 79;
pub const TCP_KEEPINIT: ::c_int = 128;
pub const TCP_FASTOPEN: ::c_int = 1025;
pub const TCP_PCAP_OUT: ::c_int = 2048;
pub const TCP_PCAP_IN: ::c_int = 4096;
+pub const TCP_FASTOPEN_PSK_LEN: ::c_int = 16;
+pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32;
pub const IP_BINDANY: ::c_int = 24;
pub const IP_BINDMULTI: ::c_int = 25;
@@ -1051,6 +2926,7 @@ pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
pub const IP_ORIGDSTADDR: ::c_int = 27;
pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
+pub const IP_DONTFRAG: ::c_int = 67;
pub const IP_RECVTOS: ::c_int = 68;
pub const IPV6_BINDANY: ::c_int = 64;
@@ -1072,22 +2948,8 @@ pub const NET_RT_IFMALIST: ::c_int = 4;
pub const NET_RT_IFLISTL: ::c_int = 5;
// System V IPC
-pub const IPC_PRIVATE: ::key_t = 0;
-pub const IPC_CREAT: ::c_int = 0o1000;
-pub const IPC_EXCL: ::c_int = 0o2000;
-pub const IPC_NOWAIT: ::c_int = 0o4000;
-pub const IPC_RMID: ::c_int = 0;
-pub const IPC_SET: ::c_int = 1;
-pub const IPC_STAT: ::c_int = 2;
pub const IPC_INFO: ::c_int = 3;
-pub const IPC_R: ::c_int = 0o400;
-pub const IPC_W: ::c_int = 0o200;
-pub const IPC_M: ::c_int = 0o10000;
pub const MSG_NOERROR: ::c_int = 0o10000;
-pub const SHM_RDONLY: ::c_int = 0o10000;
-pub const SHM_RND: ::c_int = 0o20000;
-pub const SHM_R: ::c_int = 0o400;
-pub const SHM_W: ::c_int = 0o200;
pub const SHM_LOCK: ::c_int = 11;
pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_STAT: ::c_int = 13;
@@ -1172,6 +3034,23 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
+pub const AT_NULL: ::c_int = 0;
+pub const AT_IGNORE: ::c_int = 1;
+pub const AT_EXECFD: ::c_int = 2;
+pub const AT_PHDR: ::c_int = 3;
+pub const AT_PHENT: ::c_int = 4;
+pub const AT_PHNUM: ::c_int = 5;
+pub const AT_PAGESZ: ::c_int = 6;
+pub const AT_BASE: ::c_int = 7;
+pub const AT_FLAGS: ::c_int = 8;
+pub const AT_ENTRY: ::c_int = 9;
+pub const AT_NOTELF: ::c_int = 10;
+pub const AT_UID: ::c_int = 11;
+pub const AT_EUID: ::c_int = 12;
+pub const AT_GID: ::c_int = 13;
+pub const AT_EGID: ::c_int = 14;
+pub const AT_EXECPATH: ::c_int = 15;
+
pub const TABDLY: ::tcflag_t = 0x00000004;
pub const TAB0: ::tcflag_t = 0x00000000;
pub const TAB3: ::tcflag_t = 0x00000004;
@@ -1180,6 +3059,8 @@ pub const _PC_ACL_NFS4: ::c_int = 64;
pub const _SC_CPUSET_SIZE: ::c_int = 122;
+pub const _UUID_NODE_LEN: usize = 6;
+
// Flags which can be passed to pdfork(2)
pub const PD_DAEMON: ::c_int = 0x00000001;
pub const PD_CLOEXEC: ::c_int = 0x00000002;
@@ -1207,14 +3088,709 @@ pub const UF_READONLY: ::c_ulong = 0x00001000;
pub const UF_HIDDEN: ::c_ulong = 0x00008000;
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
+// fcntl commands
+pub const F_ADD_SEALS: ::c_int = 19;
+pub const F_GET_SEALS: ::c_int = 20;
pub const F_OGETLK: ::c_int = 7;
pub const F_OSETLK: ::c_int = 8;
pub const F_OSETLKW: ::c_int = 9;
-pub const F_DUP2FD: ::c_int = 10;
-pub const F_SETLK_REMOTE: ::c_int = 14;
-pub const F_READAHEAD: ::c_int = 15;
pub const F_RDAHEAD: ::c_int = 16;
-pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
+pub const F_READAHEAD: ::c_int = 15;
+pub const F_SETLK_REMOTE: ::c_int = 14;
+pub const F_KINFO: ::c_int = 22;
+
+// for use with F_ADD_SEALS
+pub const F_SEAL_GROW: ::c_int = 4;
+pub const F_SEAL_SEAL: ::c_int = 1;
+pub const F_SEAL_SHRINK: ::c_int = 2;
+pub const F_SEAL_WRITE: ::c_int = 8;
+
+// for use with fspacectl
+pub const SPACECTL_DEALLOC: ::c_int = 1;
+
+// For getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+pub const GRND_INSECURE: ::c_uint = 0x4;
+
+// For realhostname* api
+pub const HOSTNAME_FOUND: ::c_int = 0;
+pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
+pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
+pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
+
+// For rfork
+pub const RFFDG: ::c_int = 4;
+pub const RFPROC: ::c_int = 16;
+pub const RFMEM: ::c_int = 32;
+pub const RFNOWAIT: ::c_int = 64;
+pub const RFCFDG: ::c_int = 4096;
+pub const RFTHREAD: ::c_int = 8192;
+pub const RFLINUXTHPN: ::c_int = 65536;
+pub const RFTSIGZMB: ::c_int = 524288;
+pub const RFSPAWN: ::c_int = 2147483648;
+
+// For eventfd
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+pub const EFD_NONBLOCK: ::c_int = 0x4;
+pub const EFD_CLOEXEC: ::c_int = 0x100000;
+
+pub const MALLOCX_ZERO: ::c_int = 0x40;
+
+/// size of returned wchan message
+pub const WMESGLEN: usize = 8;
+/// size of returned lock name
+pub const LOCKNAMELEN: usize = 8;
+/// size of returned thread name
+pub const TDNAMLEN: usize = 16;
+/// size of returned ki_comm name
+pub const COMMLEN: usize = 19;
+/// size of returned ki_emul
+pub const KI_EMULNAMELEN: usize = 16;
+/// number of groups in ki_groups
+pub const KI_NGROUPS: usize = 16;
+cfg_if! {
+ if #[cfg(freebsd11)] {
+ pub const KI_NSPARE_INT: usize = 4;
+ } else {
+ pub const KI_NSPARE_INT: usize = 2;
+ }
+}
+pub const KI_NSPARE_LONG: usize = 12;
+/// Flags for the process credential.
+pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001;
+/// Steal a bit from ki_cr_flags to indicate that the cred had more than
+/// KI_NGROUPS groups.
+pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000;
+/// controlling tty vnode active
+pub const KI_CTTY: usize = 0x00000001;
+/// session leader
+pub const KI_SLEADER: usize = 0x00000002;
+/// proc blocked on lock ki_lockname
+pub const KI_LOCKBLOCK: usize = 0x00000004;
+/// size of returned ki_login
+pub const LOGNAMELEN: usize = 17;
+/// size of returned ki_loginclass
+pub const LOGINCLASSLEN: usize = 17;
+
+pub const KF_ATTR_VALID: ::c_int = 0x0001;
+pub const KF_TYPE_NONE: ::c_int = 0;
+pub const KF_TYPE_VNODE: ::c_int = 1;
+pub const KF_TYPE_SOCKET: ::c_int = 2;
+pub const KF_TYPE_PIPE: ::c_int = 3;
+pub const KF_TYPE_FIFO: ::c_int = 4;
+pub const KF_TYPE_KQUEUE: ::c_int = 5;
+pub const KF_TYPE_MQUEUE: ::c_int = 7;
+pub const KF_TYPE_SHM: ::c_int = 8;
+pub const KF_TYPE_SEM: ::c_int = 9;
+pub const KF_TYPE_PTS: ::c_int = 10;
+pub const KF_TYPE_PROCDESC: ::c_int = 11;
+pub const KF_TYPE_DEV: ::c_int = 12;
+pub const KF_TYPE_UNKNOWN: ::c_int = 255;
+
+pub const KF_VTYPE_VNON: ::c_int = 0;
+pub const KF_VTYPE_VREG: ::c_int = 1;
+pub const KF_VTYPE_VDIR: ::c_int = 2;
+pub const KF_VTYPE_VBLK: ::c_int = 3;
+pub const KF_VTYPE_VCHR: ::c_int = 4;
+pub const KF_VTYPE_VLNK: ::c_int = 5;
+pub const KF_VTYPE_VSOCK: ::c_int = 6;
+pub const KF_VTYPE_VFIFO: ::c_int = 7;
+pub const KF_VTYPE_VBAD: ::c_int = 8;
+pub const KF_VTYPE_UNKNOWN: ::c_int = 255;
+
+/// Current working directory
+pub const KF_FD_TYPE_CWD: ::c_int = -1;
+/// Root directory
+pub const KF_FD_TYPE_ROOT: ::c_int = -2;
+/// Jail directory
+pub const KF_FD_TYPE_JAIL: ::c_int = -3;
+/// Ktrace vnode
+pub const KF_FD_TYPE_TRACE: ::c_int = -4;
+pub const KF_FD_TYPE_TEXT: ::c_int = -5;
+/// Controlling terminal
+pub const KF_FD_TYPE_CTTY: ::c_int = -6;
+pub const KF_FLAG_READ: ::c_int = 0x00000001;
+pub const KF_FLAG_WRITE: ::c_int = 0x00000002;
+pub const KF_FLAG_APPEND: ::c_int = 0x00000004;
+pub const KF_FLAG_ASYNC: ::c_int = 0x00000008;
+pub const KF_FLAG_FSYNC: ::c_int = 0x00000010;
+pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020;
+pub const KF_FLAG_DIRECT: ::c_int = 0x00000040;
+pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080;
+pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100;
+pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200;
+pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400;
+pub const KF_FLAG_CREAT: ::c_int = 0x00000800;
+pub const KF_FLAG_TRUNC: ::c_int = 0x00001000;
+pub const KF_FLAG_EXCL: ::c_int = 0x00002000;
+pub const KF_FLAG_EXEC: ::c_int = 0x00004000;
+
+pub const KVME_TYPE_NONE: ::c_int = 0;
+pub const KVME_TYPE_DEFAULT: ::c_int = 1;
+pub const KVME_TYPE_VNODE: ::c_int = 2;
+pub const KVME_TYPE_SWAP: ::c_int = 3;
+pub const KVME_TYPE_DEVICE: ::c_int = 4;
+pub const KVME_TYPE_PHYS: ::c_int = 5;
+pub const KVME_TYPE_DEAD: ::c_int = 6;
+pub const KVME_TYPE_SG: ::c_int = 7;
+pub const KVME_TYPE_MGTDEVICE: ::c_int = 8;
+// Present in `sys/user.h` but is undefined for whatever reason...
+// pub const KVME_TYPE_GUARD: ::c_int = 9;
+pub const KVME_TYPE_UNKNOWN: ::c_int = 255;
+pub const KVME_PROT_READ: ::c_int = 0x00000001;
+pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
+pub const KVME_FLAG_COW: ::c_int = 0x00000001;
+pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
+pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004;
+pub const KVME_FLAG_SUPER: ::c_int = 0x00000008;
+pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010;
+pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020;
+pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040;
+
+pub const KKST_MAXLEN: ::c_int = 1024;
+/// Stack is valid.
+pub const KKST_STATE_STACKOK: ::c_int = 0;
+/// Stack swapped out.
+pub const KKST_STATE_SWAPPED: ::c_int = 1;
+pub const KKST_STATE_RUNNING: ::c_int = 2;
+
+// Constants about priority.
+pub const PRI_MIN: ::c_int = 0;
+pub const PRI_MAX: ::c_int = 255;
+pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
+pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_REALTIME: ::c_int = 48;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_KERN: ::c_int = 80;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PVM: ::c_int = PRI_MIN_KERN + 4;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_TIMESHARE: ::c_int = 120;
+pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
+pub const PRI_MIN_IDLE: ::c_int = 224;
+pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
+
+pub const NZERO: ::c_int = 0;
+
+// Resource utilization information.
+pub const RUSAGE_THREAD: ::c_int = 1;
+
+cfg_if! {
+ if #[cfg(any(freebsd11, target_pointer_width = "32"))] {
+ pub const ARG_MAX: ::c_int = 256 * 1024;
+ } else {
+ pub const ARG_MAX: ::c_int = 2 * 256 * 1024;
+ }
+}
+pub const CHILD_MAX: ::c_int = 40;
+/// max command name remembered
+pub const MAXCOMLEN: usize = 19;
+/// max interpreter file name length
+pub const MAXINTERP: ::c_int = ::PATH_MAX;
+/// max login name length (incl. NUL)
+pub const MAXLOGNAME: ::c_int = 33;
+/// max simultaneous processes
+pub const MAXUPRC: ::c_int = CHILD_MAX;
+/// max bytes for an exec function
+pub const NCARGS: ::c_int = ARG_MAX;
+/// /* max number groups
+pub const NGROUPS: ::c_int = NGROUPS_MAX + 1;
+/// max open files per process
+pub const NOFILE: ::c_int = OPEN_MAX;
+/// marker for empty group set member
+pub const NOGROUP: ::c_int = 65535;
+/// max hostname size
+pub const MAXHOSTNAMELEN: ::c_int = 256;
+/// max bytes in term canon input line
+pub const MAX_CANON: ::c_int = 255;
+/// max bytes in terminal input
+pub const MAX_INPUT: ::c_int = 255;
+/// max bytes in a file name
+pub const NAME_MAX: ::c_int = 255;
+pub const MAXSYMLINKS: ::c_int = 32;
+/// max supplemental group id's
+pub const NGROUPS_MAX: ::c_int = 1023;
+/// max open files per process
+pub const OPEN_MAX: ::c_int = 64;
+
+pub const _POSIX_ARG_MAX: ::c_int = 4096;
+pub const _POSIX_LINK_MAX: ::c_int = 8;
+pub const _POSIX_MAX_CANON: ::c_int = 255;
+pub const _POSIX_MAX_INPUT: ::c_int = 255;
+pub const _POSIX_NAME_MAX: ::c_int = 14;
+pub const _POSIX_PIPE_BUF: ::c_int = 512;
+pub const _POSIX_SSIZE_MAX: ::c_int = 32767;
+pub const _POSIX_STREAM_MAX: ::c_int = 8;
+
+/// max ibase/obase values in bc(1)
+pub const BC_BASE_MAX: ::c_int = 99;
+/// max array elements in bc(1)
+pub const BC_DIM_MAX: ::c_int = 2048;
+/// max scale value in bc(1)
+pub const BC_SCALE_MAX: ::c_int = 99;
+/// max const string length in bc(1)
+pub const BC_STRING_MAX: ::c_int = 1000;
+/// max character class name size
+pub const CHARCLASS_NAME_MAX: ::c_int = 14;
+/// max weights for order keyword
+pub const COLL_WEIGHTS_MAX: ::c_int = 10;
+/// max expressions nested in expr(1)
+pub const EXPR_NEST_MAX: ::c_int = 32;
+/// max bytes in an input line
+pub const LINE_MAX: ::c_int = 2048;
+/// max RE's in interval notation
+pub const RE_DUP_MAX: ::c_int = 255;
+
+pub const _POSIX2_BC_BASE_MAX: ::c_int = 99;
+pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048;
+pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99;
+pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000;
+pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14;
+pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2;
+pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2;
+pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32;
+pub const _POSIX2_LINE_MAX: ::c_int = 2048;
+pub const _POSIX2_RE_DUP_MAX: ::c_int = 255;
+
+// sys/proc.h
+pub const TDF_BORROWING: ::c_int = 0x00000001;
+pub const TDF_INPANIC: ::c_int = 0x00000002;
+pub const TDF_INMEM: ::c_int = 0x00000004;
+pub const TDF_SINTR: ::c_int = 0x00000008;
+pub const TDF_TIMEOUT: ::c_int = 0x00000010;
+pub const TDF_IDLETD: ::c_int = 0x00000020;
+pub const TDF_CANSWAP: ::c_int = 0x00000040;
+pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
+pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
+pub const TDF_BOUNDARY: ::c_int = 0x00000400;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_ASTPENDING: ::c_int = 0x00000800;
+pub const TDF_SBDRY: ::c_int = 0x00002000;
+pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
+pub const TDF_NOLOAD: ::c_int = 0x00040000;
+pub const TDF_SERESTART: ::c_int = 0x00080000;
+pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
+pub const TDF_SEINTR: ::c_int = 0x00200000;
+pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
+#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")]
+pub const TDF_UNUSED23: ::c_int = 0x00800000;
+pub const TDF_SCHED0: ::c_int = 0x01000000;
+pub const TDF_SCHED1: ::c_int = 0x02000000;
+pub const TDF_SCHED2: ::c_int = 0x04000000;
+pub const TDF_SCHED3: ::c_int = 0x08000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_ALRMPEND: ::c_int = 0x10000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_PROFPEND: ::c_int = 0x20000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_MACPEND: ::c_int = 0x40000000;
+
+pub const TDB_SUSPEND: ::c_int = 0x00000001;
+pub const TDB_XSIG: ::c_int = 0x00000002;
+pub const TDB_USERWR: ::c_int = 0x00000004;
+pub const TDB_SCE: ::c_int = 0x00000008;
+pub const TDB_SCX: ::c_int = 0x00000010;
+pub const TDB_EXEC: ::c_int = 0x00000020;
+pub const TDB_FORK: ::c_int = 0x00000040;
+pub const TDB_STOPATFORK: ::c_int = 0x00000080;
+pub const TDB_CHILD: ::c_int = 0x00000100;
+pub const TDB_BORN: ::c_int = 0x00000200;
+pub const TDB_EXIT: ::c_int = 0x00000400;
+pub const TDB_VFORK: ::c_int = 0x00000800;
+pub const TDB_FSTP: ::c_int = 0x00001000;
+pub const TDB_STEP: ::c_int = 0x00002000;
+
+pub const TDP_OLDMASK: ::c_int = 0x00000001;
+pub const TDP_INKTR: ::c_int = 0x00000002;
+pub const TDP_INKTRACE: ::c_int = 0x00000004;
+pub const TDP_BUFNEED: ::c_int = 0x00000008;
+pub const TDP_COWINPROGRESS: ::c_int = 0x00000010;
+pub const TDP_ALTSTACK: ::c_int = 0x00000020;
+pub const TDP_DEADLKTREAT: ::c_int = 0x00000040;
+pub const TDP_NOFAULTING: ::c_int = 0x00000080;
+pub const TDP_OWEUPC: ::c_int = 0x00000200;
+pub const TDP_ITHREAD: ::c_int = 0x00000400;
+pub const TDP_SYNCIO: ::c_int = 0x00000800;
+pub const TDP_SCHED1: ::c_int = 0x00001000;
+pub const TDP_SCHED2: ::c_int = 0x00002000;
+pub const TDP_SCHED3: ::c_int = 0x00004000;
+pub const TDP_SCHED4: ::c_int = 0x00008000;
+pub const TDP_GEOM: ::c_int = 0x00010000;
+pub const TDP_SOFTDEP: ::c_int = 0x00020000;
+pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000;
+pub const TDP_WAKEUP: ::c_int = 0x00080000;
+pub const TDP_INBDFLUSH: ::c_int = 0x00100000;
+pub const TDP_KTHREAD: ::c_int = 0x00200000;
+pub const TDP_CALLCHAIN: ::c_int = 0x00400000;
+pub const TDP_IGNSUSP: ::c_int = 0x00800000;
+pub const TDP_AUDITREC: ::c_int = 0x01000000;
+pub const TDP_RFPPWAIT: ::c_int = 0x02000000;
+pub const TDP_RESETSPUR: ::c_int = 0x04000000;
+pub const TDP_NERRNO: ::c_int = 0x08000000;
+pub const TDP_EXECVMSPC: ::c_int = 0x40000000;
+
+pub const TDI_SUSPENDED: ::c_int = 0x0001;
+pub const TDI_SLEEPING: ::c_int = 0x0002;
+pub const TDI_SWAPPED: ::c_int = 0x0004;
+pub const TDI_LOCK: ::c_int = 0x0008;
+pub const TDI_IWAIT: ::c_int = 0x0010;
+
+pub const P_ADVLOCK: ::c_int = 0x00000001;
+pub const P_CONTROLT: ::c_int = 0x00000002;
+pub const P_KPROC: ::c_int = 0x00000004;
+pub const P_UNUSED3: ::c_int = 0x00000008;
+pub const P_PPWAIT: ::c_int = 0x00000010;
+pub const P_PROFIL: ::c_int = 0x00000020;
+pub const P_STOPPROF: ::c_int = 0x00000040;
+pub const P_HADTHREADS: ::c_int = 0x00000080;
+pub const P_SUGID: ::c_int = 0x00000100;
+pub const P_SYSTEM: ::c_int = 0x00000200;
+pub const P_SINGLE_EXIT: ::c_int = 0x00000400;
+pub const P_TRACED: ::c_int = 0x00000800;
+pub const P_WAITED: ::c_int = 0x00001000;
+pub const P_WEXIT: ::c_int = 0x00002000;
+pub const P_EXEC: ::c_int = 0x00004000;
+pub const P_WKILLED: ::c_int = 0x00008000;
+pub const P_CONTINUED: ::c_int = 0x00010000;
+pub const P_STOPPED_SIG: ::c_int = 0x00020000;
+pub const P_STOPPED_TRACE: ::c_int = 0x00040000;
+pub const P_STOPPED_SINGLE: ::c_int = 0x00080000;
+pub const P_PROTECTED: ::c_int = 0x00100000;
+pub const P_SIGEVENT: ::c_int = 0x00200000;
+pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000;
+pub const P_HWPMC: ::c_int = 0x00800000;
+pub const P_JAILED: ::c_int = 0x01000000;
+pub const P_TOTAL_STOP: ::c_int = 0x02000000;
+pub const P_INEXEC: ::c_int = 0x04000000;
+pub const P_STATCHILD: ::c_int = 0x08000000;
+pub const P_INMEM: ::c_int = 0x10000000;
+pub const P_SWAPPINGOUT: ::c_int = 0x20000000;
+pub const P_SWAPPINGIN: ::c_int = 0x40000000;
+pub const P_PPTRACE: ::c_int = 0x80000000;
+pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE;
+
+pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001;
+pub const P2_NOTRACE: ::c_int = 0x00000002;
+pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004;
+pub const P2_AST_SU: ::c_int = 0x00000008;
+pub const P2_PTRACE_FSTP: ::c_int = 0x00000010;
+pub const P2_TRAPCAP: ::c_int = 0x00000020;
+pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800;
+pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000;
+
+pub const P_TREE_ORPHANED: ::c_int = 0x00000001;
+pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002;
+pub const P_TREE_REAPER: ::c_int = 0x00000004;
+
+pub const SIDL: ::c_char = 1;
+pub const SRUN: ::c_char = 2;
+pub const SSLEEP: ::c_char = 3;
+pub const SSTOP: ::c_char = 4;
+pub const SZOMB: ::c_char = 5;
+pub const SWAIT: ::c_char = 6;
+pub const SLOCK: ::c_char = 7;
+
+pub const P_MAGIC: ::c_int = 0xbeefface;
+
+pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100;
+pub const TDP_UIOHELD: ::c_int = 0x10000000;
+pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000;
+pub const TDP2_COMPAT32RB: ::c_int = 0x00000002;
+pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200;
+pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400;
+pub const TDP2_SBPAGES: ::c_int = 0x00000001;
+pub const P2_ASLR_ENABLE: ::c_int = 0x00000040;
+pub const P2_ASLR_DISABLE: ::c_int = 0x00000080;
+pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100;
+pub const P_TREE_GRPEXITED: ::c_int = 0x00000008;
+
+// libprocstat.h
+pub const PS_FST_VTYPE_VNON: ::c_int = 1;
+pub const PS_FST_VTYPE_VREG: ::c_int = 2;
+pub const PS_FST_VTYPE_VDIR: ::c_int = 3;
+pub const PS_FST_VTYPE_VBLK: ::c_int = 4;
+pub const PS_FST_VTYPE_VCHR: ::c_int = 5;
+pub const PS_FST_VTYPE_VLNK: ::c_int = 6;
+pub const PS_FST_VTYPE_VSOCK: ::c_int = 7;
+pub const PS_FST_VTYPE_VFIFO: ::c_int = 8;
+pub const PS_FST_VTYPE_VBAD: ::c_int = 9;
+pub const PS_FST_VTYPE_UNKNOWN: ::c_int = 255;
+
+pub const PS_FST_TYPE_VNODE: ::c_int = 1;
+pub const PS_FST_TYPE_FIFO: ::c_int = 2;
+pub const PS_FST_TYPE_SOCKET: ::c_int = 3;
+pub const PS_FST_TYPE_PIPE: ::c_int = 4;
+pub const PS_FST_TYPE_PTS: ::c_int = 5;
+pub const PS_FST_TYPE_KQUEUE: ::c_int = 6;
+pub const PS_FST_TYPE_MQUEUE: ::c_int = 8;
+pub const PS_FST_TYPE_SHM: ::c_int = 9;
+pub const PS_FST_TYPE_SEM: ::c_int = 10;
+pub const PS_FST_TYPE_UNKNOWN: ::c_int = 11;
+pub const PS_FST_TYPE_NONE: ::c_int = 12;
+pub const PS_FST_TYPE_PROCDESC: ::c_int = 13;
+pub const PS_FST_TYPE_DEV: ::c_int = 14;
+pub const PS_FST_TYPE_EVENTFD: ::c_int = 15;
+
+pub const PS_FST_UFLAG_RDIR: ::c_int = 0x0001;
+pub const PS_FST_UFLAG_CDIR: ::c_int = 0x0002;
+pub const PS_FST_UFLAG_JAIL: ::c_int = 0x0004;
+pub const PS_FST_UFLAG_TRACE: ::c_int = 0x0008;
+pub const PS_FST_UFLAG_TEXT: ::c_int = 0x0010;
+pub const PS_FST_UFLAG_MMAP: ::c_int = 0x0020;
+pub const PS_FST_UFLAG_CTTY: ::c_int = 0x0040;
+
+pub const PS_FST_FFLAG_READ: ::c_int = 0x0001;
+pub const PS_FST_FFLAG_WRITE: ::c_int = 0x0002;
+pub const PS_FST_FFLAG_NONBLOCK: ::c_int = 0x0004;
+pub const PS_FST_FFLAG_APPEND: ::c_int = 0x0008;
+pub const PS_FST_FFLAG_SHLOCK: ::c_int = 0x0010;
+pub const PS_FST_FFLAG_EXLOCK: ::c_int = 0x0020;
+pub const PS_FST_FFLAG_ASYNC: ::c_int = 0x0040;
+pub const PS_FST_FFLAG_SYNC: ::c_int = 0x0080;
+pub const PS_FST_FFLAG_NOFOLLOW: ::c_int = 0x0100;
+pub const PS_FST_FFLAG_CREAT: ::c_int = 0x0200;
+pub const PS_FST_FFLAG_TRUNC: ::c_int = 0x0400;
+pub const PS_FST_FFLAG_EXCL: ::c_int = 0x0800;
+pub const PS_FST_FFLAG_DIRECT: ::c_int = 0x1000;
+pub const PS_FST_FFLAG_EXEC: ::c_int = 0x2000;
+pub const PS_FST_FFLAG_HASLOCK: ::c_int = 0x4000;
+
+// sys/mount.h
+
+/// File identifier.
+/// These are unique per filesystem on a single machine.
+///
+/// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid
+/// undefined behavior accessing unaligned fields within an embedded struct.
+pub const MAXFIDSZ: ::c_int = 16;
+/// Length of type name including null.
+pub const MFSNAMELEN: ::c_int = 16;
+cfg_if! {
+ if #[cfg(any(freebsd10, freebsd11))] {
+ /// Size of on/from name bufs.
+ pub const MNAMELEN: ::c_int = 88;
+ } else {
+ /// Size of on/from name bufs.
+ pub const MNAMELEN: ::c_int = 1024;
+ }
+}
+
+/// Using journaled soft updates.
+pub const MNT_SUJ: u64 = 0x100000000;
+/// Mounted by automountd(8).
+pub const MNT_AUTOMOUNTED: u64 = 0x200000000;
+/// Filesys metadata untrusted.
+pub const MNT_UNTRUSTED: u64 = 0x800000000;
+
+/// Require TLS.
+pub const MNT_EXTLS: u64 = 0x4000000000;
+/// Require TLS with client cert.
+pub const MNT_EXTLSCERT: u64 = 0x8000000000;
+/// Require TLS with user cert.
+pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000;
+
+/// Filesystem is stored locally.
+pub const MNT_LOCAL: u64 = 0x000001000;
+/// Quotas are enabled on fs.
+pub const MNT_QUOTA: u64 = 0x000002000;
+/// Identifies the root fs.
+pub const MNT_ROOTFS: u64 = 0x000004000;
+/// Mounted by a user.
+pub const MNT_USER: u64 = 0x000008000;
+/// Do not show entry in df.
+pub const MNT_IGNORE: u64 = 0x000800000;
+/// Filesystem is verified.
+pub const MNT_VERIFIED: u64 = 0x400000000;
+
+/// Do not cover a mount point.
+pub const MNT_NOCOVER: u64 = 0x001000000000;
+/// Only mount on empty dir.
+pub const MNT_EMPTYDIR: u64 = 0x002000000000;
+/// Recursively unmount uppers.
+pub const MNT_RECURSE: u64 = 0x100000000000;
+/// Unmount in async context.
+pub const MNT_DEFERRED: u64 = 0x200000000000;
+
+/// Get configured filesystems.
+pub const VFS_VFSCONF: ::c_int = 0;
+/// Generic filesystem information.
+pub const VFS_GENERIC: ::c_int = 0;
+
+/// int: highest defined filesystem type.
+pub const VFS_MAXTYPENUM: ::c_int = 1;
+/// struct: vfsconf for filesystem given as next argument.
+pub const VFS_CONF: ::c_int = 2;
+
+/// Synchronously wait for I/O to complete.
+pub const MNT_WAIT: ::c_int = 1;
+/// Start all I/O, but do not wait for it.
+pub const MNT_NOWAIT: ::c_int = 2;
+/// Push data not written by filesystem syncer.
+pub const MNT_LAZY: ::c_int = 3;
+/// Suspend file system after sync.
+pub const MNT_SUSPEND: ::c_int = 4;
+
+pub const MAXSECFLAVORS: ::c_int = 5;
+
+/// Statically compiled into kernel.
+pub const VFCF_STATIC: ::c_int = 0x00010000;
+/// May get data over the network.
+pub const VFCF_NETWORK: ::c_int = 0x00020000;
+/// Writes are not implemented.
+pub const VFCF_READONLY: ::c_int = 0x00040000;
+/// Data does not represent real files.
+pub const VFCF_SYNTHETIC: ::c_int = 0x00080000;
+/// Aliases some other mounted FS.
+pub const VFCF_LOOPBACK: ::c_int = 0x00100000;
+/// Stores file names as Unicode.
+pub const VFCF_UNICODE: ::c_int = 0x00200000;
+/// Can be mounted from within a jail.
+pub const VFCF_JAIL: ::c_int = 0x00400000;
+/// Supports delegated administration.
+pub const VFCF_DELEGADMIN: ::c_int = 0x00800000;
+/// Stop at Boundary: defer stop requests to kernel->user (AST) transition.
+pub const VFCF_SBDRY: ::c_int = 0x01000000;
+
+// time.h
+
+/// not on dst
+pub const DST_NONE: ::c_int = 0;
+/// USA style dst
+pub const DST_USA: ::c_int = 1;
+/// Australian style dst
+pub const DST_AUST: ::c_int = 2;
+/// Western European dst
+pub const DST_WET: ::c_int = 3;
+/// Middle European dst
+pub const DST_MET: ::c_int = 4;
+/// Eastern European dst
+pub const DST_EET: ::c_int = 5;
+/// Canada
+pub const DST_CAN: ::c_int = 6;
+
+pub const CPUCLOCK_WHICH_PID: ::c_int = 0;
+pub const CPUCLOCK_WHICH_TID: ::c_int = 1;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x00000001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002;
+pub const MFD_HUGETLB: ::c_uint = 0x00000004;
+pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000;
+pub const MFD_HUGE_64KB: ::c_uint = 16 << 26;
+pub const MFD_HUGE_512KB: ::c_uint = 19 << 26;
+pub const MFD_HUGE_1MB: ::c_uint = 20 << 26;
+pub const MFD_HUGE_2MB: ::c_uint = 21 << 26;
+pub const MFD_HUGE_8MB: ::c_uint = 23 << 26;
+pub const MFD_HUGE_16MB: ::c_uint = 24 << 26;
+pub const MFD_HUGE_32MB: ::c_uint = 25 << 26;
+pub const MFD_HUGE_256MB: ::c_uint = 28 << 26;
+pub const MFD_HUGE_512MB: ::c_uint = 29 << 26;
+pub const MFD_HUGE_1GB: ::c_uint = 30 << 26;
+pub const MFD_HUGE_2GB: ::c_uint = 31 << 26;
+pub const MFD_HUGE_16GB: ::c_uint = 34 << 26;
+
+pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0;
+pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1;
+pub const SHM_LARGEPAGE_ALLOC_HARD: ::c_int = 2;
+pub const SHM_RENAME_NOREPLACE: ::c_int = 1 << 0;
+pub const SHM_RENAME_EXCHANGE: ::c_int = 1 << 1;
+
+// sys/umtx.h
+
+pub const UMTX_OP_WAIT: ::c_int = 2;
+pub const UMTX_OP_WAKE: ::c_int = 3;
+pub const UMTX_OP_MUTEX_TRYLOCK: ::c_int = 4;
+pub const UMTX_OP_MUTEX_LOCK: ::c_int = 5;
+pub const UMTX_OP_MUTEX_UNLOCK: ::c_int = 6;
+pub const UMTX_OP_SET_CEILING: ::c_int = 7;
+pub const UMTX_OP_CV_WAIT: ::c_int = 8;
+pub const UMTX_OP_CV_SIGNAL: ::c_int = 9;
+pub const UMTX_OP_CV_BROADCAST: ::c_int = 10;
+pub const UMTX_OP_WAIT_UINT: ::c_int = 11;
+pub const UMTX_OP_RW_RDLOCK: ::c_int = 12;
+pub const UMTX_OP_RW_WRLOCK: ::c_int = 13;
+pub const UMTX_OP_RW_UNLOCK: ::c_int = 14;
+pub const UMTX_OP_WAIT_UINT_PRIVATE: ::c_int = 15;
+pub const UMTX_OP_WAKE_PRIVATE: ::c_int = 16;
+pub const UMTX_OP_MUTEX_WAIT: ::c_int = 17;
+pub const UMTX_OP_NWAKE_PRIVATE: ::c_int = 21;
+pub const UMTX_OP_MUTEX_WAKE2: ::c_int = 22;
+pub const UMTX_OP_SEM2_WAIT: ::c_int = 23;
+pub const UMTX_OP_SEM2_WAKE: ::c_int = 24;
+pub const UMTX_OP_SHM: ::c_int = 25;
+pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26;
+
+pub const UMTX_ABSTIME: u32 = 1;
+
+pub const CPU_LEVEL_ROOT: ::c_int = 1;
+pub const CPU_LEVEL_CPUSET: ::c_int = 2;
+pub const CPU_LEVEL_WHICH: ::c_int = 3;
+
+pub const CPU_WHICH_TID: ::c_int = 1;
+pub const CPU_WHICH_PID: ::c_int = 2;
+pub const CPU_WHICH_CPUSET: ::c_int = 3;
+pub const CPU_WHICH_IRQ: ::c_int = 4;
+pub const CPU_WHICH_JAIL: ::c_int = 5;
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
@@ -1255,6 +3831,18 @@ f! {
as ::c_uint
}
+ pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
+ ffsl(lg as ::c_long - 1)
+ }
+
+ pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
+ (tc + 2) << 8 as ::c_int
+ }
+
+ pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
+ (a + 1) << 20 as ::c_int
+ }
+
pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
ngrps - 1
@@ -1267,6 +3855,58 @@ f! {
pub fn uname(buf: *mut ::utsname) -> ::c_int {
__xuname(256, buf as *mut ::c_void)
}
+
+ pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
+ for slot in cpuset.__bits.iter_mut() {
+ *slot = 0;
+ }
+ }
+
+ pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
+ for slot in cpuset.__bits.iter_mut() {
+ *slot = !0;
+ }
+ }
+
+ pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
+ let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+ let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+ cpuset.__bits[idx] |= 1 << offset;
+ ()
+ }
+
+ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
+ let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+ let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+ cpuset.__bits[idx] &= !(1 << offset);
+ ()
+ }
+
+ pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
+ let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+ let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+ 0 != cpuset.__bits[idx] & (1 << offset)
+ }
+
+ pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int {
+ let mut s: u32 = 0;
+ let cpuset_size = ::mem::size_of::();
+ let bitset_size = ::mem::size_of::<::c_long>();
+
+ for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() {
+ s += i.count_ones();
+ };
+ s as ::c_int
+ }
+
+ pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
+ let ngrps = if ngrps > 0 {
+ ngrps - 1
+ } else {
+ 0
+ };
+ ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
+ }
}
safe_f! {
@@ -1275,13 +3915,36 @@ safe_f! {
}
}
+cfg_if! {
+ if #[cfg(not(any(freebsd10, freebsd11)))] {
+ extern "C" {
+ pub fn fhlink(fhp: *mut fhandle_t, to: *const ::c_char) -> ::c_int;
+ pub fn fhlinkat(fhp: *mut fhandle_t, tofd: ::c_int, to: *const ::c_char) -> ::c_int;
+ pub fn fhreadlink(
+ fhp: *mut fhandle_t,
+ buf: *mut ::c_char,
+ bufsize: ::size_t,
+ ) -> ::c_int;
+ pub fn getfhat(
+ fd: ::c_int,
+ path: *mut ::c_char,
+ fhp: *mut fhandle,
+ flag: ::c_int,
+ ) -> ::c_int;
+ }
+ }
+}
+
extern "C" {
+ #[cfg_attr(doc, doc(alias = "__errno_location"))]
+ #[cfg_attr(doc, doc(alias = "errno"))]
pub fn __error() -> *mut ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
@@ -1289,6 +3952,23 @@ extern "C" {
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int;
+
+ pub fn copy_file_range(
+ infd: ::c_int,
+ inoffp: *mut ::off_t,
+ outfd: ::c_int,
+ outoffp: *mut ::off_t,
+ len: ::size_t,
+ flags: ::c_uint,
+ ) -> ::ssize_t;
+
+ pub fn devname_r(
+ dev: ::dev_t,
+ mode: ::mode_t,
+ buf: *mut ::c_char,
+ len: ::c_int,
+ ) -> *mut ::c_char;
pub fn extattr_delete_fd(
fd: ::c_int,
@@ -1366,19 +4046,19 @@ extern "C" {
nbytes: ::size_t,
) -> ::ssize_t;
+ pub fn fspacectl(
+ fd: ::c_int,
+ cmd: ::c_int,
+ rqsr: *const spacectl_range,
+ flags: ::c_int,
+ rmsr: *mut spacectl_range,
+ ) -> ::c_int;
+
pub fn jail(jail: *mut ::jail) -> ::c_int;
pub fn jail_attach(jid: ::c_int) -> ::c_int;
pub fn jail_remove(jid: ::c_int) -> ::c_int;
- pub fn jail_get(
- iov: *mut ::iovec,
- niov: ::c_uint,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn jail_set(
- iov: *mut ::iovec,
- niov: ::c_uint,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+ pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
@@ -1387,31 +4067,13 @@ extern "C" {
sevp: *mut sigevent,
) -> ::c_int;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn posix_fadvise(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- advise: ::c_int,
- ) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
- pub fn mkostemps(
- template: *mut ::c_char,
- suffixlen: ::c_int,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
- pub fn aio_waitcomplete(
- iocbp: *mut *mut aiocb,
- timeout: *mut ::timespec,
- ) -> ::ssize_t;
+ pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
pub fn waitid(
@@ -1420,25 +4082,17 @@ extern "C" {
infop: *mut ::siginfo_t,
options: ::c_int,
) -> ::c_int;
+ pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ 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;
- pub fn shmctl(
- shmid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::shmid_ds,
- ) -> ::c_int;
- pub fn msgctl(
- msqid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::msqid_ds,
- ) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+ pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgsnd(
msqid: ::c_int,
@@ -1447,21 +4101,12 @@ extern "C" {
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 rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
pub fn posix_spawn(
pid: *mut ::pid_t,
@@ -1501,26 +4146,17 @@ extern "C" {
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_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_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_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,
@@ -1530,12 +4166,8 @@ extern "C" {
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_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,
@@ -1553,15 +4185,52 @@ extern "C" {
newfd: ::c_int,
) -> ::c_int;
- #[cfg_attr(
- all(target_os = "freebsd", freebsd11),
- link_name = "statfs@FBSD_1.0"
- )]
+ pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
+
+ pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
+ pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
+ pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
+ pub fn pthread_getthreadid_np() -> ::c_int;
+ pub fn pthread_getaffinity_np(
+ td: ::pthread_t,
+ cpusetsize: ::size_t,
+ cpusetp: *mut cpuset_t,
+ ) -> ::c_int;
+ pub fn pthread_setaffinity_np(
+ td: ::pthread_t,
+ cpusetsize: ::size_t,
+ cpusetp: *const cpuset_t,
+ ) -> ::c_int;
+
+ // sched.h linux compatibility api
+ pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int;
+ pub fn sched_setaffinity(
+ pid: ::pid_t,
+ cpusetsz: ::size_t,
+ cpuset: *const ::cpuset_t,
+ ) -> ::c_int;
+ pub fn sched_getcpu() -> ::c_int;
+
+ pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+
+ pub fn pthread_mutexattr_getrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: ::c_int,
+ ) -> ::c_int;
+
+ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+
+ #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
- #[cfg_attr(
- all(target_os = "freebsd", freebsd11),
- link_name = "fstatfs@FBSD_1.0"
- )]
+ #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
@@ -1587,11 +4256,194 @@ extern "C" {
needlelen: ::size_t,
) -> *mut ::c_void;
- pub fn nmount(
- iov: *mut ::iovec,
- niov: ::c_uint,
+ pub fn fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int;
+ pub fn fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int;
+ pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int;
+ pub fn getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
+ pub fn lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
+ pub fn getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int;
+ #[cfg_attr(
+ all(target_os = "freebsd", freebsd11),
+ link_name = "getmntinfo@FBSD_1.0"
+ )]
+ pub fn getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int;
+ pub fn mount(
+ type_: *const ::c_char,
+ dir: *const ::c_char,
+ flags: ::c_int,
+ data: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+
+ pub fn setproctitle(fmt: *const ::c_char, ...);
+ pub fn rfork(flags: ::c_int) -> ::c_int;
+ pub fn cpuset_getaffinity(
+ level: cpulevel_t,
+ which: cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *mut cpuset_t,
+ ) -> ::c_int;
+ pub fn cpuset_setaffinity(
+ level: cpulevel_t,
+ which: cpuwhich_t,
+ id: ::id_t,
+ setsize: ::size_t,
+ mask: *const cpuset_t,
+ ) -> ::c_int;
+ pub fn cpuset(setid: *mut ::cpusetid_t) -> ::c_int;
+ pub fn cpuset_getid(
+ level: cpulevel_t,
+ which: cpuwhich_t,
+ id: ::id_t,
+ setid: *mut ::cpusetid_t,
+ ) -> ::c_int;
+ pub fn cpuset_setid(which: cpuwhich_t, id: ::id_t, setid: ::cpusetid_t) -> ::c_int;
+ pub fn cap_enter() -> ::c_int;
+ pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
+ pub fn cap_fcntls_get(fd: ::c_int, fcntlrightsp: *mut u32) -> ::c_int;
+ pub fn cap_fcntls_limit(fd: ::c_int, fcntlrights: u32) -> ::c_int;
+ pub fn cap_ioctls_get(fd: ::c_int, cmds: *mut u_long, maxcmds: usize) -> isize;
+ pub fn cap_ioctls_limit(fd: ::c_int, cmds: *const u_long, ncmds: usize) -> ::c_int;
+ pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
+ -> *mut cap_rights_t;
+ pub fn __cap_rights_get(version: ::c_int, fd: ::c_int, rightsp: *mut cap_rights_t) -> ::c_int;
+ pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
+ pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
+ pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
+ pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
+ pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int;
+ pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t;
+ pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
+ -> *mut cap_rights_t;
+ pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
+ pub fn cap_sandboxed() -> bool;
+
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn ffs(value: ::c_int) -> ::c_int;
+ pub fn ffsl(value: ::c_long) -> ::c_int;
+ pub fn ffsll(value: ::c_longlong) -> ::c_int;
+ pub fn fls(value: ::c_int) -> ::c_int;
+ pub fn flsl(value: ::c_long) -> ::c_int;
+ pub fn flsll(value: ::c_longlong) -> ::c_int;
+ pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
+ pub fn malloc_stats_print(
+ write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
+ cbopaque: *mut ::c_void,
+ opt: *const ::c_char,
+ );
+ pub fn mallctl(
+ name: *const ::c_char,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t,
+ ) -> ::c_int;
+ pub fn mallctlnametomib(
+ name: *const ::c_char,
+ mibp: *mut ::size_t,
+ miplen: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn mallctlbymib(
+ mib: *const ::size_t,
+ mible: ::size_t,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t,
+ ) -> ::c_int;
+ pub fn mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void;
+ pub fn rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void;
+ pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
+ -> ::size_t;
+ pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
+ pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
+ pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
+ pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
+
+ pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
+
+ pub fn getpagesize() -> ::c_int;
+ pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+
+ pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
+
+ pub fn shm_create_largepage(
+ path: *const ::c_char,
+ flags: ::c_int,
+ psind: ::c_int,
+ alloc_policy: ::c_int,
+ mode: ::mode_t,
+ ) -> ::c_int;
+ pub fn shm_rename(
+ path_from: *const ::c_char,
+ path_to: *const ::c_char,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int;
+
+ pub fn _umtx_op(
+ obj: *mut ::c_void,
+ op: ::c_int,
+ val: ::c_ulong,
+ uaddr: *mut ::c_void,
+ uaddr2: *mut ::c_void,
+ ) -> ::c_int;
+}
+
+#[link(name = "memstat")]
+extern "C" {
+ pub fn memstat_strerror(error: ::c_int) -> *const ::c_char;
+ pub fn memstat_mtl_alloc() -> *mut memory_type_list;
+ pub fn memstat_mtl_first(list: *mut memory_type_list) -> *mut memory_type;
+ pub fn memstat_mtl_next(mtp: *mut memory_type) -> *mut memory_type;
+ pub fn memstat_mtl_find(
+ list: *mut memory_type_list,
+ allocator: ::c_int,
+ name: *const ::c_char,
+ ) -> *mut memory_type;
+ pub fn memstat_mtl_free(list: *mut memory_type_list);
+ pub fn memstat_mtl_geterror(list: *mut memory_type_list) -> ::c_int;
+ pub fn memstat_get_name(mtp: *const memory_type) -> *const ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+ pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int;
+ pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+ -> *mut *mut ::c_char;
+ pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int;
+ pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+ -> *mut *mut ::c_char;
+ pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char;
+ pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void;
+ pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64;
+ pub fn kvm_getswapinfo(
+ kd: *mut ::kvm_t,
+ info: *mut kvm_swap,
+ maxswap: ::c_int,
flags: ::c_int,
) -> ::c_int;
+ pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int;
+ pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int;
+ pub fn kvm_read_zpcpu(
+ kd: *mut ::kvm_t,
+ base: ::c_ulong,
+ buf: *mut ::c_void,
+ size: ::size_t,
+ cpu: ::c_int,
+ ) -> ::ssize_t;
+ pub fn kvm_read2(
+ kd: *mut ::kvm_t,
+ addr: kvaddr_t,
+ buf: *mut ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
}
#[link(name = "util")]
@@ -1604,10 +4456,175 @@ extern "C" {
string: *const ::c_char,
attrnamespace: *mut ::c_int,
) -> ::c_int;
+ pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int;
+ pub fn realhostname_sa(
+ host: *mut ::c_char,
+ hsize: ::size_t,
+ addr: *mut ::sockaddr,
+ addrlen: ::c_int,
+ ) -> ::c_int;
+
+ pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
+ pub fn kld_load(name: *const ::c_char) -> ::c_int;
+
+ pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
+
+ pub fn hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int);
+ pub fn humanize_number(
+ buf: *mut ::c_char,
+ len: ::size_t,
+ number: i64,
+ suffix: *const ::c_char,
+ scale: ::c_int,
+ flags: ::c_int,
+ ) -> ::c_int;
+
+ pub fn flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+ pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+
+ pub fn getlocalbase() -> *const ::c_char;
+}
+
+#[link(name = "procstat")]
+extern "C" {
+ pub fn procstat_open_sysctl() -> *mut procstat;
+ pub fn procstat_getfiles(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ mmapped: ::c_int,
+ ) -> *mut filestat_list;
+ pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list);
+ pub fn procstat_getprocs(
+ procstat: *mut procstat,
+ what: ::c_int,
+ arg: ::c_int,
+ count: *mut ::c_uint,
+ ) -> *mut kinfo_proc;
+ pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc);
+ pub fn procstat_getvmmap(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ count: *mut ::c_uint,
+ ) -> *mut kinfo_vmentry;
+ pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
+ pub fn procstat_close(procstat: *mut procstat);
+ pub fn procstat_freeargv(procstat: *mut procstat);
+ pub fn procstat_freeenvv(procstat: *mut procstat);
+ pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t);
+ pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo);
+ pub fn procstat_getargv(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ nchr: ::size_t,
+ ) -> *mut *mut ::c_char;
+ pub fn procstat_getenvv(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ nchr: ::size_t,
+ ) -> *mut *mut ::c_char;
+ pub fn procstat_getgroups(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ count: *mut ::c_uint,
+ ) -> *mut ::gid_t;
+ pub fn procstat_getosrel(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ osrelp: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn procstat_getpathname(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ pathname: *mut ::c_char,
+ maxlen: ::size_t,
+ ) -> ::c_int;
+ pub fn procstat_getrlimit(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ which: ::c_int,
+ rlimit: *mut ::rlimit,
+ ) -> ::c_int;
+ pub fn procstat_getumask(
+ procstat: *mut procstat,
+ kp: *mut kinfo_proc,
+ maskp: *mut ::c_ushort,
+ ) -> ::c_int;
+ pub fn procstat_open_core(filename: *const ::c_char) -> *mut procstat;
+ pub fn procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat;
+ pub fn procstat_get_socket_info(
+ proc_: *mut procstat,
+ fst: *mut filestat,
+ sock: *mut sockstat,
+ errbuf: *mut ::c_char,
+ ) -> ::c_int;
+ pub fn procstat_get_vnode_info(
+ proc_: *mut procstat,
+ fst: *mut filestat,
+ vn: *mut vnstat,
+ errbuf: *mut ::c_char,
+ ) -> ::c_int;
+ pub fn procstat_get_pts_info(
+ proc_: *mut procstat,
+ fst: *mut filestat,
+ pts: *mut ptsstat,
+ errbuf: *mut ::c_char,
+ ) -> ::c_int;
+ pub fn procstat_get_shm_info(
+ proc_: *mut procstat,
+ fst: *mut filestat,
+ shm: *mut shmstat,
+ errbuf: *mut ::c_char,
+ ) -> ::c_int;
+}
+
+#[link(name = "rt")]
+extern "C" {
+ pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
+ pub fn timer_delete(timerid: timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: timer_t,
+ flags: ::c_int,
+ value: *const itimerspec,
+ ovalue: *mut itimerspec,
+ ) -> ::c_int;
+}
+
+#[link(name = "devstat")]
+extern "C" {
+ pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long;
+ pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn devstat_selectdevs(
+ dev_select: *mut *mut device_selection,
+ num_selected: *mut ::c_int,
+ num_selections: *mut ::c_int,
+ select_generation: *mut ::c_long,
+ current_generation: ::c_long,
+ devices: *mut devstat,
+ numdevs: ::c_int,
+ matches: *mut devstat_match,
+ num_matches: ::c_int,
+ dev_selections: *mut *mut ::c_char,
+ num_dev_selections: ::c_int,
+ select_mode: devstat_select_mode,
+ maxshowdevs: ::c_int,
+ perf_select: ::c_int,
+ ) -> ::c_int;
+ pub fn devstat_buildmatch(
+ match_str: *mut ::c_char,
+ matches: *mut *mut devstat_match,
+ num_matches: *mut ::c_int,
+ ) -> ::c_int;
}
cfg_if! {
- if #[cfg(freebsd13)] {
+ if #[cfg(freebsd14)] {
+ mod freebsd14;
+ pub use self::freebsd14::*;
+ } else if #[cfg(freebsd13)] {
mod freebsd13;
pub use self::freebsd13::*;
} else if #[cfg(freebsd12)] {
@@ -1637,6 +4654,12 @@ cfg_if! {
} else if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
+ } else if #[cfg(target_arch = "powerpc")] {
+ mod powerpc;
+ pub use self::powerpc::*;
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
new file mode 100644
index 0000000000000..a0120c337e0ad
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
@@ -0,0 +1,47 @@
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+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,
+ 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,
+ pub st_size: ::off_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_blksize: ::blksize_t,
+ pub st_flags: ::fflags_t,
+ pub st_gen: u32,
+ pub st_lspare: i32,
+ pub st_birthtime: ::time_t,
+ pub st_birthtime_nsec: ::c_long,
+ }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 4 - 1;
+ }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
new file mode 100644
index 0000000000000..f9fa1c2750b22
--- /dev/null
+++ b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
@@ -0,0 +1,154 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = ::c_int;
+pub type time_t = i64;
+pub type suseconds_t = ::c_long;
+pub type register_t = i64;
+
+s_no_extra_traits! {
+ pub struct gpregs {
+ pub gp_ra: ::register_t,
+ pub gp_sp: ::register_t,
+ pub gp_gp: ::register_t,
+ pub gp_tp: ::register_t,
+ pub gp_t: [::register_t; 7],
+ pub gp_s: [::register_t; 12],
+ pub gp_a: [::register_t; 8],
+ pub gp_sepc: ::register_t,
+ pub gp_sstatus: ::register_t,
+ }
+
+ pub struct fpregs {
+ pub fp_x: [[::register_t; 2]; 32],
+ pub fp_fcsr: ::register_t,
+ pub fp_flags: ::c_int,
+ pub fp_pad: ::c_int,
+ }
+
+ pub struct mcontext_t {
+ pub mc_gpregs: gpregs,
+ pub mc_fpregs: fpregs,
+ pub mc_flags: ::c_int,
+ pub mc_pad: ::c_int,
+ pub mc_spare: [u64; 8],
+ }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 8 - 1;
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for gpregs {
+ fn eq(&self, other: &gpregs) -> bool {
+ self.gp_ra == other.gp_ra &&
+ self.gp_sp == other.gp_sp &&
+ self.gp_gp == other.gp_gp &&
+ self.gp_tp == other.gp_tp &&
+ self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) &&
+ self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) &&
+ self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) &&
+ self.gp_sepc == other.gp_sepc &&
+ self.gp_sstatus == other.gp_sstatus
+ }
+ }
+ impl Eq for gpregs {}
+ impl ::fmt::Debug for gpregs {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("gpregs")
+ .field("gp_ra", &self.gp_ra)
+ .field("gp_sp", &self.gp_sp)
+ .field("gp_gp", &self.gp_gp)
+ .field("gp_tp", &self.gp_tp)
+ .field("gp_t", &self.gp_t)
+ .field("gp_s", &self.gp_s)
+ .field("gp_a", &self.gp_a)
+ .field("gp_sepc", &self.gp_sepc)
+ .field("gp_sstatus", &self.gp_sstatus)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for gpregs {
+ fn hash(&self, state: &mut H) {
+ self.gp_ra.hash(state);
+ self.gp_sp.hash(state);
+ self.gp_gp.hash(state);
+ self.gp_tp.hash(state);
+ self.gp_t.hash(state);
+ self.gp_s.hash(state);
+ self.gp_a.hash(state);
+ self.gp_sepc.hash(state);
+ self.gp_sstatus.hash(state);
+ }
+ }
+ impl PartialEq for fpregs {
+ fn eq(&self, other: &fpregs) -> bool {
+ self.fp_x == other.fp_x &&
+ self.fp_fcsr == other.fp_fcsr &&
+ self.fp_flags == other.fp_flags &&
+ self.fp_pad == other.fp_pad
+ }
+ }
+ impl Eq for fpregs {}
+ impl ::fmt::Debug for fpregs {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("fpregs")
+ .field("fp_x", &self.fp_x)
+ .field("fp_fcsr", &self.fp_fcsr)
+ .field("fp_flags", &self.fp_flags)
+ .field("fp_pad", &self.fp_pad)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for fpregs {
+ fn hash(&self, state: &mut H) {
+ self.fp_x.hash(state);
+ self.fp_fcsr.hash(state);
+ self.fp_flags.hash(state);
+ self.fp_pad.hash(state);
+ }
+ }
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_gpregs == other.mc_gpregs &&
+ self.mc_fpregs == other.mc_fpregs &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_pad == other.mc_pad &&
+ self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_gpregs", &self.mc_gpregs)
+ .field("mc_fpregs", &self.mc_fpregs)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_pad", &self.mc_pad)
+ .field("mc_spare", &self.mc_spare)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash(&self, state: &mut H) {
+ self.mc_gpregs.hash(state);
+ self.mc_fpregs.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_pad.hash(state);
+ self.mc_spare.hash(state);
+ }
+ }
+ }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
index d3333c8b11aea..ae1fcf781047a 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
@@ -80,6 +80,36 @@ s_no_extra_traits! {
pub xmm_reg: [[u8; 16]; 8],
pub xmm_pad: [u8; 224],
}
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_elf64_auxv_union {
+ pub a_val: ::c_long,
+ pub a_ptr: *mut ::c_void,
+ pub a_fcn: extern "C" fn(),
+ }
+
+ pub struct Elf64_Auxinfo {
+ pub a_type: ::c_long,
+ #[cfg(libc_union)]
+ pub a_un: __c_anonymous_elf64_auxv_union,
+ }
+
+ pub struct kinfo_file {
+ pub kf_structsize: ::c_int,
+ pub kf_type: ::c_int,
+ pub kf_fd: ::c_int,
+ pub kf_ref_count: ::c_int,
+ pub kf_flags: ::c_int,
+ _kf_pad0: ::c_int,
+ pub kf_offset: i64,
+ _priv: [::uintptr_t; 38], // FIXME if needed
+ pub kf_status: u16,
+ _kf_pad1: u16,
+ _kf_ispare0: ::c_int,
+ pub kf_cap_rights: ::cap_rights_t,
+ _kf_cap_spare: u64,
+ pub kf_path: [::c_char; ::PATH_MAX as usize],
+ }
}
cfg_if! {
@@ -173,6 +203,102 @@ cfg_if! {
self.xmm_pad.hash(state);
}
}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_elf64_auxv_union {
+ fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool {
+ unsafe { self.a_val == other.a_val
+ || self.a_ptr == other.a_ptr
+ || self.a_fcn == other.a_fcn }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_elf64_auxv_union {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_elf64_auxv_union {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("a_val")
+ .field("a_val", unsafe { &self.a_val })
+ .finish()
+ }
+ }
+ #[cfg(not(libc_union))]
+ impl PartialEq for Elf64_Auxinfo {
+ fn eq(&self, other: &Elf64_Auxinfo) -> bool {
+ self.a_type == other.a_type
+ }
+ }
+ #[cfg(libc_union)]
+ impl PartialEq for Elf64_Auxinfo {
+ fn eq(&self, other: &Elf64_Auxinfo) -> bool {
+ self.a_type == other.a_type
+ && self.a_un == other.a_un
+ }
+ }
+ impl Eq for Elf64_Auxinfo {}
+ #[cfg(not(libc_union))]
+ impl ::fmt::Debug for Elf64_Auxinfo {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("Elf64_Auxinfo")
+ .field("a_type", &self.a_type)
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for Elf64_Auxinfo {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("Elf64_Auxinfo")
+ .field("a_type", &self.a_type)
+ .field("a_un", &self.a_un)
+ .finish()
+ }
+ }
+
+ impl PartialEq for kinfo_file {
+ fn eq(&self, other: &kinfo_file) -> bool {
+ self.kf_structsize == other.kf_structsize &&
+ self.kf_type == other.kf_type &&
+ self.kf_fd == other.kf_fd &&
+ self.kf_ref_count == other.kf_ref_count &&
+ self.kf_flags == other.kf_flags &&
+ self.kf_offset == other.kf_offset &&
+ self.kf_status == other.kf_status &&
+ self.kf_cap_rights == other.kf_cap_rights &&
+ self.kf_path
+ .iter()
+ .zip(other.kf_path.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for kinfo_file {}
+ impl ::fmt::Debug for kinfo_file {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("kinfo_file")
+ .field("kf_structsize", &self.kf_structsize)
+ .field("kf_type", &self.kf_type)
+ .field("kf_fd", &self.kf_fd)
+ .field("kf_ref_count", &self.kf_ref_count)
+ .field("kf_flags", &self.kf_flags)
+ .field("kf_offset", &self.kf_offset)
+ .field("kf_status", &self.kf_status)
+ .field("kf_cap_rights", &self.kf_cap_rights)
+ .field("kf_path", &&self.kf_path[..])
+ .finish()
+ }
+ }
+ impl ::hash::Hash for kinfo_file {
+ fn hash(&self, state: &mut H) {
+ self.kf_structsize.hash(state);
+ self.kf_type.hash(state);
+ self.kf_fd.hash(state);
+ self.kf_ref_count.hash(state);
+ self.kf_flags.hash(state);
+ self.kf_offset.hash(state);
+ self.kf_status.hash(state);
+ self.kf_cap_rights.hash(state);
+ self.kf_path.hash(state);
+ }
+ }
}
}
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 32bf7e7e7baac..9aefb36e4eb3e 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -13,6 +13,7 @@ pub type speed_t = ::c_uint;
pub type nl_item = ::c_int;
pub type id_t = i64;
pub type vm_size_t = ::uintptr_t;
+pub type key_t = ::c_long;
// elf.h
@@ -34,6 +35,10 @@ pub type Elf64_Xword = u64;
pub type iconv_t = *mut ::c_void;
+// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly,
+// making the type definition system dependent. Better not bind it exactly.
+pub type kvm_t = ::c_void;
+
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
@@ -89,6 +94,18 @@ s! {
pub imr_interface: in_addr,
}
+ pub struct ip_mreqn {
+ pub imr_multiaddr: in_addr,
+ pub imr_address: in_addr,
+ pub imr_ifindex: ::c_int,
+ }
+
+ pub struct ip_mreq_source {
+ pub imr_multiaddr: in_addr,
+ pub imr_sourceaddr: in_addr,
+ pub imr_interface: in_addr,
+ }
+
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_matchc: ::size_t,
@@ -265,6 +282,11 @@ s! {
pub time_state: ::c_int,
}
+ pub struct accept_filter_arg {
+ pub af_name: [::c_char; 16],
+ af_arg: [[::c_char; 10]; 24],
+ }
+
pub struct ptrace_io_desc {
pub piod_op: ::c_int,
pub piod_offs: *mut ::c_void,
@@ -344,6 +366,20 @@ s! {
pub dlpi_tls_modid: usize,
pub dlpi_tls_data: *mut ::c_void,
}
+
+ pub struct ipc_perm {
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub mode: ::mode_t,
+ pub seq: ::c_ushort,
+ pub key: ::key_t,
+ }
+
+ pub struct eui64 {
+ pub octet: [u8; EUI64_LEN],
+ }
}
s_no_extra_traits! {
@@ -396,12 +432,15 @@ cfg_if! {
}
// Non-public helper constant
-#[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))]
-const SIZEOF_LONG: usize = 4;
-#[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))]
-const SIZEOF_LONG: usize = 8;
-#[cfg(libc_const_size_of)]
-const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>();
+cfg_if! {
+ if #[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] {
+ const SIZEOF_LONG: usize = 4;
+ } else if #[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] {
+ const SIZEOF_LONG: usize = 8;
+ } else if #[cfg(libc_const_size_of)] {
+ const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>();
+ }
+}
#[deprecated(
since = "0.2.64",
@@ -559,6 +598,8 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 17;
+pub const F_DUP2FD: ::c_int = 10;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
@@ -589,6 +630,19 @@ pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
+pub const MNT_NOATIME: ::c_int = 0x10000000;
+pub const MNT_NOCLUSTERR: ::c_int = 0x40000000;
+pub const MNT_NOCLUSTERW: ::c_int = 0x80000000;
+pub const MNT_NOSYMFOLLOW: ::c_int = 0x00400000;
+pub const MNT_SOFTDEP: ::c_int = 0x00200000;
+pub const MNT_SUIDDIR: ::c_int = 0x00100000;
+pub const MNT_EXRDONLY: ::c_int = 0x00000080;
+pub const MNT_DEFEXPORTED: ::c_int = 0x00000200;
+pub const MNT_EXPORTANON: ::c_int = 0x00000400;
+pub const MNT_EXKERB: ::c_int = 0x00000800;
+pub const MNT_DELEXPORT: ::c_int = 0x00020000;
+
pub const MS_SYNC: ::c_int = 0x0000;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
@@ -698,6 +752,14 @@ pub const POLLSTANDARD: ::c_short = ::POLLIN
| ::POLLHUP
| ::POLLNVAL;
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+pub const AI_ALL: ::c_int = 0x00000100;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_V4MAPPED: ::c_int = 0x00000800;
+
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
@@ -788,7 +850,6 @@ pub const MINCORE_REFERENCED: ::c_int = 0x2;
pub const MINCORE_MODIFIED: ::c_int = 0x4;
pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
-pub const MINCORE_SUPER: ::c_int = 0x20;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
@@ -917,6 +978,11 @@ pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
+pub const IP_BLOCK_SOURCE: ::c_int = 72;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
@@ -960,10 +1026,16 @@ pub const LOCK_UN: ::c_int = 8;
pub const MAP_COPY: ::c_int = 0x0002;
#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+#[deprecated(
+ since = "0.2.54",
+ note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
+)]
pub const MAP_RENAME: ::c_int = 0x0020;
#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+#[deprecated(
+ since = "0.2.54",
+ note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
+)]
pub const MAP_NORESERVE: ::c_int = 0x0040;
pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
pub const MAP_STACK: ::c_int = 0x0400;
@@ -1135,7 +1207,6 @@ pub const ST_NOSUID: ::c_ulong = 2;
pub const NI_MAXHOST: ::size_t = 1025;
-pub const XU_NGROUPS: ::c_int = 16;
pub const XUCRED_VERSION: ::c_uint = 0;
pub const RTLD_LOCAL: ::c_int = 0;
@@ -1148,30 +1219,30 @@ pub const LOG_SECURITY: ::c_int = 13 << 3;
pub const LOG_CONSOLE: ::c_int = 14 << 3;
pub const LOG_NFACILITIES: ::c_int = 24;
-pub const TIOCEXCL: ::c_uint = 0x2000740d;
-pub const TIOCNXCL: ::c_uint = 0x2000740e;
+pub const TIOCEXCL: ::c_ulong = 0x2000740d;
+pub const TIOCNXCL: ::c_ulong = 0x2000740e;
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
-pub const TIOCGETA: ::c_uint = 0x402c7413;
+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_uint = 0x4004741a;
+pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
-pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456;
+pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
-pub const TIOCTIMESTAMP: ::c_uint = 0x40107459;
-pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a;
+pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
+pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
-pub const TIOCDRAIN: ::c_uint = 0x2000745e;
+pub const TIOCDRAIN: ::c_ulong = 0x2000745e;
pub const TIOCEXT: ::c_ulong = 0x80047460;
-pub const TIOCSCTTY: ::c_uint = 0x20007461;
+pub const TIOCSCTTY: ::c_ulong = 0x20007461;
pub const TIOCCONS: ::c_ulong = 0x80047462;
-pub const TIOCGSID: ::c_uint = 0x40047463;
-pub const TIOCSTAT: ::c_uint = 0x20007465;
+pub const TIOCGSID: ::c_ulong = 0x40047463;
+pub const TIOCSTAT: ::c_ulong = 0x20007465;
pub const TIOCUCNTL: ::c_ulong = 0x80047466;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCGWINSZ: ::c_uint = 0x40087468;
-pub const TIOCMGET: ::c_uint = 0x4004746a;
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
+pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCM_LE: ::c_int = 0x1;
pub const TIOCM_DTR: ::c_int = 0x2;
pub const TIOCM_RTS: ::c_int = 0x4;
@@ -1186,8 +1257,8 @@ pub const TIOCM_RNG: ::c_int = 0x80;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
-pub const TIOCSTART: ::c_uint = 0x2000746e;
-pub const TIOCSTOP: ::c_uint = 0x2000746f;
+pub const TIOCSTART: ::c_ulong = 0x2000746e;
+pub const TIOCSTOP: ::c_ulong = 0x2000746f;
pub const TIOCPKT: ::c_ulong = 0x80047470;
pub const TIOCPKT_DATA: ::c_int = 0x0;
pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
@@ -1197,13 +1268,13 @@ pub const TIOCPKT_START: ::c_int = 0x8;
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
pub const TIOCPKT_IOCTL: ::c_int = 0x40;
-pub const TIOCNOTTY: ::c_uint = 0x20007471;
+pub const TIOCNOTTY: ::c_ulong = 0x20007471;
pub const TIOCSTI: ::c_ulong = 0x80017472;
-pub const TIOCOUTQ: ::c_uint = 0x40047473;
+pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCGPGRP: ::c_uint = 0x40047477;
-pub const TIOCCDTR: ::c_uint = 0x20007478;
-pub const TIOCSDTR: ::c_uint = 0x20007479;
+pub const TIOCGPGRP: ::c_ulong = 0x40047477;
+pub const TIOCCDTR: ::c_ulong = 0x20007478;
+pub const TIOCSDTR: ::c_ulong = 0x20007479;
pub const TTYDISC: ::c_int = 0x0;
pub const SLIPDISC: ::c_int = 0x4;
pub const PPPDISC: ::c_int = 0x5;
@@ -1221,7 +1292,6 @@ pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const FIODTYPE: ::c_ulong = 0x4004667a;
pub const FIOGETLBA: ::c_ulong = 0x40046679;
-pub const FIODGNAME: ::c_ulong = 0x80106678;
pub const B0: speed_t = 0;
pub const B50: speed_t = 50;
@@ -1264,6 +1334,8 @@ pub const ONLRET: ::tcflag_t = 0x40;
pub const CMGROUP_MAX: usize = 16;
+pub const EUI64_LEN: usize = 8;
+
// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h
pub const BPF_ALIGNMENT: usize = SIZEOF_LONG;
@@ -1343,6 +1415,22 @@ pub const TIME_ERROR: ::c_int = 5;
pub const REG_ENOSYS: ::c_int = -1;
pub const REG_ILLSEQ: ::c_int = 17;
+pub const IPC_PRIVATE: ::key_t = 0;
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+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 = 0o400;
+pub const IPC_W: ::c_int = 0o200;
+pub const IPC_M: ::c_int = 0o10000;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
@@ -1359,11 +1447,7 @@ safe_f! {
extern "C" {
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
@@ -1383,19 +1467,20 @@ extern "C" {
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
- pub fn clock_settime(
- clk_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
- pub fn clock_getcpuclockid(
- pid: ::pid_t,
- clk_id: *mut ::clockid_t,
- ) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn endutxent();
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
+ pub fn fexecve(
+ fd: ::c_int,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn getgrent_r(
@@ -1426,6 +1511,8 @@ extern "C" {
flags: ::c_int,
) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
+ pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+ pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
@@ -1444,16 +1531,8 @@ extern "C" {
) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
- pub fn memrchr(
- cx: *const ::c_void,
- c: ::c_int,
- n: ::size_t,
- ) -> *mut ::c_void;
- pub fn mkfifoat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "mknodat@FBSD_1.1"
@@ -1464,35 +1543,20 @@ extern "C" {
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
- pub fn mincore(
- addr: *const ::c_void,
- len: ::size_t,
- vec: *mut ::c_char,
- ) -> ::c_int;
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
- -> *mut ::c_char;
+ pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn ppoll(
fds: *mut ::pollfd,
nfds: ::nfds_t,
timeout: *const ::timespec,
sigmask: *const sigset_t,
) -> ::c_int;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn pthread_attr_get_np(
- tid: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn pthread_attr_get_np(tid: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
@@ -1514,10 +1578,7 @@ extern "C" {
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
- pub fn pthread_condattr_setpshared(
- attr: *mut pthread_condattr_t,
- pshared: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
@@ -1535,30 +1596,46 @@ extern "C" {
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
- pub fn pthread_rwlockattr_setpshared(
- attr: *mut pthread_rwlockattr_t,
- val: ::c_int,
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ attr: *const ::pthread_barrierattr_t,
+ shared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ attr: *mut ::pthread_barrierattr_t,
+ shared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrier_init(
+ barrier: *mut pthread_barrier_t,
+ attr: *const ::pthread_barrierattr_t,
+ count: ::c_uint,
) -> ::c_int;
+ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
- pub fn ptrace(
- request: ::c_int,
- pid: ::pid_t,
- addr: *mut ::c_char,
- data: ::c_int,
+ pub fn pthread_setschedparam(
+ native: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_getschedparam(
+ native: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
) -> ::c_int;
+ pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
+ pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
- pub fn rtprio(
- function: ::c_int,
- pid: ::pid_t,
- rtp: *mut rtprio,
- ) -> ::c_int;
+ pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,
@@ -1566,10 +1643,7 @@ extern "C" {
param: *const ::sched_param,
) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
- pub fn sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sendfile(
fd: ::c_int,
s: ::c_int,
@@ -1581,20 +1655,12 @@ extern "C" {
) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
- pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int)
- -> ::c_int;
+ pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
- pub fn settimeofday(
- tv: *const ::timeval,
- tz: *const ::timezone,
- ) -> ::c_int;
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn setutxent();
- pub fn shm_open(
- name: *const ::c_char,
- oflag: ::c_int,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
@@ -1644,10 +1710,7 @@ extern "C" {
data: *mut ::c_void,
) -> ::c_int;
- pub fn iconv_open(
- tocode: *const ::c_char,
- fromcode: *const ::c_char,
- ) -> iconv_t;
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
@@ -1656,14 +1719,28 @@ extern "C" {
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+ // Added in `FreeBSD` 11.0
+ // Added in `DragonFly BSD` 5.4
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+ pub fn gethostid() -> ::c_long;
+ pub fn sethostid(hostid: ::c_long);
+
+ pub fn eui64_aton(a: *const ::c_char, e: *mut eui64) -> ::c_int;
+ pub fn eui64_ntoa(id: *const eui64, a: *mut ::c_char, len: ::size_t) -> ::c_int;
+ pub fn eui64_ntohost(hostname: *mut ::c_char, len: ::size_t, id: *const eui64) -> ::c_int;
+ pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int;
+
+ pub fn eaccess(path: *const ::c_char, mode: ::c_int) -> ::c_int;
}
#[link(name = "rt")]
extern "C" {
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_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
pub fn mq_receive(
mqd: ::mqd_t,
@@ -1677,11 +1754,7 @@ extern "C" {
msg_len: ::size_t,
msg_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_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,
@@ -1715,6 +1788,62 @@ extern "C" {
winp: *mut ::winsize,
) -> ::pid_t;
pub fn login_tty(fd: ::c_int) -> ::c_int;
+ pub fn fparseln(
+ stream: *mut ::FILE,
+ len: *mut ::size_t,
+ lineno: *mut ::size_t,
+ delim: *const ::c_char,
+ flags: ::c_int,
+ ) -> *mut ::c_char;
+}
+
+#[link(name = "execinfo")]
+extern "C" {
+ pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+ pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+ pub fn backtrace_symbols_fd(
+ addrlist: *const *mut ::c_void,
+ len: ::size_t,
+ fd: ::c_int,
+ ) -> ::c_int;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+ pub fn kvm_open(
+ execfile: *const ::c_char,
+ corefile: *const ::c_char,
+ swapfile: *const ::c_char,
+ flags: ::c_int,
+ errstr: *const ::c_char,
+ ) -> *mut ::kvm_t;
+ pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int;
+ pub fn kvm_getprocs(
+ kd: *mut ::kvm_t,
+ op: ::c_int,
+ arg: ::c_int,
+ cnt: *mut ::c_int,
+ ) -> *mut ::kinfo_proc;
+ pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+ pub fn kvm_openfiles(
+ execfile: *const ::c_char,
+ corefile: *const ::c_char,
+ swapfile: *const ::c_char,
+ flags: ::c_int,
+ errbuf: *mut ::c_char,
+ ) -> *mut ::kvm_t;
+ pub fn kvm_read(
+ kd: *mut ::kvm_t,
+ addr: ::c_ulong,
+ buf: *mut ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
+ pub fn kvm_write(
+ kd: *mut ::kvm_t,
+ addr: ::c_ulong,
+ buf: *const ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
}
cfg_if! {
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 725f5cbf22351..84e572edabee4 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -37,6 +37,8 @@ s! {
#[cfg(not(any(target_os = "macos",
target_os = "ios",
+ target_os = "tvos",
+ target_os = "watchos",
target_os = "netbsd",
target_os = "openbsd")))]
pub pw_fields: ::c_int,
@@ -113,6 +115,13 @@ s! {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -253,6 +262,7 @@ pub const FIOSETOWN: ::c_ulong = 0x8004667c;
pub const FIOGETOWN: ::c_ulong = 0x4004667b;
pub const PATH_MAX: ::c_int = 1024;
+pub const MAXPATHLEN: ::c_int = PATH_MAX;
pub const IOV_MAX: ::c_int = 1024;
@@ -337,7 +347,15 @@ pub const F_RDLCK: ::c_short = 1;
pub const F_UNLCK: ::c_short = 2;
pub const F_WRLCK: ::c_short = 3;
-pub const MNT_FORCE: ::c_int = 0x80000;
+pub const MNT_RDONLY: ::c_int = 0x00000001;
+pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
+pub const MNT_NOEXEC: ::c_int = 0x00000004;
+pub const MNT_NOSUID: ::c_int = 0x00000008;
+pub const MNT_ASYNC: ::c_int = 0x00000040;
+pub const MNT_EXPORTED: ::c_int = 0x00000100;
+pub const MNT_UPDATE: ::c_int = 0x00010000;
+pub const MNT_RELOAD: ::c_int = 0x00040000;
+pub const MNT_FORCE: ::c_int = 0x00080000;
pub const Q_SYNC: ::c_int = 0x600;
pub const Q_QUOTAON: ::c_int = 0x100;
@@ -439,6 +457,12 @@ pub const TCP_MAXSEG: ::c_int = 2;
pub const PIPE_BUF: usize = 512;
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+
+// si_code values for SIGCHLD signal
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
pub const CLD_DUMPED: ::c_int = 3;
@@ -533,7 +557,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
@@ -587,13 +611,8 @@ extern "C" {
)]
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
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;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
@@ -626,11 +645,7 @@ extern "C" {
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
- pub fn getpeereid(
- socket: ::c_int,
- euid: *mut ::uid_t,
- egid: *mut ::gid_t,
- ) -> ::c_int;
+ pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
@@ -644,9 +659,7 @@ extern "C" {
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
@@ -656,11 +669,7 @@ extern "C" {
)]
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
@@ -683,22 +692,14 @@ extern "C" {
link_name = "telldir$INODE64$UNIX2003"
)]
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "msync$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -721,49 +722,29 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "bind$UNIX2003"
)]
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "writev$UNIX2003"
)]
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "readv$UNIX2003"
)]
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sendmsg$UNIX2003"
)]
- pub fn sendmsg(
- fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recvmsg$UNIX2003"
)]
- pub fn recvmsg(
- fd: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn sync();
pub fn getgrgid_r(
@@ -792,11 +773,7 @@ extern "C" {
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 pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
#[cfg_attr(
@@ -805,6 +782,8 @@ extern "C" {
)]
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
pub fn getpwnam_r(
@@ -880,11 +859,7 @@ extern "C" {
old_value: *mut ::itimerval,
) -> ::c_int;
- pub fn regcomp(
- preg: *mut regex_t,
- pattern: *const ::c_char,
- cflags: ::c_int,
- ) -> ::c_int;
+ pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regexec(
preg: *const regex_t,
@@ -902,10 +877,31 @@ extern "C" {
) -> ::size_t;
pub fn regfree(preg: *mut regex_t);
+
+ pub fn arc4random() -> u32;
+ pub fn arc4random_buf(buf: *mut ::c_void, size: ::size_t);
+ pub fn arc4random_uniform(l: u32) -> u32;
+
+ pub fn drand48() -> ::c_double;
+ pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+ pub fn lrand48() -> ::c_long;
+ pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn mrand48() -> ::c_long;
+ pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn srand48(seed: ::c_long);
+ pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn lcong48(p: *mut ::c_ushort);
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
}
cfg_if! {
- if #[cfg(any(target_os = "macos", target_os = "ios"))] {
+ if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] {
mod apple;
pub use self::apple::*;
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 720f10be82ea3..b71531c253db1 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -31,6 +31,10 @@ impl ::Clone for sem {
}
s! {
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ }
+
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
@@ -72,8 +76,14 @@ s! {
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mode: ::mode_t,
+ #[cfg(target_os = "openbsd")]
pub seq: ::c_ushort,
+ #[cfg(target_os = "netbsd")]
+ pub _seq: ::c_ushort,
+ #[cfg(target_os = "openbsd")]
pub key: ::key_t,
+ #[cfg(target_os = "netbsd")]
+ pub _key: ::key_t,
}
pub struct ptrace_io_desc {
@@ -232,6 +242,13 @@ 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 = 0o000400;
+pub const IPC_W: ::c_int = 0o000200;
+pub const IPC_M: ::c_int = 0o010000;
+
+pub const SHM_R: ::c_int = IPC_R;
+pub const SHM_W: ::c_int = IPC_W;
+
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -402,6 +419,11 @@ pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 6;
+// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD
+pub const MNT_NODEV: ::c_int = 0x00000010;
+pub const MNT_LOCAL: ::c_int = 0x00001000;
+pub const MNT_QUOTA: ::c_int = 0x00002000;
+
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
@@ -622,28 +644,13 @@ pub const TIOCM_DSR: ::c_int = 0o0400;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-// Flags for chflags(2)
-pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
-pub const UF_NODUMP: ::c_ulong = 0x00000001;
-pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
-pub const UF_APPEND: ::c_ulong = 0x00000004;
-pub const UF_OPAQUE: ::c_ulong = 0x00000008;
-pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
-pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
-pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
-pub const SF_APPEND: ::c_ulong = 0x00040000;
-
pub const TIMER_ABSTIME: ::c_int = 1;
#[link(name = "util")]
extern "C" {
pub fn setgrent();
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn accept4(
@@ -652,49 +659,21 @@ extern "C" {
addrlen: *mut ::socklen_t,
flags: ::c_int,
) -> ::c_int;
- pub fn mincore(
- addr: *mut ::c_void,
- len: ::size_t,
- vec: *mut ::c_char,
- ) -> ::c_int;
+ pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
- pub fn clock_settime(
- clk_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn __errno() -> *mut ::c_int;
- pub fn shm_open(
- name: *const ::c_char,
- oflag: ::c_int,
- mode: ::mode_t,
- ) -> ::c_int;
- pub fn memrchr(
- cx: *const ::c_void,
- c: ::c_int,
- n: ::size_t,
- ) -> *mut ::c_void;
+ pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
- pub fn mkostemps(
- template: *mut ::c_char,
- suffixlen: ::c_int,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
@@ -703,19 +682,6 @@ extern "C" {
flag: ::c_int,
) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
- pub fn openpty(
- amaster: *mut ::c_int,
- aslave: *mut ::c_int,
- name: *mut ::c_char,
- termp: *mut termios,
- winp: *mut ::winsize,
- ) -> ::c_int;
- pub fn forkpty(
- amaster: *mut ::c_int,
- name: *mut ::c_char,
- termp: *mut termios,
- winp: *mut ::winsize,
- ) -> ::pid_t;
pub fn login_tty(fd: ::c_int) -> ::c_int;
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;
@@ -726,15 +692,8 @@ extern "C" {
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 sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
@@ -745,6 +704,21 @@ extern "C" {
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_setschedparam(
+ native: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_getschedparam(
+ native: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
@@ -759,17 +733,19 @@ extern "C" {
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ 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;
- pub fn shmctl(
- shmid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::shmid_ds,
- ) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+}
+
+extern "C" {
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+ pub fn gethostid() -> ::c_long;
+ pub fn sethostid(hostid: ::c_long) -> ::c_int;
+ pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
diff --git a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
index 58c4cf7c45526..7b895f63238d0 100644
--- a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
@@ -3,8 +3,89 @@ use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
+pub type greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
+s! {
+ pub struct __fregset {
+ #[cfg(libc_union)]
+ pub __qregs: [__c_anonymous__freg; 32],
+ pub __fpcr: u32,
+ pub __fpsr: u32,
+ }
+
+ pub struct mcontext_t {
+ pub __gregs: [::greg_t; 32],
+ pub __fregs: __fregset,
+ __spare: [::greg_t; 8],
+ }
+
+ pub struct ucontext_t {
+ pub uc_flags: ::c_uint,
+ pub uc_link: *mut ucontext_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_stack: ::stack_t,
+ pub uc_mcontext: mcontext_t,
+ }
+}
+
+s_no_extra_traits! {
+ #[cfg(libc_union)]
+ #[repr(align(16))]
+ pub union __c_anonymous__freg {
+ pub __b8: [u8; 16],
+ pub __h16: [u16; 8],
+ pub __s32: [u32; 4],
+ pub __d64: [u64; 2],
+ pub __q128: [u128; 1],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous__freg {
+ fn eq(&self, other: &__c_anonymous__freg) -> bool {
+ unsafe {
+ self.__b8 == other.__b8
+ || self.__h16 == other.__h16
+ || self.__s32 == other.__s32
+ || self.__d64 == other.__d64
+ || self.__q128 == other.__q128
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous__freg {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous__freg {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous__freg")
+ .field("__b8", &self.__b8)
+ .field("__h16", &self.__h16)
+ .field("__s32", &self.__s32)
+ .field("__d64", &self.__d64)
+ .field("__q128", &self.__q128)
+ .finish()
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous__freg {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.__b8.hash(state);
+ self.__h16.hash(state);
+ self.__s32.hash(state);
+ self.__d64.hash(state);
+ self.__q128.hash(state);
+ }
+ }
+ }
+ }
+}
+
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 82b13e9f4d7d0..41f6b23d123ee 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -7,9 +7,13 @@ pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_int;
pub type mqd_t = ::c_int;
type __pthread_spin_t = __cpu_simple_lock_nv_t;
-pub type vm_size_t = ::uintptr_t;
+pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
+pub type cpuid_t = u64;
+pub type cpuset_t = _cpuset;
+pub type pthread_spin_t = ::c_uchar;
+pub type timer_t = ::c_int;
// elf.h
@@ -31,6 +35,14 @@ pub type Elf64_Xword = u64;
pub type iconv_t = *mut ::c_void;
+e! {
+ pub enum fae_action {
+ FAE_OPEN,
+ FAE_DUP2,
+ FAE_CLOSE,
+ }
+}
+
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
@@ -44,6 +56,10 @@ cfg_if! {
}
impl siginfo_t {
+ pub unsafe fn si_addr(&self) -> *mut ::c_void {
+ self.si_addr
+ }
+
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
@@ -57,6 +73,23 @@ impl siginfo_t {
}
(*(self as *const siginfo_t as *const siginfo_timer)).value
}
+
+ pub unsafe fn si_status(&self) -> ::c_int {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ __pad1: ::c_int,
+ _pid: ::pid_t,
+ _uid: ::uid_t,
+ _value: ::sigval,
+ _cpid: ::pid_t,
+ _cuid: ::uid_t,
+ status: ::c_int,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer)).status
+ }
}
s! {
@@ -96,6 +129,11 @@ s! {
pub mq_curmsgs: ::c_long,
}
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
+
pub struct sigset_t {
__bits: [u32; 4],
}
@@ -203,13 +241,19 @@ s! {
ptr_private: *mut ::c_void,
}
+ pub struct pthread_spinlock_t {
+ pts_magic: ::c_uint,
+ pts_spin: ::pthread_spin_t,
+ pts_flags: ::c_int,
+ }
+
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: u32,
pub flags: u32,
pub fflags: u32,
pub data: i64,
- pub udata: ::intptr_t,
+ pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */
}
pub struct dqblk {
@@ -299,6 +343,14 @@ s! {
pub sc_groups: [::gid_t; 1],
}
+ pub struct uucred {
+ pub cr_unused: ::c_ushort,
+ pub cr_uid: ::uid_t,
+ pub cr_gid: ::gid_t,
+ pub cr_ngroups: ::c_int,
+ pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
+ }
+
pub struct unpcbid {
pub unp_pid: ::pid_t,
pub unp_euid: ::uid_t,
@@ -403,6 +455,16 @@ s! {
pub p_align: Elf64_Xword,
}
+ pub struct Aux32Info {
+ pub a_type: Elf32_Word,
+ pub a_v: Elf32_Word,
+ }
+
+ pub struct Aux64Info {
+ pub a_type: Elf64_Word,
+ pub a_v: Elf64_Xword,
+ }
+
// link.h
pub struct dl_phdr_info {
@@ -415,6 +477,238 @@ s! {
pub dlpi_tls_modid: usize,
pub dlpi_tls_data: *mut ::c_void,
}
+
+ pub struct _cpuset {
+ bits: [u32; 0]
+ }
+
+ pub struct accept_filter_arg {
+ pub af_name: [::c_char; 16],
+ af_arg: [[::c_char; 10]; 24],
+ }
+
+ pub struct ki_sigset_t {
+ pub __bits: [u32; 4],
+ }
+
+ pub struct kinfo_proc2 {
+ pub p_forw: u64,
+ pub p_back: u64,
+ pub p_paddr: u64,
+ pub p_addr: u64,
+ pub p_fd: u64,
+ pub p_cwdi: u64,
+ pub p_stats: u64,
+ pub p_limit: u64,
+ pub p_vmspace: u64,
+ pub p_sigacts: u64,
+ pub p_sess: u64,
+ pub p_tsess: u64,
+ pub p_ru: u64,
+ pub p_eflag: i32,
+ pub p_exitsig: i32,
+ pub p_flag: i32,
+ pub p_pid: i32,
+ pub p_ppid: i32,
+ pub p_sid: i32,
+ pub p__pgid: i32,
+ pub p_tpgid: i32,
+ pub p_uid: u32,
+ pub p_ruid: u32,
+ pub p_gid: u32,
+ pub p_rgid: u32,
+ pub p_groups: [u32; KI_NGROUPS as usize],
+ pub p_ngroups: i16,
+ pub p_jobc: i16,
+ pub p_tdev: u32,
+ pub p_estcpu: u32,
+ pub p_rtime_sec: u32,
+ pub p_rtime_usec: u32,
+ pub p_cpticks: i32,
+ pub p_pctcpu: u32,
+ pub p_swtime: u32,
+ pub p_slptime: u32,
+ pub p_schedflags: i32,
+ pub p_uticks: u64,
+ pub p_sticks: u64,
+ pub p_iticks: u64,
+ pub p_tracep: u64,
+ pub p_traceflag: i32,
+ pub p_holdcnt: i32,
+ pub p_siglist: ki_sigset_t,
+ pub p_sigmask: ki_sigset_t,
+ pub p_sigignore: ki_sigset_t,
+ pub p_sigcatch: ki_sigset_t,
+ pub p_stat: i8,
+ pub p_priority: u8,
+ pub p_usrpri: u8,
+ pub p_nice: u8,
+ pub p_xstat: u16,
+ pub p_acflag: u16,
+ pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
+ pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
+ pub p_wchan: u64,
+ pub p_login: [::c_char; KI_MAXLOGNAME as usize],
+ pub p_vm_rssize: i32,
+ pub p_vm_tsize: i32,
+ pub p_vm_dsize: i32,
+ pub p_vm_ssize: i32,
+ pub p_uvalid: i64,
+ pub p_ustart_sec: u32,
+ pub p_ustart_usec: u32,
+ pub p_uutime_sec: u32,
+ pub p_uutime_usec: u32,
+ pub p_ustime_sec: u32,
+ pub p_ustime_usec: u32,
+ pub p_uru_maxrss: u64,
+ pub p_uru_ixrss: u64,
+ pub p_uru_idrss: u64,
+ pub p_uru_isrss: u64,
+ pub p_uru_minflt: u64,
+ pub p_uru_majflt: u64,
+ pub p_uru_nswap: u64,
+ pub p_uru_inblock: u64,
+ pub p_uru_oublock: u64,
+ pub p_uru_msgsnd: u64,
+ pub p_uru_msgrcv: u64,
+ pub p_uru_nsignals: u64,
+ pub p_uru_nvcsw: u64,
+ pub p_uru_nivcsw: u64,
+ pub p_uctime_sec: u32,
+ pub p_uctime_usec: u32,
+ pub p_cpuid: u64,
+ pub p_realflag: u64,
+ pub p_nlwps: u64,
+ pub p_nrlwps: u64,
+ pub p_realstat: u64,
+ pub p_svuid: u32,
+ pub p_svgid: u32,
+ pub p_ename: [::c_char; KI_MAXEMULLEN as usize],
+ pub p_vm_vsize: i64,
+ pub p_vm_msize: i64,
+ }
+
+ pub struct kinfo_lwp {
+ pub l_forw: u64,
+ pub l_back: u64,
+ pub l_laddr: u64,
+ pub l_addr: u64,
+ pub l_lid: i32,
+ pub l_flag: i32,
+ pub l_swtime: u32,
+ pub l_slptime: u32,
+ pub l_schedflags: i32,
+ pub l_holdcnt: i32,
+ pub l_priority: u8,
+ pub l_usrpri: u8,
+ pub l_stat: i8,
+ l_pad1: i8,
+ l_pad2: i32,
+ pub l_wmesg: [::c_char; KI_WMESGLEN as usize],
+ pub l_wchan: u64,
+ pub l_cpuid: u64,
+ pub l_rtime_sec: u32,
+ pub l_rtime_usec: u32,
+ pub l_cpticks: u32,
+ pub l_pctcpu: u32,
+ pub l_pid: u32,
+ pub l_name: [::c_char; KI_LNAMELEN as usize],
+ }
+
+ pub struct kinfo_vmentry {
+ pub kve_start: u64,
+ pub kve_end: u64,
+ pub kve_offset: u64,
+ pub kve_type: u32,
+ pub kve_flags: u32,
+ pub kve_count: u32,
+ pub kve_wired_count: u32,
+ pub kve_advice: u32,
+ pub kve_attributes: u32,
+ pub kve_protection: u32,
+ pub kve_max_protection: u32,
+ pub kve_ref_count: u32,
+ pub kve_inheritance: u32,
+ pub kve_vn_fileid: u64,
+ pub kve_vn_size: u64,
+ pub kve_vn_fsid: u64,
+ pub kve_vn_rdev: u64,
+ pub kve_vn_type: u32,
+ pub kve_vn_mode: u32,
+ pub kve_path: [[::c_char; 32]; 32],
+ }
+
+ pub struct __c_anonymous_posix_spawn_fae_open {
+ pub path: *mut ::c_char,
+ pub oflag: ::c_int,
+ pub mode: ::mode_t,
+ }
+
+ pub struct __c_anonymous_posix_spawn_fae_dup2 {
+ pub newfildes: ::c_int,
+ }
+
+ pub struct posix_spawnattr_t {
+ pub sa_flags: ::c_short,
+ pub sa_pgroup: ::pid_t,
+ pub sa_schedparam: ::sched_param,
+ pub sa_schedpolicy: ::c_int,
+ pub sa_sigdefault: sigset_t,
+ pub sa_sigmask: sigset_t,
+ }
+
+ pub struct posix_spawn_file_actions_entry_t {
+ pub fae_action: fae_action,
+ pub fae_fildes: ::c_int,
+ #[cfg(libc_union)]
+ pub fae_data: __c_anonymous_posix_spawn_fae,
+ }
+
+ pub struct posix_spawn_file_actions_t {
+ pub size: ::c_uint,
+ pub len: ::c_uint,
+ #[cfg(libc_union)]
+ pub fae: *mut posix_spawn_file_actions_entry_t,
+ }
+
+ pub struct ptrace_lwpinfo {
+ pub pl_lwpid: lwpid_t,
+ pub pl_event: ::c_int,
+ }
+
+ pub struct ptrace_lwpstatus {
+ pub pl_lwpid: lwpid_t,
+ pub pl_sigpend: sigset_t,
+ pub pl_sigmask: sigset_t,
+ pub pl_name: [::c_char; 20],
+ pub pl_private: *mut ::c_void,
+ }
+
+ pub struct ptrace_siginfo {
+ pub psi_siginfo: siginfo_t,
+ pub psi_lwpid: lwpid_t,
+ }
+
+ pub struct ptrace_event {
+ pub pe_set_event: ::c_int,
+ }
+
+ pub struct sysctldesc {
+ pub descr_num: i32,
+ pub descr_ver: u32,
+ pub descr_len: u32,
+ pub descr_str: [::c_char; 1],
+ }
+
+ pub struct ifreq {
+ pub _priv: [[::c_char; 6]; 24],
+ }
+
+ pub struct ifconf {
+ pub ifc_len: ::c_int,
+ #[cfg(libc_union)]
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ }
}
s_no_extra_traits! {
@@ -427,7 +721,7 @@ s_no_extra_traits! {
pub ut_session: u16,
pub ut_type: u16,
pub ut_pid: ::pid_t,
- pub ut_exit: __exit_status,
+ pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported
pub ut_ss: sockaddr_storage,
pub ut_tv: ::timeval,
pub ut_pad: [u8; _UTX_PADSIZE],
@@ -445,7 +739,6 @@ s_no_extra_traits! {
pub ipi_ifindex: ::c_uint,
}
- #[repr(packed)]
pub struct arphdr {
pub ar_hrd: u16,
pub ar_pro: u16,
@@ -454,7 +747,6 @@ s_no_extra_traits! {
pub ar_op: u16,
}
- #[repr(packed)]
pub struct in_addr {
pub s_addr: ::in_addr_t,
}
@@ -529,6 +821,18 @@ s_no_extra_traits! {
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::c_void
}
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_posix_spawn_fae {
+ pub open: __c_anonymous_posix_spawn_fae_open,
+ pub dup2: __c_anonymous_posix_spawn_fae_dup2,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifc_ifcu {
+ pub ifcu_buf: *mut ::c_void,
+ pub ifcu_req: *mut ifreq,
+ }
}
cfg_if! {
@@ -956,6 +1260,76 @@ cfg_if! {
self.sigev_notify_attributes.hash(state);
}
}
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_posix_spawn_fae {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_posix_spawn_fae {
+ fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool {
+ unsafe {
+ self.open == other.open
+ || self.dup2 == other.dup2
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_posix_fae")
+ .field("open", &self.open)
+ .field("dup2", &self.dup2)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.open.hash(state);
+ self.dup2.hash(state);
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifc_ifcu {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifc_ifcu {
+ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+ unsafe {
+ self.ifcu_buf == other.ifcu_buf
+ || self.ifcu_req == other.ifcu_req
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_ifc_ifcu")
+ .field("ifcu_buf", &self.ifcu_buf)
+ .field("ifcu_req", &self.ifcu_req)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.ifcu_buf.hash(state);
+ self.ifcu_req.hash(state);
+ }
+ }
+ }
}
}
@@ -965,6 +1339,36 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
+pub const AT_NULL: ::c_int = 0;
+pub const AT_IGNORE: ::c_int = 1;
+pub const AT_EXECFD: ::c_int = 2;
+pub const AT_PHDR: ::c_int = 3;
+pub const AT_PHENT: ::c_int = 4;
+pub const AT_PHNUM: ::c_int = 5;
+pub const AT_PAGESZ: ::c_int = 6;
+pub const AT_BASE: ::c_int = 7;
+pub const AT_FLAGS: ::c_int = 8;
+pub const AT_ENTRY: ::c_int = 9;
+pub const AT_DCACHEBSIZE: ::c_int = 10;
+pub const AT_ICACHEBSIZE: ::c_int = 11;
+pub const AT_UCACHEBSIZE: ::c_int = 12;
+pub const AT_STACKBASE: ::c_int = 13;
+pub const AT_EUID: ::c_int = 2000;
+pub const AT_RUID: ::c_int = 2001;
+pub const AT_EGID: ::c_int = 2002;
+pub const AT_RGID: ::c_int = 2003;
+pub const AT_SUN_LDELF: ::c_int = 2004;
+pub const AT_SUN_LDSHDR: ::c_int = 2005;
+pub const AT_SUN_LDNAME: ::c_int = 2006;
+pub const AT_SUN_LDPGSIZE: ::c_int = 2007;
+pub const AT_SUN_PLATFORM: ::c_int = 2008;
+pub const AT_SUN_HWCAP: ::c_int = 2009;
+pub const AT_SUN_IFLUSH: ::c_int = 2010;
+pub const AT_SUN_CPU: ::c_int = 2011;
+pub const AT_SUN_EMUL_ENTRY: ::c_int = 2012;
+pub const AT_SUN_EMUL_EXECFD: ::c_int = 2013;
+pub const AT_SUN_EXECNAME: ::c_int = 2014;
+
pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
@@ -1024,6 +1428,30 @@ pub const F_CLOSEM: ::c_int = 10;
pub const F_GETNOSIGPIPE: ::c_int = 13;
pub const F_SETNOSIGPIPE: ::c_int = 14;
pub const F_MAXFD: ::c_int = 11;
+pub const F_GETPATH: ::c_int = 15;
+
+pub const FUTEX_WAIT: ::c_int = 0;
+pub const FUTEX_WAKE: ::c_int = 1;
+pub const FUTEX_FD: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_CMP_REQUEUE: ::c_int = 4;
+pub const FUTEX_WAKE_OP: ::c_int = 5;
+pub const FUTEX_LOCK_PI: ::c_int = 6;
+pub const FUTEX_UNLOCK_PI: ::c_int = 7;
+pub const FUTEX_TRYLOCK_PI: ::c_int = 8;
+pub const FUTEX_WAIT_BITSET: ::c_int = 9;
+pub const FUTEX_WAKE_BITSET: ::c_int = 10;
+pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
+pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 1 << 7;
+pub const FUTEX_CLOCK_REALTIME: ::c_int = 1 << 8;
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+pub const FUTEX_WAITERS: u32 = 1 << 31;
+pub const FUTEX_OWNER_DIED: u32 = 1 << 30;
+pub const FUTEX_SYNCOBJ_1: u32 = 1 << 29;
+pub const FUTEX_SYNCOBJ_0: u32 = 1 << 28;
+pub const FUTEX_TID_MASK: u32 = (1 << 28) - 1;
+pub const FUTEX_BITSET_MATCH_ANY: u32 = !0;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
@@ -1140,10 +1568,7 @@ pub const IPPROTO_VRRP: ::c_int = 112;
/// Common Address Resolution Protocol
pub const IPPROTO_CARP: ::c_int = 112;
/// L2TPv3
-// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16,
-// but isn't yet supported by the NetBSD rumprun kernel image used for
-// libc testing.
-//pub const IPPROTO_L2TP: ::c_int = 115;
+pub const IPPROTO_L2TP: ::c_int = 115;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
/// PFSYNC
@@ -1192,6 +1617,18 @@ pub const MAP_RENAME: ::c_int = 0x20;
pub const MAP_NORESERVE: ::c_int = 0x40;
pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
pub const MAP_WIRED: ::c_int = 0x800;
+pub const MAP_STACK: ::c_int = 0x2000;
+// map alignment aliases for MAP_ALIGNED
+pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
+pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT;
+// mremap flag
+pub const MAP_REMAPDUP: ::c_int = 0x004;
pub const DCCP_TYPE_REQUEST: ::c_int = 0;
pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
@@ -1348,6 +1785,23 @@ pub const BIOCSDLT: ::c_ulong = 0x80044278;
pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
+//
+pub const MNT_UNION: ::c_int = 0x00000020;
+pub const MNT_NOCOREDUMP: ::c_int = 0x00008000;
+pub const MNT_RELATIME: ::c_int = 0x00020000;
+pub const MNT_IGNORE: ::c_int = 0x00100000;
+pub const MNT_NFS4ACLS: ::c_int = 0x00200000;
+pub const MNT_DISCARD: ::c_int = 0x00800000;
+pub const MNT_EXTATTR: ::c_int = 0x01000000;
+pub const MNT_LOG: ::c_int = 0x02000000;
+pub const MNT_NOATIME: ::c_int = 0x04000000;
+pub const MNT_AUTOMOUNTED: ::c_int = 0x10000000;
+pub const MNT_SYMPERM: ::c_int = 0x20000000;
+pub const MNT_NODEVMTIME: ::c_int = 0x40000000;
+pub const MNT_SOFTDEP: ::c_int = 0x80000000;
+pub const MNT_POSIX1EACLS: ::c_int = 0x00000800;
+pub const MNT_ACLS: ::c_int = MNT_POSIX1EACLS;
+
//
pub const NTP_API: ::c_int = 4;
pub const MAXPHASE: ::c_long = 500000000;
@@ -1400,6 +1854,13 @@ pub const TIME_OOP: ::c_int = 3;
pub const TIME_WAIT: ::c_int = 4;
pub const TIME_ERROR: ::c_int = 5;
+pub const LITTLE_ENDIAN: ::c_int = 1234;
+pub const BIG_ENDIAN: ::c_int = 4321;
+
+pub const PL_EVENT_NONE: ::c_int = 0;
+pub const PL_EVENT_SIGNAL: ::c_int = 1;
+pub const PL_EVENT_SUSPENDED: ::c_int = 2;
+
cfg_if! {
if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
target_arch = "x86", target_arch = "x86_64"))] {
@@ -1453,6 +1914,11 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const SCHED_NONE: ::c_int = -1;
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
pub const EVFILT_AIO: u32 = 2;
pub const EVFILT_PROC: u32 = 4;
pub const EVFILT_READ: u32 = 0;
@@ -1493,7 +1959,23 @@ pub const NOTE_CHILD: u32 = 0x00000004;
pub const TMP_MAX: ::c_uint = 308915776;
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_SRV: ::c_int = 0x00000800;
+
pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NUMERICHOST: ::c_int = 0x000000002;
+pub const NI_NAMEREQD: ::c_int = 0x000000004;
+pub const NI_NUMERICSERV: ::c_int = 0x000000008;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+pub const NI_WITHSCOPEID: ::c_int = 0x00000020;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
pub const RTLD_NOLOAD: ::c_int = 0x2000;
pub const RTLD_LOCAL: ::c_int = 0x200;
@@ -1647,6 +2129,8 @@ pub const KERN_PROC_NARGV: ::c_int = 2;
pub const KERN_PROC_ENV: ::c_int = 3;
pub const KERN_PROC_NENV: ::c_int = 4;
pub const KERN_PROC_PATHNAME: ::c_int = 5;
+pub const VM_PROC: ::c_int = 16;
+pub const VM_PROC_MAP: ::c_int = 1;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
@@ -1741,12 +2225,101 @@ pub const PT_SYSCALLEMU: ::c_int = 15;
pub const PT_SET_EVENT_MASK: ::c_int = 16;
pub const PT_GET_EVENT_MASK: ::c_int = 17;
pub const PT_GET_PROCESS_STATE: ::c_int = 18;
+pub const PT_SET_SIGINFO: ::c_int = 19;
+pub const PT_GET_SIGINFO: ::c_int = 20;
+pub const PT_RESUME: ::c_int = 21;
+pub const PT_SUSPEND: ::c_int = 23;
+pub const PT_STOP: ::c_int = 23;
+pub const PT_LWPSTATUS: ::c_int = 24;
+pub const PT_LWPNEXT: ::c_int = 25;
+pub const PT_SET_SIGPASS: ::c_int = 26;
+pub const PT_GET_SIGPASS: ::c_int = 27;
pub const PT_FIRSTMACH: ::c_int = 32;
+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;
+pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40;
+
// Flags for chflags(2)
-pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
+pub const SF_APPEND: ::c_ulong = 0x00040000;
+pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
+pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
pub const SF_LOG: ::c_ulong = 0x00400000;
+pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
pub const SF_SNAPINVAL: ::c_ulong = 0x00800000;
+pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
+pub const UF_APPEND: ::c_ulong = 0x00000004;
+pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
+pub const UF_NODUMP: ::c_ulong = 0x00000001;
+pub const UF_OPAQUE: ::c_ulong = 0x00000008;
+pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
+
+// sys/sysctl.h
+pub const KVME_PROT_READ: ::c_int = 0x00000001;
+pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
+
+pub const KVME_FLAG_COW: ::c_int = 0x00000001;
+pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
+pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x000000004;
+pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
+pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
+pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;
+
+pub const NGROUPS_MAX: ::c_int = 16;
+
+pub const KI_NGROUPS: ::c_int = 16;
+pub const KI_MAXCOMLEN: ::c_int = 24;
+pub const KI_WMESGLEN: ::c_int = 8;
+pub const KI_MAXLOGNAME: ::c_int = 24;
+pub const KI_MAXEMULLEN: ::c_int = 16;
+pub const KI_LNAMELEN: ::c_int = 20;
+
+// sys/lwp.h
+pub const LSIDL: ::c_int = 1;
+pub const LSRUN: ::c_int = 2;
+pub const LSSLEEP: ::c_int = 3;
+pub const LSSTOP: ::c_int = 4;
+pub const LSZOMB: ::c_int = 5;
+pub const LSONPROC: ::c_int = 7;
+pub const LSSUSPENDED: ::c_int = 8;
+
+pub const _REG_RDI: ::c_int = 0;
+pub const _REG_RSI: ::c_int = 1;
+pub const _REG_RDX: ::c_int = 2;
+pub const _REG_RCX: ::c_int = 3;
+pub const _REG_R8: ::c_int = 4;
+pub const _REG_R9: ::c_int = 5;
+pub const _REG_R10: ::c_int = 6;
+pub const _REG_R11: ::c_int = 7;
+pub const _REG_R12: ::c_int = 8;
+pub const _REG_R13: ::c_int = 9;
+pub const _REG_R14: ::c_int = 10;
+pub const _REG_R15: ::c_int = 11;
+pub const _REG_RBP: ::c_int = 12;
+pub const _REG_RBX: ::c_int = 13;
+pub const _REG_RAX: ::c_int = 14;
+pub const _REG_GS: ::c_int = 15;
+pub const _REG_FS: ::c_int = 16;
+pub const _REG_ES: ::c_int = 17;
+pub const _REG_DS: ::c_int = 18;
+pub const _REG_TRAPNO: ::c_int = 19;
+pub const _REG_ERR: ::c_int = 20;
+pub const _REG_RIP: ::c_int = 21;
+pub const _REG_CS: ::c_int = 22;
+pub const _REG_RFLAGS: ::c_int = 23;
+pub const _REG_RSP: ::c_int = 24;
+pub const _REG_SS: ::c_int = 25;
+
+// sys/xattr.h
+pub const XATTR_CREATE: ::c_int = 0x01;
+pub const XATTR_REPLACE: ::c_int = 0x02;
+// sys/extattr.h
+pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
@@ -1802,6 +2375,14 @@ f! {
};
::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
}
+
+ pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
+ x << 3
+ }
+
+ pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
+ (x >> 3) & 0x7
+ }
}
safe_f! {
@@ -1820,6 +2401,16 @@ safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0xffff
}
+
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= (major << 8) & 0x000ff00;
+ dev |= (minor << 12) & 0xfff00000;
+ dev |= minor & 0xff;
+ dev
+ }
}
extern "C" {
@@ -1831,6 +2422,8 @@ extern "C" {
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
+
+ pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
}
#[link(name = "rt")]
@@ -1860,6 +2453,30 @@ extern "C" {
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+ pub fn execvpe(
+ file: *const ::c_char,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
+
+ pub fn extattr_list_fd(
+ fd: ::c_int,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
+ pub fn extattr_list_file(
+ path: *const ::c_char,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
+ pub fn extattr_list_link(
+ path: *const ::c_char,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t,
+ ) -> ::ssize_t;
pub fn extattr_delete_fd(
fd: ::c_int,
attrnamespace: ::c_int,
@@ -1926,6 +2543,20 @@ extern "C" {
attrnamespace: *mut ::c_int,
) -> ::c_int;
+ pub fn openpty(
+ amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut ::termios,
+ winp: *mut ::winsize,
+ ) -> ::c_int;
+ pub fn forkpty(
+ amaster: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut ::termios,
+ winp: *mut ::winsize,
+ ) -> ::pid_t;
+
#[link_name = "__lutimes50"]
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
#[link_name = "__gettimeofday50"]
@@ -1939,11 +2570,7 @@ extern "C" {
sevlen: ::socklen_t,
flags: ::c_int,
) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn sysctl(
name: *const ::c_int,
namelen: ::c_uint,
@@ -1979,8 +2606,7 @@ extern "C" {
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_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
pub fn mq_receive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
@@ -1993,11 +2619,7 @@ extern "C" {
msg_len: ::size_t,
msg_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_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
#[link_name = "__mq_timedreceive50"]
pub fn mq_timedreceive(
mqd: ::mqd_t,
@@ -2015,25 +2637,16 @@ extern "C" {
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,
- data: ::c_int,
- ) -> ::c_int;
+ pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int;
+ pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+ pub fn pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_setname_np(
t: ::pthread_t,
name: *const ::c_char,
arg: *const ::c_void,
) -> ::c_int;
- pub fn pthread_attr_get_np(
- thread: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
- pub fn pthread_getattr_np(
- native: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
+ pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+ pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
@@ -2043,6 +2656,24 @@ extern "C" {
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t,
) -> ::c_int;
+ pub fn pthread_getaffinity_np(
+ thread: ::pthread_t,
+ size: ::size_t,
+ set: *mut cpuset_t,
+ ) -> ::c_int;
+ pub fn pthread_setaffinity_np(
+ thread: ::pthread_t,
+ size: ::size_t,
+ set: *mut cpuset_t,
+ ) -> ::c_int;
+
+ pub fn _cpuset_create() -> *mut cpuset_t;
+ pub fn _cpuset_destroy(set: *mut cpuset_t);
+ pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
+ pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
+ pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int;
+ pub fn _cpuset_size(set: *const cpuset_t) -> ::size_t;
+ pub fn _cpuset_zero(set: *mut cpuset_t);
#[link_name = "__sigtimedwait50"]
pub fn sigtimedwait(
set: *const sigset_t,
@@ -2050,19 +2681,24 @@ extern "C" {
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+ pub fn waitid(
+ idtype: idtype_t,
+ id: ::id_t,
+ infop: *mut ::siginfo_t,
+ options: ::c_int,
+ ) -> ::c_int;
+
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
#[link_name = "__settimeofday50"]
pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn kqueue1(flags: ::c_int) -> ::c_int;
+
pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
@@ -2098,10 +2734,11 @@ extern "C" {
data: *mut ::c_void,
) -> ::c_int;
- pub fn iconv_open(
- tocode: *const ::c_char,
- fromcode: *const ::c_char,
- ) -> iconv_t;
+ // dlfcn.h
+
+ pub fn _dlauxinfo() -> *mut ::c_void;
+
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
@@ -2110,6 +2747,129 @@ extern "C" {
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+ pub fn timer_create(
+ clockid: ::clockid_t,
+ sevp: *mut ::sigevent,
+ timerid: *mut ::timer_t,
+ ) -> ::c_int;
+ pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: ::timer_t,
+ flags: ::c_int,
+ new_value: *const ::itimerspec,
+ old_value: *mut ::itimerspec,
+ ) -> ::c_int;
+
+ // Added in `NetBSD` 7.0
+ pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
+ pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+ pub fn setproctitle(fmt: *const ::c_char, ...);
+ pub fn mremap(
+ oldp: *mut ::c_void,
+ oldsize: ::size_t,
+ newp: *mut ::c_void,
+ newsize: ::size_t,
+ flags: ::c_int,
+ ) -> *mut ::c_void;
+
+ pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+ pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+ pub fn sched_setscheduler(
+ pid: ::pid_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+
+ #[link_name = "__pollts50"]
+ pub fn pollts(
+ fds: *mut ::pollfd,
+ nfds: ::nfds_t,
+ ts: *const ::timespec,
+ sigmask: *const ::sigset_t,
+ ) -> ::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;
}
#[link(name = "util")]
@@ -2129,16 +2889,8 @@ extern "C" {
) -> ::c_int;
pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
- pub fn getlastlogx(
- fname: *const ::c_char,
- uid: ::uid_t,
- ll: *mut lastlogx,
- ) -> *mut lastlogx;
- pub fn updlastlogx(
- fname: *const ::c_char,
- uid: ::uid_t,
- ll: *mut lastlogx,
- ) -> ::c_int;
+ pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+ pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
@@ -2154,6 +2906,147 @@ extern "C" {
pub fn setutent();
pub fn endutent();
pub fn getutent() -> *mut utmp;
+
+ pub fn efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE;
+ pub fn emalloc(n: ::size_t) -> *mut ::c_void;
+ pub fn ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void;
+ pub fn erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void;
+ pub fn ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t);
+ pub fn estrdup(s: *const ::c_char) -> *mut ::c_char;
+ pub fn estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char;
+ pub fn estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
+ pub fn estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
+ pub fn estrtoi(
+ nptr: *const ::c_char,
+ base: ::c_int,
+ lo: ::intmax_t,
+ hi: ::intmax_t,
+ ) -> ::intmax_t;
+ pub fn estrtou(
+ nptr: *const ::c_char,
+ base: ::c_int,
+ lo: ::uintmax_t,
+ hi: ::uintmax_t,
+ ) -> ::uintmax_t;
+ pub fn easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
+ pub fn evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
+ pub fn esetfunc(
+ cb: ::Option,
+ ) -> ::Option;
+ pub fn secure_path(path: *const ::c_char) -> ::c_int;
+ pub fn snprintb(
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ fmt: *const ::c_char,
+ val: u64,
+ ) -> ::c_int;
+ pub fn snprintb_m(
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ fmt: *const ::c_char,
+ val: u64,
+ max: ::size_t,
+ ) -> ::c_int;
+
+ pub fn getbootfile() -> *const ::c_char;
+ pub fn getbyteorder() -> ::c_int;
+ pub fn getdiskrawname(
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ name: *const ::c_char,
+ ) -> *const ::c_char;
+ pub fn getdiskcookedname(
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ name: *const ::c_char,
+ ) -> *const ::c_char;
+ pub fn getfsspecname(
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ spec: *const ::c_char,
+ ) -> *const ::c_char;
+
+ pub fn strpct(
+ buf: *mut ::c_char,
+ bufsiz: ::size_t,
+ numerator: ::uintmax_t,
+ denominator: ::uintmax_t,
+ precision: ::size_t,
+ ) -> *mut ::c_char;
+ pub fn strspct(
+ buf: *mut ::c_char,
+ bufsiz: ::size_t,
+ numerator: ::intmax_t,
+ denominator: ::intmax_t,
+ precision: ::size_t,
+ ) -> *mut ::c_char;
+ #[link_name = "__login50"]
+ pub fn login(ut: *const utmp);
+ #[link_name = "__loginx50"]
+ pub fn loginx(ut: *const utmpx);
+ pub fn logout(line: *const ::c_char);
+ pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int);
+ pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char);
+ pub fn logwtmpx(
+ line: *const ::c_char,
+ name: *const ::c_char,
+ host: *const ::c_char,
+ status: ::c_int,
+ tpe: ::c_int,
+ );
+
+ pub fn getxattr(
+ path: *const ::c_char,
+ name: *const ::c_char,
+ value: *mut ::c_void,
+ size: ::size_t,
+ ) -> ::ssize_t;
+ pub fn lgetxattr(
+ path: *const ::c_char,
+ name: *const ::c_char,
+ value: *mut ::c_void,
+ size: ::size_t,
+ ) -> ::ssize_t;
+ pub fn fgetxattr(
+ filedes: ::c_int,
+ name: *const ::c_char,
+ value: *mut ::c_void,
+ size: ::size_t,
+ ) -> ::ssize_t;
+ pub fn setxattr(
+ path: *const ::c_char,
+ name: *const ::c_char,
+ value: *const ::c_void,
+ size: ::size_t,
+ ) -> ::c_int;
+ pub fn lsetxattr(
+ path: *const ::c_char,
+ name: *const ::c_char,
+ value: *const ::c_void,
+ size: ::size_t,
+ ) -> ::c_int;
+ pub fn fsetxattr(
+ filedes: ::c_int,
+ name: *const ::c_char,
+ value: *const ::c_void,
+ size: ::size_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+ pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+ pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+ pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+ pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+ pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+
+ pub fn string_to_flags(
+ string_p: *mut *mut ::c_char,
+ setp: *mut ::c_ulong,
+ clrp: *mut ::c_ulong,
+ ) -> ::c_int;
+ pub fn flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int;
+
+ pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}
cfg_if! {
diff --git a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
index 0860d4f6c7b57..2f6e4454577a0 100644
--- a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
@@ -3,8 +3,25 @@ use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
+pub type c___greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
+s! {
+ pub struct mcontext_t {
+ pub __gregs: [c___greg_t; 26],
+ pub _mc_tlsbase: c___greg_t,
+ pub __fpregs: [[::c_char;32]; 16],
+ }
+
+ pub struct ucontext_t {
+ pub uc_flags: ::c_uint,
+ pub uc_link: *mut ::ucontext_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_stack: ::stack_t,
+ pub uc_mcontext: ::mcontext_t,
+ }
+}
+
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
diff --git a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
index 99350ec8dc3d4..2bc82e486c596 100644
--- a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
@@ -1,6 +1,20 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
+pub type ucontext_t = sigcontext;
+
+s! {
+ pub struct sigcontext {
+ __sc_unused: ::c_int,
+ pub sc_mask: ::c_int,
+ pub sc_sp: ::c_ulong,
+ pub sc_lr: ::c_ulong,
+ pub sc_elr: ::c_ulong,
+ pub sc_spsr: ::c_ulong,
+ pub sc_x: [::c_ulong; 30],
+ pub sc_cookie: ::c_long,
+ }
+}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
diff --git a/src/unix/bsd/netbsdlike/openbsd/arm.rs b/src/unix/bsd/netbsdlike/openbsd/arm.rs
new file mode 100644
index 0000000000000..f1ab365d1cd1b
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsd/arm.rs
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 8 - 1;
+ }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/src/unix/bsd/netbsdlike/openbsd/mips64.rs
new file mode 100644
index 0000000000000..15803ced09a08
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsd/mips64.rs
@@ -0,0 +1,8 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+
+#[doc(hidden)]
+pub const _ALIGNBYTES: usize = 7;
+
+pub const _MAX_PAGE_SHIFT: u32 = 14;
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index a4b1d31194a55..3c966990a50cd 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -14,6 +14,7 @@ pub type pthread_cond_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_rwlock_t = *mut ::c_void;
pub type pthread_rwlockattr_t = *mut ::c_void;
+pub type pthread_spinlock_t = ::uintptr_t;
pub type caddr_t = *mut ::c_char;
// elf.h
@@ -34,6 +35,11 @@ pub type Elf64_Sxword = i64;
pub type Elf64_Word = u32;
pub type Elf64_Xword = u64;
+// search.h
+
+pub type ENTRY = entry;
+pub type ACTION = ::c_uint;
+
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
@@ -47,6 +53,12 @@ cfg_if! {
}
s! {
+ pub struct ip_mreqn {
+ pub imr_multiaddr: in_addr,
+ pub imr_address: in_addr,
+ pub imr_ifindex: ::c_int,
+ }
+
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_matchc: ::size_t,
@@ -208,6 +220,12 @@ s! {
pub sin_zero: [i8; 8],
}
+ pub struct splice {
+ pub sp_fd: ::c_int,
+ pub sp_max: ::off_t,
+ pub sp_idle: ::timeval,
+ }
+
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
@@ -383,9 +401,143 @@ s! {
pub dlpi_phdr: *const Elf_Phdr,
pub dlpi_phnum: Elf_Half,
}
+
+ // sys/sysctl.h
+ pub struct kinfo_proc {
+ pub p_forw: u64,
+ pub p_back: u64,
+ pub p_paddr: u64,
+ pub p_addr: u64,
+ pub p_fd: u64,
+ pub p_stats: u64,
+ pub p_limit: u64,
+ pub p_vmspace: u64,
+ pub p_sigacts: u64,
+ pub p_sess: u64,
+ pub p_tsess: u64,
+ pub p_ru: u64,
+ pub p_eflag: i32,
+ pub p_exitsig: i32,
+ pub p_flag: i32,
+ pub p_pid: i32,
+ pub p_ppid: i32,
+ pub p_sid: i32,
+ pub p__pgid: i32,
+ pub p_tpgid: i32,
+ pub p_uid: u32,
+ pub p_ruid: u32,
+ pub p_gid: u32,
+ pub p_rgid: u32,
+ pub p_groups: [u32; KI_NGROUPS as usize],
+ pub p_ngroups: i16,
+ pub p_jobc: i16,
+ pub p_tdev: u32,
+ pub p_estcpu: u32,
+ pub p_rtime_sec: u32,
+ pub p_rtime_usec: u32,
+ pub p_cpticks: i32,
+ pub p_pctcpu: u32,
+ pub p_swtime: u32,
+ pub p_slptime: u32,
+ pub p_schedflags: i32,
+ pub p_uticks: u64,
+ pub p_sticks: u64,
+ pub p_iticks: u64,
+ pub p_tracep: u64,
+ pub p_traceflag: i32,
+ pub p_holdcnt: i32,
+ pub p_siglist: i32,
+ pub p_sigmask: u32,
+ pub p_sigignore: u32,
+ pub p_sigcatch: u32,
+ pub p_stat: i8,
+ pub p_priority: u8,
+ pub p_usrpri: u8,
+ pub p_nice: u8,
+ pub p_xstat: u16,
+ pub p_spare: u16,
+ pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
+ pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
+ pub p_wchan: u64,
+ pub p_login: [::c_char; KI_MAXLOGNAME as usize],
+ pub p_vm_rssize: i32,
+ pub p_vm_tsize: i32,
+ pub p_vm_dsize: i32,
+ pub p_vm_ssize: i32,
+ pub p_uvalid: i64,
+ pub p_ustart_sec: u64,
+ pub p_ustart_usec: u32,
+ pub p_uutime_sec: u32,
+ pub p_uutime_usec: u32,
+ pub p_ustime_sec: u32,
+ pub p_ustime_usec: u32,
+ pub p_uru_maxrss: u64,
+ pub p_uru_ixrss: u64,
+ pub p_uru_idrss: u64,
+ pub p_uru_isrss: u64,
+ pub p_uru_minflt: u64,
+ pub p_uru_majflt: u64,
+ pub p_uru_nswap: u64,
+ pub p_uru_inblock: u64,
+ pub p_uru_oublock: u64,
+ pub p_uru_msgsnd: u64,
+ pub p_uru_msgrcv: u64,
+ pub p_uru_nsignals: u64,
+ pub p_uru_nvcsw: u64,
+ pub p_uru_nivcsw: u64,
+ pub p_uctime_sec: u32,
+ pub p_uctime_usec: u32,
+ pub p_psflags: u32,
+ pub p_acflag: u32,
+ pub p_svuid: u32,
+ pub p_svgid: u32,
+ pub p_emul: [::c_char; KI_EMULNAMELEN as usize],
+ pub p_rlim_rss_cur: u64,
+ pub p_cpuid: u64,
+ pub p_vm_map_size: u64,
+ pub p_tid: i32,
+ pub p_rtableid: u32,
+ pub p_pledge: u64,
+ }
+
+ pub struct kinfo_vmentry {
+ pub kve_start: ::c_ulong,
+ pub kve_end: ::c_ulong,
+ pub kve_guard: ::c_ulong,
+ pub kve_fspace: ::c_ulong,
+ pub kve_fspace_augment: ::c_ulong,
+ pub kve_offset: u64,
+ pub kve_wired_count: ::c_int,
+ pub kve_etype: ::c_int,
+ pub kve_protection: ::c_int,
+ pub kve_max_protection: ::c_int,
+ pub kve_advice: ::c_int,
+ pub kve_inheritance: ::c_int,
+ pub kve_flags: u8,
+ }
+
+ pub struct ptrace_state {
+ pub pe_report_event: ::c_int,
+ pub pe_other_pid: ::pid_t,
+ pub pe_tid: ::pid_t,
+ }
+
+ pub struct ptrace_thread_state {
+ pub pts_tid: ::pid_t,
+ }
+
+ // search.h
+ pub struct entry {
+ pub key: *mut ::c_char,
+ pub data: *mut ::c_void,
+ }
}
impl siginfo_t {
+ pub unsafe fn si_addr(&self) -> *mut ::c_char {
+ self.si_addr
+ }
+
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
@@ -936,6 +1088,10 @@ pub const NET_RT_STATS: ::c_int = 4;
pub const NET_RT_TABLE: ::c_int = 5;
pub const NET_RT_IFNAMES: ::c_int = 6;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.95",
+ note = "Possibly increasing over the releases and might not be so used in the field"
+)]
pub const NET_RT_MAXID: ::c_int = 7;
pub const IPV6_JOIN_GROUP: ::c_int = 12;
@@ -1106,6 +1262,10 @@ pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
pub const FD_SETSIZE: usize = 1024;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_OTHER: ::c_int = 2;
+pub const SCHED_RR: ::c_int = 3;
+
pub const ST_NOSUID: ::c_ulong = 2;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
@@ -1137,7 +1297,9 @@ pub const EV_DISPATCH: u16 = 0x80;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
-pub const EV_SYSFLAGS: u16 = 0xf000;
+
+#[deprecated(since = "0.2.113", note = "Not stable across OS versions")]
+pub const EV_SYSFLAGS: u16 = 0xf800;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_EOF: u32 = 0x00000002;
@@ -1160,6 +1322,20 @@ pub const NOTE_CHILD: u32 = 0x00000004;
pub const TMP_MAX: ::c_uint = 0x7fffffff;
+pub const AI_PASSIVE: ::c_int = 1;
+pub const AI_CANONNAME: ::c_int = 2;
+pub const AI_NUMERICHOST: ::c_int = 4;
+pub const AI_EXT: ::c_int = 8;
+pub const AI_NUMERICSERV: ::c_int = 16;
+pub const AI_FQDN: ::c_int = 32;
+pub const AI_ADDRCONFIG: ::c_int = 64;
+
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+
pub const NI_MAXHOST: ::size_t = 256;
pub const RTLD_LOCAL: ::c_int = 0;
@@ -1266,6 +1442,10 @@ pub const KERN_AUDIO: ::c_int = 84;
pub const KERN_CPUSTATS: ::c_int = 85;
pub const KERN_PFSTATUS: ::c_int = 86;
pub const KERN_TIMEOUT_STATS: ::c_int = 87;
+#[deprecated(
+ since = "0.2.95",
+ note = "Possibly increasing over the releases and might not be so used in the field"
+)]
pub const KERN_MAXID: ::c_int = 88;
pub const KERN_PROC_ALL: ::c_int = 0;
@@ -1293,6 +1473,35 @@ pub const KI_WMESGLEN: ::c_int = 8;
pub const KI_MAXLOGNAME: ::c_int = 32;
pub const KI_EMULNAMELEN: ::c_int = 8;
+pub const KVE_ET_OBJ: ::c_int = 0x00000001;
+pub const KVE_ET_SUBMAP: ::c_int = 0x00000002;
+pub const KVE_ET_COPYONWRITE: ::c_int = 0x00000004;
+pub const KVE_ET_NEEDSCOPY: ::c_int = 0x00000008;
+pub const KVE_ET_HOLE: ::c_int = 0x00000010;
+pub const KVE_ET_NOFAULT: ::c_int = 0x00000020;
+pub const KVE_ET_STACK: ::c_int = 0x00000040;
+pub const KVE_ET_WC: ::c_int = 0x000000080;
+pub const KVE_ET_CONCEAL: ::c_int = 0x000000100;
+pub const KVE_ET_SYSCALL: ::c_int = 0x000000200;
+pub const KVE_ET_FREEMAPPED: ::c_int = 0x000000800;
+
+pub const KVE_PROT_NONE: ::c_int = 0x00000000;
+pub const KVE_PROT_READ: ::c_int = 0x00000001;
+pub const KVE_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVE_PROT_EXEC: ::c_int = 0x00000004;
+
+pub const KVE_ADV_NORMAL: ::c_int = 0x00000000;
+pub const KVE_ADV_RANDOM: ::c_int = 0x00000001;
+pub const KVE_ADV_SEQUENTIAL: ::c_int = 0x00000002;
+
+pub const KVE_INH_SHARE: ::c_int = 0x00000000;
+pub const KVE_INH_COPY: ::c_int = 0x00000010;
+pub const KVE_INH_NONE: ::c_int = 0x00000020;
+pub const KVE_INH_ZERO: ::c_int = 0x00000030;
+
+pub const KVE_F_STATIC: ::c_int = 0x1;
+pub const KVE_F_KMEM: ::c_int = 0x2;
+
pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS;
pub const OLCUC: ::tcflag_t = 0x20;
pub const ONOCR: ::tcflag_t = 0x40;
@@ -1360,6 +1569,7 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;
pub const TMPFS_ARGS_VERSION: ::c_int = 1;
pub const MAP_STACK: ::c_int = 0x4000;
+pub const MAP_CONCEAL: ::c_int = 0x8000;
// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
pub const IFF_UP: ::c_int = 0x1; // interface is up
@@ -1383,6 +1593,11 @@ pub const PTHREAD_STACK_MIN: ::size_t = 1_usize << _MAX_PAGE_SHIFT;
pub const MINSIGSTKSZ: ::size_t = 3_usize << _MAX_PAGE_SHIFT;
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;
+pub const PT_SET_EVENT_MASK: ::c_int = 12;
+pub const PT_GET_EVENT_MASK: ::c_int = 13;
+pub const PT_GET_PROCESS_STATE: ::c_int = 14;
+pub const PT_GET_THREAD_FIRST: ::c_int = 15;
+pub const PT_GET_THREAD_NEXT: ::c_int = 16;
pub const PT_FIRSTMACH: ::c_int = 32;
pub const SOCK_CLOEXEC: ::c_int = 0x8000;
@@ -1397,6 +1612,65 @@ pub const PTRACE_FORK: ::c_int = 0x0002;
pub const WCONTINUED: ::c_int = 8;
+// search.h
+pub const FIND: ::ACTION = 0;
+pub const ENTER: ::ACTION = 1;
+
+// futex.h
+pub const FUTEX_WAIT: ::c_int = 1;
+pub const FUTEX_WAKE: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
+
+// sysctl.h, kinfo_proc p_eflag constants
+pub const EPROC_CTTY: i32 = 0x01; // controlling tty vnode active
+pub const EPROC_SLEADER: i32 = 0x02; // session leader
+pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings
+pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked
+
+// Flags for chflags(2)
+pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
+pub const UF_NODUMP: ::c_uint = 0x00000001;
+pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
+pub const UF_APPEND: ::c_uint = 0x00000004;
+pub const UF_OPAQUE: ::c_uint = 0x00000008;
+pub const SF_SETTABLE: ::c_uint = 0xffff0000;
+pub const SF_ARCHIVED: ::c_uint = 0x00010000;
+pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
+pub const SF_APPEND: ::c_uint = 0x00040000;
+
+// sys/mount.h
+pub const MNT_NOPERM: ::c_int = 0x00000020;
+pub const MNT_WXALLOWED: ::c_int = 0x00000800;
+pub const MNT_EXRDONLY: ::c_int = 0x00000080;
+pub const MNT_DEFEXPORTED: ::c_int = 0x00000200;
+pub const MNT_EXPORTANON: ::c_int = 0x00000400;
+pub const MNT_ROOTFS: ::c_int = 0x00004000;
+pub const MNT_NOATIME: ::c_int = 0x00008000;
+pub const MNT_DELEXPORT: ::c_int = 0x00020000;
+pub const MNT_STALLED: ::c_int = 0x00100000;
+pub const MNT_SWAPPABLE: ::c_int = 0x00200000;
+pub const MNT_WANTRDWR: ::c_int = 0x02000000;
+pub const MNT_SOFTDEP: ::c_int = 0x04000000;
+pub const MNT_DOOMED: ::c_int = 0x08000000;
+
+// For use with vfs_fsync and getfsstat
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+pub const MNT_LAZY: ::c_int = 3;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
+pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
+
+const _LC_LAST: ::c_int = 7;
+pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2;
+
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -1453,23 +1727,28 @@ safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
(status & 0o177777) == 0o177777
}
+
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= (major & 0xff) << 8;
+ dev |= minor & 0xff;
+ dev |= (minor & 0xffff00) << 8;
+ dev
+ }
}
extern "C" {
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
- pub fn settimeofday(
- tp: *const ::timeval,
- tz: *const ::timezone,
- ) -> ::c_int;
+ pub fn settimeofday(tp: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn execvpe(
file: *const ::c_char,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
- pub fn pledge(
- promises: *const ::c_char,
- execpromises: *const ::c_char,
- ) -> ::c_int;
+ pub fn pledge(promises: *const ::c_char, execpromises: *const ::c_char) -> ::c_int;
+ pub fn unveil(path: *const ::c_char, permissions: *const ::c_char) -> ::c_int;
pub fn strtonum(
nptr: *const ::c_char,
minval: ::c_longlong,
@@ -1495,6 +1774,8 @@ extern "C" {
servlen: ::size_t,
flags: ::c_int,
) -> ::c_int;
+ pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+ pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
pub fn kevent(
kq: ::c_int,
changelist: *const ::kevent,
@@ -1503,11 +1784,8 @@ extern "C" {
nevents: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+ pub fn getthrid() -> ::pid_t;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
@@ -1518,11 +1796,24 @@ extern "C" {
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
+ pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
- pub fn pthread_stackseg_np(
- thread: ::pthread_t,
- sinfo: *mut ::stack_t,
+ pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int;
+
+ pub fn openpty(
+ amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *const ::termios,
+ winp: *const ::winsize,
) -> ::c_int;
+ pub fn forkpty(
+ amaster: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *const ::termios,
+ winp: *const ::winsize,
+ ) -> ::pid_t;
+
pub fn sysctl(
name: *const ::c_int,
namelen: ::c_uint,
@@ -1534,12 +1825,8 @@ extern "C" {
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
- pub fn ptrace(
- request: ::c_int,
- pid: ::pid_t,
- addr: caddr_t,
- data: ::c_int,
- ) -> ::c_int;
+ pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: caddr_t, data: ::c_int) -> ::c_int;
+ pub fn utrace(label: *const ::c_char, addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
@@ -1557,6 +1844,66 @@ extern "C" {
>,
data: *mut ::c_void,
) -> ::c_int;
+ pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+ pub fn freelocale(loc: ::locale_t);
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+ pub fn duplocale(base: ::locale_t) -> ::locale_t;
+
+ // Added in `OpenBSD` 5.5
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+
+ pub fn setproctitle(fmt: *const ::c_char, ...);
+
+ pub fn freezero(ptr: *mut ::c_void, size: ::size_t);
+ pub fn malloc_conceal(size: ::size_t) -> *mut ::c_void;
+ pub fn calloc_conceal(nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn srand48_deterministic(seed: ::c_long);
+ pub fn seed48_deterministic(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn lcong48_deterministic(p: *mut ::c_ushort);
+
+ pub fn lsearch(
+ key: *const ::c_void,
+ base: *mut ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lfind(
+ key: *const ::c_void,
+ base: *const ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn hcreate(nelt: ::size_t) -> ::c_int;
+ pub fn hdestroy();
+ pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY;
+
+ // futex.h
+ pub fn futex(
+ uaddr: *mut u32,
+ op: ::c_int,
+ val: ::c_int,
+ timeout: *const ::timespec,
+ uaddr2: *mut u32,
+ ) -> ::c_int;
+}
+
+#[link(name = "execinfo")]
+extern "C" {
+ pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+ pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+ pub fn backtrace_symbols_fd(
+ addrlist: *const *mut ::c_void,
+ len: ::size_t,
+ fd: ::c_int,
+ ) -> ::c_int;
+ pub fn backtrace_symbols_fmt(
+ addrlist: *const *mut ::c_void,
+ len: ::size_t,
+ fmt: *const ::c_char,
+ ) -> *mut *mut ::c_char;
}
cfg_if! {
@@ -1565,23 +1912,40 @@ cfg_if! {
// these functions use statfs which uses the union mount_info:
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+ pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+ pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::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")] {
+ if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
+ } else if #[cfg(target_arch = "arm")] {
+ mod arm;
+ pub use self::arm::*;
+ } else if #[cfg(target_arch = "mips64")] {
+ mod mips64;
+ pub use self::mips64::*;
+ } else if #[cfg(target_arch = "powerpc")] {
+ mod powerpc;
+ pub use self::powerpc::*;
+ } else if #[cfg(target_arch = "powerpc64")] {
+ mod powerpc64;
+ pub use self::powerpc64::*;
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else if #[cfg(target_arch = "sparc64")] {
mod sparc64;
pub use self::sparc64::*;
+ } else if #[cfg(target_arch = "x86")] {
+ mod x86;
+ pub use self::x86::*;
+ } else if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ pub use self::x86_64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
new file mode 100644
index 0000000000000..f1ab365d1cd1b
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 8 - 1;
+ }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
new file mode 100644
index 0000000000000..99350ec8dc3d4
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
@@ -0,0 +1,16 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 8 - 1;
+ }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
new file mode 100644
index 0000000000000..99350ec8dc3d4
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
@@ -0,0 +1,16 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+ if #[cfg(libc_const_size_of)] {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+ } else {
+ #[doc(hidden)]
+ pub const _ALIGNBYTES: usize = 8 - 1;
+ }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
index 263b6e13a2d72..60dab004456fc 100644
--- a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
@@ -3,6 +3,112 @@ use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
+pub type ucontext_t = sigcontext;
+
+s! {
+ pub struct sigcontext {
+ pub sc_rdi: ::c_long,
+ pub sc_rsi: ::c_long,
+ pub sc_rdx: ::c_long,
+ pub sc_rcx: ::c_long,
+ pub sc_r8: ::c_long,
+ pub sc_r9: ::c_long,
+ pub sc_r10: ::c_long,
+ pub sc_r11: ::c_long,
+ pub sc_r12: ::c_long,
+ pub sc_r13: ::c_long,
+ pub sc_r14: ::c_long,
+ pub sc_r15: ::c_long,
+ pub sc_rbp: ::c_long,
+ pub sc_rbx: ::c_long,
+ pub sc_rax: ::c_long,
+ pub sc_gs: ::c_long,
+ pub sc_fs: ::c_long,
+ pub sc_es: ::c_long,
+ pub sc_ds: ::c_long,
+ pub sc_trapno: ::c_long,
+ pub sc_err: ::c_long,
+ pub sc_rip: ::c_long,
+ pub sc_cs: ::c_long,
+ pub sc_rflags: ::c_long,
+ pub sc_rsp: ::c_long,
+ pub sc_ss: ::c_long,
+ pub sc_fpstate: *mut fxsave64,
+ __sc_unused: ::c_int,
+ pub sc_mask: ::c_int,
+ pub sc_cookie: ::c_long,
+ }
+}
+
+s_no_extra_traits! {
+ #[repr(packed)]
+ pub struct fxsave64 {
+ pub fx_fcw: u16,
+ pub fx_fsw: u16,
+ pub fx_ftw: u8,
+ __fx_unused1: u8,
+ pub fx_fop: u16,
+ pub fx_rip: u64,
+ pub fx_rdp: u64,
+ pub fx_mxcsr: u32,
+ pub fx_mxcsr_mask: u32,
+ pub fx_st: [[u64; 2]; 8],
+ pub fx_xmm: [[u64; 2]; 16],
+ __fx_unused3: [u8; 96],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ // `fxsave64` is packed, so field access is unaligned.
+ // use {x} to create temporary storage, copy field to it, and do aligned access.
+ impl PartialEq for fxsave64 {
+ fn eq(&self, other: &fxsave64) -> bool {
+ return {self.fx_fcw} == {other.fx_fcw} &&
+ {self.fx_fsw} == {other.fx_fsw} &&
+ {self.fx_ftw} == {other.fx_ftw} &&
+ {self.fx_fop} == {other.fx_fop} &&
+ {self.fx_rip} == {other.fx_rip} &&
+ {self.fx_rdp} == {other.fx_rdp} &&
+ {self.fx_mxcsr} == {other.fx_mxcsr} &&
+ {self.fx_mxcsr_mask} == {other.fx_mxcsr_mask} &&
+ {self.fx_st}.iter().zip({other.fx_st}.iter()).all(|(a,b)| a == b) &&
+ {self.fx_xmm}.iter().zip({other.fx_xmm}.iter()).all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for fxsave64 {}
+ impl ::fmt::Debug for fxsave64 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("fxsave64")
+ .field("fx_fcw", &{self.fx_fcw})
+ .field("fx_fsw", &{self.fx_fsw})
+ .field("fx_ftw", &{self.fx_ftw})
+ .field("fx_fop", &{self.fx_fop})
+ .field("fx_rip", &{self.fx_rip})
+ .field("fx_rdp", &{self.fx_rdp})
+ .field("fx_mxcsr", &{self.fx_mxcsr})
+ .field("fx_mxcsr_mask", &{self.fx_mxcsr_mask})
+ // FIXME: .field("fx_st", &{self.fx_st})
+ // FIXME: .field("fx_xmm", &{self.fx_xmm})
+ .finish()
+ }
+ }
+ impl ::hash::Hash for fxsave64 {
+ fn hash(&self, state: &mut H) {
+ {self.fx_fcw}.hash(state);
+ {self.fx_fsw}.hash(state);
+ {self.fx_ftw}.hash(state);
+ {self.fx_fop}.hash(state);
+ {self.fx_rip}.hash(state);
+ {self.fx_rdp}.hash(state);
+ {self.fx_mxcsr}.hash(state);
+ {self.fx_mxcsr_mask}.hash(state);
+ {self.fx_st}.hash(state);
+ {self.fx_xmm}.hash(state);
+ }
+ }
+ }
+}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
diff --git a/src/unix/haiku/b32.rs b/src/unix/haiku/b32.rs
index cce8864883a1a..073ae9d4b58e2 100644
--- a/src/unix/haiku/b32.rs
+++ b/src/unix/haiku/b32.rs
@@ -1,3 +1,20 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type time_t = i32;
+
+pub type Elf_Addr = ::Elf32_Addr;
+pub type Elf_Half = ::Elf32_Half;
+pub type Elf_Phdr = ::Elf32_Phdr;
+
+s! {
+ 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,
+ }
+}
diff --git a/src/unix/haiku/b64.rs b/src/unix/haiku/b64.rs
index 3e66f14c92a6f..456918052d289 100644
--- a/src/unix/haiku/b64.rs
+++ b/src/unix/haiku/b64.rs
@@ -1,3 +1,20 @@
pub type c_ulong = u64;
pub type c_long = i64;
pub type time_t = i64;
+
+pub type Elf_Addr = ::Elf64_Addr;
+pub type Elf_Half = ::Elf64_Half;
+pub type Elf_Phdr = ::Elf64_Phdr;
+
+s! {
+ 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,
+ }
+}
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 0fc9024ec60e8..95ddadaeeac47 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -28,8 +28,32 @@ pub type fsfilcnt_t = i64;
pub type pthread_attr_t = *mut ::c_void;
pub type nl_item = ::c_int;
pub type id_t = i32;
-pub type idtype_t = ::c_uint;
+pub type idtype_t = ::c_int;
pub type fd_mask = u32;
+pub type regoff_t = ::c_int;
+pub type key_t = i32;
+pub type msgqnum_t = u32;
+pub type msglen_t = u32;
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Off = u32;
+pub type Elf32_Sword = i32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Off = u64;
+pub type Elf64_Sword = i32;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+pub type ENTRY = entry;
+pub type ACTION = ::c_int;
+
+pub type posix_spawnattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
@@ -102,6 +126,16 @@ s! {
pub ai_next: *mut addrinfo,
}
+ pub struct ifaddrs {
+ pub ifa_next: *mut ifaddrs,
+ pub ifa_name: *const ::c_char,
+ pub ifa_flags: ::c_uint,
+ pub ifa_addr: *mut ::sockaddr,
+ pub ifa_netmask: *mut ::sockaddr,
+ pub ifa_dstaddr: *mut ::sockaddr,
+ pub ifa_data: *mut ::c_void,
+ }
+
pub struct fd_set {
// size for 1024 bits, and a fd_mask with size u32
fds_bits: [fd_mask; 32],
@@ -261,6 +295,10 @@ s! {
waiters: [*mut ::c_void; 2],
}
+ pub struct pthread_spinlock_t {
+ lock: u32,
+ }
+
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
@@ -315,6 +353,90 @@ s! {
pub named_sem_id: i32, // actually a union with unnamed_sem (i32)
pub padding: [i32; 2],
}
+
+ pub struct ucred {
+ pub pid: ::pid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ }
+
+ pub struct sockaddr_dl {
+ pub sdl_len: u8,
+ pub sdl_family: u8,
+ pub sdl_e_type: u16,
+ pub sdl_index: u32,
+ pub sdl_type: u8,
+ pub sdl_nlen: u8,
+ pub sdl_alen: u8,
+ pub sdl_slen: u8,
+ pub sdl_data: [u8; 46],
+ }
+
+ pub struct spwd {
+ pub sp_namp: *mut ::c_char,
+ pub sp_pwdp: *mut ::c_char,
+ pub sp_lstchg: ::c_int,
+ pub sp_min: ::c_int,
+ pub sp_max: ::c_int,
+ pub sp_warn: ::c_int,
+ pub sp_inact: ::c_int,
+ pub sp_expire: ::c_int,
+ pub sp_flag: ::c_int,
+ }
+
+ pub struct regex_t {
+ __buffer: *mut ::c_void,
+ __allocated: ::size_t,
+ __used: ::size_t,
+ __syntax: ::c_ulong,
+ __fastmap: *mut ::c_char,
+ __translate: *mut ::c_char,
+ __re_nsub: ::size_t,
+ __bitfield: u8,
+ }
+
+ pub struct regmatch_t {
+ pub rm_so: regoff_t,
+ pub rm_eo: regoff_t,
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_qnum: ::msgqnum_t,
+ pub msg_qbytes: ::msglen_t,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ pub msg_stime: ::time_t,
+ pub msg_rtime: ::time_t,
+ pub msg_ctime: ::time_t,
+ }
+
+ pub struct ipc_perm {
+ pub key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ }
+
+ pub struct sembuf {
+ pub sem_num: ::c_ushort,
+ pub sem_op: ::c_short,
+ pub sem_flg: ::c_short,
+ }
+
+ pub struct entry {
+ pub key: *mut ::c_char,
+ pub data: *mut ::c_void,
+ }
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -346,10 +468,63 @@ s_no_extra_traits! {
__unused1: *mut ::c_void, // actually a function pointer
pub sigev_notify_attributes: *mut ::pthread_attr_t,
}
+
+ pub struct utmpx {
+ pub ut_type: ::c_short,
+ pub ut_tv: ::timeval,
+ pub ut_id: [::c_char; 8],
+ pub ut_pid: ::pid_t,
+ pub ut_user: [::c_char; 32],
+ pub ut_line: [::c_char; 16],
+ pub ut_host: [::c_char; 128],
+ __ut_reserved: [::c_char; 64],
+ }
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for utmpx {
+ fn eq(&self, other: &utmpx) -> bool {
+ self.ut_type == other.ut_type
+ && self.ut_tv == other.ut_tv
+ && self.ut_id == other.ut_id
+ && self.ut_pid == other.ut_pid
+ && self.ut_user == other.ut_user
+ && self.ut_line == other.ut_line
+ && self.ut_host.iter().zip(other.ut_host.iter()).all(|(a,b)| a == b)
+ && self.__ut_reserved == other.__ut_reserved
+ }
+ }
+
+ impl Eq for utmpx {}
+
+ impl ::fmt::Debug for utmpx {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("utmpx")
+ .field("ut_type", &self.ut_type)
+ .field("ut_tv", &self.ut_tv)
+ .field("ut_id", &self.ut_id)
+ .field("ut_pid", &self.ut_pid)
+ .field("ut_user", &self.ut_user)
+ .field("ut_line", &self.ut_line)
+ .field("ut_host", &self.ut_host)
+ .field("__ut_reserved", &self.__ut_reserved)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for utmpx {
+ fn hash(&self, state: &mut H) {
+ self.ut_type.hash(state);
+ self.ut_tv.hash(state);
+ self.ut_id.hash(state);
+ self.ut_pid.hash(state);
+ self.ut_user.hash(state);
+ self.ut_line.hash(state);
+ self.ut_host.hash(state);
+ self.__ut_reserved.hash(state);
+ }
+ }
impl PartialEq for sockaddr_un {
fn eq(&self, other: &sockaddr_un) -> bool {
self.sun_len == other.sun_len
@@ -535,6 +710,8 @@ pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const CLOCK_REALTIME: ::c_int = -1;
pub const CLOCK_MONOTONIC: ::c_int = 0;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = -2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = -3;
pub const RLIMIT_CORE: ::c_int = 0;
pub const RLIMIT_CPU: ::c_int = 1;
@@ -543,6 +720,7 @@ pub const RLIMIT_FSIZE: ::c_int = 3;
pub const RLIMIT_NOFILE: ::c_int = 4;
pub const RLIMIT_STACK: ::c_int = 5;
pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIM_INFINITY: ::rlim_t = 0xffffffff;
// Haiku specific
pub const RLIMIT_NOVMON: ::c_int = 7;
pub const RLIM_NLIMITS: ::c_int = 8;
@@ -674,6 +852,7 @@ pub const MAP_SHARED: ::c_int = 0x01;
pub const MAP_PRIVATE: ::c_int = 0x02;
pub const MAP_FIXED: ::c_int = 0x04;
pub const MAP_ANONYMOUS: ::c_int = 0x08;
+pub const MAP_NORESERVE: ::c_int = 0x10;
pub const MAP_ANON: ::c_int = MAP_ANONYMOUS;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
@@ -780,6 +959,7 @@ pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_RANDOM: ::c_int = 3;
pub const MADV_WILLNEED: ::c_int = 4;
pub const MADV_DONTNEED: ::c_int = 5;
+pub const MADV_FREE: ::c_int = 6;
// https://github.com/haiku/haiku/blob/master/headers/posix/net/if.h#L80
pub const IFF_UP: ::c_int = 0x0001;
@@ -809,6 +989,15 @@ pub const AF_LOCAL: ::c_int = 9;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_BLUETOOTH: ::c_int = 10;
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+
pub const IP_OPTIONS: ::c_int = 1;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_TOS: ::c_int = 3;
@@ -872,6 +1061,7 @@ pub const LOCK_EX: ::c_int = 0x02;
pub const LOCK_NB: ::c_int = 0x04;
pub const LOCK_UN: ::c_int = 0x08;
+pub const MINSIGSTKSZ: ::size_t = 8192;
pub const SIGSTKSZ: ::size_t = 16384;
pub const IOV_MAX: ::c_int = 1024;
@@ -888,6 +1078,9 @@ pub const SA_NOMASK: ::c_int = SA_NODEFER;
pub const SA_STACK: ::c_int = SA_ONSTACK;
pub const SA_ONESHOT: ::c_int = SA_RESETHAND;
+pub const SS_ONSTACK: ::c_int = 0x1;
+pub const SS_DISABLE: ::c_int = 0x2;
+
pub const FD_SETSIZE: usize = 1024;
pub const RTLD_LOCAL: ::c_int = 0x0;
@@ -979,6 +1172,7 @@ pub const _SC_HOST_NAME_MAX: ::c_int = 61;
pub const _SC_REGEXP: ::c_int = 62;
pub const _SC_SYMLOOP_MAX: ::c_int = 63;
pub const _SC_SHELL: ::c_int = 64;
+pub const _SC_TTY_NAME_MAX: ::c_int = 65;
pub const PTHREAD_STACK_MIN: ::size_t = 8192;
@@ -1045,6 +1239,8 @@ pub const SO_PEERCRED: ::c_int = 0x4000000b;
pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const SOMAXCONN: ::c_int = 32;
+
pub const NI_MAXHOST: ::size_t = 1025;
pub const WNOHANG: ::c_int = 0x01;
@@ -1054,6 +1250,12 @@ pub const WEXITED: ::c_int = 0x08;
pub const WSTOPPED: ::c_int = 0x10;
pub const WNOWAIT: ::c_int = 0x20;
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 40;
+pub const BUS_ADRERR: ::c_int = 41;
+pub const BUS_OBJERR: ::c_int = 42;
+
+// si_code values for SIGCHLD signal
pub const CLD_EXITED: ::c_int = 60;
pub const CLD_KILLED: ::c_int = 61;
pub const CLD_DUMPED: ::c_int = 62;
@@ -1234,6 +1436,16 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+// utmpx entry types
+pub const EMPTY: ::c_short = 0;
+pub const BOOT_TIME: ::c_short = 1;
+pub const OLD_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 3;
+pub const USER_PROCESS: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const DEAD_PROCESS: ::c_short = 7;
+
pub const LOG_PID: ::c_int = 1 << 12;
pub const LOG_CONS: ::c_int = 2 << 12;
pub const LOG_ODELAY: ::c_int = 4 << 12;
@@ -1242,6 +1454,13 @@ pub const LOG_SERIAL: ::c_int = 16 << 12;
pub const LOG_PERROR: ::c_int = 32 << 12;
pub const LOG_NOWAIT: ::c_int = 64 << 12;
+// spawn.h
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
+pub const POSIX_SPAWN_SETSID: ::c_int = 0x40;
+
const_fn! {
{const} fn CMSG_ALIGN(len: usize) -> usize {
len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1)
@@ -1295,7 +1514,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
@@ -1354,11 +1573,13 @@ extern "C" {
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
pub fn getpriority(which: ::c_int, who: id_t) -> ::c_int;
- pub fn setpriority(
- which: ::c_int,
- who: id_t,
- priority: ::c_int,
- ) -> ::c_int;
+ pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
+
+ pub fn endusershell();
+ pub fn getpass(prompt: *const ::c_char) -> *mut ::c_char;
+ pub fn getusershell() -> *mut ::c_char;
+ pub fn issetugid() -> ::c_int;
+ pub fn setusershell();
pub fn utimensat(
fd: ::c_int,
@@ -1367,31 +1588,69 @@ extern "C" {
flag: ::c_int,
) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn _errnop() -> *mut ::c_int;
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 getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+ pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+ pub fn ppoll(
+ fds: *mut ::pollfd,
+ numfds: ::nfds_t,
+ timeout: *const ::timespec,
+ sigMask: *const sigset_t,
+ ) -> ::c_int;
-#[link(name = "bsd")]
-extern "C" {
- pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
+ pub fn getspent() -> *mut spwd;
+ pub fn getspent_r(
+ pwd: *mut spwd,
+ buf: *mut ::c_char,
+ bufferSize: ::size_t,
+ res: *mut *mut spwd,
+ ) -> ::c_int;
+ pub fn setspent();
+ pub fn endspent();
+ pub fn getspnam(name: *const ::c_char) -> *mut spwd;
+ pub fn getspnam_r(
+ name: *const ::c_char,
+ spwd: *mut spwd,
+ buffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ res: *mut *mut spwd,
) -> ::c_int;
+ pub fn sgetspent(line: *const ::c_char) -> *mut spwd;
+ pub fn sgetspent_r(
+ line: *const ::c_char,
+ spwd: *mut spwd,
+ buffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ res: *mut *mut spwd,
+ ) -> ::c_int;
+ pub fn fgetspent(file: *mut ::FILE) -> *mut spwd;
+ pub fn fgetspent_r(
+ file: *mut ::FILE,
+ spwd: *mut spwd,
+ buffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ res: *mut *mut spwd,
+ ) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+ pub fn mknodat(
+ dirfd: ::c_int,
+ pathname: *const ::c_char,
+ mode: ::mode_t,
+ dev: dev_t,
+ ) -> ::c_int;
+ pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
- pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
- pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn pthread_create(
thread: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
@@ -1415,14 +1674,13 @@ extern "C" {
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
+ pub fn valloc(numBytes: ::size_t) -> *mut ::c_void;
+ pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+ pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn getnameinfo(
sa: *const ::sockaddr,
@@ -1437,50 +1695,35 @@ extern "C" {
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
- pub fn waitid(
- idtype: idtype_t,
- id: id_t,
- infop: *mut ::siginfo_t,
- options: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
- pub fn shm_open(
- name: *const ::c_char,
- oflag: ::c_int,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
@@ -1491,36 +1734,15 @@ extern "C" {
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::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,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- count: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- count: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
- pub fn sendmsg(
- fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recvmsg(
- fd: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn execvpe(
file: *const ::c_char,
argv: *const *const ::c_char,
@@ -1533,6 +1755,12 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
+ pub fn getgrouplist(
+ user: *const ::c_char,
+ basegroup: ::gid_t,
+ grouplist: *mut ::gid_t,
+ groupcount: *mut ::c_int,
+ ) -> ::c_int;
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;
@@ -1543,16 +1771,11 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_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;
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
@@ -1567,6 +1790,12 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
+ pub fn getpwent() -> *mut passwd;
+ pub fn setpwent();
+ pub fn endpwent();
+ pub fn endgrent();
+ pub fn getgrent() -> *mut ::group;
+ pub fn setgrent();
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
pub fn pthread_atfork(
prepare: ::Option,
@@ -1575,21 +1804,208 @@ extern "C" {
) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
- pub fn openpty(
+ pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+ pub fn uname(buf: *mut ::utsname) -> ::c_int;
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn setutxent();
+ pub fn endutxent();
+ pub fn faccessat(
+ dirfd: ::c_int,
+ pathname: *const ::c_char,
+ mode: ::c_int,
+ flags: ::c_int,
+ ) -> ::c_int;
+
+ pub fn sigtimedwait(
+ set: *const sigset_t,
+ info: *mut siginfo_t,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+
+ pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+ pub fn setitimer(
+ which: ::c_int,
+ new_value: *const ::itimerval,
+ old_value: *mut ::itimerval,
+ ) -> ::c_int;
+
+ pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+
+ pub fn regexec(
+ preg: *const regex_t,
+ input: *const ::c_char,
+ nmatch: ::size_t,
+ pmatch: *mut regmatch_t,
+ eflags: ::c_int,
+ ) -> ::c_int;
+
+ pub fn regerror(
+ errcode: ::c_int,
+ preg: *const regex_t,
+ errbuf: *mut ::c_char,
+ errbuf_size: ::size_t,
+ ) -> ::size_t;
+
+ pub fn regfree(preg: *mut regex_t);
+
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+ pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+ pub fn msgrcv(
+ msqid: ::c_int,
+ msgp: *mut ::c_void,
+ msgsz: ::size_t,
+ msgtype: ::c_long,
+ msgflg: ::c_int,
+ ) -> ::ssize_t;
+ pub fn msgsnd(
+ msqid: ::c_int,
+ msgp: *const ::c_void,
+ msgsz: ::size_t,
+ msgflg: ::c_int,
+ ) -> ::c_int;
+ pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+ pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+
+ pub fn lsearch(
+ key: *const ::c_void,
+ base: *mut ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lfind(
+ key: *const ::c_void,
+ base: *const ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn hcreate(nelt: ::size_t) -> ::c_int;
+ pub fn hdestroy();
+ pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY;
+
+ pub fn drand48() -> ::c_double;
+ pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+ pub fn lrand48() -> ::c_long;
+ pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn mrand48() -> ::c_long;
+ pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn srand48(seed: ::c_long);
+ pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn lcong48(p: *mut ::c_ushort);
+
+ pub fn clearenv() -> ::c_int;
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn sync();
+ pub fn getpagesize() -> ::c_int;
+
+ pub fn brk(addr: *mut ::c_void) -> ::c_int;
+ pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+
+ 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_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_destroy(
+ file_actions: *mut posix_spawn_file_actions_t,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_addopen(
+ file_actions: *mut posix_spawn_file_actions_t,
+ fildes: ::c_int,
+ path: *const ::c_char,
+ oflag: ::c_int,
+ mode: ::mode_t,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_addclose(
+ file_actions: *mut posix_spawn_file_actions_t,
+ fildes: ::c_int,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_adddup2(
+ file_actions: *mut posix_spawn_file_actions_t,
+ fildes: ::c_int,
+ newfildes: ::c_int,
+ ) -> ::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_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,
+ _pgroup: *mut ::pid_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: ::pid_t) -> ::c_int;
+ pub fn posix_spawnattr_getsigdefault(
+ attr: *const posix_spawnattr_t,
+ sigdefault: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigdefault(
+ attr: *mut posix_spawnattr_t,
+ sigdefault: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigmask(
+ attr: *const posix_spawnattr_t,
+ _sigmask: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigmask(
+ attr: *mut posix_spawnattr_t,
+ sigmask: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
+}
+
+#[link(name = "bsd")]
+extern "C" {
+ pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+ pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+ pub fn forkpty(
amaster: *mut ::c_int,
- aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
- ) -> ::c_int;
- pub fn forkpty(
+ ) -> ::pid_t;
+ pub fn openpty(
amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
- ) -> ::pid_t;
- pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
- pub fn uname(buf: *mut ::utsname) -> ::c_int;
+ ) -> ::c_int;
+ pub fn strsep(string: *mut *mut ::c_char, delimiters: *const ::c_char) -> *mut ::c_char;
+ pub fn explicit_bzero(buf: *mut ::c_void, len: ::size_t);
+ pub fn login_tty(_fd: ::c_int) -> ::c_int;
}
cfg_if! {
@@ -1602,5 +2018,20 @@ cfg_if! {
}
}
+cfg_if! {
+ if #[cfg(target_arch = "x86")] {
+ // TODO
+ // 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")] {
+ // TODO
+ // mod aarch64;
+ // pub use self::aarch64::*;
+ }
+}
+
mod native;
pub use self::native::*;
diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs
index c5ae21a82338b..44bcc1e3b75f4 100644
--- a/src/unix/haiku/native.rs
+++ b/src/unix/haiku/native.rs
@@ -20,10 +20,7 @@
macro_rules! haiku_constant {
($a:tt, $b:tt, $c:tt, $d:tt) => {
- (($a as u32) << 24)
- + (($b as u32) << 16)
- + (($c as u32) << 8)
- + ($d as u32)
+ (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32)
};
}
@@ -64,6 +61,142 @@ e! {
B_ADD_ON_IMAGE,
B_SYSTEM_IMAGE
}
+
+ // kernel/scheduler.h
+
+ pub enum be_task_flags {
+ B_DEFAULT_MEDIA_PRIORITY = 0x000,
+ B_OFFLINE_PROCESSING = 0x001,
+ B_STATUS_RENDERING = 0x002,
+ B_USER_INPUT_HANDLING = 0x004,
+ B_LIVE_VIDEO_MANIPULATION = 0x008,
+ B_VIDEO_PLAYBACK = 0x010,
+ B_VIDEO_RECORDING = 0x020,
+ B_LIVE_AUDIO_MANIPULATION = 0x040,
+ B_AUDIO_PLAYBACK = 0x080,
+ B_AUDIO_RECORDING = 0x100,
+ B_LIVE_3D_RENDERING = 0x200,
+ B_NUMBER_CRUNCHING = 0x400,
+ B_MIDI_PROCESSING = 0x800,
+ }
+
+ pub enum schduler_mode {
+ SCHEDULER_MODE_LOW_LATENCY,
+ SCHEDULER_MODE_POWER_SAVING,
+ }
+
+ // FindDirectory.h
+ pub enum path_base_directory {
+ B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY,
+ B_FIND_PATH_ADD_ONS_DIRECTORY,
+ B_FIND_PATH_APPS_DIRECTORY,
+ B_FIND_PATH_BIN_DIRECTORY,
+ B_FIND_PATH_BOOT_DIRECTORY,
+ B_FIND_PATH_CACHE_DIRECTORY,
+ B_FIND_PATH_DATA_DIRECTORY,
+ B_FIND_PATH_DEVELOP_DIRECTORY,
+ B_FIND_PATH_DEVELOP_LIB_DIRECTORY,
+ B_FIND_PATH_DOCUMENTATION_DIRECTORY,
+ B_FIND_PATH_ETC_DIRECTORY,
+ B_FIND_PATH_FONTS_DIRECTORY,
+ B_FIND_PATH_HEADERS_DIRECTORY,
+ B_FIND_PATH_LIB_DIRECTORY,
+ B_FIND_PATH_LOG_DIRECTORY,
+ B_FIND_PATH_MEDIA_NODES_DIRECTORY,
+ B_FIND_PATH_PACKAGES_DIRECTORY,
+ B_FIND_PATH_PREFERENCES_DIRECTORY,
+ B_FIND_PATH_SERVERS_DIRECTORY,
+ B_FIND_PATH_SETTINGS_DIRECTORY,
+ B_FIND_PATH_SOUNDS_DIRECTORY,
+ B_FIND_PATH_SPOOL_DIRECTORY,
+ B_FIND_PATH_TRANSLATORS_DIRECTORY,
+ B_FIND_PATH_VAR_DIRECTORY,
+ B_FIND_PATH_IMAGE_PATH = 1000,
+ B_FIND_PATH_PACKAGE_PATH,
+ }
+
+ pub enum directory_which {
+ B_DESKTOP_DIRECTORY = 0,
+ B_TRASH_DIRECTORY,
+ B_SYSTEM_DIRECTORY = 1000,
+ B_SYSTEM_ADDONS_DIRECTORY = 1002,
+ B_SYSTEM_BOOT_DIRECTORY,
+ B_SYSTEM_FONTS_DIRECTORY,
+ B_SYSTEM_LIB_DIRECTORY,
+ B_SYSTEM_SERVERS_DIRECTORY,
+ B_SYSTEM_APPS_DIRECTORY,
+ B_SYSTEM_BIN_DIRECTORY,
+ B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010,
+ B_SYSTEM_PREFERENCES_DIRECTORY,
+ B_SYSTEM_TRANSLATORS_DIRECTORY,
+ B_SYSTEM_MEDIA_NODES_DIRECTORY,
+ B_SYSTEM_SOUNDS_DIRECTORY,
+ B_SYSTEM_DATA_DIRECTORY,
+ B_SYSTEM_DEVELOP_DIRECTORY,
+ B_SYSTEM_PACKAGES_DIRECTORY,
+ B_SYSTEM_HEADERS_DIRECTORY,
+ B_SYSTEM_ETC_DIRECTORY = 2008,
+ B_SYSTEM_SETTINGS_DIRECTORY = 2010,
+ B_SYSTEM_LOG_DIRECTORY = 2012,
+ B_SYSTEM_SPOOL_DIRECTORY,
+ B_SYSTEM_TEMP_DIRECTORY,
+ B_SYSTEM_VAR_DIRECTORY,
+ B_SYSTEM_CACHE_DIRECTORY = 2020,
+ B_SYSTEM_NONPACKAGED_DIRECTORY = 2023,
+ B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_BIN_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_DOCUMENTATION_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_LIB_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_HEADERS_DIRECTORY,
+ B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY,
+ B_USER_DIRECTORY = 3000,
+ B_USER_CONFIG_DIRECTORY,
+ B_USER_ADDONS_DIRECTORY,
+ B_USER_BOOT_DIRECTORY,
+ B_USER_FONTS_DIRECTORY,
+ B_USER_LIB_DIRECTORY,
+ B_USER_SETTINGS_DIRECTORY,
+ B_USER_DESKBAR_DIRECTORY,
+ B_USER_PRINTERS_DIRECTORY,
+ B_USER_TRANSLATORS_DIRECTORY,
+ B_USER_MEDIA_NODES_DIRECTORY,
+ B_USER_SOUNDS_DIRECTORY,
+ B_USER_DATA_DIRECTORY,
+ B_USER_CACHE_DIRECTORY,
+ B_USER_PACKAGES_DIRECTORY,
+ B_USER_HEADERS_DIRECTORY,
+ B_USER_NONPACKAGED_DIRECTORY,
+ B_USER_NONPACKAGED_ADDONS_DIRECTORY,
+ B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY,
+ B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY,
+ B_USER_NONPACKAGED_BIN_DIRECTORY,
+ B_USER_NONPACKAGED_DATA_DIRECTORY,
+ B_USER_NONPACKAGED_FONTS_DIRECTORY,
+ B_USER_NONPACKAGED_SOUNDS_DIRECTORY,
+ B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY,
+ B_USER_NONPACKAGED_LIB_DIRECTORY,
+ B_USER_NONPACKAGED_HEADERS_DIRECTORY,
+ B_USER_NONPACKAGED_DEVELOP_DIRECTORY,
+ B_USER_DEVELOP_DIRECTORY,
+ B_USER_DOCUMENTATION_DIRECTORY,
+ B_USER_SERVERS_DIRECTORY,
+ B_USER_APPS_DIRECTORY,
+ B_USER_BIN_DIRECTORY,
+ B_USER_PREFERENCES_DIRECTORY,
+ B_USER_ETC_DIRECTORY,
+ B_USER_LOG_DIRECTORY,
+ B_USER_SPOOL_DIRECTORY,
+ B_USER_VAR_DIRECTORY,
+ B_APPS_DIRECTORY = 4000,
+ B_PREFERENCES_DIRECTORY,
+ B_UTILITIES_DIRECTORY,
+ B_PACKAGE_LINKS_DIRECTORY,
+ }
}
s! {
@@ -99,29 +232,29 @@ s! {
}
pub struct team_info {
- team: team_id,
- thread_count: i32,
- image_count: i32,
- area_count: i32,
- debugger_nub_thread: thread_id,
- debugger_nub_port: port_id,
- argc: i32,
- args: [::c_char; 64],
- uid: ::uid_t,
- gid: ::gid_t
+ pub team: team_id,
+ pub thread_count: i32,
+ pub image_count: i32,
+ pub area_count: i32,
+ pub debugger_nub_thread: thread_id,
+ pub debugger_nub_port: port_id,
+ pub argc: i32,
+ pub args: [::c_char; 64],
+ pub uid: ::uid_t,
+ pub gid: ::gid_t
}
pub struct sem_info {
- sem: sem_id,
- team: team_id,
- name: [::c_char; B_OS_NAME_LENGTH],
- count: i32,
- latest_holder: thread_id
+ pub sem: sem_id,
+ pub team: team_id,
+ pub name: [::c_char; B_OS_NAME_LENGTH],
+ pub count: i32,
+ pub latest_holder: thread_id
}
pub struct team_usage_info {
- user_time: bigtime_t,
- kernel_time: bigtime_t
+ pub user_time: bigtime_t,
+ pub kernel_time: bigtime_t
}
pub struct thread_info {
@@ -139,7 +272,8 @@ s! {
pub struct cpu_info {
pub active_time: bigtime_t,
- pub enabled: bool
+ pub enabled: bool,
+ pub current_frequency: u64
}
pub struct system_info {
@@ -178,34 +312,34 @@ s! {
// kernel/fs_attr.h
pub struct attr_info {
- type_: u32,
- size: ::off_t
+ pub type_: u32,
+ pub size: ::off_t
}
// kernel/fs_index.h
pub struct index_info {
- type_: u32,
- size: ::off_t,
- modification_time: ::time_t,
- creation_time: ::time_t,
- uid: ::uid_t,
- gid: ::gid_t
+ pub type_: u32,
+ pub size: ::off_t,
+ pub modification_time: ::time_t,
+ pub creation_time: ::time_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t
}
//kernel/fs_info.h
pub struct fs_info {
- dev: ::dev_t,
- root: ::ino_t,
- flags: u32,
- block_size: ::off_t,
- io_size: ::off_t,
- total_blocks: ::off_t,
- free_blocks: ::off_t,
- total_nodes: ::off_t,
- free_nodes: ::off_t,
- device_name: [::c_char; 128],
- volume_name: [::c_char; B_FILE_NAME_LENGTH],
- fsh_name: [::c_char; B_OS_NAME_LENGTH]
+ pub dev: ::dev_t,
+ pub root: ::ino_t,
+ pub flags: u32,
+ pub block_size: ::off_t,
+ pub io_size: ::off_t,
+ pub total_blocks: ::off_t,
+ pub free_blocks: ::off_t,
+ pub total_nodes: ::off_t,
+ pub free_nodes: ::off_t,
+ pub device_name: [::c_char; 128],
+ pub volume_name: [::c_char; B_FILE_NAME_LENGTH],
+ pub fsh_name: [::c_char; B_OS_NAME_LENGTH]
}
// kernel/image.h
@@ -226,6 +360,93 @@ s! {
pub api_version: i32,
pub abi: i32
}
+
+ pub struct __c_anonymous_eax_0 {
+ pub max_eax: u32,
+ pub vendor_id: [::c_char; 12],
+ }
+
+ pub struct __c_anonymous_eax_1 {
+ pub stepping: u32,
+ pub model: u32,
+ pub family: u32,
+ pub tpe: u32,
+ __reserved_0: u32,
+ pub extended_model: u32,
+ pub extended_family: u32,
+ __reserved_1: u32,
+ pub brand_index: u32,
+ pub clflush: u32,
+ pub logical_cpus: u32,
+ pub apic_id: u32,
+ pub features: u32,
+ pub extended_features: u32,
+ }
+
+ pub struct __c_anonymous_eax_2 {
+ pub call_num: u8,
+ pub cache_descriptors: [u8; 15],
+ }
+
+ pub struct __c_anonymous_eax_3 {
+ __reserved: [u32; 2],
+ pub serial_number_high: u32,
+ pub serial_number_low: u32,
+ }
+
+ pub struct __c_anonymous_regs {
+ pub eax: u32,
+ pub ebx: u32,
+ pub edx: u32,
+ pub ecx: u32,
+ }
+}
+
+s_no_extra_traits! {
+ #[cfg(libc_union)]
+ pub union cpuid_info {
+ pub eax_0: __c_anonymous_eax_0,
+ pub eax_1: __c_anonymous_eax_1,
+ pub eax_2: __c_anonymous_eax_2,
+ pub eax_3: __c_anonymous_eax_3,
+ pub as_chars: [::c_char; 16],
+ pub regs: __c_anonymous_regs,
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ #[cfg(libc_union)]
+ impl PartialEq for cpuid_info {
+ fn eq(&self, other: &cpuid_info) -> bool {
+ unsafe {
+ self.eax_0 == other.eax_0
+ || self.eax_1 == other.eax_1
+ || self.eax_2 == other.eax_2
+ || self.eax_3 == other.eax_3
+ || self.as_chars == other.as_chars
+ || self.regs == other.regs
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for cpuid_info {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for cpuid_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("cpuid_info")
+ .field("eax_0", &self.eax_0)
+ .field("eax_1", &self.eax_1)
+ .field("eax_2", &self.eax_2)
+ .field("eax_3", &self.eax_3)
+ .field("as_chars", &self.as_chars)
+ .field("regs", &self.regs)
+ .finish()
+ }
+ }
+ }
+ }
}
// kernel/OS.h
@@ -236,8 +457,7 @@ pub const B_INFINITE_TIMEOUT: usize = 9223372036854775807;
pub const B_RELATIVE_TIMEOUT: u32 = 0x8;
pub const B_ABSOLUTE_TIMEOUT: u32 = 0x10;
pub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40;
-pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 =
- B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE;
+pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE;
pub const B_NO_LOCK: u32 = 0;
pub const B_LAZY_LOCK: u32 = 1;
@@ -440,8 +660,7 @@ pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10;
pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11;
pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12;
pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13;
-pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t =
- B_APP_ERROR_BASE + 14;
+pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14;
pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15;
pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16;
pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17;
@@ -449,7 +668,6 @@ pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18;
// Storage kit errors
pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0;
-pub const B_FILE_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 1;
pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2;
pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3;
pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4;
@@ -586,11 +804,9 @@ pub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G');
pub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G');
pub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E');
pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N');
-pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 =
- haiku_constant!('B', 'M', 'C', 'G');
+pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G');
pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T');
-pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 =
- haiku_constant!('B', 'M', 'C', 'W');
+pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W');
pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G');
pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G');
pub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E');
@@ -645,11 +861,7 @@ extern "C" {
pub fn delete_area(id: area_id) -> status_t;
pub fn resize_area(id: area_id, newSize: usize) -> status_t;
pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t;
- pub fn _get_area_info(
- id: area_id,
- areaInfo: *mut area_info,
- size: usize,
- ) -> status_t;
+ pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t;
pub fn _get_next_area_info(
team: team_id,
cookie: *mut isize,
@@ -690,19 +902,11 @@ extern "C" {
pub fn close_port(port: port_id) -> status_t;
pub fn delete_port(port: port_id) -> status_t;
pub fn port_buffer_size(port: port_id) -> ::ssize_t;
- pub fn port_buffer_size_etc(
- port: port_id,
- flags: u32,
- timeout: bigtime_t,
- ) -> ::ssize_t;
+ pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t;
pub fn port_count(port: port_id) -> ::ssize_t;
pub fn set_port_owner(port: port_id, team: team_id) -> status_t;
- pub fn _get_port_info(
- port: port_id,
- buf: *mut port_info,
- portInfoSize: ::size_t,
- ) -> status_t;
+ pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t;
pub fn _get_next_port_info(
port: port_id,
cookie: *mut i32,
@@ -720,12 +924,7 @@ extern "C" {
pub fn create_sem(count: i32, name: *const ::c_char) -> sem_id;
pub fn delete_sem(id: sem_id) -> status_t;
pub fn acquire_sem(id: sem_id) -> status_t;
- pub fn acquire_sem_etc(
- id: sem_id,
- count: i32,
- flags: u32,
- timeout: bigtime_t,
- ) -> status_t;
+ pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t;
pub fn release_sem(id: sem_id) -> status_t;
pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t;
pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t;
@@ -738,11 +937,7 @@ extern "C" {
) -> status_t;
pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t;
pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t;
- pub fn _get_sem_info(
- id: sem_id,
- info: *mut sem_info,
- infoSize: ::size_t,
- ) -> status_t;
+ pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t;
pub fn _get_next_sem_info(
team: team_id,
cookie: *mut i32,
@@ -751,16 +946,8 @@ extern "C" {
) -> status_t;
pub fn kill_team(team: team_id) -> status_t;
- pub fn _get_team_info(
- team: team_id,
- info: *mut team_info,
- size: ::size_t,
- ) -> status_t;
- pub fn _get_next_team_info(
- cookie: *mut i32,
- info: *mut team_info,
- size: ::size_t,
- ) -> status_t;
+ pub fn _get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t;
+ pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t;
pub fn spawn_thread(
func: thread_func,
@@ -772,52 +959,39 @@ extern "C" {
pub fn resume_thread(thread: thread_id) -> status_t;
pub fn suspend_thread(thread: thread_id) -> status_t;
- pub fn rename_thread(
- thread: thread_id,
- newName: *const ::c_char,
- ) -> status_t;
- pub fn set_thread_priority(
- thread: thread_id,
- newPriority: i32,
- ) -> status_t;
+ pub fn rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t;
+ pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t;
+ pub fn suggest_thread_priority(
+ what: u32,
+ period: i32,
+ jitter: ::bigtime_t,
+ length: ::bigtime_t,
+ ) -> i32;
+ pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t;
pub fn exit_thread(status: status_t);
- pub fn wait_for_thread(
- thread: thread_id,
- returnValue: *mut status_t,
- ) -> status_t;
- pub fn on_exit_thread(
- callback: extern "C" fn(*mut ::c_void),
- data: *mut ::c_void,
- ) -> status_t;
+ pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t;
+ pub fn on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t;
pub fn find_thread(name: *const ::c_char) -> thread_id;
+ pub fn get_scheduler_mode() -> i32;
+ pub fn set_scheduler_mode(mode: i32) -> status_t;
+
pub fn send_data(
thread: thread_id,
code: i32,
buffer: *const ::c_void,
bufferSize: ::size_t,
) -> status_t;
- pub fn receive_data(
- sender: *mut thread_id,
- buffer: *mut ::c_void,
- bufferSize: ::size_t,
- ) -> i32;
+ pub fn receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t)
+ -> i32;
pub fn has_data(thread: thread_id) -> bool;
pub fn snooze(amount: bigtime_t) -> status_t;
- pub fn snooze_etc(
- amount: bigtime_t,
- timeBase: ::c_int,
- flags: u32,
- ) -> status_t;
+ pub fn snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t;
pub fn snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t;
- pub fn _get_thread_info(
- id: thread_id,
- info: *mut thread_info,
- size: ::size_t,
- ) -> status_t;
+ pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t;
pub fn _get_next_thread_info(
team: team_id,
cookie: *mut i32,
@@ -845,23 +1019,19 @@ extern "C" {
pub fn debugger(message: *const ::c_char);
pub fn disable_debugger(state: ::c_int) -> ::c_int;
- // TODO: cpuid_info struct and the get_cpuid() function
-
pub fn get_system_info(info: *mut system_info) -> status_t;
- pub fn get_cpu_info(
+ pub fn _get_cpu_info_etc(
firstCPU: u32,
cpuCount: u32,
info: *mut cpu_info,
+ size: ::size_t,
) -> status_t;
pub fn is_computer_on() -> i32;
pub fn is_computer_on_fire() -> ::c_double;
pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int;
pub fn set_signal_stack(base: *mut ::c_void, size: ::size_t);
- pub fn wait_for_objects(
- infos: *mut object_wait_info,
- numInfos: ::c_int,
- ) -> ::ssize_t;
+ pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t;
pub fn wait_for_objects_etc(
infos: *mut object_wait_info,
numInfos: ::c_int,
@@ -939,11 +1109,7 @@ extern "C" {
pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int;
// kernel/fs_query.h
- pub fn fs_open_query(
- device: ::dev_t,
- query: *const ::c_char,
- flags: u32,
- ) -> *mut ::DIR;
+ pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR;
pub fn fs_open_live_query(
device: ::dev_t,
query: *const ::c_char,
@@ -953,11 +1119,7 @@ extern "C" {
) -> *mut ::DIR;
pub fn fs_close_query(d: *mut ::DIR) -> ::c_int;
pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent;
- pub fn get_path_for_dirent(
- dent: *mut ::dirent,
- buf: *mut ::c_char,
- len: ::size_t,
- ) -> status_t;
+ pub fn get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t;
// kernel/fs_volume.h
pub fn fs_mount_volume(
@@ -992,24 +1154,95 @@ extern "C" {
symbolLocation: *mut *mut ::c_void,
) -> status_t;
pub fn clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32);
- pub fn _get_image_info(
- image: image_id,
- info: *mut image_info,
- size: ::size_t,
- ) -> status_t;
+ pub fn _get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t;
pub fn _get_next_image_info(
team: team_id,
cookie: *mut i32,
info: *mut image_info,
size: ::size_t,
) -> status_t;
+ pub fn find_path(
+ codePointer: *const ::c_void,
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ pathBuffer: *mut ::c_char,
+ bufferSize: usize,
+ ) -> status_t;
+ pub fn find_path_etc(
+ codePointer: *const ::c_void,
+ dependency: *const ::c_char,
+ architecture: *const ::c_char,
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ flags: u32,
+ pathBuffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ ) -> status_t;
+ pub fn find_path_for_path(
+ path: *const ::c_char,
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ pathBuffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ ) -> status_t;
+ pub fn find_path_for_path_etc(
+ path: *const ::c_char,
+ dependency: *const ::c_char,
+ architectur: *const ::c_char,
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ flags: u32,
+ pathBuffer: *mut ::c_char,
+ bufferSize: ::size_t,
+ ) -> status_t;
+ pub fn find_paths(
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ _paths: *mut *mut *mut ::c_char,
+ pathCount: *mut ::size_t,
+ ) -> status_t;
+ pub fn find_paths_etc(
+ architecture: *const ::c_char,
+ baseDirectory: path_base_directory,
+ subPath: *const ::c_char,
+ flags: u32,
+ _paths: *mut *mut *mut ::c_char,
+ pathCount: *mut ::size_t,
+ ) -> status_t;
+ pub fn find_directory(
+ which: directory_which,
+ volume: ::dev_t,
+ createIt: bool,
+ pathString: *mut ::c_char,
+ length: i32,
+ ) -> status_t;
+}
+
+cfg_if! {
+ if #[cfg(libc_union)] {
+ extern "C" {
+ pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t;
+ }
+ }
}
// The following functions are defined as macros in C/C++
+#[inline]
+pub unsafe fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t {
+ _get_cpu_info_etc(
+ firstCPU,
+ cpuCount,
+ info,
+ core::mem::size_of::() as ::size_t,
+ )
+}
+
+#[inline]
pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t {
_get_area_info(id, info, core::mem::size_of::() as usize)
}
+#[inline]
pub unsafe fn get_next_area_info(
team: team_id,
cookie: *mut isize,
@@ -1023,10 +1256,12 @@ pub unsafe fn get_next_area_info(
)
}
+#[inline]
pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t {
_get_port_info(port, buf, core::mem::size_of::() as ::size_t)
}
+#[inline]
pub unsafe fn get_next_port_info(
port: port_id,
cookie: *mut i32,
@@ -1040,6 +1275,7 @@ pub unsafe fn get_next_port_info(
)
}
+#[inline]
pub unsafe fn get_port_message_info_etc(
port: port_id,
info: *mut port_message_info,
@@ -1055,15 +1291,13 @@ pub unsafe fn get_port_message_info_etc(
)
}
+#[inline]
pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t {
_get_sem_info(id, info, core::mem::size_of::() as ::size_t)
}
-pub unsafe fn get_next_sem_info(
- team: team_id,
- cookie: *mut i32,
- info: *mut sem_info,
-) -> status_t {
+#[inline]
+pub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t {
_get_next_sem_info(
team,
cookie,
@@ -1072,26 +1306,18 @@ pub unsafe fn get_next_sem_info(
)
}
+#[inline]
pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t {
_get_team_info(team, info, core::mem::size_of::() as ::size_t)
}
-pub unsafe fn get_next_team_info(
- cookie: *mut i32,
- info: *mut team_info,
-) -> status_t {
- _get_next_team_info(
- cookie,
- info,
- core::mem::size_of::() as ::size_t,
- )
+#[inline]
+pub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t {
+ _get_next_team_info(cookie, info, core::mem::size_of::() as ::size_t)
}
-pub unsafe fn get_team_usage_info(
- team: team_id,
- who: i32,
- info: *mut team_usage_info,
-) -> status_t {
+#[inline]
+pub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t {
_get_team_usage_info(
team,
who,
@@ -1100,13 +1326,12 @@ pub unsafe fn get_team_usage_info(
)
}
-pub unsafe fn get_thread_info(
- id: thread_id,
- info: *mut thread_info,
-) -> status_t {
+#[inline]
+pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t {
_get_thread_info(id, info, core::mem::size_of::() as ::size_t)
}
+#[inline]
pub unsafe fn get_next_thread_info(
team: team_id,
cookie: *mut i32,
@@ -1121,17 +1346,12 @@ pub unsafe fn get_next_thread_info(
}
// kernel/image.h
-pub unsafe fn get_image_info(
- image: image_id,
- info: *mut image_info,
-) -> status_t {
- _get_image_info(
- image,
- info,
- core::mem::size_of::() as ::size_t,
- )
+#[inline]
+pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t {
+ _get_image_info(image, info, core::mem::size_of::() as ::size_t)
}
+#[inline]
pub unsafe fn get_next_image_info(
team: team_id,
cookie: *mut i32,
diff --git a/src/unix/haiku/x86_64.rs b/src/unix/haiku/x86_64.rs
new file mode 100644
index 0000000000000..1b0462f204632
--- /dev/null
+++ b/src/unix/haiku/x86_64.rs
@@ -0,0 +1,264 @@
+s_no_extra_traits! {
+ pub struct fpu_state {
+ pub control: ::c_ushort,
+ pub status: ::c_ushort,
+ pub tag: ::c_ushort,
+ pub opcode: ::c_ushort,
+ pub rip: ::c_ulong,
+ pub rdp: ::c_ulong,
+ pub mxcsr: ::c_uint,
+ pub mscsr_mask: ::c_uint,
+ pub _fpreg: [[::c_uchar; 8]; 16],
+ pub _xmm: [[::c_uchar; 16]; 16],
+ pub _reserved_416_511: [::c_uchar; 96],
+ }
+
+ pub struct xstate_hdr {
+ pub bv: ::c_ulong,
+ pub xcomp_bv: ::c_ulong,
+ pub _reserved: [::c_uchar; 48],
+ }
+
+ pub struct savefpu {
+ pub fp_fxsave: fpu_state,
+ pub fp_xstate: xstate_hdr,
+ pub _fp_ymm: [[::c_uchar; 16]; 16],
+ }
+
+ pub struct mcontext_t {
+ pub rax: ::c_ulong,
+ pub rbx: ::c_ulong,
+ pub rcx: ::c_ulong,
+ pub rdx: ::c_ulong,
+ pub rdi: ::c_ulong,
+ pub rsi: ::c_ulong,
+ pub rbp: ::c_ulong,
+ pub r8: ::c_ulong,
+ pub r9: ::c_ulong,
+ pub r10: ::c_ulong,
+ pub r11: ::c_ulong,
+ pub r12: ::c_ulong,
+ pub r13: ::c_ulong,
+ pub r14: ::c_ulong,
+ pub r15: ::c_ulong,
+ pub rsp: ::c_ulong,
+ pub rip: ::c_ulong,
+ pub rflags: ::c_ulong,
+ pub fpu: savefpu,
+ }
+
+ pub struct ucontext_t {
+ pub uc_link: *mut ucontext_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_stack: ::stack_t,
+ pub uc_mcontext: mcontext_t,
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for fpu_state {
+ fn eq(&self, other: &fpu_state) -> bool {
+ self.control == other.control
+ && self.status == other.status
+ && self.tag == other.tag
+ && self.opcode == other.opcode
+ && self.rip == other.rip
+ && self.rdp == other.rdp
+ && self.mxcsr == other.mxcsr
+ && self.mscsr_mask == other.mscsr_mask
+ && self._fpreg.iter().zip(other._fpreg.iter()).all(|(a, b)| a == b)
+ && self._xmm.iter().zip(other._xmm.iter()).all(|(a, b)| a == b)
+ && self._reserved_416_511.
+ iter().
+ zip(other._reserved_416_511.iter()).
+ all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for fpu_state {}
+ impl ::fmt::Debug for fpu_state {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("fpu_state")
+ .field("control", &self.control)
+ .field("status", &self.status)
+ .field("tag", &self.tag)
+ .field("opcode", &self.opcode)
+ .field("rip", &self.rip)
+ .field("rdp", &self.rdp)
+ .field("mxcsr", &self.mxcsr)
+ .field("mscsr_mask", &self.mscsr_mask)
+ // FIXME: .field("_fpreg", &self._fpreg)
+ // FIXME: .field("_xmm", &self._xmm)
+ // FIXME: .field("_reserved_416_511", &self._reserved_416_511)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for fpu_state {
+ fn hash(&self, state: &mut H) {
+ self.control.hash(state);
+ self.status.hash(state);
+ self.tag.hash(state);
+ self.opcode.hash(state);
+ self.rip.hash(state);
+ self.rdp.hash(state);
+ self.mxcsr.hash(state);
+ self.mscsr_mask.hash(state);
+ self._fpreg.hash(state);
+ self._xmm.hash(state);
+ self._reserved_416_511.hash(state);
+ }
+ }
+
+ impl PartialEq for xstate_hdr {
+ fn eq(&self, other: &xstate_hdr) -> bool {
+ self.bv == other.bv
+ && self.xcomp_bv == other.xcomp_bv
+ && self._reserved.iter().zip(other._reserved.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for xstate_hdr {}
+ impl ::fmt::Debug for xstate_hdr {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("xstate_hdr")
+ .field("bv", &self.bv)
+ .field("xcomp_bv", &self.xcomp_bv)
+ // FIXME: .field("_reserved", &field._reserved)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for xstate_hdr {
+ fn hash(&self, state: &mut H) {
+ self.bv.hash(state);
+ self.xcomp_bv.hash(state);
+ self._reserved.hash(state);
+ }
+ }
+
+ impl PartialEq for savefpu {
+ fn eq(&self, other: &savefpu) -> bool {
+ self.fp_fxsave == other.fp_fxsave
+ && self.fp_xstate == other.fp_xstate
+ && self._fp_ymm.iter().zip(other._fp_ymm.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for savefpu {}
+ impl ::fmt::Debug for savefpu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("savefpu")
+ .field("fp_fxsave", &self.fp_fxsave)
+ .field("fp_xstate", &self.fp_xstate)
+ // FIXME: .field("_fp_ymm", &field._fp_ymm)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for savefpu {
+ fn hash(&self, state: &mut H) {
+ self.fp_fxsave.hash(state);
+ self.fp_xstate.hash(state);
+ self._fp_ymm.hash(state);
+ }
+ }
+
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.rax == other.rax
+ && self.rbx == other.rbx
+ && self.rbx == other.rbx
+ && self.rcx == other.rcx
+ && self.rdx == other.rdx
+ && self.rdi == other.rdi
+ && self.rsi == other.rsi
+ && self.r8 == other.r8
+ && self.r9 == other.r9
+ && self.r10 == other.r10
+ && self.r11 == other.r11
+ && self.r12 == other.r12
+ && self.r13 == other.r13
+ && self.r14 == other.r14
+ && self.r15 == other.r15
+ && self.rsp == other.rsp
+ && self.rip == other.rip
+ && self.rflags == other.rflags
+ && self.fpu == other.fpu
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("rax", &self.rax)
+ .field("rbx", &self.rbx)
+ .field("rcx", &self.rcx)
+ .field("rdx", &self.rdx)
+ .field("rdi", &self.rdi)
+ .field("rsi", &self.rsi)
+ .field("rbp", &self.rbp)
+ .field("r8", &self.r8)
+ .field("r9", &self.r9)
+ .field("r10", &self.r10)
+ .field("r11", &self.r11)
+ .field("r12", &self.r12)
+ .field("r13", &self.r13)
+ .field("r14", &self.r14)
+ .field("r15", &self.r15)
+ .field("rsp", &self.rsp)
+ .field("rip", &self.rip)
+ .field("rflags", &self.rflags)
+ .field("fpu", &self.fpu)
+ .finish()
+
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash(&self, state: &mut H) {
+ self.rax.hash(state);
+ self.rbx.hash(state);
+ self.rcx.hash(state);
+ self.rdx.hash(state);
+ self.rdi.hash(state);
+ self.rsi.hash(state);
+ self.rbp.hash(state);
+ self.r8.hash(state);
+ self.r9.hash(state);
+ self.r10.hash(state);
+ self.r11.hash(state);
+ self.r12.hash(state);
+ self.r13.hash(state);
+ self.r14.hash(state);
+ self.r15.hash(state);
+ self.rsp.hash(state);
+ self.rip.hash(state);
+ self.rflags.hash(state);
+ self.fpu.hash(state);
+ }
+ }
+
+ impl PartialEq for ucontext_t {
+ fn eq(&self, other: &ucontext_t) -> bool {
+ self.uc_link == other.uc_link
+ && self.uc_sigmask == other.uc_sigmask
+ && self.uc_stack == other.uc_stack
+ && self.uc_mcontext == other.uc_mcontext
+ }
+ }
+ impl Eq for ucontext_t {}
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_link", &self.uc_link)
+ .field("uc_sigmask", &self.uc_sigmask)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ucontext_t {
+ fn hash(&self, state: &mut H) {
+ self.uc_link.hash(state);
+ self.uc_sigmask.hash(state);
+ self.uc_stack.hash(state);
+ self.uc_mcontext.hash(state);
+ }
+ }
+ }
+}
diff --git a/src/unix/hermit/mod.rs b/src/unix/hermit/mod.rs
index ad0fd14dcc9d2..6a656a8598f21 100644
--- a/src/unix/hermit/mod.rs
+++ b/src/unix/hermit/mod.rs
@@ -960,35 +960,19 @@ safe_f! {
extern "C" {
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
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 bind(
- s: ::c_int,
- name: *const ::sockaddr,
- namelen: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) -> ::c_int;
- pub fn clock_gettime(
- clock_id: ::clockid_t,
- tp: *mut ::timespec,
- ) -> ::c_int;
+ pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn getpwuid_r(
@@ -1011,11 +995,7 @@ extern "C" {
arg: *mut ::c_void,
) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const ::sigset_t,
- oset: *mut ::sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const ::sigset_t, oset: *mut ::sigset_t) -> ::c_int;
pub fn recvfrom(
s: ::c_int,
diff --git a/src/unix/linux_like/android/b32/arm.rs b/src/unix/linux_like/android/b32/arm.rs
index 8a53e53994134..8b8e549550e3b 100644
--- a/src/unix/linux_like/android/b32/arm.rs
+++ b/src/unix/linux_like/android/b32/arm.rs
@@ -138,7 +138,7 @@ cfg_if! {
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask__c_anonymous_union.hash(state);
- &self.uc_regspace[..].hash(state);
+ self.uc_regspace[..].hash(state);
// Ignore padding field
}
}
@@ -501,6 +501,9 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_R0: ::c_int = 0;
diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs
index e686da60b5cbd..1f4f796f2a94a 100644
--- a/src/unix/linux_like/android/b32/mod.rs
+++ b/src/unix/linux_like/android/b32/mod.rs
@@ -8,6 +8,7 @@ pub type off64_t = ::c_longlong;
pub type sigset_t = ::c_ulong;
pub type socklen_t = i32;
pub type time64_t = i64;
+pub type __u64 = ::c_ulonglong;
s! {
pub struct sigaction {
@@ -27,7 +28,7 @@ s! {
__pad0: [::c_uchar; 4],
__st_ino: ::ino_t,
pub st_mode: ::c_uint,
- pub st_nlink: ::c_uint,
+ pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulonglong,
@@ -49,7 +50,7 @@ s! {
__pad0: [::c_uchar; 4],
__st_ino: ::ino_t,
pub st_mode: ::c_uint,
- pub st_nlink: ::c_uint,
+ pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulonglong,
@@ -119,6 +120,14 @@ s! {
__reserved: [::c_char; 12],
}
+ pub struct pthread_barrier_t {
+ __private: [i32; 8],
+ }
+
+ pub struct pthread_spinlock_t {
+ __private: [i32; 2],
+ }
+
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
@@ -194,13 +203,9 @@ pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
pub const PTRACE_GETFPREGS: ::c_int = 14;
pub const PTRACE_SETFPREGS: ::c_int = 15;
-pub const PTRACE_GETREGS: ::c_int = 12;
-pub const PTRACE_SETREGS: ::c_int = 13;
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t =
- pthread_mutex_t { value: 0 };
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t =
- pthread_cond_t { value: 0 };
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0 };
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { value: 0 };
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
lock: PTHREAD_MUTEX_INITIALIZER,
cond: PTHREAD_COND_INITIALIZER,
diff --git a/src/unix/linux_like/android/b32/x86/mod.rs b/src/unix/linux_like/android/b32/x86/mod.rs
index 6507cb4e07da3..9545ecbfbc44f 100644
--- a/src/unix/linux_like/android/b32/x86/mod.rs
+++ b/src/unix/linux_like/android/b32/x86/mod.rs
@@ -533,6 +533,9 @@ pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
diff --git a/src/unix/linux_like/android/b64/aarch64/int128.rs b/src/unix/linux_like/android/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/android/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs
index 5acb328be9aec..36871b084c80d 100644
--- a/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -1,12 +1,13 @@
pub type c_char = u8;
pub type wchar_t = u32;
+pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
- pub st_nlink: ::c_uint,
+ pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
@@ -29,7 +30,7 @@ s! {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
- pub st_nlink: ::c_uint,
+ pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
@@ -47,6 +48,13 @@ s! {
__unused4: ::c_uint,
__unused5: ::c_uint,
}
+
+ pub struct user_regs_struct {
+ pub regs: [u64; 31],
+ pub sp: u64,
+ pub pc: u64,
+ pub pstate: u64,
+ }
}
pub const O_DIRECT: ::c_int = 0x10000;
@@ -125,6 +133,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;
@@ -365,6 +374,9 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_syscalls: ::c_long = 436;
cfg_if! {
@@ -373,3 +385,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs
index c23e2dbf2df1d..67d0dacf17e93 100644
--- a/src/unix/linux_like/android/b64/mod.rs
+++ b/src/unix/linux_like/android/b64/mod.rs
@@ -105,6 +105,14 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct pthread_barrier_t {
+ __private: [i64; 4],
+ }
+
+ pub struct pthread_spinlock_t {
+ __private: i64,
+ }
}
s_no_extra_traits! {
@@ -323,6 +331,12 @@ f! {
extern "C" {
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+ pub fn __system_property_wait(
+ pi: *const ::prop_info,
+ __old_serial: u32,
+ __new_serial_ptr: *mut u32,
+ __relative_timeout: *const ::timespec,
+ ) -> bool;
}
cfg_if! {
@@ -332,6 +346,9 @@ cfg_if! {
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/linux_like/android/b64/riscv64/align.rs b/src/unix/linux_like/android/b64/riscv64/align.rs
new file mode 100644
index 0000000000000..8e949963a637f
--- /dev/null
+++ b/src/unix/linux_like/android/b64/riscv64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct max_align_t {
+ priv_: [f32; 8]
+ }
+}
diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs
new file mode 100644
index 0000000000000..2421792cfd4f7
--- /dev/null
+++ b/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -0,0 +1,342 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+ pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_mode: ::c_uint,
+ pub st_nlink: ::c_uint,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: ::dev_t,
+ __pad1: ::c_ulong,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::c_int,
+ __pad2: ::c_int,
+ pub st_blocks: ::c_long,
+ 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,
+ __unused4: ::c_uint,
+ __unused5: ::c_uint,
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_mode: ::c_uint,
+ pub st_nlink: ::c_uint,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: ::dev_t,
+ __pad1: ::c_ulong,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::c_int,
+ __pad2: ::c_int,
+ pub st_blocks: ::c_long,
+ 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,
+ __unused4: ::c_uint,
+ __unused5: ::c_uint,
+ }
+}
+
+pub const O_DIRECT: ::c_int = 0x40000;
+pub const O_DIRECTORY: ::c_int = 0x200000;
+pub const O_NOFOLLOW: ::c_int = 0x400000;
+pub const O_LARGEFILE: ::c_int = 0x100000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+// From NDK's asm/hwcap.h
+pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << ('I' - 'A');
+pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << ('M' - 'A');
+pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << ('A' - 'A');
+pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << ('F' - 'A');
+pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << ('D' - 'A');
+pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << ('C' - 'A');
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_syscalls: ::c_long = 436;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs
index 27fd17b3ffb34..1e3ee31c5be59 100644
--- a/src/unix/linux_like/android/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/android/b64/x86_64/mod.rs
@@ -1,6 +1,7 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
@@ -46,6 +47,61 @@ s! {
pub struct _libc_xmmreg {
pub element: [u32; 4],
}
+
+ pub struct user_regs_struct {
+ pub r15: ::c_ulong,
+ pub r14: ::c_ulong,
+ pub r13: ::c_ulong,
+ pub r12: ::c_ulong,
+ pub rbp: ::c_ulong,
+ pub rbx: ::c_ulong,
+ pub r11: ::c_ulong,
+ pub r10: ::c_ulong,
+ pub r9: ::c_ulong,
+ pub r8: ::c_ulong,
+ pub rax: ::c_ulong,
+ pub rcx: ::c_ulong,
+ pub rdx: ::c_ulong,
+ pub rsi: ::c_ulong,
+ pub rdi: ::c_ulong,
+ pub orig_rax: ::c_ulong,
+ pub rip: ::c_ulong,
+ pub cs: ::c_ulong,
+ pub eflags: ::c_ulong,
+ pub rsp: ::c_ulong,
+ pub ss: ::c_ulong,
+ pub fs_base: ::c_ulong,
+ pub gs_base: ::c_ulong,
+ pub ds: ::c_ulong,
+ pub es: ::c_ulong,
+ pub fs: ::c_ulong,
+ pub gs: ::c_ulong,
+ }
+
+ pub struct user {
+ pub regs: user_regs_struct,
+ pub u_fpvalid: ::c_int,
+ pub i387: user_fpregs_struct,
+ pub u_tsize: ::c_ulong,
+ pub u_dsize: ::c_ulong,
+ pub u_ssize: ::c_ulong,
+ pub start_code: ::c_ulong,
+ pub start_stack: ::c_ulong,
+ pub signal: ::c_long,
+ __reserved: ::c_int,
+ #[cfg(target_pointer_width = "32")]
+ __pad1: u32,
+ pub u_ar0: *mut user_regs_struct,
+ #[cfg(target_pointer_width = "32")]
+ __pad2: u32,
+ pub u_fpstate: *mut user_fpregs_struct,
+ pub magic: ::c_ulong,
+ pub u_comm: [::c_char; 32],
+ pub u_debugreg: [::c_ulong; 8],
+ pub error_code: ::c_ulong,
+ pub fault_address: ::c_ulong,
+ }
+
}
cfg_if! {
@@ -117,6 +173,20 @@ s_no_extra_traits! {
pub uc_sigmask64: __c_anonymous_uc_sigmask,
__fpregs_mem: _libc_fpstate,
}
+
+ pub struct user_fpregs_struct {
+ pub cwd: ::c_ushort,
+ pub swd: ::c_ushort,
+ pub ftw: ::c_ushort,
+ pub fop: ::c_ushort,
+ pub rip: ::c_ulong,
+ pub rdp: ::c_ulong,
+ pub mxcsr: ::c_uint,
+ pub mxcr_mask: ::c_uint,
+ pub st_space: [::c_uint; 32],
+ pub xmm_space: [::c_uint; 64],
+ padding: [::c_uint; 24],
+ }
}
cfg_if! {
@@ -253,6 +323,62 @@ cfg_if! {
// Ignore padding field
}
}
+
+ impl PartialEq for user_fpregs_struct {
+ fn eq(&self, other: &user_fpregs_struct) -> bool {
+ self.cwd == other.cwd
+ && self.swd == other.swd
+ && self.ftw == other.ftw
+ && self.fop == other.fop
+ && self.rip == other.rip
+ && self.rdp == other.rdp
+ && self.mxcsr == other.mxcsr
+ && self.mxcr_mask == other.mxcr_mask
+ && self.st_space == other.st_space
+ && self
+ .xmm_space
+ .iter()
+ .zip(other.xmm_space.iter())
+ .all(|(a,b)| a == b)
+ // Ignore padding field
+ }
+ }
+
+ impl Eq for user_fpregs_struct {}
+
+ impl ::fmt::Debug for user_fpregs_struct {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("user_fpregs_struct")
+ .field("cwd", &self.cwd)
+ .field("swd", &self.swd)
+ .field("ftw", &self.ftw)
+ .field("fop", &self.fop)
+ .field("rip", &self.rip)
+ .field("rdp", &self.rdp)
+ .field("mxcsr", &self.mxcsr)
+ .field("mxcr_mask", &self.mxcr_mask)
+ .field("st_space", &self.st_space)
+ // FIXME: .field("xmm_space", &self.xmm_space)
+ // Ignore padding field
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for user_fpregs_struct {
+ fn hash(&self, state: &mut H) {
+ self.cwd.hash(state);
+ self.swd.hash(state);
+ self.ftw.hash(state);
+ self.fop.hash(state);
+ self.rip.hash(state);
+ self.rdp.hash(state);
+ self.mxcsr.hash(state);
+ self.mxcr_mask.hash(state);
+ self.st_space.hash(state);
+ self.xmm_space.hash(state);
+ // Ignore padding field
+ }
+ }
}
}
@@ -602,6 +728,9 @@ pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index a86bf96f9429c..adec24a0a0ef4 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -11,6 +11,7 @@ pub type useconds_t = u32;
pub type pthread_t = ::c_long;
pub type pthread_mutexattr_t = ::c_long;
pub type pthread_rwlockattr_t = ::c_long;
+pub type pthread_barrierattr_t = ::c_int;
pub type pthread_condattr_t = ::c_long;
pub type pthread_key_t = ::c_int;
pub type fsfilcnt_t = ::c_ulong;
@@ -26,6 +27,25 @@ pub type loff_t = ::c_longlong;
pub type __kernel_loff_t = ::c_longlong;
pub type __kernel_pid_t = ::c_int;
+pub type __u8 = ::c_uchar;
+pub type __u16 = ::c_ushort;
+pub type __s16 = ::c_short;
+pub type __u32 = ::c_uint;
+pub type __s32 = ::c_int;
+
+// linux/elf.h
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Off = u32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Off = u64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
s! {
pub struct stack_t {
pub ss_sp: *mut ::c_void,
@@ -73,6 +93,19 @@ s! {
pub c_ospeed: ::speed_t,
}
+ pub struct mallinfo {
+ pub arena: ::size_t,
+ pub ordblks: ::size_t,
+ pub smblks: ::size_t,
+ pub hblks: ::size_t,
+ pub hblkhd: ::size_t,
+ pub usmblks: ::size_t,
+ pub fsmblks: ::size_t,
+ pub uordblks: ::size_t,
+ pub fordblks: ::size_t,
+ pub keepcost: ::size_t,
+ }
+
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
@@ -244,6 +277,218 @@ s! {
pub svm_cid: ::c_uint,
pub svm_zero: [u8; 4]
}
+
+ // linux/elf.h
+
+ 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,
+ }
+
+ // link.h
+
+ 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,
+
+ // These fields were added in Android R
+ pub dlpi_adds: ::c_ulonglong,
+ pub dlpi_subs: ::c_ulonglong,
+ pub dlpi_tls_modid: ::size_t,
+ pub dlpi_tls_data: *mut ::c_void,
+ }
+
+ // linux/filter.h
+ pub struct sock_filter {
+ pub code: ::__u16,
+ pub jt: ::__u8,
+ pub jf: ::__u8,
+ pub k: ::__u32,
+ }
+
+ pub struct sock_fprog {
+ pub len: ::c_ushort,
+ pub filter: *mut sock_filter,
+ }
+
+ // linux/seccomp.h
+ pub struct seccomp_data {
+ pub nr: ::c_int,
+ pub arch: ::__u32,
+ pub instruction_pointer: ::__u64,
+ pub args: [::__u64; 6],
+ }
+
+ pub struct ptrace_peeksiginfo_args {
+ pub off: ::__u64,
+ pub flags: ::__u32,
+ pub nr: ::__s32,
+ }
+
+ // linux/input.h
+ pub struct input_event {
+ pub time: ::timeval,
+ pub type_: ::__u16,
+ pub code: ::__u16,
+ pub value: ::__s32,
+ }
+
+ pub struct input_id {
+ pub bustype: ::__u16,
+ pub vendor: ::__u16,
+ pub product: ::__u16,
+ pub version: ::__u16,
+ }
+
+ pub struct input_absinfo {
+ pub value: ::__s32,
+ pub minimum: ::__s32,
+ pub maximum: ::__s32,
+ pub fuzz: ::__s32,
+ pub flat: ::__s32,
+ pub resolution: ::__s32,
+ }
+
+ pub struct input_keymap_entry {
+ pub flags: ::__u8,
+ pub len: ::__u8,
+ pub index: ::__u16,
+ pub keycode: ::__u32,
+ pub scancode: [::__u8; 32],
+ }
+
+ pub struct input_mask {
+ pub type_: ::__u32,
+ pub codes_size: ::__u32,
+ pub codes_ptr: ::__u64,
+ }
+
+ pub struct ff_replay {
+ pub length: ::__u16,
+ pub delay: ::__u16,
+ }
+
+ pub struct ff_trigger {
+ pub button: ::__u16,
+ pub interval: ::__u16,
+ }
+
+ pub struct ff_envelope {
+ pub attack_length: ::__u16,
+ pub attack_level: ::__u16,
+ pub fade_length: ::__u16,
+ pub fade_level: ::__u16,
+ }
+
+ pub struct ff_constant_effect {
+ pub level: ::__s16,
+ pub envelope: ff_envelope,
+ }
+
+ pub struct ff_ramp_effect {
+ pub start_level: ::__s16,
+ pub end_level: ::__s16,
+ pub envelope: ff_envelope,
+ }
+
+ pub struct ff_condition_effect {
+ pub right_saturation: ::__u16,
+ pub left_saturation: ::__u16,
+
+ pub right_coeff: ::__s16,
+ pub left_coeff: ::__s16,
+
+ pub deadband: ::__u16,
+ pub center: ::__s16,
+ }
+
+ pub struct ff_periodic_effect {
+ pub waveform: ::__u16,
+ pub period: ::__u16,
+ pub magnitude: ::__s16,
+ pub offset: ::__s16,
+ pub phase: ::__u16,
+
+ pub envelope: ff_envelope,
+
+ pub custom_len: ::__u32,
+ pub custom_data: *mut ::__s16,
+ }
+
+ pub struct ff_rumble_effect {
+ pub strong_magnitude: ::__u16,
+ pub weak_magnitude: ::__u16,
+ }
+
+ pub struct ff_effect {
+ pub type_: ::__u16,
+ pub id: ::__s16,
+ pub direction: ::__u16,
+ pub trigger: ff_trigger,
+ pub replay: ff_replay,
+ // FIXME this is actually a union
+ #[cfg(target_pointer_width = "64")]
+ pub u: [u64; 4],
+ #[cfg(target_pointer_width = "32")]
+ pub u: [u32; 7],
+ }
+
+ // linux/uinput.h
+ pub struct uinput_ff_upload {
+ pub request_id: ::__u32,
+ pub retval: ::__s32,
+ pub effect: ff_effect,
+ pub old: ff_effect,
+ }
+
+ pub struct uinput_ff_erase {
+ pub request_id: ::__u32,
+ pub retval: ::__s32,
+ pub effect_id: ::__u32,
+ }
+
+ pub struct uinput_abs_setup {
+ pub code: ::__u16,
+ pub absinfo: input_absinfo,
+ }
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -306,6 +551,22 @@ s_no_extra_traits! {
pub salg_name: [::c_uchar; 64],
}
+ pub struct uinput_setup {
+ pub id: input_id,
+ pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+ pub ff_effects_max: ::__u32,
+ }
+
+ pub struct uinput_user_dev {
+ pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+ pub id: input_id,
+ pub ff_effects_max: ::__u32,
+ pub absmax: [::__s32; ABS_CNT],
+ pub absmin: [::__s32; ABS_CNT],
+ pub absfuzz: [::__s32; ABS_CNT],
+ pub absflat: [::__s32; ABS_CNT],
+ }
+
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
/// type are unsound and will be removed in the future.
#[deprecated(
@@ -317,6 +578,12 @@ s_no_extra_traits! {
pub ivlen: u32,
pub iv: [::c_uchar; 0],
}
+
+ pub struct prop_info {
+ __name: [::c_char; 32],
+ __serial: ::c_uint,
+ __value: [[::c_char; 4]; 23],
+ }
}
cfg_if! {
@@ -598,6 +865,72 @@ cfg_if! {
}
}
+ impl PartialEq for uinput_setup {
+ fn eq(&self, other: &uinput_setup) -> bool {
+ self.id == other.id
+ && self.name[..] == other.name[..]
+ && self.ff_effects_max == other.ff_effects_max
+ }
+ }
+ impl Eq for uinput_setup {}
+
+ impl ::fmt::Debug for uinput_setup {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("uinput_setup")
+ .field("id", &self.id)
+ .field("name", &&self.name[..])
+ .field("ff_effects_max", &self.ff_effects_max)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for uinput_setup {
+ fn hash(&self, state: &mut H) {
+ self.id.hash(state);
+ self.name.hash(state);
+ self.ff_effects_max.hash(state);
+ }
+ }
+
+ impl PartialEq for uinput_user_dev {
+ fn eq(&self, other: &uinput_user_dev) -> bool {
+ self.name[..] == other.name[..]
+ && self.id == other.id
+ && self.ff_effects_max == other.ff_effects_max
+ && self.absmax[..] == other.absmax[..]
+ && self.absmin[..] == other.absmin[..]
+ && self.absfuzz[..] == other.absfuzz[..]
+ && self.absflat[..] == other.absflat[..]
+ }
+ }
+ impl Eq for uinput_user_dev {}
+
+ impl ::fmt::Debug for uinput_user_dev {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("uinput_setup")
+ .field("name", &&self.name[..])
+ .field("id", &self.id)
+ .field("ff_effects_max", &self.ff_effects_max)
+ .field("absmax", &&self.absmax[..])
+ .field("absmin", &&self.absmin[..])
+ .field("absfuzz", &&self.absfuzz[..])
+ .field("absflat", &&self.absflat[..])
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for uinput_user_dev {
+ fn hash(&self, state: &mut H) {
+ self.name.hash(state);
+ self.id.hash(state);
+ self.ff_effects_max.hash(state);
+ self.absmax.hash(state);
+ self.absmin.hash(state);
+ self.absfuzz.hash(state);
+ self.absflat.hash(state);
+ }
+ }
+
#[allow(deprecated)]
impl af_alg_iv {
fn as_slice(&self) -> &[u8] {
@@ -635,6 +968,24 @@ cfg_if! {
self.as_slice().hash(state);
}
}
+
+ impl PartialEq for prop_info {
+ fn eq(&self, other: &prop_info) -> bool {
+ self.__name == other.__name &&
+ self.__serial == other.__serial &&
+ self.__value == other.__value
+ }
+ }
+ impl Eq for prop_info {}
+ impl ::fmt::Debug for prop_info {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("prop_info")
+ .field("__name", &self.__name)
+ .field("__serial", &self.__serial)
+ .field("__value", &self.__value)
+ .finish()
+ }
+ }
}
}
@@ -663,9 +1014,6 @@ pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-pub const EPOLLRDHUP: ::c_int = 0x00002000;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
// sys/eventfd.h
pub const EFD_SEMAPHORE: ::c_int = 0x1;
@@ -680,6 +1028,8 @@ pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2;
pub const USER_PROCESS: ::c_short = 7;
+pub const _POSIX_VDISABLE: ::cc_t = 0;
+
// linux/falloc.h
pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
@@ -858,6 +1208,12 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
+pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010;
+
+pub const IFF_LOWER_UP: ::c_int = 0x10000;
+pub const IFF_DORMANT: ::c_int = 0x20000;
+pub const IFF_ECHO: ::c_int = 0x40000;
+
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
@@ -1076,6 +1432,9 @@ pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
pub const SO_TIMESTAMP: ::c_int = 29;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
@@ -1089,8 +1448,6 @@ pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_BUSY_POLL: ::c_int = 46;
-pub const TCP_ULP: ::c_int = 31;
-
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
pub const O_ACCMODE: ::c_int = 3;
@@ -1128,33 +1485,6 @@ pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0o200000;
-pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
-pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
-pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
-pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
-pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
-pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
-pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
-pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
-pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
-pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
-pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
-pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
-pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
-pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
-pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
-pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
-pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
-pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
-pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
-pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
-pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
-pub const TMPFS_MAGIC: ::c_long = 0x01021994;
-pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
-
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const PTRACE_TRACEME: ::c_int = 0;
@@ -1167,6 +1497,8 @@ pub const PTRACE_POKEUSER: ::c_int = 6;
pub const PTRACE_CONT: ::c_int = 7;
pub const PTRACE_KILL: ::c_int = 8;
pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
pub const PTRACE_ATTACH: ::c_int = 16;
pub const PTRACE_DETACH: ::c_int = 17;
pub const PTRACE_SYSCALL: ::c_int = 24;
@@ -1174,6 +1506,8 @@ pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
pub const PTRACE_EVENT_STOP: ::c_int = 128;
@@ -1205,12 +1539,17 @@ pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
+pub const RLIM_NLIMITS: ::c_int = 16;
pub const RLIM_INFINITY: ::rlim_t = !0;
pub const TCGETS: ::c_int = 0x5401;
pub const TCSETS: ::c_int = 0x5402;
pub const TCSETSW: ::c_int = 0x5403;
pub const TCSETSF: ::c_int = 0x5404;
+pub const TCGETS2: ::c_int = 0x802c542a;
+pub const TCSETS2: ::c_int = 0x402c542b;
+pub const TCSETSW2: ::c_int = 0x402c542c;
+pub const TCSETSF2: ::c_int = 0x402c542d;
pub const TCGETA: ::c_int = 0x5405;
pub const TCSETA: ::c_int = 0x5406;
pub const TCSETAW: ::c_int = 0x5407;
@@ -1259,11 +1598,8 @@ pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00000008;
-pub const AI_MASK: ::c_int = AI_PASSIVE
- | AI_CANONNAME
- | AI_NUMERICHOST
- | AI_NUMERICSERV
- | AI_ADDRCONFIG;
+pub const AI_MASK: ::c_int =
+ AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
pub const AI_ALL: ::c_int = 0x00000100;
pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
@@ -1407,6 +1743,12 @@ pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKIOMIN: ::c_int = 0x1278;
+pub const BLKIOOPT: ::c_int = 0x1279;
+pub const BLKSSZGET: ::c_int = 0x1268;
+pub const BLKPBSZGET: ::c_int = 0x127B;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
@@ -1660,14 +2002,39 @@ pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
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 NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
+pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
+pub const NETLINK_CAP_ACK: ::c_int = 10;
+pub const NETLINK_EXT_ACK: ::c_int = 11;
+pub const NETLINK_GET_STRICT_CHK: ::c_int = 12;
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;
+pub const GRND_INSECURE: ::c_uint = 0x0004;
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 SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1;
+pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2;
+pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4;
+pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8;
+
+pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000;
+pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000;
+pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff;
+
+pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000;
+pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000;
+pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD;
+pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000;
+pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000;
+pub const SECCOMP_RET_USER_NOTIF: ::c_uint = 0x7fc00000;
+pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000;
+pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000;
+pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000;
+
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);
@@ -1720,6 +2087,39 @@ pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
pub const MFD_HUGETLB: ::c_uint = 0x0004;
+pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
+pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
+pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
+pub const MFD_HUGE_2MB: ::c_uint = 0x54000000;
+pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000;
+pub const MFD_HUGE_16MB: ::c_uint = 0x60000000;
+pub const MFD_HUGE_32MB: ::c_uint = 0x64000000;
+pub const MFD_HUGE_256MB: ::c_uint = 0x70000000;
+pub const MFD_HUGE_512MB: ::c_uint = 0x74000000;
+pub const MFD_HUGE_1GB: ::c_uint = 0x78000000;
+pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000;
+pub const MFD_HUGE_16GB: ::c_uint = 0x88000000;
+pub const MFD_HUGE_MASK: ::c_uint = 63;
+pub const MFD_HUGE_SHIFT: ::c_uint = 26;
+
+// 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_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;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
// linux/netfilter.h
pub const NF_DROP: ::c_int = 0;
@@ -1989,9 +2389,52 @@ pub const NFT_TRACETYPE_RULE: ::c_int = 3;
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
pub const NFT_NG_RANDOM: ::c_int = 1;
+// linux/input.h
+pub const FF_MAX: ::__u16 = 0x7f;
+pub const FF_CNT: usize = FF_MAX as usize + 1;
+
+// linux/input-event-codes.h
+pub const INPUT_PROP_MAX: ::__u16 = 0x1f;
+pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1;
+pub const EV_MAX: ::__u16 = 0x1f;
+pub const EV_CNT: usize = EV_MAX as usize + 1;
+pub const SYN_MAX: ::__u16 = 0xf;
+pub const SYN_CNT: usize = SYN_MAX as usize + 1;
+pub const KEY_MAX: ::__u16 = 0x2ff;
+pub const KEY_CNT: usize = KEY_MAX as usize + 1;
+pub const REL_MAX: ::__u16 = 0x0f;
+pub const REL_CNT: usize = REL_MAX as usize + 1;
+pub const ABS_MAX: ::__u16 = 0x3f;
+pub const ABS_CNT: usize = ABS_MAX as usize + 1;
+pub const SW_MAX: ::__u16 = 0x0f;
+pub const SW_CNT: usize = SW_MAX as usize + 1;
+pub const MSC_MAX: ::__u16 = 0x07;
+pub const MSC_CNT: usize = MSC_MAX as usize + 1;
+pub const LED_MAX: ::__u16 = 0x0f;
+pub const LED_CNT: usize = LED_MAX as usize + 1;
+pub const REP_MAX: ::__u16 = 0x01;
+pub const REP_CNT: usize = REP_MAX as usize + 1;
+pub const SND_MAX: ::__u16 = 0x07;
+pub const SND_CNT: usize = SND_MAX as usize + 1;
+
+// linux/uinput.h
+pub const UINPUT_VERSION: ::c_uint = 5;
+pub const UINPUT_MAX_NAME_SIZE: usize = 80;
+
+// bionic/libc/kernel/uapi/linux/if_tun.h
pub const IFF_TUN: ::c_int = 0x0001;
pub const IFF_TAP: ::c_int = 0x0002;
+pub const IFF_NAPI: ::c_int = 0x0010;
+pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
pub const IFF_NO_PI: ::c_int = 0x1000;
+pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
+pub const IFF_VNET_HDR: ::c_int = 0x4000;
+pub const IFF_TUN_EXCL: ::c_int = 0x8000;
+pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
+pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
+pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
+pub const IFF_PERSIST: ::c_int = 0x0800;
+pub const IFF_NOFILTER: ::c_int = 0x1000;
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
// from https://android.googlesource.com/
@@ -2153,6 +2596,9 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
+// sys/mman.h
+pub const MLOCK_ONFAULT: ::c_int = 0x01;
+
// uapi/linux/vm_sockets.h
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
@@ -2180,10 +2626,10 @@ pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
pub const IN_IGNORED: u32 = 0x0000_8000;
pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
-// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
-// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
-// pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_ISDIR: u32 = 0x4000_0000;
pub const IN_ONESHOT: u32 = 0x8000_0000;
@@ -2219,8 +2665,7 @@ pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
-pub const FUTEX_CMD_MASK: ::c_int =
- !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
// linux/errqueue.h
pub const SO_EE_ORIGIN_NONE: u8 = 0;
@@ -2279,6 +2724,20 @@ pub const SCHED_BATCH: ::c_int = 3;
pub const SCHED_IDLE: ::c_int = 5;
pub const SCHED_DEADLINE: ::c_int = 6;
+pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
+
+pub const CLONE_PIDFD: ::c_int = 0x1000;
+
+// linux/mempolicy.h
+pub const MPOL_DEFAULT: ::c_int = 0;
+pub const MPOL_PREFERRED: ::c_int = 1;
+pub const MPOL_BIND: ::c_int = 2;
+pub const MPOL_INTERLEAVE: ::c_int = 3;
+pub const MPOL_LOCAL: ::c_int = 4;
+pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13;
+pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14;
+pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
+
// bits/seek_constants.h
pub const SEEK_DATA: ::c_int = 3;
pub const SEEK_HOLE: ::c_int = 4;
@@ -2289,6 +2748,243 @@ pub const AF_VSOCK: ::c_int = 40;
pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
+pub const SOMAXCONN: ::c_int = 128;
+
+// sys/prctl.h
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
+pub const PR_GET_SECUREBITS: ::c_int = 27;
+pub const PR_SET_SECUREBITS: ::c_int = 28;
+
+// sys/system_properties.h
+pub const PROP_VALUE_MAX: ::c_int = 92;
+pub const PROP_NAME_MAX: ::c_int = 32;
+
+// sys/prctl.h
+pub const PR_SET_VMA: ::c_int = 0x53564d41;
+pub const PR_SET_VMA_ANON_NAME: ::c_int = 0;
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
+pub const PR_GET_SECCOMP: ::c_int = 21;
+pub const PR_SET_SECCOMP: ::c_int = 22;
+pub const PR_GET_TIMING: ::c_int = 13;
+pub const PR_SET_TIMING: ::c_int = 14;
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
+
+// linux/if_addr.h
+pub const IFA_UNSPEC: ::c_ushort = 0;
+pub const IFA_ADDRESS: ::c_ushort = 1;
+pub const IFA_LOCAL: ::c_ushort = 2;
+pub const IFA_LABEL: ::c_ushort = 3;
+pub const IFA_BROADCAST: ::c_ushort = 4;
+pub const IFA_ANYCAST: ::c_ushort = 5;
+pub const IFA_CACHEINFO: ::c_ushort = 6;
+pub const IFA_MULTICAST: ::c_ushort = 7;
+
+pub const IFA_F_SECONDARY: u32 = 0x01;
+pub const IFA_F_TEMPORARY: u32 = 0x01;
+pub const IFA_F_NODAD: u32 = 0x02;
+pub const IFA_F_OPTIMISTIC: u32 = 0x04;
+pub const IFA_F_DADFAILED: u32 = 0x08;
+pub const IFA_F_HOMEADDRESS: u32 = 0x10;
+pub const IFA_F_DEPRECATED: u32 = 0x20;
+pub const IFA_F_TENTATIVE: u32 = 0x40;
+pub const IFA_F_PERMANENT: u32 = 0x80;
+
+// linux/if_link.h
+pub const IFLA_UNSPEC: ::c_ushort = 0;
+pub const IFLA_ADDRESS: ::c_ushort = 1;
+pub const IFLA_BROADCAST: ::c_ushort = 2;
+pub const IFLA_IFNAME: ::c_ushort = 3;
+pub const IFLA_MTU: ::c_ushort = 4;
+pub const IFLA_LINK: ::c_ushort = 5;
+pub const IFLA_QDISC: ::c_ushort = 6;
+pub const IFLA_STATS: ::c_ushort = 7;
+pub const IFLA_COST: ::c_ushort = 8;
+pub const IFLA_PRIORITY: ::c_ushort = 9;
+pub const IFLA_MASTER: ::c_ushort = 10;
+pub const IFLA_WIRELESS: ::c_ushort = 11;
+pub const IFLA_PROTINFO: ::c_ushort = 12;
+pub const IFLA_TXQLEN: ::c_ushort = 13;
+pub const IFLA_MAP: ::c_ushort = 14;
+pub const IFLA_WEIGHT: ::c_ushort = 15;
+pub const IFLA_OPERSTATE: ::c_ushort = 16;
+pub const IFLA_LINKMODE: ::c_ushort = 17;
+pub const IFLA_LINKINFO: ::c_ushort = 18;
+pub const IFLA_NET_NS_PID: ::c_ushort = 19;
+pub const IFLA_IFALIAS: ::c_ushort = 20;
+pub const IFLA_NUM_VF: ::c_ushort = 21;
+pub const IFLA_VFINFO_LIST: ::c_ushort = 22;
+pub const IFLA_STATS64: ::c_ushort = 23;
+pub const IFLA_VF_PORTS: ::c_ushort = 24;
+pub const IFLA_PORT_SELF: ::c_ushort = 25;
+pub const IFLA_AF_SPEC: ::c_ushort = 26;
+pub const IFLA_GROUP: ::c_ushort = 27;
+pub const IFLA_NET_NS_FD: ::c_ushort = 28;
+pub const IFLA_EXT_MASK: ::c_ushort = 29;
+pub const IFLA_PROMISCUITY: ::c_ushort = 30;
+pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31;
+pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32;
+pub const IFLA_CARRIER: ::c_ushort = 33;
+pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34;
+pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35;
+pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36;
+pub const IFLA_LINK_NETNSID: ::c_ushort = 37;
+pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38;
+pub const IFLA_PROTO_DOWN: ::c_ushort = 39;
+pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40;
+pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41;
+pub const IFLA_PAD: ::c_ushort = 42;
+pub const IFLA_XDP: ::c_ushort = 43;
+pub const IFLA_EVENT: ::c_ushort = 44;
+pub const IFLA_NEW_NETNSID: ::c_ushort = 45;
+pub const IFLA_IF_NETNSID: ::c_ushort = 46;
+pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID;
+pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47;
+pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48;
+pub const IFLA_NEW_IFINDEX: ::c_ushort = 49;
+pub const IFLA_MIN_MTU: ::c_ushort = 50;
+pub const IFLA_MAX_MTU: ::c_ushort = 51;
+
+pub const IFLA_INFO_UNSPEC: ::c_ushort = 0;
+pub const IFLA_INFO_KIND: ::c_ushort = 1;
+pub const IFLA_INFO_DATA: ::c_ushort = 2;
+pub const IFLA_INFO_XSTATS: ::c_ushort = 3;
+pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4;
+pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
+
+// linux/rtnetlink.h
+pub const TCA_UNSPEC: ::c_ushort = 0;
+pub const TCA_KIND: ::c_ushort = 1;
+pub const TCA_OPTIONS: ::c_ushort = 2;
+pub const TCA_STATS: ::c_ushort = 3;
+pub const TCA_XSTATS: ::c_ushort = 4;
+pub const TCA_RATE: ::c_ushort = 5;
+pub const TCA_FCNT: ::c_ushort = 6;
+pub const TCA_STATS2: ::c_ushort = 7;
+pub const TCA_STAB: ::c_ushort = 8;
+
+pub const RTM_NEWLINK: u16 = 16;
+pub const RTM_DELLINK: u16 = 17;
+pub const RTM_GETLINK: u16 = 18;
+pub const RTM_SETLINK: u16 = 19;
+pub const RTM_NEWADDR: u16 = 20;
+pub const RTM_DELADDR: u16 = 21;
+pub const RTM_GETADDR: u16 = 22;
+pub const RTM_NEWROUTE: u16 = 24;
+pub const RTM_DELROUTE: u16 = 25;
+pub const RTM_GETROUTE: u16 = 26;
+pub const RTM_NEWNEIGH: u16 = 28;
+pub const RTM_DELNEIGH: u16 = 29;
+pub const RTM_GETNEIGH: u16 = 30;
+pub const RTM_NEWRULE: u16 = 32;
+pub const RTM_DELRULE: u16 = 33;
+pub const RTM_GETRULE: u16 = 34;
+pub const RTM_NEWQDISC: u16 = 36;
+pub const RTM_DELQDISC: u16 = 37;
+pub const RTM_GETQDISC: u16 = 38;
+pub const RTM_NEWTCLASS: u16 = 40;
+pub const RTM_DELTCLASS: u16 = 41;
+pub const RTM_GETTCLASS: u16 = 42;
+pub const RTM_NEWTFILTER: u16 = 44;
+pub const RTM_DELTFILTER: u16 = 45;
+pub const RTM_GETTFILTER: u16 = 46;
+pub const RTM_NEWACTION: u16 = 48;
+pub const RTM_DELACTION: u16 = 49;
+pub const RTM_GETACTION: u16 = 50;
+pub const RTM_NEWPREFIX: u16 = 52;
+pub const RTM_GETMULTICAST: u16 = 58;
+pub const RTM_GETANYCAST: u16 = 62;
+pub const RTM_NEWNEIGHTBL: u16 = 64;
+pub const RTM_GETNEIGHTBL: u16 = 66;
+pub const RTM_SETNEIGHTBL: u16 = 67;
+pub const RTM_NEWNDUSEROPT: u16 = 68;
+pub const RTM_NEWADDRLABEL: u16 = 72;
+pub const RTM_DELADDRLABEL: u16 = 73;
+pub const RTM_GETADDRLABEL: u16 = 74;
+pub const RTM_GETDCB: u16 = 78;
+pub const RTM_SETDCB: u16 = 79;
+pub const RTM_NEWNETCONF: u16 = 80;
+pub const RTM_GETNETCONF: u16 = 82;
+pub const RTM_NEWMDB: u16 = 84;
+pub const RTM_DELMDB: u16 = 85;
+pub const RTM_GETMDB: u16 = 86;
+pub const RTM_NEWNSID: u16 = 88;
+pub const RTM_DELNSID: u16 = 89;
+pub const RTM_GETNSID: u16 = 90;
+
+pub const RTM_F_NOTIFY: ::c_uint = 0x100;
+pub const RTM_F_CLONED: ::c_uint = 0x200;
+pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
+pub const RTM_F_PREFIX: ::c_uint = 0x800;
+
+pub const RTA_UNSPEC: ::c_ushort = 0;
+pub const RTA_DST: ::c_ushort = 1;
+pub const RTA_SRC: ::c_ushort = 2;
+pub const RTA_IIF: ::c_ushort = 3;
+pub const RTA_OIF: ::c_ushort = 4;
+pub const RTA_GATEWAY: ::c_ushort = 5;
+pub const RTA_PRIORITY: ::c_ushort = 6;
+pub const RTA_PREFSRC: ::c_ushort = 7;
+pub const RTA_METRICS: ::c_ushort = 8;
+pub const RTA_MULTIPATH: ::c_ushort = 9;
+pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
+pub const RTA_FLOW: ::c_ushort = 11;
+pub const RTA_CACHEINFO: ::c_ushort = 12;
+pub const RTA_SESSION: ::c_ushort = 13; // No longer used
+pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
+pub const RTA_TABLE: ::c_ushort = 15;
+pub const RTA_MARK: ::c_ushort = 16;
+pub const RTA_MFC_STATS: ::c_ushort = 17;
+
+pub const RTN_UNSPEC: ::c_uchar = 0;
+pub const RTN_UNICAST: ::c_uchar = 1;
+pub const RTN_LOCAL: ::c_uchar = 2;
+pub const RTN_BROADCAST: ::c_uchar = 3;
+pub const RTN_ANYCAST: ::c_uchar = 4;
+pub const RTN_MULTICAST: ::c_uchar = 5;
+pub const RTN_BLACKHOLE: ::c_uchar = 6;
+pub const RTN_UNREACHABLE: ::c_uchar = 7;
+pub const RTN_PROHIBIT: ::c_uchar = 8;
+pub const RTN_THROW: ::c_uchar = 9;
+pub const RTN_NAT: ::c_uchar = 10;
+pub const RTN_XRESOLVE: ::c_uchar = 11;
+
+pub const RTPROT_UNSPEC: ::c_uchar = 0;
+pub const RTPROT_REDIRECT: ::c_uchar = 1;
+pub const RTPROT_KERNEL: ::c_uchar = 2;
+pub const RTPROT_BOOT: ::c_uchar = 3;
+pub const RTPROT_STATIC: ::c_uchar = 4;
+
+pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
+pub const RT_SCOPE_SITE: ::c_uchar = 200;
+pub const RT_SCOPE_LINK: ::c_uchar = 253;
+pub const RT_SCOPE_HOST: ::c_uchar = 254;
+pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
+
+pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
+pub const RT_TABLE_COMPAT: ::c_uchar = 252;
+pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
+pub const RT_TABLE_MAIN: ::c_uchar = 254;
+pub const RT_TABLE_LOCAL: ::c_uchar = 255;
+
+pub const RTMSG_NEWDEVICE: u32 = 0x11;
+pub const RTMSG_DELDEVICE: u32 = 0x12;
+pub const RTMSG_NEWROUTE: u32 = 0x21;
+pub const RTMSG_DELROUTE: u32 = 0x22;
+
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
+cfg_if! {
+ if #[cfg(not(target_arch = "s390x"))] {
+ pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
+ } else if #[cfg(target_arch = "s390x")] {
+ pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
+ }
+}
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2304,6 +3000,12 @@ f! {
}
}
+ pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t {
+ let _dummy: cpu_set_t = ::mem::zeroed();
+ let size_in_bits = 8 * ::mem::size_of_val(&_dummy.__bits[0]);
+ ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t
+ }
+
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.__bits.iter_mut() {
*slot = 0;
@@ -2311,40 +3013,50 @@ f! {
}
pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
- let size_in___bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]);
- let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
+ let size_in_bits
+ = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc
+ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
cpuset.__bits[idx] |= 1 << offset;
()
}
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
- let size_in___bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]);
- let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
+ let size_in_bits
+ = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc
+ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
cpuset.__bits[idx] &= !(1 << offset);
()
}
pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
- let size_in___bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]);
- let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
+ let size_in_bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]);
+ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
0 != (cpuset.__bits[idx] & (1 << offset))
}
+ pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int {
+ let mut s: u32 = 0;
+ let size_of_mask = ::mem::size_of_val(&cpuset.__bits[0]);
+ for i in cpuset.__bits[..(size / size_of_mask)].iter() {
+ s += i.count_ones();
+ };
+ s as ::c_int
+ }
+
+ pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int {
+ CPU_COUNT_S(::mem::size_of::(), cpuset)
+ }
+
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
set1.__bits == set2.__bits
}
+
pub fn major(dev: ::dev_t) -> ::c_int {
((dev >> 8) & 0xfff) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int
}
- pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t {
- let ma = ma as ::dev_t;
- 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)
}
@@ -2354,6 +3066,15 @@ f! {
}
}
+safe_f! {
+ pub {const} fn makedev(ma: ::c_uint, mi: ::c_uint) -> ::dev_t {
+ let ma = ma as ::dev_t;
+ let mi = mi as ::dev_t;
+ ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
+ }
+
+}
+
extern "C" {
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
@@ -2371,29 +3092,14 @@ extern "C" {
new_limit: *const ::rlimit64,
old_limit: *mut ::rlimit64,
) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
@@ -2411,18 +3117,8 @@ extern "C" {
sevlen: ::size_t,
flags: ::c_int,
) -> ::c_int;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- count: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- count: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn process_vm_readv(
pid: ::pid_t,
local_iov: *const ::iovec,
@@ -2444,11 +3140,13 @@ extern "C" {
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
pub fn __sched_cpufree(set: *mut ::cpu_set_t);
- pub fn __sched_cpucount(
- setsize: ::size_t,
- set: *const cpu_set_t,
- ) -> ::c_int;
+ pub fn __sched_cpucount(setsize: ::size_t, set: *const cpu_set_t) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
+ pub fn mallinfo() -> ::mallinfo;
+ // available from API 23
+ pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
+
+ pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
pub fn utmpname(name: *const ::c_char) -> ::c_int;
pub fn setutent();
@@ -2456,28 +3154,10 @@ extern "C" {
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn fallocate(
- fd: ::c_int,
- mode: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn fallocate64(
- fd: ::c_int,
- mode: ::c_int,
- offset: ::off64_t,
- len: ::off64_t,
- ) -> ::c_int;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn posix_fallocate64(
- fd: ::c_int,
- offset: ::off64_t,
- len: ::off64_t,
- ) -> ::c_int;
+ pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
pub fn getxattr(
path: *const c_char,
name: *const c_char,
@@ -2517,34 +3197,15 @@ extern "C" {
size: ::size_t,
flags: ::c_int,
) -> ::c_int;
- pub fn listxattr(
- path: *const c_char,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
- pub fn llistxattr(
- path: *const c_char,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
- pub fn flistxattr(
- filedes: ::c_int,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
+ pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+ pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t;
pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
- pub fn signalfd(
- fd: ::c_int,
- mask: *const ::sigset_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
pub fn timerfd_create(clock: ::clockid_t, flags: ::c_int) -> ::c_int;
- pub fn timerfd_gettime(
- fd: ::c_int,
- current_value: *mut itimerspec,
- ) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int, current_value: *mut itimerspec) -> ::c_int;
pub fn timerfd_settime(
fd: ::c_int,
flags: ::c_int,
@@ -2552,11 +3213,8 @@ extern "C" {
old_value: *mut itimerspec,
) -> ::c_int;
pub fn syscall(num: ::c_long, ...) -> ::c_long;
- pub fn sched_getaffinity(
- pid: ::pid_t,
- cpusetsize: ::size_t,
- cpuset: *mut cpu_set_t,
- ) -> ::c_int;
+ pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+ -> ::c_int;
pub fn sched_setaffinity(
pid: ::pid_t,
cpusetsize: ::size_t,
@@ -2570,12 +3228,8 @@ extern "C" {
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;
+ pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+ -> ::c_int;
pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
@@ -2584,16 +3238,8 @@ extern "C" {
pub fn unshare(flags: ::c_int) -> ::c_int;
pub fn umount(target: *const ::c_char) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
- pub fn tee(
- fd_in: ::c_int,
- fd_out: ::c_int,
- len: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
- pub fn settimeofday(
- tv: *const ::timeval,
- tz: *const ::timezone,
- ) -> ::c_int;
+ pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn splice(
fd_in: ::c_int,
off_in: *mut ::loff_t,
@@ -2603,17 +3249,10 @@ extern "C" {
flags: ::c_uint,
) -> ::ssize_t;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec)
- -> ::c_int;
- pub fn sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
- pub fn sched_setparam(
- pid: ::pid_t,
- param: *const ::sched_param,
- ) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
pub fn vmsplice(
@@ -2642,6 +3281,28 @@ extern "C" {
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ attr: *const ::pthread_barrierattr_t,
+ shared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ attr: *mut ::pthread_barrierattr_t,
+ shared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrier_init(
+ barrier: *mut pthread_barrier_t,
+ attr: *const ::pthread_barrierattr_t,
+ count: ::c_uint,
+ ) -> ::c_int;
+ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
pub fn clone(
cb: extern "C" fn(*mut ::c_void) -> ::c_int,
child_stack: *mut ::c_void,
@@ -2704,11 +3365,7 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
@@ -2781,17 +3438,9 @@ extern "C" {
) -> ::c_int;
pub fn inotify_init() -> ::c_int;
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
- pub fn inotify_add_watch(
- fd: ::c_int,
- path: *const ::c_char,
- mask: u32,
- ) -> ::c_int;
+ pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
- pub fn regcomp(
- preg: *mut ::regex_t,
- pattern: *const ::c_char,
- cflags: ::c_int,
- ) -> ::c_int;
+ pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regexec(
preg: *const ::regex_t,
@@ -2813,6 +3462,50 @@ extern "C" {
pub fn android_set_abort_message(msg: *const ::c_char);
pub fn gettid() -> ::pid_t;
+
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+ pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+
+ pub fn __system_property_set(__name: *const ::c_char, __value: *const ::c_char) -> ::c_int;
+ pub fn __system_property_get(__name: *const ::c_char, __value: *mut ::c_char) -> ::c_int;
+ pub fn __system_property_find(__name: *const ::c_char) -> *const prop_info;
+ pub fn __system_property_find_nth(__n: ::c_uint) -> *const prop_info;
+ pub fn __system_property_foreach(
+ __callback: unsafe extern "C" fn(__pi: *const prop_info, __cookie: *mut ::c_void),
+ __cookie: *mut ::c_void,
+ ) -> ::c_int;
+
+ // #include
+ /// Only available in API Version 21+
+ pub fn dl_iterate_phdr(
+ callback: ::Option<
+ unsafe extern "C" fn(
+ info: *mut dl_phdr_info,
+ size: usize,
+ data: *mut ::c_void,
+ ) -> ::c_int,
+ >,
+ data: *mut ::c_void,
+ ) -> ::c_int;
+
+ pub fn arc4random() -> u32;
+ pub fn arc4random_uniform(__upper_bound: u32) -> u32;
+ pub fn arc4random_buf(__buf: *mut ::c_void, __n: ::size_t);
+
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+ pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *const ::c_char) -> *mut ::c_char;
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index 9599e1992fbeb..f2024900cbca9 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -899,8 +899,6 @@ pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
pub const RTLD_NODELETE: ::c_int = 0x1000;
pub const RTLD_NOW: ::c_int = 0x2;
-pub const TCP_MD5SIG: ::c_int = 14;
-
align_const! {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
@@ -967,10 +965,6 @@ pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_HUGETLB: ::c_int = 0o4000;
pub const SHM_NORESERVE: ::c_int = 0o10000;
-pub const EPOLLRDHUP: ::c_int = 0x2000;
-pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
@@ -1155,9 +1149,6 @@ pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
-pub const XATTR_CREATE: ::c_int = 0x1;
-pub const XATTR_REPLACE: ::c_int = 0x2;
-
pub const _POSIX_VDISABLE: ::cc_t = 0;
pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
@@ -1337,19 +1328,10 @@ pub const POSIX_MADV_DONTNEED: ::c_int = 0;
pub const RLIM_INFINITY: ::rlim_t = !0;
pub const RLIMIT_NLIMITS: ::c_int = 15;
+pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
-pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
-pub const TCP_THIN_DUPACK: ::c_int = 17;
-pub const TCP_USER_TIMEOUT: ::c_int = 18;
-pub const TCP_REPAIR: ::c_int = 19;
-pub const TCP_REPAIR_QUEUE: ::c_int = 20;
-pub const TCP_QUEUE_SEQ: ::c_int = 21;
-pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
-pub const TCP_FASTOPEN: ::c_int = 23;
-pub const TCP_TIMESTAMP: ::c_int = 24;
-
#[doc(hidden)]
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
pub const SIGUNUSED: ::c_int = ::SIGSYS;
@@ -1386,8 +1368,6 @@ pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
pub const PTRACE_LISTEN: ::c_int = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
-
pub const PTRACE_GETFPREGS: ::c_uint = 14;
pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
@@ -1689,6 +1669,8 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const SOMAXCONN: ::c_int = 128;
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -1758,8 +1740,10 @@ f! {
minor |= (dev & 0xffffff00) >> 12;
minor as ::c_uint
}
+}
- pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
@@ -1776,14 +1760,9 @@ extern "C" {
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
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);
@@ -1794,23 +1773,12 @@ extern "C" {
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
- pub fn shm_open(
- name: *const c_char,
- oflag: ::c_int,
- mode: mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn __errno_location() -> *mut ::c_int;
- pub fn fopen64(
- filename: *const c_char,
- mode: *const c_char,
- ) -> *mut ::FILE;
+ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn freopen64(
filename: *const c_char,
mode: *const c_char,
@@ -1819,38 +1787,16 @@ extern "C" {
pub fn tmpfile64() -> *mut ::FILE;
pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
- pub fn fseeko64(
- stream: *mut ::FILE,
- offset: ::off64_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
- pub fn mkostemps(
- template: *mut ::c_char,
- suffixlen: ::c_int,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
- -> *mut ::c_char;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
@@ -1869,11 +1815,7 @@ extern "C" {
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
// Not available now on Android
- pub fn mkfifoat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
@@ -1888,35 +1830,21 @@ extern "C" {
pub fn glob(
pattern: *const c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
diff --git a/src/unix/linux_like/linux/align.rs b/src/unix/linux_like/linux/align.rs
index 11f5504a5a68d..3a3277f29cf47 100644
--- a/src/unix/linux_like/linux/align.rs
+++ b/src/unix/linux_like/linux/align.rs
@@ -9,7 +9,8 @@ macro_rules! expand_align {
target_arch = "sparc64",
target_arch = "aarch64",
target_arch = "riscv64",
- target_arch = "riscv32"),
+ target_arch = "riscv32",
+ target_arch = "loongarch64"),
repr(align(4)))]
#[cfg_attr(not(any(target_pointer_width = "32",
target_arch = "x86_64",
@@ -19,7 +20,8 @@ macro_rules! expand_align {
target_arch = "sparc64",
target_arch = "aarch64",
target_arch = "riscv64",
- target_arch = "riscv32")),
+ target_arch = "riscv32",
+ target_arch = "loongarch64")),
repr(align(8)))]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
@@ -76,6 +78,7 @@ macro_rules! expand_align {
any(target_arch = "mips",
target_arch = "arm",
target_arch = "hexagon",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
@@ -85,6 +88,7 @@ macro_rules! expand_align {
not(any(target_arch = "mips",
target_arch = "arm",
target_arch = "hexagon",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
@@ -99,6 +103,7 @@ macro_rules! expand_align {
any(target_arch = "mips",
target_arch = "arm",
target_arch = "hexagon",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
@@ -108,6 +113,7 @@ macro_rules! expand_align {
not(any(target_arch = "mips",
target_arch = "arm",
target_arch = "hexagon",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
new file mode 100644
index 0000000000000..40bc30a4f336b
--- /dev/null
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -0,0 +1,287 @@
+s! {
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+}
+
+// include/uapi/asm-generic/socket.h
+// arch/alpha/include/uapi/asm/socket.h
+// tools/include/uapi/asm-generic/socket.h
+// arch/mips/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 1;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 1;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 20;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 21;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+cfg_if! {
+ // Some of these platforms in CI already have these constants.
+ // But they may still not have those _OLD ones.
+ if #[cfg(all(any(target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64"),
+ not(target_env = "musl")))] {
+ pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+ pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+ pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+ pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+ pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+ pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+ }
+}
+
+cfg_if! {
+ if #[cfg(any(target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64"))] {
+ pub const FICLONE: ::c_ulong = 0x40049409;
+ pub const FICLONERANGE: ::c_ulong = 0x4020940D;
+ }
+}
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x5401;
+pub const TCSETS: ::Ioctl = 0x5402;
+pub const TCSETSW: ::Ioctl = 0x5403;
+pub const TCSETSF: ::Ioctl = 0x5404;
+pub const TCGETA: ::Ioctl = 0x5405;
+pub const TCSETA: ::Ioctl = 0x5406;
+pub const TCSETAW: ::Ioctl = 0x5407;
+pub const TCSETAF: ::Ioctl = 0x5408;
+pub const TCSBRK: ::Ioctl = 0x5409;
+pub const TCXONC: ::Ioctl = 0x540A;
+pub const TCFLSH: ::Ioctl = 0x540B;
+pub const TIOCEXCL: ::Ioctl = 0x540C;
+pub const TIOCNXCL: ::Ioctl = 0x540D;
+pub const TIOCSCTTY: ::Ioctl = 0x540E;
+pub const TIOCGPGRP: ::Ioctl = 0x540F;
+pub const TIOCSPGRP: ::Ioctl = 0x5410;
+pub const TIOCOUTQ: ::Ioctl = 0x5411;
+pub const TIOCSTI: ::Ioctl = 0x5412;
+pub const TIOCGWINSZ: ::Ioctl = 0x5413;
+pub const TIOCSWINSZ: ::Ioctl = 0x5414;
+pub const TIOCMGET: ::Ioctl = 0x5415;
+pub const TIOCMBIS: ::Ioctl = 0x5416;
+pub const TIOCMBIC: ::Ioctl = 0x5417;
+pub const TIOCMSET: ::Ioctl = 0x5418;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
+pub const FIONREAD: ::Ioctl = 0x541B;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x541D;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x5420;
+pub const FIONBIO: ::Ioctl = 0x5421;
+pub const TIOCNOTTY: ::Ioctl = 0x5422;
+pub const TIOCSETD: ::Ioctl = 0x5423;
+pub const TIOCGETD: ::Ioctl = 0x5424;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x5429;
+pub const TCGETS2: ::Ioctl = 0x802c542a;
+pub const TCSETS2: ::Ioctl = 0x402c542b;
+pub const TCSETSW2: ::Ioctl = 0x402c542c;
+pub const TCSETSF2: ::Ioctl = 0x402c542d;
+pub const TIOCGRS485: ::Ioctl = 0x542E;
+pub const TIOCSRS485: ::Ioctl = 0x542F;
+pub const TIOCGPTN: ::Ioctl = 0x80045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x40045431;
+pub const TIOCGDEV: ::Ioctl = 0x80045432;
+pub const TCGETX: ::Ioctl = 0x5432;
+pub const TCSETX: ::Ioctl = 0x5433;
+pub const TCSETXF: ::Ioctl = 0x5434;
+pub const TCSETXW: ::Ioctl = 0x5435;
+pub const TIOCSIG: ::Ioctl = 0x40045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x80045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x80045439;
+pub const TIOCGEXCL: ::Ioctl = 0x80045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x5441;
+// pub const TIOCGISO7816: ::Ioctl = 0x80285442;
+// pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x5450;
+pub const FIOCLEX: ::Ioctl = 0x5451;
+pub const FIOASYNC: ::Ioctl = 0x5452;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const BLKIOMIN: ::Ioctl = 0x1278;
+pub const BLKIOOPT: ::Ioctl = 0x1279;
+pub const BLKSSZGET: ::Ioctl = 0x1268;
+pub const BLKPBSZGET: ::Ioctl = 0x127B;
+
+cfg_if! {
+ if #[cfg(any(target_arch = "arm",
+ target_arch = "s390x"))] {
+ pub const FIOQSIZE: ::Ioctl = 0x545E;
+ } else {
+ pub const FIOQSIZE: ::Ioctl = 0x5460;
+ }
+}
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+ if #[cfg(any(target_env = "gnu",
+ target_env = "uclibc"))] {
+
+ pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+ pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+ pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+ pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+ pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+ pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+ pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+ pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+ pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+ pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+ pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+ pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+ pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+ pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+ pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+ pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+ pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+ } else if #[cfg(target_env = "musl")] {
+
+ pub const RLIMIT_CPU: ::c_int = 0;
+ pub const RLIMIT_FSIZE: ::c_int = 1;
+ pub const RLIMIT_DATA: ::c_int = 2;
+ pub const RLIMIT_STACK: ::c_int = 3;
+ pub const RLIMIT_CORE: ::c_int = 4;
+ pub const RLIMIT_RSS: ::c_int = 5;
+ pub const RLIMIT_NPROC: ::c_int = 6;
+ pub const RLIMIT_NOFILE: ::c_int = 7;
+ pub const RLIMIT_MEMLOCK: ::c_int = 8;
+ pub const RLIMIT_AS: ::c_int = 9;
+ pub const RLIMIT_LOCKS: ::c_int = 10;
+ pub const RLIMIT_SIGPENDING: ::c_int = 11;
+ pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+ pub const RLIMIT_NICE: ::c_int = 13;
+ pub const RLIMIT_RTPRIO: ::c_int = 14;
+ pub const RLIMIT_RTTIME: ::c_int = 15;
+ pub const RLIM_NLIMITS: ::c_int = 15;
+ pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_env = "gnu")] {
+ pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+ }
+ else if #[cfg(target_env = "uclibc")] {
+ pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
+ }
+}
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs
new file mode 100644
index 0000000000000..077417de52faf
--- /dev/null
+++ b/src/unix/linux_like/linux/arch/mips/mod.rs
@@ -0,0 +1,285 @@
+s! {
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 23],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+}
+
+// arch/mips/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_TYPE: ::c_int = 0x1008;
+// pub const SO_STYLE: ::c_int = SO_TYPE;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+// NOTE: These definitions are now being renamed with _OLD postfix,
+// but CI haven't support them yet.
+// Some related consts could be found in b32.rs and b64.rs
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 0x1005;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 0x1006;
+pub const SO_ACCEPTCONN: ::c_int = 0x1009;
+pub const SO_PROTOCOL: ::c_int = 0x1028;
+pub const SO_DOMAIN: ::c_int = 0x1029;
+
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_PASSCRED: ::c_int = 17;
+pub const SO_PEERCRED: ::c_int = 18;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_PEERSEC: ::c_int = 30;
+pub const SO_SNDBUFFORCE: ::c_int = 31;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+// NOTE: These definitions are now being renamed with _OLD postfix,
+// but CI haven't support them yet.
+// Some related consts could be found in b32.rs and b64.rs
+pub const SO_TIMESTAMP: ::c_int = 29;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x540d;
+pub const TCSETS: ::Ioctl = 0x540e;
+pub const TCSETSW: ::Ioctl = 0x540f;
+pub const TCSETSF: ::Ioctl = 0x5410;
+pub const TCGETA: ::Ioctl = 0x5401;
+pub const TCSETA: ::Ioctl = 0x5402;
+pub const TCSETAW: ::Ioctl = 0x5403;
+pub const TCSETAF: ::Ioctl = 0x5404;
+pub const TCSBRK: ::Ioctl = 0x5405;
+pub const TCXONC: ::Ioctl = 0x5406;
+pub const TCFLSH: ::Ioctl = 0x5407;
+pub const TIOCEXCL: ::Ioctl = 0x740d;
+pub const TIOCNXCL: ::Ioctl = 0x740e;
+pub const TIOCSCTTY: ::Ioctl = 0x5480;
+pub const TIOCGPGRP: ::Ioctl = 0x40047477;
+pub const TIOCSPGRP: ::Ioctl = 0x80047476;
+pub const TIOCOUTQ: ::Ioctl = 0x7472;
+pub const TIOCSTI: ::Ioctl = 0x5472;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x741d;
+pub const TIOCMBIS: ::Ioctl = 0x741b;
+pub const TIOCMBIC: ::Ioctl = 0x741c;
+pub const TIOCMSET: ::Ioctl = 0x741a;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5481;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x5482;
+pub const FIONREAD: ::Ioctl = 0x467f;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x5483;
+pub const TIOCCONS: ::Ioctl = 0x80047478;
+pub const TIOCGSERIAL: ::Ioctl = 0x5484;
+pub const TIOCSSERIAL: ::Ioctl = 0x5485;
+pub const TIOCPKT: ::Ioctl = 0x5470;
+pub const FIONBIO: ::Ioctl = 0x667e;
+pub const TIOCNOTTY: ::Ioctl = 0x5471;
+pub const TIOCSETD: ::Ioctl = 0x7401;
+pub const TIOCGETD: ::Ioctl = 0x7400;
+pub const TCSBRKP: ::Ioctl = 0x5486;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x7416;
+pub const TCGETS2: ::Ioctl = 0x4030542a;
+pub const TCSETS2: ::Ioctl = 0x8030542b;
+pub const TCSETSW2: ::Ioctl = 0x8030542c;
+pub const TCSETSF2: ::Ioctl = 0x8030542d;
+pub const TIOCGPTN: ::Ioctl = 0x40045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x6602;
+pub const FIOCLEX: ::Ioctl = 0x6601;
+pub const FIOASYNC: ::Ioctl = 0x667d;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5488;
+pub const TIOCSERGWILD: ::Ioctl = 0x5489;
+pub const TIOCSERSWILD: ::Ioctl = 0x548a;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x548b;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x548c;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x548d;
+pub const TIOCSERGETLSR: ::Ioctl = 0x548e;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x548f;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x5490;
+pub const TIOCMIWAIT: ::Ioctl = 0x5491;
+pub const TIOCGICOUNT: ::Ioctl = 0x5492;
+pub const FIOQSIZE: ::Ioctl = 0x667f;
+pub const TIOCSLTC: ::Ioctl = 0x7475;
+pub const TIOCGETP: ::Ioctl = 0x7408;
+pub const TIOCSETP: ::Ioctl = 0x7409;
+pub const TIOCSETN: ::Ioctl = 0x740a;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+
+cfg_if! {
+ if #[cfg(target_env = "musl")] {
+ pub const TIOCGRS485: ::Ioctl = 0x4020542e;
+ pub const TIOCSRS485: ::Ioctl = 0xc020542f;
+ }
+}
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x010;
+pub const TIOCM_SR: ::c_int = 0x020;
+pub const TIOCM_CTS: ::c_int = 0x040;
+pub const TIOCM_CAR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x200;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x400;
+
+pub const BOTHER: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+ if #[cfg(any(target_env = "gnu",
+ target_env = "uclibc"))] {
+
+ pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+ pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+ pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+ pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+ pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+ pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
+ pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
+ pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
+ pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
+ pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
+ pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+ pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+ pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+ pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+ pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+ pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+ pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+ } else if #[cfg(target_env = "musl")] {
+
+ pub const RLIMIT_CPU: ::c_int = 0;
+ pub const RLIMIT_FSIZE: ::c_int = 1;
+ pub const RLIMIT_DATA: ::c_int = 2;
+ pub const RLIMIT_STACK: ::c_int = 3;
+ pub const RLIMIT_CORE: ::c_int = 4;
+ pub const RLIMIT_NOFILE: ::c_int = 5;
+ pub const RLIMIT_AS: ::c_int = 6;
+ pub const RLIMIT_RSS: ::c_int = 7;
+ pub const RLIMIT_NPROC: ::c_int = 8;
+ pub const RLIMIT_MEMLOCK: ::c_int = 9;
+ pub const RLIMIT_LOCKS: ::c_int = 10;
+ pub const RLIMIT_SIGPENDING: ::c_int = 11;
+ pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+ pub const RLIMIT_NICE: ::c_int = 13;
+ pub const RLIMIT_RTPRIO: ::c_int = 14;
+ pub const RLIMIT_RTTIME: ::c_int = 15;
+ pub const RLIM_NLIMITS: ::c_int = 15;
+ pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+ pub const RLIM_INFINITY: ::rlim_t = !0;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_env = "gnu")] {
+ pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+ } else if #[cfg(target_env = "uclibc")] {
+ pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_arch = "mips64",
+ any(target_env = "gnu",
+ target_env = "uclibc"))] {
+ pub const RLIM_INFINITY: ::rlim_t = !0;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_arch = "mips",
+ any(target_env = "gnu",
+ target_env = "uclibc"))] {
+ pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+ }
+}
diff --git a/src/unix/linux_like/linux/arch/mod.rs b/src/unix/linux_like/linux/arch/mod.rs
new file mode 100644
index 0000000000000..c1528f593f63e
--- /dev/null
+++ b/src/unix/linux_like/linux/arch/mod.rs
@@ -0,0 +1,15 @@
+cfg_if! {
+ if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] {
+ mod mips;
+ pub use self::mips::*;
+ } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] {
+ mod powerpc;
+ pub use self::powerpc::*;
+ } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
+ mod sparc;
+ pub use self::sparc::*;
+ } else {
+ mod generic;
+ pub use self::generic::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs
new file mode 100644
index 0000000000000..637b7a1e34746
--- /dev/null
+++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs
@@ -0,0 +1,240 @@
+// arch/powerpc/include/uapi/asm/socket.h
+
+pub const SOL_SOCKET: ::c_int = 1;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 1;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+// powerpc only differs in these
+pub const SO_RCVLOWAT: ::c_int = 16;
+pub const SO_SNDLOWAT: ::c_int = 17;
+pub const SO_RCVTIMEO: ::c_int = 18;
+pub const SO_SNDTIMEO: ::c_int = 19;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 18;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 19;
+pub const SO_PASSCRED: ::c_int = 20;
+pub const SO_PEERCRED: ::c_int = 21;
+// end
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+cfg_if! {
+ if #[cfg(target_env = "gnu")] {
+ pub const TCGETS: ::Ioctl = 0x403c7413;
+ pub const TCSETS: ::Ioctl = 0x803c7414;
+ pub const TCSETSW: ::Ioctl = 0x803c7415;
+ pub const TCSETSF: ::Ioctl = 0x803c7416;
+ } else if #[cfg(target_env = "musl")] {
+ pub const TCGETS: ::Ioctl = 0x402c7413;
+ pub const TCSETS: ::Ioctl = 0x802c7414;
+ pub const TCSETSW: ::Ioctl = 0x802c7415;
+ pub const TCSETSF: ::Ioctl = 0x802c7416;
+ }
+}
+
+pub const TCGETA: ::Ioctl = 0x40147417;
+pub const TCSETA: ::Ioctl = 0x80147418;
+pub const TCSETAW: ::Ioctl = 0x80147419;
+pub const TCSETAF: ::Ioctl = 0x8014741C;
+pub const TCSBRK: ::Ioctl = 0x2000741D;
+pub const TCXONC: ::Ioctl = 0x2000741E;
+pub const TCFLSH: ::Ioctl = 0x2000741F;
+pub const TIOCEXCL: ::Ioctl = 0x540C;
+pub const TIOCNXCL: ::Ioctl = 0x540D;
+pub const TIOCSCTTY: ::Ioctl = 0x540E;
+pub const TIOCGPGRP: ::Ioctl = 0x40047477;
+pub const TIOCSPGRP: ::Ioctl = 0x80047476;
+pub const TIOCOUTQ: ::Ioctl = 0x40047473;
+pub const TIOCSTI: ::Ioctl = 0x5412;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x5415;
+pub const TIOCMBIS: ::Ioctl = 0x5416;
+pub const TIOCMBIC: ::Ioctl = 0x5417;
+pub const TIOCMSET: ::Ioctl = 0x5418;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
+pub const FIONREAD: ::Ioctl = 0x4004667F;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x541D;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x5420;
+pub const FIONBIO: ::Ioctl = 0x8004667e;
+pub const TIOCNOTTY: ::Ioctl = 0x5422;
+pub const TIOCSETD: ::Ioctl = 0x5423;
+pub const TIOCGETD: ::Ioctl = 0x5424;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x5429;
+pub const TIOCGRS485: ::Ioctl = 0x542e;
+pub const TIOCSRS485: ::Ioctl = 0x542f;
+pub const TIOCGPTN: ::Ioctl = 0x40045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x20006602;
+pub const FIOCLEX: ::Ioctl = 0x20006601;
+pub const FIOASYNC: ::Ioctl = 0x8004667d;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+//pub const FIOQSIZE: ::Ioctl = 0x40086680;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0o0037;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+ if #[cfg(target_env = "gnu")] {
+
+ pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+ pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+ pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+ pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+ pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+ pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+ pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+ pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+ pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+ pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+ pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+ pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+ pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+ pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+ pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+ pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+ pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+ pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+ } else if #[cfg(target_env = "musl")] {
+
+ pub const RLIMIT_CPU: ::c_int = 0;
+ pub const RLIMIT_FSIZE: ::c_int = 1;
+ pub const RLIMIT_DATA: ::c_int = 2;
+ pub const RLIMIT_STACK: ::c_int = 3;
+ pub const RLIMIT_CORE: ::c_int = 4;
+ pub const RLIMIT_RSS: ::c_int = 5;
+ pub const RLIMIT_NPROC: ::c_int = 6;
+ pub const RLIMIT_NOFILE: ::c_int = 7;
+ pub const RLIMIT_MEMLOCK: ::c_int = 8;
+ pub const RLIMIT_AS: ::c_int = 9;
+ pub const RLIMIT_LOCKS: ::c_int = 10;
+ pub const RLIMIT_SIGPENDING: ::c_int = 11;
+ pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+ pub const RLIMIT_NICE: ::c_int = 13;
+ pub const RLIMIT_RTPRIO: ::c_int = 14;
+ pub const RLIMIT_RTTIME: ::c_int = 15;
+ pub const RLIM_NLIMITS: ::c_int = 15;
+ pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+ }
+}
+pub const RLIM_INFINITY: ::rlim_t = !0;
diff --git a/src/unix/linux_like/linux/arch/sparc/mod.rs b/src/unix/linux_like/linux/arch/sparc/mod.rs
new file mode 100644
index 0000000000000..da3e388e3d286
--- /dev/null
+++ b/src/unix/linux_like/linux/arch/sparc/mod.rs
@@ -0,0 +1,228 @@
+s! {
+ pub struct termios2 {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_line: ::cc_t,
+ pub c_cc: [::cc_t; 19],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+}
+
+// arch/sparc/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_PASSCRED: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_PEERCRED: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_BSDCOMPAT: ::c_int = 0x0400;
+pub const SO_RCVLOWAT: ::c_int = 0x0800;
+pub const SO_SNDLOWAT: ::c_int = 0x1000;
+pub const SO_RCVTIMEO: ::c_int = 0x2000;
+pub const SO_SNDTIMEO: ::c_int = 0x4000;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 0x2000;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 0x4000;
+pub const SO_ACCEPTCONN: ::c_int = 0x8000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
+pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_PROTOCOL: ::c_int = 0x1028;
+pub const SO_DOMAIN: ::c_int = 0x1029;
+pub const SO_NO_CHECK: ::c_int = 0x000b;
+pub const SO_PRIORITY: ::c_int = 0x000c;
+pub const SO_BINDTODEVICE: ::c_int = 0x000d;
+pub const SO_ATTACH_FILTER: ::c_int = 0x001a;
+pub const SO_DETACH_FILTER: ::c_int = 0x001b;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 0x001c;
+pub const SO_PEERSEC: ::c_int = 0x001e;
+pub const SO_PASSSEC: ::c_int = 0x001f;
+pub const SO_MARK: ::c_int = 0x0022;
+pub const SO_RXQ_OVFL: ::c_int = 0x0024;
+pub const SO_WIFI_STATUS: ::c_int = 0x0025;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 0x0026;
+pub const SO_NOFCS: ::c_int = 0x0027;
+pub const SO_LOCK_FILTER: ::c_int = 0x0028;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 0x0029;
+pub const SO_BUSY_POLL: ::c_int = 0x0030;
+pub const SO_MAX_PACING_RATE: ::c_int = 0x0031;
+pub const SO_BPF_EXTENSIONS: ::c_int = 0x0032;
+pub const SO_INCOMING_CPU: ::c_int = 0x0033;
+pub const SO_ATTACH_BPF: ::c_int = 0x0034;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 0x0035;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 0x0036;
+pub const SO_CNX_ADVICE: ::c_int = 0x0037;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 0x0038;
+pub const SO_MEMINFO: ::c_int = 0x0039;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 0x003a;
+pub const SO_COOKIE: ::c_int = 0x003b;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 0x003c;
+pub const SO_PEERGROUPS: ::c_int = 0x003d;
+pub const SO_ZEROCOPY: ::c_int = 0x003e;
+pub const SO_TXTIME: ::c_int = 0x003f;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 0x0041;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 0x5001;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 0x5002;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 0x5004;
+pub const SO_TIMESTAMP: ::c_int = 0x001d;
+pub const SO_TIMESTAMPNS: ::c_int = 0x0021;
+pub const SO_TIMESTAMPING: ::c_int = 0x0023;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 0x001d;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 0x0021;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 0x0023;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 0x0046;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 0x0042;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 0x0043;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 0x0044;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 0x0045;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 0x0047;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 0x0048;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 0x0049;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x40245408;
+pub const TCSETS: ::Ioctl = 0x80245409;
+pub const TCSETSW: ::Ioctl = 0x8024540a;
+pub const TCSETSF: ::Ioctl = 0x8024540b;
+pub const TCGETA: ::Ioctl = 0x40125401;
+pub const TCSETA: ::Ioctl = 0x80125402;
+pub const TCSETAW: ::Ioctl = 0x80125403;
+pub const TCSETAF: ::Ioctl = 0x80125404;
+pub const TCSBRK: ::Ioctl = 0x20005405;
+pub const TCXONC: ::Ioctl = 0x20005406;
+pub const TCFLSH: ::Ioctl = 0x20005407;
+pub const TIOCEXCL: ::Ioctl = 0x2000740d;
+pub const TIOCNXCL: ::Ioctl = 0x2000740e;
+pub const TIOCSCTTY: ::Ioctl = 0x20007484;
+pub const TIOCGPGRP: ::Ioctl = 0x40047483;
+pub const TIOCSPGRP: ::Ioctl = 0x80047482;
+pub const TIOCOUTQ: ::Ioctl = 0x40047473;
+pub const TIOCSTI: ::Ioctl = 0x80017472;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x4004746a;
+pub const TIOCMBIS: ::Ioctl = 0x8004746c;
+pub const TIOCMBIC: ::Ioctl = 0x8004746b;
+pub const TIOCMSET: ::Ioctl = 0x8004746d;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x40047464;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x80047465;
+pub const FIONREAD: ::Ioctl = 0x4004667f;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x20007424;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x80047470;
+pub const FIONBIO: ::Ioctl = 0x8004667e;
+pub const TIOCNOTTY: ::Ioctl = 0x20007471;
+pub const TIOCSETD: ::Ioctl = 0x80047401;
+pub const TIOCGETD: ::Ioctl = 0x40047400;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x2000747b;
+pub const TIOCCBRK: ::Ioctl = 0x2000747a;
+pub const TIOCGSID: ::Ioctl = 0x40047485;
+pub const TCGETS2: ::Ioctl = 0x402c540c;
+pub const TCSETS2: ::Ioctl = 0x802c540d;
+pub const TCSETSW2: ::Ioctl = 0x802c540e;
+pub const TCSETSF2: ::Ioctl = 0x802c540f;
+pub const TIOCGPTN: ::Ioctl = 0x40047486;
+pub const TIOCSPTLCK: ::Ioctl = 0x80047487;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80047488;
+pub const TIOCVHANGUP: ::Ioctl = 0x20005437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20007489;
+pub const FIONCLEX: ::Ioctl = 0x20006602;
+pub const FIOCLEX: ::Ioctl = 0x20006601;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const TIOCSTART: ::Ioctl = 0x2000746e;
+pub const TIOCSTOP: ::Ioctl = 0x2000746f;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+
+//pub const FIOASYNC: ::Ioctl = 0x4004667d;
+//pub const FIOQSIZE: ::Ioctl = ;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285443;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285444;
+//pub const TIOCGRS485: ::Ioctl = 0x40205441;
+//pub const TIOCSRS485: ::Ioctl = 0xc0205442;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0x1000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
+pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
+pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+cfg_if! {
+ if #[cfg(target_arch = "sparc64")] {
+ pub const RLIM_INFINITY: ::rlim_t = !0;
+ } else if #[cfg(target_arch = "sparc")] {
+ pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/src/unix/linux_like/linux/gnu/b32/arm/align.rs
index 825546be90a91..2645ec4c3d4f1 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/align.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/align.rs
@@ -4,4 +4,50 @@ s_no_extra_traits! {
pub struct max_align_t {
priv_: [i64; 2]
}
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(8))]
+ 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,
+ pub uc_regspace: [::c_ulong; 128],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for ucontext_t {
+ fn eq(&self, other: &ucontext_t) -> bool {
+ self.uc_flags == other.uc_flags
+ && self.uc_link == other.uc_link
+ && self.uc_stack == other.uc_stack
+ && self.uc_mcontext == other.uc_mcontext
+ && self.uc_sigmask == other.uc_sigmask
+ }
+ }
+ impl Eq for ucontext_t {}
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_flags", &self.uc_link)
+ .field("uc_link", &self.uc_link)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_sigmask", &self.uc_sigmask)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ucontext_t {
+ fn hash(&self, state: &mut H) {
+ self.uc_flags.hash(state);
+ self.uc_link.hash(state);
+ self.uc_stack.hash(state);
+ self.uc_mcontext.hash(state);
+ self.uc_sigmask.hash(state);
+ }
+ }
+ }
}
diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
index 95c07168e5bf7..e0ac0dfc34ed0 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -141,17 +141,6 @@ s! {
__glibc_reserved5: ::c_ulong,
}
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
-
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -172,9 +161,38 @@ s! {
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
+
+ pub struct seccomp_notif_sizes {
+ pub seccomp_notif: ::__u16,
+ pub seccomp_notif_resp: ::__u16,
+ pub seccomp_data: ::__u16,
+ }
+
+ pub struct mcontext_t {
+ pub trap_no: ::c_ulong,
+ pub error_code: ::c_ulong,
+ pub oldmask: ::c_ulong,
+ pub arm_r0: ::c_ulong,
+ pub arm_r1: ::c_ulong,
+ pub arm_r2: ::c_ulong,
+ pub arm_r3: ::c_ulong,
+ pub arm_r4: ::c_ulong,
+ pub arm_r5: ::c_ulong,
+ pub arm_r6: ::c_ulong,
+ pub arm_r7: ::c_ulong,
+ pub arm_r8: ::c_ulong,
+ pub arm_r9: ::c_ulong,
+ pub arm_r10: ::c_ulong,
+ pub arm_fp: ::c_ulong,
+ pub arm_ip: ::c_ulong,
+ pub arm_sp: ::c_ulong,
+ pub arm_lr: ::c_ulong,
+ pub arm_pc: ::c_ulong,
+ pub arm_cpsr: ::c_ulong,
+ pub fault_address: ::c_ulong,
+ }
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
@@ -194,11 +212,6 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x02000;
@@ -214,8 +227,6 @@ pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
-pub const SOL_SOCKET: ::c_int = 1;
-
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
@@ -301,42 +312,12 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -447,7 +428,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -464,6 +444,11 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
@@ -471,52 +456,11 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
-pub const TCGETS: ::c_ulong = 0x5401;
-pub const TCSETS: ::c_ulong = 0x5402;
-pub const TCSETSW: ::c_ulong = 0x5403;
-pub const TCSETSF: ::c_ulong = 0x5404;
-pub const TCGETA: ::c_ulong = 0x5405;
-pub const TCSETA: ::c_ulong = 0x5406;
-pub const TCSETAW: ::c_ulong = 0x5407;
-pub const TCSETAF: ::c_ulong = 0x5408;
-pub const TCSBRK: ::c_ulong = 0x5409;
-pub const TCXONC: ::c_ulong = 0x540A;
-pub const TCFLSH: ::c_ulong = 0x540B;
-pub const TIOCINQ: ::c_ulong = 0x541B;
-pub const TIOCGPGRP: ::c_ulong = 0x540F;
-pub const TIOCSPGRP: ::c_ulong = 0x5410;
-pub const TIOCOUTQ: ::c_ulong = 0x5411;
-pub const TIOCGWINSZ: ::c_ulong = 0x5413;
-pub const TIOCSWINSZ: ::c_ulong = 0x5414;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-pub const FIONREAD: ::c_ulong = 0x541B;
-
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCCONS: ::c_ulong = 0x541D;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -871,6 +815,7 @@ pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
pub const SYS_statx: ::c_long = 397;
+pub const SYS_rseq: ::c_long = 398;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -890,6 +835,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/src/unix/linux_like/linux/gnu/b32/m68k/align.rs b/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
new file mode 100644
index 0000000000000..639394a309e3a
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ #[repr(align(2))]
+ pub struct max_align_t {
+ priv_: [i8; 20]
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
new file mode 100644
index 0000000000000..3b78f181cd19f
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
@@ -0,0 +1,849 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+ pub struct sigaction {
+ pub sa_sigaction: ::sighandler_t,
+ pub sa_mask: ::sigset_t,
+ pub sa_flags: ::c_ulong,
+ pub sa_restorer: ::Option,
+ }
+
+ pub struct statfs {
+ pub f_type: ::__fsword_t,
+ pub f_bsize: ::__fsword_t,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_fsid: ::fsid_t,
+
+ pub f_namelen: ::__fsword_t,
+ pub f_frsize: ::__fsword_t,
+ pub f_flags: ::__fsword_t,
+ f_spare: [::__fsword_t; 4],
+ }
+
+ pub struct flock {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct flock64 {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off64_t,
+ pub l_len: ::off64_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct 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,
+ __seq: ::c_ushort,
+ __pad1: ::c_ushort,
+ __glibc_reserved1: ::c_ulong,
+ __glibc_reserved2: ::c_ulong,
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ __pad1: ::c_ushort,
+ 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,
+ __pad2: ::c_ushort,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt64_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_ulong,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_ulong,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_ulong,
+ pub st_ino: ::ino64_t,
+ }
+
+ pub struct statfs64 {
+ pub f_type: ::__fsword_t,
+ pub f_bsize: ::__fsword_t,
+ pub f_blocks: ::fsblkcnt64_t,
+ pub f_bfree: ::fsblkcnt64_t,
+ pub f_bavail: ::fsblkcnt64_t,
+ pub f_files: ::fsblkcnt64_t,
+ pub f_ffree: ::fsblkcnt64_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::__fsword_t,
+ pub f_frsize: ::__fsword_t,
+ pub f_flags: ::__fsword_t,
+ pub f_spare: [::__fsword_t; 4],
+ }
+
+ pub struct statvfs64 {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt64_t,
+ pub f_bfree: ::fsblkcnt64_t,
+ pub f_bavail: ::fsblkcnt64_t,
+ pub f_files: ::fsblkcnt64_t,
+ pub f_ffree: ::fsblkcnt64_t,
+ pub f_favail: ::fsblkcnt64_t,
+ pub f_fsid: ::c_ulong,
+ __f_unused: ::c_int,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ __f_spare: [::c_int; 6],
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_atime: ::time_t,
+ __glibc_reserved1: ::c_long,
+ pub shm_dtime: ::time_t,
+ __glibc_reserved2: ::c_long,
+ pub shm_ctime: ::time_t,
+ __glibc_reserved3: ::c_long,
+ pub shm_cpid: ::pid_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_nattch: ::shmatt_t,
+ __glibc_reserved5: ::c_ulong,
+ __glibc_reserved6: ::c_ulong,
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_stime: ::time_t,
+ __glibc_reserved1: ::c_uint,
+ pub msg_rtime: ::time_t,
+ __glibc_reserved2: ::c_uint,
+ pub msg_ctime: ::time_t,
+ __glibc_reserved3: ::c_uint,
+ __msg_cbytes: ::c_ulong,
+ pub msg_qnum: ::msgqnum_t,
+ pub msg_qbytes: ::msglen_t,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ __glibc_reserved4: ::c_ulong,
+ __glibc_reserved5: ::c_ulong,
+ }
+
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_code: ::c_int,
+ pub si_errno: ::c_int,
+ _pad: [::c_int; 29],
+ _align: [usize; 0],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_flags: ::c_int,
+ pub ss_size: ::size_t
+ }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0x20000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_SYSEMU: ::c_uint = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+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_time32: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_chown16: ::c_long = 16;
+pub const SYS_stat: ::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_oldumount: ::c_long = 22;
+pub const SYS_setuid16: ::c_long = 23;
+pub const SYS_getuid16: ::c_long = 24;
+pub const SYS_stime32: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_fstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime32: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid16: ::c_long = 46;
+pub const SYS_getgid16: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid16: ::c_long = 49;
+pub const SYS_getegid16: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid16: ::c_long = 70;
+pub const SYS_setregid16: ::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_old_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_getgroups16: ::c_long = 80;
+pub const SYS_setgroups16: ::c_long = 81;
+pub const SYS_old_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_lstat: ::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_old_readdir: ::c_long = 89;
+pub const SYS_old_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_fchown16: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_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_newstat: ::c_long = 106;
+pub const SYS_newlstat: ::c_long = 107;
+pub const SYS_newfstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_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_newuname: ::c_long = 122;
+pub const SYS_cacheflush: ::c_long = 123;
+pub const SYS_adjtimex_time32: ::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_setfsuid16: ::c_long = 138;
+pub const SYS_setfsgid16: ::c_long = 139;
+pub const SYS_llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_select: ::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_time32: ::c_long = 161;
+pub const SYS_nanosleep_time32: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid16: ::c_long = 164;
+pub const SYS_getresuid16: ::c_long = 165;
+pub const SYS_getpagesize: ::c_long = 166;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid16: ::c_long = 170;
+pub const SYS_getresgid16: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait_time32: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_lchown16: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_getrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_chown: ::c_long = 198;
+pub const SYS_getuid: ::c_long = 199;
+pub const SYS_getgid: ::c_long = 200;
+pub const SYS_geteuid: ::c_long = 201;
+pub const SYS_getegid: ::c_long = 202;
+pub const SYS_setreuid: ::c_long = 203;
+pub const SYS_setregid: ::c_long = 204;
+pub const SYS_getgroups: ::c_long = 205;
+pub const SYS_setgroups: ::c_long = 206;
+pub const SYS_fchown: ::c_long = 207;
+pub const SYS_setresuid: ::c_long = 208;
+pub const SYS_getresuid: ::c_long = 209;
+pub const SYS_setresgid: ::c_long = 210;
+pub const SYS_getresgid: ::c_long = 211;
+pub const SYS_lchown: ::c_long = 212;
+pub const SYS_setuid: ::c_long = 213;
+pub const SYS_setgid: ::c_long = 214;
+pub const SYS_setfsuid: ::c_long = 215;
+pub const SYS_setfsgid: ::c_long = 216;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_gettid: ::c_long = 221;
+pub const SYS_tkill: ::c_long = 222;
+pub const SYS_setxattr: ::c_long = 223;
+pub const SYS_lsetxattr: ::c_long = 224;
+pub const SYS_fsetxattr: ::c_long = 225;
+pub const SYS_getxattr: ::c_long = 226;
+pub const SYS_lgetxattr: ::c_long = 227;
+pub const SYS_fgetxattr: ::c_long = 228;
+pub const SYS_listxattr: ::c_long = 229;
+pub const SYS_llistxattr: ::c_long = 230;
+pub const SYS_flistxattr: ::c_long = 231;
+pub const SYS_removexattr: ::c_long = 232;
+pub const SYS_lremovexattr: ::c_long = 233;
+pub const SYS_fremovexattr: ::c_long = 234;
+pub const SYS_futex_time32: ::c_long = 235;
+pub const SYS_sendfile64: ::c_long = 236;
+pub const SYS_mincore: ::c_long = 237;
+pub const SYS_madvise: ::c_long = 238;
+pub const SYS_fcntl64: ::c_long = 239;
+pub const SYS_readahead: ::c_long = 240;
+pub const SYS_io_setup: ::c_long = 241;
+pub const SYS_io_destroy: ::c_long = 242;
+pub const SYS_io_getevents_time32: ::c_long = 243;
+pub const SYS_io_submit: ::c_long = 244;
+pub const SYS_io_cancel: ::c_long = 245;
+pub const SYS_fadvise64: ::c_long = 246;
+pub const SYS_exit_group: ::c_long = 247;
+pub const SYS_lookup_dcookie: ::c_long = 248;
+pub const SYS_epoll_create: ::c_long = 249;
+pub const SYS_epoll_ctl: ::c_long = 250;
+pub const SYS_epoll_wait: ::c_long = 251;
+pub const SYS_remap_file_pages: ::c_long = 252;
+pub const SYS_set_tid_address: ::c_long = 253;
+pub const SYS_timer_create: ::c_long = 254;
+pub const SYS_timer_settime32: ::c_long = 255;
+pub const SYS_timer_gettime32: ::c_long = 256;
+pub const SYS_timer_getoverrun: ::c_long = 257;
+pub const SYS_timer_delete: ::c_long = 258;
+pub const SYS_clock_settime32: ::c_long = 259;
+pub const SYS_clock_gettime32: ::c_long = 260;
+pub const SYS_clock_getres_time32: ::c_long = 261;
+pub const SYS_clock_nanosleep_time32: ::c_long = 262;
+pub const SYS_statfs64: ::c_long = 263;
+pub const SYS_fstatfs64: ::c_long = 264;
+pub const SYS_tgkill: ::c_long = 265;
+pub const SYS_utimes_time32: ::c_long = 266;
+pub const SYS_fadvise64_64: ::c_long = 267;
+pub const SYS_mbind: ::c_long = 268;
+pub const SYS_get_mempolicy: ::c_long = 269;
+pub const SYS_set_mempolicy: ::c_long = 270;
+pub const SYS_mq_open: ::c_long = 271;
+pub const SYS_mq_unlink: ::c_long = 272;
+pub const SYS_mq_timedsend_time32: ::c_long = 273;
+pub const SYS_mq_timedreceive_time32: ::c_long = 274;
+pub const SYS_mq_notify: ::c_long = 275;
+pub const SYS_mq_getsetattr: ::c_long = 276;
+pub const SYS_waitid: ::c_long = 277;
+pub const SYS_add_key: ::c_long = 279;
+pub const SYS_request_key: ::c_long = 280;
+pub const SYS_keyctl: ::c_long = 281;
+pub const SYS_ioprio_set: ::c_long = 282;
+pub const SYS_ioprio_get: ::c_long = 283;
+pub const SYS_inotify_init: ::c_long = 284;
+pub const SYS_inotify_add_watch: ::c_long = 285;
+pub const SYS_inotify_rm_watch: ::c_long = 286;
+pub const SYS_migrate_pages: ::c_long = 287;
+pub const SYS_openat: ::c_long = 288;
+pub const SYS_mkdirat: ::c_long = 289;
+pub const SYS_mknodat: ::c_long = 290;
+pub const SYS_fchownat: ::c_long = 291;
+pub const SYS_futimesat_time32: ::c_long = 292;
+pub const SYS_fstatat64: ::c_long = 293;
+pub const SYS_unlinkat: ::c_long = 294;
+pub const SYS_renameat: ::c_long = 295;
+pub const SYS_linkat: ::c_long = 296;
+pub const SYS_symlinkat: ::c_long = 297;
+pub const SYS_readlinkat: ::c_long = 298;
+pub const SYS_fchmodat: ::c_long = 299;
+pub const SYS_faccessat: ::c_long = 300;
+pub const SYS_pselect6_time32: ::c_long = 301;
+pub const SYS_ppoll_time32: ::c_long = 302;
+pub const SYS_unshare: ::c_long = 303;
+pub const SYS_set_robust_list: ::c_long = 304;
+pub const SYS_get_robust_list: ::c_long = 305;
+pub const SYS_splice: ::c_long = 306;
+pub const SYS_sync_file_range: ::c_long = 307;
+pub const SYS_tee: ::c_long = 308;
+pub const SYS_vmsplice: ::c_long = 309;
+pub const SYS_move_pages: ::c_long = 310;
+pub const SYS_sched_setaffinity: ::c_long = 311;
+pub const SYS_sched_getaffinity: ::c_long = 312;
+pub const SYS_kexec_load: ::c_long = 313;
+pub const SYS_getcpu: ::c_long = 314;
+pub const SYS_epoll_pwait: ::c_long = 315;
+pub const SYS_utimensat_time32: ::c_long = 316;
+pub const SYS_signalfd: ::c_long = 317;
+pub const SYS_timerfd_create: ::c_long = 318;
+pub const SYS_eventfd: ::c_long = 319;
+pub const SYS_fallocate: ::c_long = 320;
+pub const SYS_timerfd_settime32: ::c_long = 321;
+pub const SYS_timerfd_gettime32: ::c_long = 322;
+pub const SYS_signalfd4: ::c_long = 323;
+pub const SYS_eventfd2: ::c_long = 324;
+pub const SYS_epoll_create1: ::c_long = 325;
+pub const SYS_dup3: ::c_long = 326;
+pub const SYS_pipe2: ::c_long = 327;
+pub const SYS_inotify_init1: ::c_long = 328;
+pub const SYS_preadv: ::c_long = 329;
+pub const SYS_pwritev: ::c_long = 330;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 331;
+pub const SYS_perf_event_open: ::c_long = 332;
+pub const SYS_get_thread_area: ::c_long = 333;
+pub const SYS_set_thread_area: ::c_long = 334;
+pub const SYS_atomic_cmpxchg_32: ::c_long = 335;
+pub const SYS_atomic_barrier: ::c_long = 336;
+pub const SYS_fanotify_init: ::c_long = 337;
+pub const SYS_fanotify_mark: ::c_long = 338;
+pub const SYS_prlimit64: ::c_long = 339;
+pub const SYS_name_to_handle_at: ::c_long = 340;
+pub const SYS_open_by_handle_at: ::c_long = 341;
+pub const SYS_clock_adjtime32: ::c_long = 342;
+pub const SYS_syncfs: ::c_long = 343;
+pub const SYS_setns: ::c_long = 344;
+pub const SYS_process_vm_readv: ::c_long = 345;
+pub const SYS_process_vm_writev: ::c_long = 346;
+pub const SYS_kcmp: ::c_long = 347;
+pub const SYS_finit_module: ::c_long = 348;
+pub const SYS_sched_setattr: ::c_long = 349;
+pub const SYS_sched_getattr: ::c_long = 350;
+pub const SYS_renameat2: ::c_long = 351;
+pub const SYS_getrandom: ::c_long = 352;
+pub const SYS_memfd_create: ::c_long = 353;
+pub const SYS_bpf: ::c_long = 354;
+pub const SYS_execveat: ::c_long = 355;
+pub const SYS_socket: ::c_long = 356;
+pub const SYS_socketpair: ::c_long = 357;
+pub const SYS_bind: ::c_long = 358;
+pub const SYS_connect: ::c_long = 359;
+pub const SYS_listen: ::c_long = 360;
+pub const SYS_accept4: ::c_long = 361;
+pub const SYS_getsockopt: ::c_long = 362;
+pub const SYS_setsockopt: ::c_long = 363;
+pub const SYS_getsockname: ::c_long = 364;
+pub const SYS_getpeername: ::c_long = 365;
+pub const SYS_sendto: ::c_long = 366;
+pub const SYS_sendmsg: ::c_long = 367;
+pub const SYS_recvfrom: ::c_long = 368;
+pub const SYS_recvmsg: ::c_long = 369;
+pub const SYS_shutdown: ::c_long = 370;
+pub const SYS_recvmmsg_time32: ::c_long = 371;
+pub const SYS_sendmmsg: ::c_long = 372;
+pub const SYS_userfaultfd: ::c_long = 373;
+pub const SYS_membarrier: ::c_long = 374;
+pub const SYS_mlock2: ::c_long = 375;
+pub const SYS_copy_file_range: ::c_long = 376;
+pub const SYS_preadv2: ::c_long = 377;
+pub const SYS_pwritev2: ::c_long = 378;
+pub const SYS_statx: ::c_long = 379;
+pub const SYS_seccomp: ::c_long = 380;
+pub const SYS_pkey_mprotect: ::c_long = 381;
+pub const SYS_pkey_alloc: ::c_long = 382;
+pub const SYS_pkey_free: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 384;
+pub const SYS_semget: ::c_long = 393;
+pub const SYS_semctl: ::c_long = 394;
+pub const SYS_shmget: ::c_long = 395;
+pub const SYS_shmctl: ::c_long = 396;
+pub const SYS_shmat: ::c_long = 397;
+pub const SYS_shmdt: ::c_long = 398;
+pub const SYS_msgget: ::c_long = 399;
+pub const SYS_msgsnd: ::c_long = 400;
+pub const SYS_msgrcv: ::c_long = 401;
+pub const SYS_msgctl: ::c_long = 402;
+pub const SYS_clock_gettime: ::c_long = 403;
+pub const SYS_clock_settime: ::c_long = 404;
+pub const SYS_clock_adjtime: ::c_long = 405;
+pub const SYS_clock_getres: ::c_long = 406;
+pub const SYS_clock_nanosleep: ::c_long = 407;
+pub const SYS_timer_gettime: ::c_long = 408;
+pub const SYS_timer_settime: ::c_long = 409;
+pub const SYS_timerfd_gettime: ::c_long = 410;
+pub const SYS_timerfd_settime: ::c_long = 411;
+pub const SYS_utimensat: ::c_long = 412;
+pub const SYS_pselect6: ::c_long = 413;
+pub const SYS_ppoll: ::c_long = 414;
+pub const SYS_io_pgetevents: ::c_long = 416;
+pub const SYS_recvmmsg: ::c_long = 417;
+pub const SYS_mq_timedsend: ::c_long = 418;
+pub const SYS_mq_timedreceive: ::c_long = 419;
+pub const SYS_semtimedop: ::c_long = 420;
+pub const SYS_rt_sigtimedwait: ::c_long = 421;
+pub const SYS_futex: ::c_long = 422;
+pub const SYS_sched_rr_get_interval: ::c_long = 423;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
index d502606192916..6a03f0ba83bac 100644
--- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
@@ -153,17 +153,6 @@ s! {
pub l_pid: ::pid_t,
pad: [::c_long; 4],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 23],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const O_LARGEFILE: ::c_int = 0x2000;
@@ -527,6 +516,7 @@ pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
pub const SYS_pkey_free: ::c_long = 4000 + 365;
pub const SYS_statx: ::c_long = 4000 + 366;
+pub const SYS_rseq: ::c_long = 4000 + 367;
pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
@@ -546,18 +536,19 @@ pub const SYS_faccessat2: ::c_long = 4000 + 439;
pub const SYS_process_madvise: ::c_long = 4000 + 440;
pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
-pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
-
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 256;
pub const O_EXCL: ::c_int = 1024;
@@ -668,59 +659,6 @@ pub const MAP_STACK: ::c_int = 0x40000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_STYLE: ::c_int = SO_TYPE;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_ACCEPTCONN: ::c_int = 0x1009;
-pub const SO_PROTOCOL: ::c_int = 0x1028;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PASSCRED: ::c_int = 17;
-pub const SO_PEERCRED: ::c_int = 18;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_PEERSEC: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 31;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-
-pub const FIOCLEX: ::c_ulong = 0x6601;
-pub const FIONCLEX: ::c_ulong = 0x6602;
-pub const FIONBIO: ::c_ulong = 0x667e;
-
pub const SA_SIGINFO: ::c_int = 0x00000008;
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
@@ -775,38 +713,6 @@ pub const F_SETOWN: ::c_int = 24;
pub const SFD_NONBLOCK: ::c_int = 0x80;
-pub const TCGETS: ::c_ulong = 0x540d;
-pub const TCSETS: ::c_ulong = 0x540e;
-pub const TCSETSW: ::c_ulong = 0x540f;
-pub const TCSETSF: ::c_ulong = 0x5410;
-pub const TCGETA: ::c_ulong = 0x5401;
-pub const TCSETA: ::c_ulong = 0x5402;
-pub const TCSETAW: ::c_ulong = 0x5403;
-pub const TCSETAF: ::c_ulong = 0x5404;
-pub const TCSBRK: ::c_ulong = 0x5405;
-pub const TCXONC: ::c_ulong = 0x5406;
-pub const TCFLSH: ::c_ulong = 0x5407;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
-pub const TIOCINQ: ::c_ulong = 0x467f;
-pub const TIOCLINUX: ::c_ulong = 0x5483;
-pub const TIOCGSERIAL: ::c_ulong = 0x5484;
-pub const TIOCEXCL: ::c_ulong = 0x740d;
-pub const TIOCNXCL: ::c_ulong = 0x740e;
-pub const TIOCSCTTY: ::c_ulong = 0x5480;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x7472;
-pub const TIOCSTI: ::c_ulong = 0x5472;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCMGET: ::c_ulong = 0x741d;
-pub const TIOCMBIS: ::c_ulong = 0x741b;
-pub const TIOCMBIC: ::c_ulong = 0x741c;
-pub const TIOCMSET: ::c_ulong = 0x741a;
-pub const FIONREAD: ::c_ulong = 0x467f;
-pub const TIOCCONS: ::c_ulong = 0x80047478;
-
pub const RTLD_DEEPBIND: ::c_int = 0x10;
pub const RTLD_GLOBAL: ::c_int = 0x4;
pub const RTLD_NOLOAD: ::c_int = 0x8;
@@ -886,7 +792,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -903,13 +808,6 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const TIOCM_ST: ::c_int = 0x010;
-pub const TIOCM_SR: ::c_int = 0x020;
-pub const TIOCM_CTS: ::c_int = 0x040;
-pub const TIOCM_CAR: ::c_int = 0x100;
-pub const TIOCM_RNG: ::c_int = 0x200;
-pub const TIOCM_DSR: ::c_int = 0x400;
-
pub const EHWPOISON: ::c_int = 168;
cfg_if! {
diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs
index c7fa1a8a2831f..ad0d64c51d5b4 100644
--- a/src/unix/linux_like/linux/gnu/b32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/mod.rs
@@ -11,9 +11,11 @@ pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type nlink_t = u32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type __fsword_t = i32;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
+pub type __syscall_ulong_t = ::c_ulong;
cfg_if! {
if #[cfg(target_arch = "riscv32")] {
@@ -133,17 +135,24 @@ s! {
pub _f: [::c_char; 8],
}
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
+ pub struct semid_ds {
+ pub sem_perm: ipc_perm,
+ #[cfg(target_arch = "powerpc")]
+ __reserved: ::__syscall_ulong_t,
+ pub sem_otime: ::time_t,
+ #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
+ __reserved: ::__syscall_ulong_t,
+ #[cfg(target_arch = "powerpc")]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_ctime: ::time_t,
+ #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_nsems: ::__syscall_ulong_t,
+ __glibc_reserved3: ::__syscall_ulong_t,
+ __glibc_reserved4: ::__syscall_ulong_t,
}
}
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_TIMESTAMP: ::c_int = 29;
-
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
@@ -162,11 +171,6 @@ cfg_if! {
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 SO_BINDTODEVICE: ::c_int = 0x000d;
- pub const SO_MARK: ::c_int = 0x0022;
- pub const SO_RXQ_OVFL: ::c_int = 0x0024;
- pub const SO_PEEK_OFF: ::c_int = 0x0026;
- pub const SO_BUSY_POLL: ::c_int = 0x0030;
pub const SA_ONSTACK: ::c_int = 1;
@@ -213,11 +217,6 @@ cfg_if! {
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 SO_BINDTODEVICE: ::c_int = 25;
- pub const SO_MARK: ::c_int = 36;
- pub const SO_RXQ_OVFL: ::c_int = 40;
- pub const SO_PEEK_OFF: ::c_int = 42;
- pub const SO_BUSY_POLL: ::c_int = 46;
pub const SA_ONSTACK: ::c_int = 0x08000000;
@@ -318,9 +317,6 @@ pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETREGS: ::c_uint = 12;
pub const PTRACE_SETREGS: ::c_uint = 13;
-pub const TIOCSBRK: ::c_int = 0x5427;
-pub const TIOCCBRK: ::c_int = 0x5428;
-
extern "C" {
pub fn sysctl(
name: *mut ::c_int,
@@ -342,6 +338,9 @@ cfg_if! {
} else if #[cfg(target_arch = "mips")] {
mod mips;
pub use self::mips::*;
+ } else if #[cfg(target_arch = "m68k")] {
+ mod m68k;
+ pub use self::m68k::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs
index e20c298fc570e..e70b216bf9c50 100644
--- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs
+++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs
@@ -163,7 +163,6 @@ s! {
}
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
@@ -183,24 +182,10 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x00080;
pub const MAP_NORESERVE: ::c_int = 0x00040;
@@ -215,8 +200,6 @@ pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
-pub const SOL_SOCKET: ::c_int = 1;
-
pub const EDEADLOCK: ::c_int = 58;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
@@ -302,42 +285,12 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_RCVLOWAT: ::c_int = 16;
-pub const SO_SNDLOWAT: ::c_int = 17;
-pub const SO_RCVTIMEO: ::c_int = 18;
-pub const SO_SNDTIMEO: ::c_int = 19;
-pub const SO_PASSCRED: ::c_int = 20;
-pub const SO_PEERCRED: ::c_int = 21;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const FIOCLEX: ::c_ulong = 0x20006601;
-pub const FIONCLEX: ::c_ulong = 0x20006602;
-pub const FIONBIO: ::c_ulong = 0x8004667e;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -351,18 +304,6 @@ pub const F_SETOWN: ::c_int = 8;
pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGUSR1: ::c_int = 10;
@@ -474,7 +415,6 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
-pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
@@ -483,26 +423,6 @@ pub const IEXTEN: ::tcflag_t = 0x400;
pub const TOSTOP: ::tcflag_t = 0x400000;
pub const FLUSHO: ::tcflag_t = 0x800000;
pub const EXTPROC: ::tcflag_t = 0x10000000;
-pub const TCGETS: ::c_ulong = 0x403c7413;
-pub const TCSETS: ::c_ulong = 0x803c7414;
-pub const TCSETSW: ::c_ulong = 0x803c7415;
-pub const TCSETSF: ::c_ulong = 0x803c7416;
-pub const TCGETA: ::c_ulong = 0x40147417;
-pub const TCSETA: ::c_ulong = 0x80147418;
-pub const TCSETAW: ::c_ulong = 0x80147419;
-pub const TCSETAF: ::c_ulong = 0x8014741c;
-pub const TCSBRK: ::c_ulong = 0x2000741d;
-pub const TCXONC: ::c_ulong = 0x2000741e;
-pub const TCFLSH: ::c_ulong = 0x2000741f;
-pub const TIOCINQ: ::c_ulong = 0x4004667f;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x40047473;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCGRS485: ::c_int = 0x542e;
-pub const TIOCSRS485: ::c_int = 0x542f;
-pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -874,6 +794,7 @@ pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 387;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -893,3 +814,11 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
new file mode 100644
index 0000000000000..48d152a5721ec
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ pub struct ucontext_t {
+ pub __uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: mcontext_t,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub __gregs: [::c_ulong; 32],
+ pub __fpregs: __riscv_mc_fp_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub union __riscv_mc_fp_state {
+ pub __f: __riscv_mc_f_ext_state,
+ pub __d: __riscv_mc_d_ext_state,
+ pub __q: __riscv_mc_q_ext_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_f_ext_state {
+ pub __f: [::c_uint; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_d_ext_state {
+ pub __f: [::c_ulonglong; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct __riscv_mc_q_ext_state {
+ pub __f: [::c_ulonglong; 64],
+ pub __fcsr: ::c_uint,
+ pub __glibc_reserved: [::c_uint; 3],
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
index 16ce074e945e8..827f85e86790c 100644
--- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
@@ -198,20 +198,11 @@ s! {
}
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
+pub const O_LARGEFILE: ::c_int = 0;
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const TIOCGSOFTCAR: ::c_ulong = 21529;
-pub const TIOCSSOFTCAR: ::c_ulong = 21530;
-pub const TIOCGRS485: ::c_int = 21550;
-pub const TIOCSRS485: ::c_int = 21551;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -221,6 +212,7 @@ pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 1052672;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_GROWSDOWN: ::c_int = 256;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -300,51 +292,7 @@ pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = 26;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = 35;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = 41;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = 27;
+
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SA_SIGINFO: ::c_int = 4;
@@ -384,23 +332,6 @@ pub const SFD_NONBLOCK: ::c_int = 2048;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 21532;
-pub const TIOCGSERIAL: ::c_ulong = 21534;
-pub const TIOCEXCL: ::c_ulong = 21516;
-pub const TIOCNXCL: ::c_ulong = 21517;
-pub const TIOCSCTTY: ::c_ulong = 21518;
-pub const TIOCSTI: ::c_ulong = 21522;
-pub const TIOCMGET: ::c_ulong = 21525;
-pub const TIOCMBIS: ::c_ulong = 21526;
-pub const TIOCMBIC: ::c_ulong = 21527;
-pub const TIOCMSET: ::c_ulong = 21528;
-pub const TIOCCONS: ::c_ulong = 21533;
-pub const TIOCM_ST: ::c_int = 8;
-pub const TIOCM_SR: ::c_int = 16;
-pub const TIOCM_CTS: ::c_int = 32;
-pub const TIOCM_CAR: ::c_int = 64;
-pub const TIOCM_RNG: ::c_int = 128;
-pub const TIOCM_DSR: ::c_int = 256;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
@@ -424,9 +355,6 @@ pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const FIOCLEX: ::c_ulong = 21585;
-pub const FIONCLEX: ::c_ulong = 21584;
-pub const FIONBIO: ::c_ulong = 21537;
pub const MCL_CURRENT: ::c_int = 1;
pub const MCL_FUTURE: ::c_int = 2;
pub const SIGSTKSZ: ::size_t = 8192;
@@ -522,26 +450,18 @@ pub const IEXTEN: ::tcflag_t = 32768;
pub const TOSTOP: ::tcflag_t = 256;
pub const FLUSHO: ::tcflag_t = 4096;
pub const EXTPROC: ::tcflag_t = 65536;
-pub const TCGETS: ::c_ulong = 21505;
-pub const TCSETS: ::c_ulong = 21506;
-pub const TCSETSW: ::c_ulong = 21507;
-pub const TCSETSF: ::c_ulong = 21508;
-pub const TCGETA: ::c_ulong = 21509;
-pub const TCSETA: ::c_ulong = 21510;
-pub const TCSETAW: ::c_ulong = 21511;
-pub const TCSETAF: ::c_ulong = 21512;
-pub const TCSBRK: ::c_ulong = 21513;
-pub const TCXONC: ::c_ulong = 21514;
-pub const TCFLSH: ::c_ulong = 21515;
-pub const TIOCINQ: ::c_ulong = 21531;
-pub const TIOCGPGRP: ::c_ulong = 21519;
-pub const TIOCSPGRP: ::c_ulong = 21520;
-pub const TIOCOUTQ: ::c_ulong = 21521;
-pub const TIOCGWINSZ: ::c_ulong = 21523;
-pub const TIOCSWINSZ: ::c_ulong = 21524;
-pub const FIONREAD: ::c_ulong = 21531;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
@@ -818,6 +738,7 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -837,3 +758,18 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
index ed1224880f9f0..57ad9fe8ee21b 100644
--- a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
@@ -191,34 +191,13 @@ s! {
__glibc_reserved1: ::c_ulong,
__glibc_reserved2: ::c_ulong,
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x80047465;
-
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
-
pub const O_APPEND: ::c_int = 0x8;
pub const O_CREAT: ::c_int = 0x200;
pub const O_EXCL: ::c_int = 0x800;
@@ -320,27 +299,6 @@ pub const ENOTRECOVERABLE: ::c_int = 133;
pub const EHWPOISON: ::c_int = 135;
pub const ERFKILL: ::c_int = 134;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_PASSCRED: ::c_int = 2;
-pub const SO_REUSEADDR: ::c_int = 4;
-pub const SO_PEERSEC: ::c_int = 0x001e;
-pub const SO_PASSSEC: ::c_int = 0x001f;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_DONTROUTE: ::c_int = 16;
-pub const SO_BROADCAST: ::c_int = 32;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
-pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_KEEPALIVE: ::c_int = 8;
-pub const SO_OOBINLINE: ::c_int = 0x100;
-pub const SO_LINGER: ::c_int = 128;
-pub const SO_REUSEPORT: ::c_int = 0x200;
-pub const SO_ACCEPTCONN: ::c_int = 0x8000;
-
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -388,25 +346,6 @@ pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCEXCL: ::c_ulong = 0x2000740d;
-pub const TIOCNXCL: ::c_ulong = 0x2000740e;
-pub const TIOCSCTTY: ::c_ulong = 0x20007484;
-pub const TIOCSTI: ::c_ulong = 0x80017472;
-pub const TIOCMGET: ::c_ulong = 0x4004746a;
-pub const TIOCMBIS: ::c_ulong = 0x8004746c;
-pub const TIOCMBIC: ::c_ulong = 0x8004746b;
-pub const TIOCMSET: ::c_ulong = 0x8004746d;
-pub const TIOCCONS: ::c_ulong = 0x20007424;
-
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const O_DIRECTORY: ::c_int = 0o200000;
pub const O_NOFOLLOW: ::c_int = 0o400000;
pub const O_LARGEFILE: ::c_int = 0x40000;
@@ -422,16 +361,6 @@ pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const SO_PEERCRED: ::c_int = 0x40;
-pub const SO_RCVLOWAT: ::c_int = 0x800;
-pub const SO_SNDLOWAT: ::c_int = 0x1000;
-pub const SO_RCVTIMEO: ::c_int = 0x2000;
-pub const SO_SNDTIMEO: ::c_int = 0x4000;
-
-pub const FIOCLEX: ::c_ulong = 0x20006601;
-pub const FIONCLEX: ::c_ulong = 0x20006602;
-pub const FIONBIO: ::c_ulong = 0x8004667e;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -507,7 +436,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0x1000;
pub const B57600: ::speed_t = 0x1001;
pub const B115200: ::speed_t = 0x1002;
pub const B230400: ::speed_t = 0x1003;
@@ -531,24 +459,6 @@ pub const IEXTEN: ::tcflag_t = 0x8000;
pub const TOSTOP: ::tcflag_t = 0x100;
pub const FLUSHO: ::tcflag_t = 0x1000;
pub const EXTPROC: ::tcflag_t = 0x10000;
-pub const TCGETS: ::c_ulong = 0x40245408;
-pub const TCSETS: ::c_ulong = 0x80245409;
-pub const TCSETSW: ::c_ulong = 0x8024540a;
-pub const TCSETSF: ::c_ulong = 0x8024540b;
-pub const TCGETA: ::c_ulong = 0x40125401;
-pub const TCSETA: ::c_ulong = 0x80125402;
-pub const TCSETAW: ::c_ulong = 0x80125403;
-pub const TCSETAF: ::c_ulong = 0x80125404;
-pub const TCSBRK: ::c_ulong = 0x20005405;
-pub const TCXONC: ::c_ulong = 0x20005406;
-pub const TCFLSH: ::c_ulong = 0x20005407;
-pub const TIOCINQ: ::c_ulong = 0x4004667f;
-pub const TIOCGPGRP: ::c_ulong = 0x40047483;
-pub const TIOCSPGRP: ::c_ulong = 0x80047482;
-pub const TIOCOUTQ: ::c_ulong = 0x40047473;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -908,6 +818,7 @@ pub const SYS_copy_file_range: ::c_long = 357;
pub const SYS_preadv2: ::c_long = 358;
pub const SYS_pwritev2: ::c_long = 359;
pub const SYS_statx: ::c_long = 360;
+pub const SYS_rseq: ::c_long = 365;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -928,6 +839,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
index 77253d09d7e23..93622387e81a9 100644
--- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
@@ -215,17 +215,6 @@ s! {
__glibc_reserved5: ::c_ulong,
}
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
-
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -246,6 +235,12 @@ s! {
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
+
+ pub struct seccomp_notif_sizes {
+ pub seccomp_notif: ::__u16,
+ pub seccomp_notif_resp: ::__u16,
+ pub seccomp_data: ::__u16,
+ }
}
s_no_extra_traits! {
@@ -375,7 +370,6 @@ cfg_if! {
}
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
@@ -395,13 +389,6 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-
-pub const SOL_SOCKET: ::c_int = 1;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x02000;
@@ -503,33 +490,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
@@ -540,10 +500,6 @@ pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
-
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
pub const PTRACE_SYSEMU: ::c_uint = 31;
@@ -637,18 +593,6 @@ pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
@@ -667,7 +611,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -691,40 +634,11 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
-pub const TCGETS: ::c_ulong = 0x5401;
-pub const TCSETS: ::c_ulong = 0x5402;
-pub const TCSETSW: ::c_ulong = 0x5403;
-pub const TCSETSF: ::c_ulong = 0x5404;
-pub const TCGETA: ::c_ulong = 0x5405;
-pub const TCSETA: ::c_ulong = 0x5406;
-pub const TCSETAW: ::c_ulong = 0x5407;
-pub const TCSETAF: ::c_ulong = 0x5408;
-pub const TCSBRK: ::c_ulong = 0x5409;
-pub const TCXONC: ::c_ulong = 0x540A;
-pub const TCFLSH: ::c_ulong = 0x540B;
-pub const TIOCINQ: ::c_ulong = 0x541B;
-pub const TIOCGPGRP: ::c_ulong = 0x540F;
-pub const TIOCSPGRP: ::c_ulong = 0x5410;
-pub const TIOCOUTQ: ::c_ulong = 0x5411;
-pub const TIOCGWINSZ: ::c_ulong = 0x5413;
-pub const TIOCSWINSZ: ::c_ulong = 0x5414;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-pub const FIONREAD: ::c_ulong = 0x541B;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -1106,6 +1020,7 @@ pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 386;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -1125,6 +1040,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
@@ -1166,19 +1089,16 @@ pub const REG_EFL: ::c_int = 16;
pub const REG_UESP: ::c_int = 17;
pub const REG_SS: ::c_int = 18;
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
extern "C" {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
- pub fn makecontext(
- ucp: *mut ucontext_t,
- func: extern "C" fn(),
- argc: ::c_int,
- ...
- );
- pub fn swapcontext(
- uocp: *mut ucontext_t,
- ucp: *const ucontext_t,
- ) -> ::c_int;
+ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
index 154c2c54ce6de..06173be663b9b 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
@@ -26,4 +26,33 @@ s! {
// auto-derive traits like Debug
__reserved: [[u64; 32]; 16],
}
+
+ #[repr(align(16))]
+ pub struct user_fpsimd_struct {
+ pub vregs: [[u64; 2]; 32],
+ pub fpsr: ::c_uint,
+ pub fpcr: ::c_uint,
+ }
+
+ #[repr(align(8))]
+ pub struct clone_args {
+ pub flags: ::c_ulonglong,
+ pub pidfd: ::c_ulonglong,
+ pub child_tid: ::c_ulonglong,
+ pub parent_tid: ::c_ulonglong,
+ pub exit_signal: ::c_ulonglong,
+ pub stack: ::c_ulonglong,
+ pub stack_size: ::c_ulonglong,
+ pub tls: ::c_ulonglong,
+ pub set_tid: ::c_ulonglong,
+ pub set_tid_size: ::c_ulonglong,
+ pub cgroup: ::c_ulonglong,
+ }
+}
+
+extern "C" {
+ pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+ pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
}
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index f54622849c8ac..a20a1cf688e3c 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -6,6 +6,7 @@ pub type nlink_t = u32;
pub type blksize_t = i32;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
@@ -142,6 +143,13 @@ s! {
__size: [usize; 8]
}
+ pub struct user_regs_struct {
+ pub regs: [::c_ulonglong; 31],
+ pub sp: ::c_ulonglong,
+ pub pc: ::c_ulonglong,
+ pub pstate: ::c_ulonglong,
+ }
+
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
@@ -168,17 +176,6 @@ s! {
__unused5: ::c_ulong
}
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
-
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -200,10 +197,10 @@ s! {
pub ss_size: ::size_t
}
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
+ pub struct seccomp_notif_sizes {
+ pub seccomp_notif: ::__u16,
+ pub seccomp_notif_resp: ::__u16,
+ pub seccomp_data: ::__u16,
}
}
@@ -213,12 +210,6 @@ pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -322,80 +313,6 @@ pub const ERFKILL: ::c_int = 132;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 1;
-
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
-pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
-pub const SO_CNX_ADVICE: ::c_int = 53;
-pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
-pub const SO_MEMINFO: ::c_int = 55;
-pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
-pub const SO_COOKIE: ::c_int = 57;
-pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
-pub const SO_PEERGROUPS: ::c_int = 59;
-pub const SO_ZEROCOPY: ::c_int = 60;
-pub const SO_TXTIME: ::c_int = 61;
-pub const SCM_TXTIME: ::c_int = SO_TXTIME;
-pub const SO_BINDTOIFINDEX: ::c_int = 62;
-pub const SO_TIMESTAMP_NEW: ::c_int = 63;
-pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
-pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
-pub const SO_RCVTIMEO_NEW: ::c_int = 66;
-pub const SO_SNDTIMEO_NEW: ::c_int = 67;
-pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
-
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -454,29 +371,6 @@ pub const F_UNLCK: ::c_int = 2;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const TIOCSBRK: ::c_ulong = 0x5427;
-pub const TIOCCBRK: ::c_ulong = 0x5428;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -527,10 +421,6 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const EDEADLOCK: ::c_int = 35;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -606,7 +496,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -623,6 +512,11 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
@@ -630,32 +524,11 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
-pub const TCGETS: ::c_ulong = 0x5401;
-pub const TCSETS: ::c_ulong = 0x5402;
-pub const TCSETSW: ::c_ulong = 0x5403;
-pub const TCSETSF: ::c_ulong = 0x5404;
-pub const TCGETA: ::c_ulong = 0x5405;
-pub const TCSETA: ::c_ulong = 0x5406;
-pub const TCSETAW: ::c_ulong = 0x5407;
-pub const TCSETAF: ::c_ulong = 0x5408;
-pub const TCSBRK: ::c_ulong = 0x5409;
-pub const TCXONC: ::c_ulong = 0x540A;
-pub const TCFLSH: ::c_ulong = 0x540B;
-pub const TIOCINQ: ::c_ulong = 0x541B;
-pub const TIOCGPGRP: ::c_ulong = 0x540F;
-pub const TIOCSPGRP: ::c_ulong = 0x5410;
-pub const TIOCOUTQ: ::c_ulong = 0x5411;
-pub const TIOCGWINSZ: ::c_ulong = 0x5413;
-pub const TIOCSWINSZ: ::c_ulong = 0x5414;
-pub const FIONREAD: ::c_ulong = 0x541B;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-
// sys/auxv.h
pub const HWCAP_FP: ::c_ulong = 1 << 0;
pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
@@ -700,6 +573,22 @@ pub const HWCAP_PACG: ::c_ulong = 1 << 31;
//pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
//pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
//pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
+//pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
+
+// linux/prctl.h
+pub const PR_PAC_RESET_KEYS: ::c_int = 54;
+pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55;
+pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56;
+pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60;
+pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61;
+
+pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1;
+
+pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0;
+pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1;
+pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
+pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
+pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;
// Syscall table
pub const SYS_io_setup: ::c_long = 0;
@@ -976,6 +865,8 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_kexec_file_load: ::c_long = 294;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -995,6 +886,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
pub fn sysctl(
@@ -1023,3 +922,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
new file mode 100644
index 0000000000000..4cae9c1c35f68
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
@@ -0,0 +1,40 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct max_align_t {
+ priv_: [f64; 4]
+ }
+}
+
+s! {
+ pub struct ucontext_t {
+ pub uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: mcontext_t,
+ }
+
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub sc_pc: ::c_ulonglong,
+ pub sc_regs: [::c_ulonglong; 32],
+ pub sc_flags: ::c_ulong,
+ pub sc_extcontext: [u64; 0],
+ }
+
+ #[repr(align(8))]
+ pub struct clone_args {
+ pub flags: ::c_ulonglong,
+ pub pidfd: ::c_ulonglong,
+ pub child_tid: ::c_ulonglong,
+ pub parent_tid: ::c_ulonglong,
+ pub exit_signal: ::c_ulonglong,
+ pub stack: ::c_ulonglong,
+ pub stack_size: ::c_ulonglong,
+ pub tls: ::c_ulonglong,
+ pub set_tid: ::c_ulonglong,
+ pub set_tid_size: ::c_ulonglong,
+ pub cgroup: ::c_ulonglong,
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
new file mode 100644
index 0000000000000..d64c353bb05b7
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
@@ -0,0 +1,862 @@
+use pthread_mutex_t;
+
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = i32;
+
+pub type blksize_t = i32;
+pub type nlink_t = u32;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+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,
+ __pad1: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ __pad2: ::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_int; 2],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino64_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,
+ pub __pad1: ::dev_t,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::blksize_t,
+ pub __pad2: ::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_int; 2],
+ }
+
+ pub struct statfs {
+ pub f_type: ::__fsword_t,
+ pub f_bsize: ::__fsword_t,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::__fsword_t,
+ pub f_frsize: ::__fsword_t,
+ pub f_flags: ::__fsword_t,
+ pub f_spare: [::__fsword_t; 4],
+ }
+
+ pub struct statfs64 {
+ pub f_type: ::__fsword_t,
+ pub f_bsize: ::__fsword_t,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::__fsword_t,
+ pub f_frsize: ::__fsword_t,
+ pub f_flags: ::__fsword_t,
+ pub f_spare: [::__fsword_t; 4],
+ }
+
+ pub struct flock {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct flock64 {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off64_t,
+ pub l_len: ::off64_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct statvfs {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_favail: ::fsfilcnt_t,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ __f_spare: [::c_int; 6],
+ }
+
+ pub struct statvfs64 {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_favail: u64,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ __f_spare: [::c_int; 6],
+ }
+
+ pub struct pthread_attr_t {
+ __size: [::c_ulong; 7]
+ }
+
+ pub struct sigaction {
+ pub sa_sigaction: ::sighandler_t,
+ pub sa_mask: ::sigset_t,
+ pub sa_flags: ::c_int,
+ pub sa_restorer: ::Option,
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_flags: ::c_int,
+ pub ss_size: ::size_t,
+ }
+
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_errno: ::c_int,
+ pub si_code: ::c_int,
+ #[doc(hidden)]
+ #[deprecated(
+ since="0.2.54",
+ note="Please leave a comment on \
+ https://github.com/rust-lang/libc/pull/1316 if you're using \
+ this field"
+ )]
+ pub _pad: [::c_int; 29],
+ _align: [u64; 0],
+ }
+
+ pub struct ipc_perm {
+ pub __key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::c_uint,
+ pub __seq: ::c_ushort,
+ __pad2: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_atime: ::time_t,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_nattch: ::shmatt_t,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong
+ }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_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_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_sendfile: ::c_long = 71;
+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_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+//pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_io_pgetevents: ::c_long = 292;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_kexec_file_load: ::c_long = 294;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+//pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const O_DIRECT: ::c_int = 0o00040000;
+pub const O_DIRECTORY: ::c_int = 0o00200000;
+pub const O_NOFOLLOW: ::c_int = 0o00400000;
+pub const O_TRUNC: ::c_int = 0o00001000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0o02000000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+pub const O_APPEND: ::c_int = 0o00002000;
+pub const O_CREAT: ::c_int = 0o00000100;
+pub const O_EXCL: ::c_int = 0o00000200;
+pub const O_NOCTTY: ::c_int = 0o00000400;
+pub const O_NONBLOCK: ::c_int = 0o00004000;
+pub const FASYNC: ::c_int = 0o00020000;
+pub const O_SYNC: ::c_int = 0o04010000;
+pub const O_RSYNC: ::c_int = 0o04010000;
+pub const O_FSYNC: ::c_int = O_SYNC;
+pub const O_ASYNC: ::c_int = 0o00020000;
+pub const O_DSYNC: ::c_int = 0o00010000;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_GETLK: ::c_int = 5;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const MAP_NORESERVE: ::c_int = 0x4000;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x1000;
+pub const MAP_LOCKED: ::c_int = 0x2000;
+pub const MAP_POPULATE: ::c_int = 0x8000;
+pub const MAP_NONBLOCK: ::c_int = 0x10000;
+pub const MAP_STACK: ::c_int = 0x20000;
+pub const MAP_HUGETLB: ::c_int = 0x40000;
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGURG: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGIO: ::c_int = 29;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGUNUSED: ::c_int = 31;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const VEOF: usize = 4;
+pub const VTIME: usize = 5;
+pub const VMIN: usize = 6;
+pub const VSWTC: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VEOL: usize = 11;
+pub const VREPRINT: usize = 12;
+pub const VDISCARD: usize = 13;
+pub const VWERASE: usize = 14;
+pub const VEOL2: usize = 16;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+
+pub const NCCS: usize = 32;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
index 6e2bd3cf4d8b4..0bf5084d54461 100644
--- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
@@ -8,6 +8,7 @@ pub type nlink_t = u64;
pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
s! {
pub struct stat {
@@ -183,17 +184,6 @@ s! {
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 23],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -577,6 +567,7 @@ pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
pub const SYS_pkey_free: ::c_long = 5000 + 325;
pub const SYS_statx: ::c_long = 5000 + 326;
+pub const SYS_rseq: ::c_long = 5000 + 327;
pub const SYS_pidfd_send_signal: ::c_long = 5000 + 424;
pub const SYS_io_uring_setup: ::c_long = 5000 + 425;
pub const SYS_io_uring_enter: ::c_long = 5000 + 426;
@@ -596,6 +587,14 @@ pub const SYS_faccessat2: ::c_long = 5000 + 439;
pub const SYS_process_madvise: ::c_long = 5000 + 440;
pub const SYS_epoll_pwait2: ::c_long = 5000 + 441;
pub const SYS_mount_setattr: ::c_long = 5000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 5000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 5000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 5000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 5000 + 446;
+pub const SYS_memfd_secret: ::c_long = 5000 + 447;
+pub const SYS_process_mrelease: ::c_long = 5000 + 448;
+pub const SYS_futex_waitv: ::c_long = 5000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 5000 + 450;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
@@ -639,12 +638,6 @@ pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
-
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 256;
pub const O_EXCL: ::c_int = 1024;
@@ -756,66 +749,6 @@ pub const MAP_HUGETLB: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_STYLE: ::c_int = SO_TYPE;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_ACCEPTCONN: ::c_int = 0x1009;
-pub const SO_PROTOCOL: ::c_int = 0x1028;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_PASSCRED: ::c_int = 17;
-pub const SO_PEERCRED: ::c_int = 18;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_PEERSEC: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 31;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-
-pub const FIOCLEX: ::c_ulong = 0x6601;
-pub const FIONCLEX: ::c_ulong = 0x6602;
-pub const FIONBIO: ::c_ulong = 0x667e;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000008;
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
@@ -882,40 +815,6 @@ pub const F_OFD_SETLKW: ::c_int = 38;
pub const SFD_NONBLOCK: ::c_int = 0x80;
-pub const TCGETS: ::c_ulong = 0x540d;
-pub const TCSETS: ::c_ulong = 0x540e;
-pub const TCSETSW: ::c_ulong = 0x540f;
-pub const TCSETSF: ::c_ulong = 0x5410;
-pub const TCGETA: ::c_ulong = 0x5401;
-pub const TCSETA: ::c_ulong = 0x5402;
-pub const TCSETAW: ::c_ulong = 0x5403;
-pub const TCSETAF: ::c_ulong = 0x5404;
-pub const TCSBRK: ::c_ulong = 0x5405;
-pub const TCXONC: ::c_ulong = 0x5406;
-pub const TCFLSH: ::c_ulong = 0x5407;
-pub const TIOCSBRK: ::c_ulong = 0x5427;
-pub const TIOCCBRK: ::c_ulong = 0x5428;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
-pub const TIOCINQ: ::c_ulong = 0x467f;
-pub const TIOCLINUX: ::c_ulong = 0x5483;
-pub const TIOCGSERIAL: ::c_ulong = 0x5484;
-pub const TIOCEXCL: ::c_ulong = 0x740d;
-pub const TIOCNXCL: ::c_ulong = 0x740e;
-pub const TIOCSCTTY: ::c_ulong = 0x5480;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x7472;
-pub const TIOCSTI: ::c_ulong = 0x5472;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCMGET: ::c_ulong = 0x741d;
-pub const TIOCMBIS: ::c_ulong = 0x741b;
-pub const TIOCMBIC: ::c_ulong = 0x741c;
-pub const TIOCMSET: ::c_ulong = 0x741a;
-pub const FIONREAD: ::c_ulong = 0x467f;
-pub const TIOCCONS: ::c_ulong = 0x80047478;
-
pub const RTLD_DEEPBIND: ::c_int = 0x10;
pub const RTLD_GLOBAL: ::c_int = 0x4;
pub const RTLD_NOLOAD: ::c_int = 0x8;
@@ -995,7 +894,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -1012,13 +910,6 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const TIOCM_ST: ::c_int = 0x010;
-pub const TIOCM_SR: ::c_int = 0x020;
-pub const TIOCM_CTS: ::c_int = 0x040;
-pub const TIOCM_CAR: ::c_int = 0x100;
-pub const TIOCM_RNG: ::c_int = 0x200;
-pub const TIOCM_DSR: ::c_int = 0x400;
-
pub const EHWPOISON: ::c_int = 168;
extern "C" {
diff --git a/src/unix/linux_like/linux/gnu/b64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mod.rs
index 138adc910c801..443958cff7372 100644
--- a/src/unix/linux_like/linux/gnu/b64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/mod.rs
@@ -9,6 +9,11 @@ pub type msglen_t = u64;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type rlim_t = u64;
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+pub type __syscall_ulong_t = ::c_ulonglong;
+#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+pub type __syscall_ulong_t = ::c_ulong;
+
cfg_if! {
if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
pub type clock_t = i32;
@@ -60,9 +65,32 @@ s! {
__glibc_reserved5: u64,
}
+ pub struct semid_ds {
+ pub sem_perm: ipc_perm,
+ pub sem_otime: ::time_t,
+ #[cfg(not(any(
+ target_arch = "aarch64",
+ target_arch = "loongarch64",
+ target_arch = "mips64",
+ target_arch = "powerpc64",
+ target_arch = "riscv64",
+ target_arch = "sparc64")))]
+ __reserved: ::__syscall_ulong_t,
+ pub sem_ctime: ::time_t,
+ #[cfg(not(any(
+ target_arch = "aarch64",
+ target_arch = "loongarch64",
+ target_arch = "mips64",
+ target_arch = "powerpc64",
+ target_arch = "riscv64",
+ target_arch = "sparc64")))]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_nsems: ::__syscall_ulong_t,
+ __glibc_reserved3: ::__syscall_ulong_t,
+ __glibc_reserved4: ::__syscall_ulong_t,
+ }
}
-pub const RLIM_INFINITY: ::rlim_t = !0;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const O_LARGEFILE: ::c_int = 0;
@@ -89,6 +117,9 @@ cfg_if! {
} else if #[cfg(any(target_arch = "riscv64"))] {
mod riscv64;
pub use self::riscv64::*;
+ } else if #[cfg(any(target_arch = "loongarch64"))] {
+ mod loongarch64;
+ pub use self::loongarch64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
index d4a946f0ded04..ce8ce97bb4fee 100644
--- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
@@ -10,6 +10,7 @@ pub type nlink_t = u64;
pub type blksize_t = i64;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
s! {
pub struct sigaction {
@@ -190,12 +191,6 @@ s! {
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
-
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
- }
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
@@ -207,15 +202,6 @@ pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const VEOF: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -319,61 +305,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SOL_SOCKET: ::c_int = 1;
-
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 20;
-pub const SO_PEERCRED: ::c_int = 21;
-pub const SO_RCVLOWAT: ::c_int = 16;
-pub const SO_SNDLOWAT: ::c_int = 17;
-pub const SO_RCVTIMEO: ::c_int = 18;
-pub const SO_SNDTIMEO: ::c_int = 19;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -436,29 +367,6 @@ pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const TIOCSBRK: ::c_ulong = 0x5427;
-pub const TIOCCBRK: ::c_ulong = 0x5428;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -561,10 +469,6 @@ pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const FIOCLEX: ::c_ulong = 0x20006601;
-pub const FIONCLEX: ::c_ulong = 0x20006602;
-pub const FIONBIO: ::c_ulong = 0x8004667e;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -654,7 +558,6 @@ pub const B2500000: ::speed_t = 0o0033;
pub const B3000000: ::speed_t = 0o0034;
pub const B3500000: ::speed_t = 0o0035;
pub const B4000000: ::speed_t = 0o0036;
-pub const BOTHER: ::speed_t = 0o0037;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
@@ -663,24 +566,6 @@ pub const IEXTEN: ::tcflag_t = 0x400;
pub const TOSTOP: ::tcflag_t = 0x400000;
pub const FLUSHO: ::tcflag_t = 0x800000;
pub const EXTPROC: ::tcflag_t = 0x10000000;
-pub const TCGETS: ::c_ulong = 0x403c7413;
-pub const TCSETS: ::c_ulong = 0x803c7414;
-pub const TCSETSW: ::c_ulong = 0x803c7415;
-pub const TCSETSF: ::c_ulong = 0x803c7416;
-pub const TCGETA: ::c_ulong = 0x40147417;
-pub const TCSETA: ::c_ulong = 0x80147418;
-pub const TCSETAW: ::c_ulong = 0x80147419;
-pub const TCSETAF: ::c_ulong = 0x8014741c;
-pub const TCSBRK: ::c_ulong = 0x2000741d;
-pub const TCXONC: ::c_ulong = 0x2000741e;
-pub const TCFLSH: ::c_ulong = 0x2000741f;
-pub const TIOCINQ: ::c_ulong = 0x4004667f;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x40047473;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const FIONREAD: ::c_ulong = 0x4004667f;
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
@@ -1043,6 +928,7 @@ pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 387;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -1062,6 +948,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
pub fn sysctl(
diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
new file mode 100644
index 0000000000000..48d152a5721ec
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ pub struct ucontext_t {
+ pub __uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: mcontext_t,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub __gregs: [::c_ulong; 32],
+ pub __fpregs: __riscv_mc_fp_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub union __riscv_mc_fp_state {
+ pub __f: __riscv_mc_f_ext_state,
+ pub __d: __riscv_mc_d_ext_state,
+ pub __q: __riscv_mc_q_ext_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_f_ext_state {
+ pub __f: [::c_uint; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_d_ext_state {
+ pub __f: [::c_ulonglong; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct __riscv_mc_q_ext_state {
+ pub __f: [::c_ulonglong; 64],
+ pub __fcsr: ::c_uint,
+ pub __glibc_reserved: [::c_uint; 3],
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
index 858048904b65e..9d022f96e092b 100644
--- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -11,6 +11,7 @@ pub type fsblkcnt64_t = ::c_ulong;
pub type fsfilcnt64_t = ::c_ulong;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct pthread_attr_t {
@@ -191,12 +192,6 @@ s! {
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
-
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
- }
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
@@ -205,15 +200,6 @@ pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const TIOCGSOFTCAR: ::c_ulong = 21529;
-pub const TIOCSSOFTCAR: ::c_ulong = 21530;
-pub const TIOCGRS485: ::c_int = 21550;
-pub const TIOCSRS485: ::c_int = 21551;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -226,6 +212,7 @@ pub const O_FSYNC: ::c_int = 1052672;
pub const O_NOATIME: ::c_int = 262144;
pub const O_PATH: ::c_int = 2097152;
pub const O_TMPFILE: ::c_int = 4259840;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_GROWSDOWN: ::c_int = 256;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -305,59 +292,7 @@ pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = 26;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = 35;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = 41;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = 27;
+
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SA_ONSTACK: ::c_int = 134217728;
@@ -407,23 +342,6 @@ pub const SFD_NONBLOCK: ::c_int = 2048;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 21532;
-pub const TIOCGSERIAL: ::c_ulong = 21534;
-pub const TIOCEXCL: ::c_ulong = 21516;
-pub const TIOCNXCL: ::c_ulong = 21517;
-pub const TIOCSCTTY: ::c_ulong = 21518;
-pub const TIOCSTI: ::c_ulong = 21522;
-pub const TIOCMGET: ::c_ulong = 21525;
-pub const TIOCMBIS: ::c_ulong = 21526;
-pub const TIOCMBIC: ::c_ulong = 21527;
-pub const TIOCMSET: ::c_ulong = 21528;
-pub const TIOCCONS: ::c_ulong = 21533;
-pub const TIOCM_ST: ::c_int = 8;
-pub const TIOCM_SR: ::c_int = 16;
-pub const TIOCM_CTS: ::c_int = 32;
-pub const TIOCM_CAR: ::c_int = 64;
-pub const TIOCM_RNG: ::c_int = 128;
-pub const TIOCM_DSR: ::c_int = 256;
pub const SFD_CLOEXEC: ::c_int = 524288;
pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 512;
@@ -470,9 +388,12 @@ pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const FIOCLEX: ::c_ulong = 21585;
-pub const FIONCLEX: ::c_ulong = 21584;
-pub const FIONBIO: ::c_ulong = 21537;
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
pub const MCL_CURRENT: ::c_int = 1;
pub const MCL_FUTURE: ::c_int = 2;
pub const SIGSTKSZ: ::size_t = 8192;
@@ -568,26 +489,19 @@ pub const IEXTEN: ::tcflag_t = 32768;
pub const TOSTOP: ::tcflag_t = 256;
pub const FLUSHO: ::tcflag_t = 4096;
pub const EXTPROC: ::tcflag_t = 65536;
-pub const TCGETS: ::c_ulong = 21505;
-pub const TCSETS: ::c_ulong = 21506;
-pub const TCSETSW: ::c_ulong = 21507;
-pub const TCSETSF: ::c_ulong = 21508;
-pub const TCGETA: ::c_ulong = 21509;
-pub const TCSETA: ::c_ulong = 21510;
-pub const TCSETAW: ::c_ulong = 21511;
-pub const TCSETAF: ::c_ulong = 21512;
-pub const TCSBRK: ::c_ulong = 21513;
-pub const TCXONC: ::c_ulong = 21514;
-pub const TCFLSH: ::c_ulong = 21515;
-pub const TIOCINQ: ::c_ulong = 21531;
-pub const TIOCGPGRP: ::c_ulong = 21519;
-pub const TIOCSPGRP: ::c_ulong = 21520;
-pub const TIOCOUTQ: ::c_ulong = 21521;
-pub const TIOCGWINSZ: ::c_ulong = 21523;
-pub const TIOCSWINSZ: ::c_ulong = 21524;
-pub const FIONREAD: ::c_ulong = 21531;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
+
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_close: ::c_long = 57;
@@ -863,6 +777,7 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -882,3 +797,18 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs
index b5032f9677cd3..c4bae089ce295 100644
--- a/src/unix/linux_like/linux/gnu/b64/s390x.rs
+++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs
@@ -11,6 +11,7 @@ pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
+pub type __s64 = i64;
s! {
pub struct sigaction {
@@ -153,17 +154,6 @@ s! {
__f_spare: [::c_int; 6],
}
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
-
pub struct __psw_t {
pub mask: u64,
pub addr: u64,
@@ -340,9 +330,6 @@ pub const EDEADLK: ::c_int = 35;
pub const ENOSYS: ::c_int = 38;
pub const ENOTCONN: ::c_int = 107;
pub const ETIMEDOUT: ::c_int = 110;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -354,30 +341,10 @@ pub const SIGBUS: ::c_int = 7;
pub const SIGSTKSZ: ::size_t = 0x2000;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const SIG_SETMASK: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_BUSY_POLL: ::c_int = 46;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
-
pub const O_NOCTTY: ::c_int = 256;
pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
@@ -399,6 +366,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
pub const EDEADLOCK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -471,26 +439,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
@@ -548,51 +496,10 @@ pub const F_OFD_SETLKW: ::c_int = 38;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
-pub const TCGETS: ::c_ulong = 0x5401;
-pub const TCSETS: ::c_ulong = 0x5402;
-pub const TCSETSW: ::c_ulong = 0x5403;
-pub const TCSETSF: ::c_ulong = 0x5404;
-pub const TCGETA: ::c_ulong = 0x5405;
-pub const TCSETA: ::c_ulong = 0x5406;
-pub const TCSETAW: ::c_ulong = 0x5407;
-pub const TCSETAF: ::c_ulong = 0x5408;
-pub const TCSBRK: ::c_ulong = 0x5409;
-pub const TCXONC: ::c_ulong = 0x540A;
-pub const TCFLSH: ::c_ulong = 0x540B;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCINQ: ::c_ulong = 0x541B;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCGPGRP: ::c_ulong = 0x540F;
-pub const TIOCSPGRP: ::c_ulong = 0x5410;
-pub const TIOCOUTQ: ::c_ulong = 0x5411;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCGWINSZ: ::c_ulong = 0x5413;
-pub const TIOCSWINSZ: ::c_ulong = 0x5414;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const FIONREAD: ::c_ulong = 0x541B;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const TIOCSBRK: ::c_ulong = 0x5427;
-pub const TIOCCBRK: ::c_ulong = 0x5428;
-
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const VTIME: usize = 5;
pub const VSWTC: usize = 7;
pub const VSTART: usize = 8;
@@ -650,7 +557,6 @@ pub const PARODD: ::tcflag_t = 0o001000;
pub const HUPCL: ::tcflag_t = 0o002000;
pub const CLOCAL: ::tcflag_t = 0o004000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -1009,6 +915,7 @@ pub const SYS_setfsuid: ::c_long = 215;
pub const SYS_setfsgid: ::c_long = 216;
pub const SYS_newfstatat: ::c_long = 293;
pub const SYS_statx: ::c_long = 379;
+pub const SYS_rseq: ::c_long = 383;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -1028,6 +935,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
@@ -1041,14 +956,6 @@ extern "C" {
) -> ::c_int;
pub fn getcontext(ucp: *mut ::ucontext_t) -> ::c_int;
pub fn setcontext(ucp: *const ::ucontext_t) -> ::c_int;
- pub fn makecontext(
- ucp: *mut ::ucontext_t,
- func: extern "C" fn(),
- argc: ::c_int,
- ...
- );
- pub fn swapcontext(
- uocp: *mut ::ucontext_t,
- ucp: *const ::ucontext_t,
- ) -> ::c_int;
+ pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn swapcontext(uocp: *mut ::ucontext_t, ucp: *const ::ucontext_t) -> ::c_int;
}
diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
index 60a13c39fa69d..9fdacfac81dd2 100644
--- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
@@ -10,6 +10,7 @@ pub type nlink_t = u32;
pub type blksize_t = i64;
pub type suseconds_t = i32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
@@ -193,17 +194,6 @@ s! {
__reserved1: ::c_ulong,
__reserved2: ::c_ulong
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
@@ -215,15 +205,6 @@ pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x40047464;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x80047465;
-
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
-
pub const O_APPEND: ::c_int = 0x8;
pub const O_CREAT: ::c_int = 0x200;
pub const O_EXCL: ::c_int = 0x800;
@@ -328,33 +309,6 @@ pub const ENOTRECOVERABLE: ::c_int = 133;
pub const EHWPOISON: ::c_int = 135;
pub const ERFKILL: ::c_int = 134;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_PASSCRED: ::c_int = 2;
-pub const SO_REUSEADDR: ::c_int = 4;
-pub const SO_BINDTODEVICE: ::c_int = 0x000d;
-pub const SO_TIMESTAMP: ::c_int = 0x001d;
-pub const SO_PEERSEC: ::c_int = 0x001e;
-pub const SO_PASSSEC: ::c_int = 0x001f;
-pub const SO_MARK: ::c_int = 0x0022;
-pub const SO_RXQ_OVFL: ::c_int = 0x0024;
-pub const SO_PEEK_OFF: ::c_int = 0x0026;
-pub const SO_BUSY_POLL: ::c_int = 0x0030;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_DONTROUTE: ::c_int = 16;
-pub const SO_BROADCAST: ::c_int = 32;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
-pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_KEEPALIVE: ::c_int = 8;
-pub const SO_OOBINLINE: ::c_int = 0x100;
-pub const SO_LINGER: ::c_int = 128;
-pub const SO_REUSEPORT: ::c_int = 0x200;
-pub const SO_ACCEPTCONN: ::c_int = 0x8000;
-
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -391,7 +345,7 @@ pub const POLLWRBAND: ::c_short = 0x100;
pub const O_ASYNC: ::c_int = 0x40;
pub const O_NDELAY: ::c_int = 0x4004;
-pub const PTRACE_DETACH: ::c_uint = 11;
+pub const PTRACE_DETACH: ::c_uint = 17;
pub const EFD_NONBLOCK: ::c_int = 0x4000;
@@ -414,27 +368,6 @@ pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCEXCL: ::c_ulong = 0x2000740d;
-pub const TIOCNXCL: ::c_ulong = 0x2000740e;
-pub const TIOCCONS: ::c_ulong = 0x20007424;
-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 TIOCSTI: ::c_ulong = 0x80017472;
-pub const TIOCCBRK: ::c_ulong = 0x2000747a;
-pub const TIOCSBRK: ::c_ulong = 0x2000747b;
-pub const TIOCSCTTY: ::c_ulong = 0x20007484;
-
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const SFD_CLOEXEC: ::c_int = 0x400000;
pub const NCCS: usize = 17;
@@ -507,16 +440,6 @@ pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const SO_PEERCRED: ::c_int = 0x40;
-pub const SO_RCVLOWAT: ::c_int = 0x800;
-pub const SO_SNDLOWAT: ::c_int = 0x1000;
-pub const SO_RCVTIMEO: ::c_int = 0x2000;
-pub const SO_SNDTIMEO: ::c_int = 0x4000;
-
-pub const FIOCLEX: ::c_ulong = 0x20006601;
-pub const FIONCLEX: ::c_ulong = 0x20006602;
-pub const FIONBIO: ::c_ulong = 0x8004667e;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
@@ -592,7 +515,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0x1000;
pub const B57600: ::speed_t = 0x1001;
pub const B115200: ::speed_t = 0x1002;
pub const B230400: ::speed_t = 0x1003;
@@ -616,24 +538,6 @@ pub const IEXTEN: ::tcflag_t = 0x8000;
pub const TOSTOP: ::tcflag_t = 0x100;
pub const FLUSHO: ::tcflag_t = 0x1000;
pub const EXTPROC: ::tcflag_t = 0x10000;
-pub const TCGETS: ::c_ulong = 0x40245408;
-pub const TCSETS: ::c_ulong = 0x80245409;
-pub const TCSETSW: ::c_ulong = 0x8024540a;
-pub const TCSETSF: ::c_ulong = 0x8024540b;
-pub const TCGETA: ::c_ulong = 0x40125401;
-pub const TCSETA: ::c_ulong = 0x80125402;
-pub const TCSETAW: ::c_ulong = 0x80125403;
-pub const TCSETAF: ::c_ulong = 0x80125404;
-pub const TCSBRK: ::c_ulong = 0x20005405;
-pub const TCXONC: ::c_ulong = 0x20005406;
-pub const TCFLSH: ::c_ulong = 0x20005407;
-pub const TIOCINQ: ::c_ulong = 0x4004667f;
-pub const TIOCGPGRP: ::c_ulong = 0x40047483;
-pub const TIOCSPGRP: ::c_ulong = 0x80047482;
-pub const TIOCOUTQ: ::c_ulong = 0x40047473;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -975,6 +879,7 @@ pub const SYS_copy_file_range: ::c_long = 357;
pub const SYS_preadv2: ::c_long = 358;
pub const SYS_pwritev2: ::c_long = 359;
pub const SYS_statx: ::c_long = 360;
+pub const SYS_rseq: ::c_long = 365;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -995,6 +900,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
pub fn sysctl(
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
index 7ca870fd02b71..ba3075edd7e36 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
@@ -5,3 +5,20 @@ s_no_extra_traits! {
priv_: [f64; 4]
}
}
+
+s! {
+ #[repr(align(8))]
+ pub struct clone_args {
+ pub flags: ::c_ulonglong,
+ pub pidfd: ::c_ulonglong,
+ pub child_tid: ::c_ulonglong,
+ pub parent_tid: ::c_ulonglong,
+ pub exit_signal: ::c_ulonglong,
+ pub stack: ::c_ulonglong,
+ pub stack_size: ::c_ulonglong,
+ pub tls: ::c_ulonglong,
+ pub set_tid: ::c_ulonglong,
+ pub set_tid_size: ::c_ulonglong,
+ pub cgroup: ::c_ulonglong,
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
index faad040ef99e6..d515d22315d0c 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -7,6 +7,7 @@ pub type blksize_t = i64;
pub type greg_t = i64;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
@@ -259,21 +260,18 @@ s! {
__unused5: u64
}
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
+ pub struct seccomp_notif_sizes {
+ pub seccomp_notif: ::__u16,
+ pub seccomp_notif_resp: ::__u16,
+ pub seccomp_data: ::__u16,
}
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
+ pub struct ptrace_rseq_configuration {
+ pub rseq_abi_pointer: ::__u64,
+ pub rseq_abi_size: ::__u32,
+ pub signature: ::__u32,
+ pub flags: ::__u32,
+ pub pad: ::__u32,
}
}
@@ -409,16 +407,6 @@ pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
-pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
-pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
-pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
-pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
-pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
@@ -515,80 +503,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SOL_SOCKET: ::c_int = 1;
-
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
-pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
-pub const SO_CNX_ADVICE: ::c_int = 53;
-pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
-pub const SO_MEMINFO: ::c_int = 55;
-pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
-pub const SO_COOKIE: ::c_int = 57;
-pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
-pub const SO_PEERGROUPS: ::c_int = 59;
-pub const SO_ZEROCOPY: ::c_int = 60;
-pub const SO_TXTIME: ::c_int = 61;
-pub const SCM_TXTIME: ::c_int = SO_TXTIME;
-pub const SO_BINDTOIFINDEX: ::c_int = 62;
-pub const SO_TIMESTAMP_NEW: ::c_int = 63;
-pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
-pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
-pub const SO_RCVTIMEO_NEW: ::c_int = 66;
-pub const SO_SNDTIMEO_NEW: ::c_int = 67;
-pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
-
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -629,6 +543,7 @@ pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_GET_RSEQ_CONFIGURATION: ::c_uint = 0x420f;
pub const EFD_NONBLOCK: ::c_int = 0x800;
@@ -651,25 +566,6 @@ pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
-pub const TIOCLINUX: ::c_ulong = 0x541C;
-pub const TIOCGSERIAL: ::c_ulong = 0x541E;
-pub const TIOCEXCL: ::c_ulong = 0x540C;
-pub const TIOCNXCL: ::c_ulong = 0x540D;
-pub const TIOCSCTTY: ::c_ulong = 0x540E;
-pub const TIOCSTI: ::c_ulong = 0x5412;
-pub const TIOCMGET: ::c_ulong = 0x5415;
-pub const TIOCMBIS: ::c_ulong = 0x5416;
-pub const TIOCMBIC: ::c_ulong = 0x5417;
-pub const TIOCMSET: ::c_ulong = 0x5418;
-pub const TIOCCONS: ::c_ulong = 0x541D;
-
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -729,10 +625,6 @@ pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
-
pub const PTRACE_GETFPREGS: ::c_uint = 14;
pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
@@ -743,6 +635,19 @@ pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
pub const PTRACE_SYSEMU: ::c_uint = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+pub const PR_GET_SPECULATION_CTRL: ::c_int = 52;
+pub const PR_SET_SPECULATION_CTRL: ::c_int = 53;
+pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0;
+pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0;
+pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1;
+pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2;
+pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3;
+pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4;
+pub const PR_SPEC_STORE_BYPASS: ::c_int = 0;
+pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1;
+// FIXME: perharps for later
+//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2;
+
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -818,7 +723,6 @@ pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -842,26 +746,6 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
-pub const TCGETS: ::c_ulong = 0x5401;
-pub const TCSETS: ::c_ulong = 0x5402;
-pub const TCSETSW: ::c_ulong = 0x5403;
-pub const TCSETSF: ::c_ulong = 0x5404;
-pub const TCGETA: ::c_ulong = 0x5405;
-pub const TCSETA: ::c_ulong = 0x5406;
-pub const TCSETAW: ::c_ulong = 0x5407;
-pub const TCSETAF: ::c_ulong = 0x5408;
-pub const TCSBRK: ::c_ulong = 0x5409;
-pub const TCXONC: ::c_ulong = 0x540A;
-pub const TCFLSH: ::c_ulong = 0x540B;
-pub const TIOCINQ: ::c_ulong = 0x541B;
-pub const TIOCGPGRP: ::c_ulong = 0x540F;
-pub const TIOCSPGRP: ::c_ulong = 0x5410;
-pub const TIOCOUTQ: ::c_ulong = 0x5411;
-pub const TIOCGWINSZ: ::c_ulong = 0x5413;
-pub const TIOCSWINSZ: ::c_ulong = 0x5414;
-pub const FIONREAD: ::c_ulong = 0x541B;
-pub const TIOCSBRK: ::c_ulong = 0x5427;
-pub const TIOCCBRK: ::c_ulong = 0x5428;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
@@ -917,25 +801,18 @@ pub const REG_TRAPNO: ::c_int = 20;
pub const REG_OLDMASK: ::c_int = 21;
pub const REG_CR2: ::c_int = 22;
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
extern "C" {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
- pub fn makecontext(
- ucp: *mut ucontext_t,
- func: extern "C" fn(),
- argc: ::c_int,
- ...
- );
- pub fn swapcontext(
- uocp: *mut ucontext_t,
- ucp: *const ucontext_t,
- ) -> ::c_int;
+ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
pub fn iopl(level: ::c_int) -> ::c_int;
- pub fn ioperm(
- from: ::c_ulong,
- num: ::c_ulong,
- turn_on: ::c_int,
- ) -> ::c_int;
+ pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
index e126984268d90..35d2714ee92d5 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
@@ -409,6 +409,7 @@ pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
pub const SYS_statx: ::c_long = 332;
+pub const SYS_rseq: ::c_long = 334;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
@@ -428,6 +429,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
pub fn sysctl(
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
index dcbc3472f080c..807b948ef82b5 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
@@ -337,6 +337,7 @@ pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332;
+pub const SYS_rseq: ::c_long = __X32_SYSCALL_BIT + 334;
pub const SYS_pidfd_send_signal: ::c_long = __X32_SYSCALL_BIT + 424;
pub const SYS_io_uring_setup: ::c_long = __X32_SYSCALL_BIT + 425;
pub const SYS_io_uring_enter: ::c_long = __X32_SYSCALL_BIT + 426;
@@ -356,6 +357,14 @@ pub const SYS_faccessat2: ::c_long = __X32_SYSCALL_BIT + 439;
pub const SYS_process_madvise: ::c_long = __X32_SYSCALL_BIT + 440;
pub const SYS_epoll_pwait2: ::c_long = __X32_SYSCALL_BIT + 441;
pub const SYS_mount_setattr: ::c_long = __X32_SYSCALL_BIT + 442;
+pub const SYS_quotactl_fd: ::c_long = __X32_SYSCALL_BIT + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = __X32_SYSCALL_BIT + 444;
+pub const SYS_landlock_add_rule: ::c_long = __X32_SYSCALL_BIT + 445;
+pub const SYS_landlock_restrict_self: ::c_long = __X32_SYSCALL_BIT + 446;
+pub const SYS_memfd_secret: ::c_long = __X32_SYSCALL_BIT + 447;
+pub const SYS_process_mrelease: ::c_long = __X32_SYSCALL_BIT + 448;
+pub const SYS_futex_waitv: ::c_long = __X32_SYSCALL_BIT + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = __X32_SYSCALL_BIT + 450;
pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 32e9a9bd32a9e..98a58a2acb866 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -4,6 +4,16 @@ pub type __rlimit_resource_t = ::c_uint;
pub type Lmid_t = ::c_long;
pub type regoff_t = ::c_int;
+cfg_if! {
+ if #[cfg(doc)] {
+ // Used in `linux::arch` to define ioctl constants.
+ pub(crate) type Ioctl = ::c_ulong;
+ } else {
+ #[doc(hidden)]
+ pub type Ioctl = ::c_ulong;
+ }
+}
+
s! {
pub struct statx {
pub stx_mask: u32,
@@ -128,17 +138,17 @@ s! {
pub keepcost: ::c_int,
}
- pub struct nlmsghdr {
- pub nlmsg_len: u32,
- pub nlmsg_type: u16,
- pub nlmsg_flags: u16,
- pub nlmsg_seq: u32,
- pub nlmsg_pid: u32,
- }
-
- pub struct nlmsgerr {
- pub error: ::c_int,
- pub msg: nlmsghdr,
+ pub struct mallinfo2 {
+ pub arena: ::size_t,
+ pub ordblks: ::size_t,
+ pub smblks: ::size_t,
+ pub hblks: ::size_t,
+ pub hblkhd: ::size_t,
+ pub usmblks: ::size_t,
+ pub fsmblks: ::size_t,
+ pub uordblks: ::size_t,
+ pub fordblks: ::size_t,
+ pub keepcost: ::size_t,
}
pub struct nl_pktinfo {
@@ -161,11 +171,6 @@ s! {
pub nm_gid: u32,
}
- pub struct nlattr {
- pub nla_len: u16,
- pub nla_type: u16,
- }
-
pub struct rtentry {
pub rt_pad1: ::c_ulong,
pub rt_dst: ::sockaddr,
@@ -300,6 +305,51 @@ s! {
pub ch_size: ::Elf32_Word,
pub ch_addralign: ::Elf32_Word,
}
+
+ pub struct seminfo {
+ pub semmap: ::c_int,
+ pub semmni: ::c_int,
+ pub semmns: ::c_int,
+ pub semmnu: ::c_int,
+ pub semmsl: ::c_int,
+ pub semopm: ::c_int,
+ pub semume: ::c_int,
+ pub semusz: ::c_int,
+ pub semvmx: ::c_int,
+ pub semaem: ::c_int,
+ }
+
+ pub struct ptrace_peeksiginfo_args {
+ pub off: ::__u64,
+ pub flags: ::__u32,
+ pub nr: ::__s32,
+ }
+
+ pub struct __c_anonymous_ptrace_syscall_info_entry {
+ pub nr: ::__u64,
+ pub args: [::__u64; 6],
+ }
+
+ pub struct __c_anonymous_ptrace_syscall_info_exit {
+ pub sval: ::__s64,
+ pub is_error: ::__u8,
+ }
+
+ pub struct __c_anonymous_ptrace_syscall_info_seccomp {
+ pub nr: ::__u64,
+ pub args: [::__u64; 6],
+ pub ret_data: ::__u32,
+ }
+
+ pub struct ptrace_syscall_info {
+ pub op: ::__u8,
+ pub pad: [::__u8; 3],
+ pub arch: ::__u32,
+ pub instruction_pointer: ::__u64,
+ pub stack_pointer: ::__u64,
+ #[cfg(libc_union)]
+ pub u: __c_anonymous_ptrace_syscall_info_data,
+ }
}
impl siginfo_t {
@@ -387,6 +437,18 @@ cfg_if! {
self.sifields().sigchld.si_stime
}
}
+
+ pub union __c_anonymous_ptrace_syscall_info_data {
+ pub entry: __c_anonymous_ptrace_syscall_info_entry,
+ pub exit: __c_anonymous_ptrace_syscall_info_exit,
+ pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp,
+ }
+ impl ::Copy for __c_anonymous_ptrace_syscall_info_data {}
+ impl ::Clone for __c_anonymous_ptrace_syscall_info_data {
+ fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data {
+ *self
+ }
+ }
}
}
@@ -403,22 +465,26 @@ s_no_extra_traits! {
#[cfg(any(target_arch = "aarch64",
target_arch = "s390x",
+ target_arch = "loongarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64"))))]
pub ut_session: ::c_long,
#[cfg(any(target_arch = "aarch64",
target_arch = "s390x",
+ target_arch = "loongarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64"))))]
pub ut_tv: ::timeval,
#[cfg(not(any(target_arch = "aarch64",
target_arch = "s390x",
+ target_arch = "loongarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
pub ut_session: i32,
#[cfg(not(any(target_arch = "aarch64",
target_arch = "s390x",
+ target_arch = "loongarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
pub ut_tv: __timeval,
@@ -485,6 +551,44 @@ cfg_if! {
self.__glibc_reserved.hash(state);
}
}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ptrace_syscall_info_data {
+ fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool {
+ unsafe {
+ self.entry == other.entry ||
+ self.exit == other.exit ||
+ self.seccomp == other.seccomp
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ptrace_syscall_info_data {}
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ptrace_syscall_info_data {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_ptrace_syscall_info_data")
+ .field("entry", &self.entry)
+ .field("exit", &self.exit)
+ .field("seccomp", &self.seccomp)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.entry.hash(state);
+ self.exit.hash(state);
+ self.seccomp.hash(state);
+ }
+ }
+ }
}
}
@@ -529,19 +633,6 @@ pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB;
pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB;
pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB;
-pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
-pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
-pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
-pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
-pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
-pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
-pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
-pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
-pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
-pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
-pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
-pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
-
pub const PRIO_PROCESS: ::__priority_which_t = 0;
pub const PRIO_PGRP: ::__priority_which_t = 1;
pub const PRIO_USER: ::__priority_which_t = 2;
@@ -578,6 +669,7 @@ pub const RTLD_DI_TLS_MODID: ::c_int = 9;
pub const RTLD_DI_TLS_DATA: ::c_int = 10;
pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint;
pub const SOL_RXRPC: ::c_int = 272;
pub const SOL_PPPOL2TP: ::c_int = 273;
@@ -621,18 +713,6 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOCK_DCCP: ::c_int = 6;
pub const SOCK_PACKET: ::c_int = 10;
-pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
-pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
-pub const TCP_THIN_DUPACK: ::c_int = 17;
-pub const TCP_USER_TIMEOUT: ::c_int = 18;
-pub const TCP_REPAIR: ::c_int = 19;
-pub const TCP_REPAIR_QUEUE: ::c_int = 20;
-pub const TCP_QUEUE_SEQ: ::c_int = 21;
-pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
-pub const TCP_FASTOPEN: ::c_int = 23;
-pub const TCP_TIMESTAMP: ::c_int = 24;
-pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
-
pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000;
pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010;
// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0
@@ -756,114 +836,15 @@ pub const O_ACCMODE: ::c_int = 3;
pub const ST_RELATIME: ::c_ulong = 4096;
pub const NI_MAXHOST: ::socklen_t = 1025;
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
cfg_if! {
if #[cfg(not(target_arch = "s390x"))] {
- pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
- pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
- pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
- pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
- pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
- pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
- pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
- pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
- pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
- pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
- pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
- pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
- pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
- pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
- pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
- pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
- pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
- pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
- pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
- pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
- pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
- pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
- pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
- pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
- pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
- pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
- pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
- pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
- pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
- pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
- pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
- pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
- pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
- pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
- pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
- pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
- pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
- pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
- pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
- pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
- pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
- pub const SECURITYFS_MAGIC: ::c_long = 0x73636673;
- pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c;
- pub const SMACK_MAGIC: ::c_long = 0x43415d53;
- pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
- pub const SYSFS_MAGIC: ::c_long = 0x62656572;
- pub const TMPFS_MAGIC: ::c_long = 0x01021994;
- pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
- pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
- pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
- pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
} else if #[cfg(target_arch = "s390x")] {
- pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
- pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
- pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
- pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
- pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
- pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
- pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
- pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
- pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
- pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
- pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
- pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
- pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
- pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
- pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
- pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
- pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
- pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
- pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
- pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
- pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
- pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
- pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
- pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
- pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
- pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
- pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
- pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
- pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
- pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
- pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
- pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
- pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
- pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
- pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
- pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
- pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
- pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
- pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
- pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
- pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
- pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673;
- pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c;
- pub const SMACK_MAGIC: ::c_uint = 0x43415d53;
- pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
- pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
- pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
- pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
- pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
- pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
- pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
}
}
@@ -892,6 +873,7 @@ pub const PTRACE_SEIZE: ::c_uint = 0x4206;
pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
pub const PTRACE_LISTEN: ::c_uint = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
+pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e;
// linux/fs.h
@@ -953,17 +935,26 @@ 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;
-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;
+// elf.h
+pub const NT_PRSTATUS: ::c_int = 1;
+pub const NT_PRFPREG: ::c_int = 2;
+pub const NT_FPREGSET: ::c_int = 2;
+pub const NT_PRPSINFO: ::c_int = 3;
+pub const NT_PRXREG: ::c_int = 4;
+pub const NT_TASKSTRUCT: ::c_int = 4;
+pub const NT_PLATFORM: ::c_int = 5;
+pub const NT_AUXV: ::c_int = 6;
+pub const NT_GWINDOWS: ::c_int = 7;
+pub const NT_ASRS: ::c_int = 8;
+pub const NT_PSTATUS: ::c_int = 10;
+pub const NT_PSINFO: ::c_int = 13;
+pub const NT_PRCRED: ::c_int = 14;
+pub const NT_UTSNAME: ::c_int = 15;
+pub const NT_LWPSTATUS: ::c_int = 16;
+pub const NT_LWPSINFO: ::c_int = 17;
+pub const NT_PRFPXREG: ::c_int = 20;
+
+pub const ELFOSABI_ARM_AEABI: u8 = 64;
// linux/keyctl.h
pub const KEYCTL_DH_COMPUTE: u32 = 23;
@@ -996,193 +987,6 @@ cfg_if! {
}
}
-// linux/netfilter/nf_tables.h
-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 = 25;
-
-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 M_MXFAST: ::c_int = 1;
pub const M_NLBLKS: ::c_int = 2;
pub const M_GRAIN: ::c_int = 3;
@@ -1222,6 +1026,11 @@ pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
+pub const STATX_ATTR_MOUNT_ROOT: ::c_int = 0x2000;
+pub const STATX_ATTR_VERITY: ::c_int = 0x00100000;
+pub const STATX_ATTR_DAX: ::c_int = 0x00200000;
+
+pub const SOMAXCONN: ::c_int = 4096;
//sys/timex.h
pub const ADJ_OFFSET: ::c_uint = 0x0001;
@@ -1335,11 +1144,7 @@ extern "C" {
num: ::size_t,
size: ::size_t,
compar: ::Option<
- unsafe extern "C" fn(
- *const ::c_void,
- *const ::c_void,
- *mut ::c_void,
- ) -> ::c_int,
+ unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int,
>,
arg: *mut ::c_void,
);
@@ -1357,22 +1162,10 @@ extern "C" {
timeout: *mut ::timespec,
) -> ::c_int;
- pub fn getrlimit64(
- resource: ::__rlimit_resource_t,
- rlim: *mut ::rlimit64,
- ) -> ::c_int;
- pub fn setrlimit64(
- resource: ::__rlimit_resource_t,
- rlim: *const ::rlimit64,
- ) -> ::c_int;
- pub fn getrlimit(
- resource: ::__rlimit_resource_t,
- rlim: *mut ::rlimit,
- ) -> ::c_int;
- pub fn setrlimit(
- resource: ::__rlimit_resource_t,
- rlim: *const ::rlimit,
- ) -> ::c_int;
+ pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
pub fn prlimit(
pid: ::pid_t,
resource: ::__rlimit_resource_t,
@@ -1403,24 +1196,16 @@ extern "C" {
mask: ::c_uint,
statxbuf: *mut statx,
) -> ::c_int;
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
-
- pub fn memmem(
- haystack: *const ::c_void,
- haystacklen: ::size_t,
- needle: *const ::c_void,
- needlelen: ::size_t,
- ) -> *mut ::c_void;
+ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
pub fn adjtimex(buf: *mut timex) -> ::c_int;
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
#[link_name = "ntp_gettimex"]
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+ pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
+
pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
@@ -1450,6 +1235,20 @@ extern "C" {
offset: ::off_t,
flags: ::c_int,
) -> ::ssize_t;
+ pub fn preadv64v2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off64_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
+ pub fn pwritev64v2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off64_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
pub fn renameat2(
olddirfd: ::c_int,
oldpath: *const ::c_char,
@@ -1457,6 +1256,13 @@ extern "C" {
newpath: *const ::c_char,
flags: ::c_uint,
) -> ::c_int;
+
+ // Added in `glibc` 2.25
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+ // Added in `glibc` 2.29
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
}
extern "C" {
@@ -1465,9 +1271,7 @@ extern "C" {
pub fn glob64(
pattern: *const ::c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut glob64_t,
) -> ::c_int;
pub fn globfree64(pglob: *mut glob64_t);
@@ -1483,21 +1287,7 @@ extern "C" {
cpuset: *const ::cpu_set_t,
) -> ::c_int;
pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
- pub fn setpriority(
- which: ::__priority_which_t,
- who: ::id_t,
- prio: ::c_int,
- ) -> ::c_int;
- pub fn pthread_getaffinity_np(
- thread: ::pthread_t,
- cpusetsize: ::size_t,
- cpuset: *mut ::cpu_set_t,
- ) -> ::c_int;
- pub fn pthread_setaffinity_np(
- thread: ::pthread_t,
- cpusetsize: ::size_t,
- cpuset: *const ::cpu_set_t,
- ) -> ::c_int;
+ pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn pthread_rwlockattr_getkind_np(
attr: *const ::pthread_rwlockattr_t,
val: *mut ::c_int,
@@ -1506,8 +1296,10 @@ extern "C" {
attr: *mut ::pthread_rwlockattr_t,
val: ::c_int,
) -> ::c_int;
- pub fn sched_getcpu() -> ::c_int;
+ pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
pub fn mallinfo() -> ::mallinfo;
+ pub fn mallinfo2() -> ::mallinfo2;
+ pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
pub fn getpwent_r(
pwd: *mut ::passwd,
@@ -1521,33 +1313,70 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
- pub fn pthread_getname_np(
- thread: ::pthread_t,
- name: *mut ::c_char,
- len: ::size_t,
+ pub fn fgetpwent_r(
+ stream: *mut ::FILE,
+ pwd: *mut ::passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::passwd,
) -> ::c_int;
- pub fn pthread_setname_np(
- thread: ::pthread_t,
- name: *const ::c_char,
+ pub fn fgetgrent_r(
+ stream: *mut ::FILE,
+ grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group,
) -> ::c_int;
+
+ pub fn sethostid(hostid: ::c_long) -> ::c_int;
+
+ pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
+
+ pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+ pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+ pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+ pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn strftime(
+ s: *mut ::c_char,
+ max: ::size_t,
+ format: *const ::c_char,
+ tm: *const ::tm,
+ ) -> ::size_t;
+ pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ /// POSIX version of `basename(3)`, defined in `libgen.h`.
+ #[link_name = "__xpg_basename"]
+ pub fn posix_basename(path: *mut ::c_char) -> *mut ::c_char;
+ /// GNU version of `basename(3)`, defined in `string.h`.
+ #[link_name = "basename"]
+ pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char;
}
extern "C" {
- pub fn dlmopen(
- lmid: Lmid_t,
- filename: *const ::c_char,
- flag: ::c_int,
- ) -> *mut ::c_void;
- pub fn dlinfo(
- handle: *mut ::c_void,
- request: ::c_int,
- info: *mut ::c_void,
+ pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+ pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
+ pub fn dladdr1(
+ addr: *const ::c_void,
+ info: *mut ::Dl_info,
+ extra_info: *mut *mut ::c_void,
+ flags: ::c_int,
) -> ::c_int;
+ pub fn malloc_trim(__pad: ::size_t) -> ::c_int;
+}
+
+extern "C" {
+ pub fn gnu_get_libc_release() -> *const ::c_char;
+ pub fn gnu_get_libc_version() -> *const ::c_char;
}
cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "arm",
+ target_arch = "m68k",
target_arch = "mips",
target_arch = "powerpc",
target_arch = "sparc",
@@ -1560,7 +1389,8 @@ cfg_if! {
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64",
- target_arch = "riscv64"))] {
+ target_arch = "riscv64",
+ target_arch = "loongarch64"))] {
mod b64;
pub use self::b64::*;
} else {
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 058b0df4353fd..9658f07446370 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
+pub type pthread_spinlock_t = ::c_int;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
@@ -38,7 +39,12 @@ pub type Elf64_Section = u16;
// linux/can.h
pub type canid_t = u32;
+
+// linux/can/j1939.h
pub type can_err_mask_t = u32;
+pub type pgn_t = u32;
+pub type priority_t = u8;
+pub type name_t = u64;
pub type iconv_t = *mut ::c_void;
@@ -541,6 +547,84 @@ s! {
pub can_id: canid_t,
pub can_mask: canid_t,
}
+
+ // linux/can/j1939.h
+ pub struct j1939_filter {
+ pub name: name_t,
+ pub name_mask: name_t,
+ pub pgn: pgn_t,
+ pub pgn_mask: pgn_t,
+ pub addr: u8,
+ pub addr_mask: u8,
+ }
+
+ // linux/filter.h
+ pub struct sock_filter {
+ pub code: ::__u16,
+ pub jt: ::__u8,
+ pub jf: ::__u8,
+ pub k: ::__u32,
+ }
+
+ pub struct sock_fprog {
+ pub len: ::c_ushort,
+ pub filter: *mut sock_filter,
+ }
+
+ // linux/seccomp.h
+ pub struct seccomp_data {
+ pub nr: ::c_int,
+ pub arch: ::__u32,
+ pub instruction_pointer: ::__u64,
+ pub args: [::__u64; 6],
+ }
+
+ pub struct nlmsghdr {
+ pub nlmsg_len: u32,
+ pub nlmsg_type: u16,
+ pub nlmsg_flags: u16,
+ pub nlmsg_seq: u32,
+ pub nlmsg_pid: u32,
+ }
+
+ pub struct nlmsgerr {
+ pub error: ::c_int,
+ pub msg: nlmsghdr,
+ }
+
+ pub struct nlattr {
+ pub nla_len: u16,
+ pub nla_type: u16,
+ }
+
+ pub struct file_clone_range {
+ pub src_fd: ::__s64,
+ pub src_offset: ::__u64,
+ pub src_length: ::__u64,
+ pub dest_offset: ::__u64,
+ }
+
+ pub struct __c_anonymous_ifru_map {
+ pub mem_start: ::c_ulong,
+ pub mem_end: ::c_ulong,
+ pub base_addr: ::c_ushort,
+ pub irq: ::c_uchar,
+ pub dma: ::c_uchar,
+ pub port: ::c_uchar,
+ }
+
+ pub struct in6_ifreq {
+ pub ifr6_addr: ::in6_addr,
+ pub ifr6_prefixlen: u32,
+ pub ifr6_ifindex: ::c_int,
+ }
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -628,6 +712,41 @@ s_no_extra_traits! {
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pad: [::c_long; 4],
}
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifr_ifru {
+ pub ifru_addr: ::sockaddr,
+ pub ifru_dstaddr: ::sockaddr,
+ pub ifru_broadaddr: ::sockaddr,
+ pub ifru_netmask: ::sockaddr,
+ pub ifru_hwaddr: ::sockaddr,
+ pub ifru_flags: ::c_short,
+ pub ifru_ifindex: ::c_int,
+ pub ifru_metric: ::c_int,
+ pub ifru_mtu: ::c_int,
+ pub ifru_map: __c_anonymous_ifru_map,
+ pub ifru_slave: [::c_char; ::IFNAMSIZ],
+ pub ifru_newname: [::c_char; ::IFNAMSIZ],
+ pub ifru_data: *mut ::c_char,
+ }
+
+ pub struct ifreq {
+ /// interface name, e.g. "en0"
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ #[cfg(libc_union)]
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
+ #[cfg(not(libc_union))]
+ pub ifr_ifru: ::sockaddr,
+ }
+}
+
+s_no_extra_traits! {
+ // linux/net_tstamp.h
+ #[allow(missing_debug_implementations)]
+ pub struct sock_txtime {
+ pub clockid: ::clockid_t,
+ pub flags: ::__u32,
+ }
}
cfg_if! {
@@ -992,6 +1111,34 @@ cfg_if! {
self.mq_curmsgs.hash(state);
}
}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifr_ifru")
+ .field("ifru_addr", unsafe { &self.ifru_addr })
+ .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+ .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+ .field("ifru_netmask", unsafe { &self.ifru_netmask })
+ .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr })
+ .field("ifru_flags", unsafe { &self.ifru_flags })
+ .field("ifru_ifindex", unsafe { &self.ifru_ifindex })
+ .field("ifru_metric", unsafe { &self.ifru_metric })
+ .field("ifru_mtu", unsafe { &self.ifru_mtu })
+ .field("ifru_map", unsafe { &self.ifru_map })
+ .field("ifru_slave", unsafe { &self.ifru_slave })
+ .field("ifru_newname", unsafe { &self.ifru_newname })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .finish()
+ }
+ }
+ impl ::fmt::Debug for ifreq {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifreq")
+ .field("ifr_name", &self.ifr_name)
+ .field("ifr_ifru", &self.ifr_ifru)
+ .finish()
+ }
+ }
}
}
@@ -1235,6 +1382,181 @@ pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+// elf.h - Fields in the e_ident array.
+pub const EI_NIDENT: usize = 16;
+
+pub const EI_MAG0: usize = 0;
+pub const ELFMAG0: u8 = 0x7f;
+pub const EI_MAG1: usize = 1;
+pub const ELFMAG1: u8 = b'E';
+pub const EI_MAG2: usize = 2;
+pub const ELFMAG2: u8 = b'L';
+pub const EI_MAG3: usize = 3;
+pub const ELFMAG3: u8 = b'F';
+pub const SELFMAG: usize = 4;
+
+pub const EI_CLASS: usize = 4;
+pub const ELFCLASSNONE: u8 = 0;
+pub const ELFCLASS32: u8 = 1;
+pub const ELFCLASS64: u8 = 2;
+pub const ELFCLASSNUM: usize = 3;
+
+pub const EI_DATA: usize = 5;
+pub const ELFDATANONE: u8 = 0;
+pub const ELFDATA2LSB: u8 = 1;
+pub const ELFDATA2MSB: u8 = 2;
+pub const ELFDATANUM: usize = 3;
+
+pub const EI_VERSION: usize = 6;
+
+pub const EI_OSABI: usize = 7;
+pub const ELFOSABI_NONE: u8 = 0;
+pub const ELFOSABI_SYSV: u8 = 0;
+pub const ELFOSABI_HPUX: u8 = 1;
+pub const ELFOSABI_NETBSD: u8 = 2;
+pub const ELFOSABI_GNU: u8 = 3;
+pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU;
+pub const ELFOSABI_SOLARIS: u8 = 6;
+pub const ELFOSABI_AIX: u8 = 7;
+pub const ELFOSABI_IRIX: u8 = 8;
+pub const ELFOSABI_FREEBSD: u8 = 9;
+pub const ELFOSABI_TRU64: u8 = 10;
+pub const ELFOSABI_MODESTO: u8 = 11;
+pub const ELFOSABI_OPENBSD: u8 = 12;
+pub const ELFOSABI_ARM: u8 = 97;
+pub const ELFOSABI_STANDALONE: u8 = 255;
+
+pub const EI_ABIVERSION: usize = 8;
+
+pub const EI_PAD: usize = 9;
+
+// elf.h - Legal values for e_type (object file type).
+pub const ET_NONE: u16 = 0;
+pub const ET_REL: u16 = 1;
+pub const ET_EXEC: u16 = 2;
+pub const ET_DYN: u16 = 3;
+pub const ET_CORE: u16 = 4;
+pub const ET_NUM: u16 = 5;
+pub const ET_LOOS: u16 = 0xfe00;
+pub const ET_HIOS: u16 = 0xfeff;
+pub const ET_LOPROC: u16 = 0xff00;
+pub const ET_HIPROC: u16 = 0xffff;
+
+// elf.h - Legal values for e_machine (architecture).
+pub const EM_NONE: u16 = 0;
+pub const EM_M32: u16 = 1;
+pub const EM_SPARC: u16 = 2;
+pub const EM_386: u16 = 3;
+pub const EM_68K: u16 = 4;
+pub const EM_88K: u16 = 5;
+pub const EM_860: u16 = 7;
+pub const EM_MIPS: u16 = 8;
+pub const EM_S370: u16 = 9;
+pub const EM_MIPS_RS3_LE: u16 = 10;
+pub const EM_PARISC: u16 = 15;
+pub const EM_VPP500: u16 = 17;
+pub const EM_SPARC32PLUS: u16 = 18;
+pub const EM_960: u16 = 19;
+pub const EM_PPC: u16 = 20;
+pub const EM_PPC64: u16 = 21;
+pub const EM_S390: u16 = 22;
+pub const EM_V800: u16 = 36;
+pub const EM_FR20: u16 = 37;
+pub const EM_RH32: u16 = 38;
+pub const EM_RCE: u16 = 39;
+pub const EM_ARM: u16 = 40;
+pub const EM_FAKE_ALPHA: u16 = 41;
+pub const EM_SH: u16 = 42;
+pub const EM_SPARCV9: u16 = 43;
+pub const EM_TRICORE: u16 = 44;
+pub const EM_ARC: u16 = 45;
+pub const EM_H8_300: u16 = 46;
+pub const EM_H8_300H: u16 = 47;
+pub const EM_H8S: u16 = 48;
+pub const EM_H8_500: u16 = 49;
+pub const EM_IA_64: u16 = 50;
+pub const EM_MIPS_X: u16 = 51;
+pub const EM_COLDFIRE: u16 = 52;
+pub const EM_68HC12: u16 = 53;
+pub const EM_MMA: u16 = 54;
+pub const EM_PCP: u16 = 55;
+pub const EM_NCPU: u16 = 56;
+pub const EM_NDR1: u16 = 57;
+pub const EM_STARCORE: u16 = 58;
+pub const EM_ME16: u16 = 59;
+pub const EM_ST100: u16 = 60;
+pub const EM_TINYJ: u16 = 61;
+pub const EM_X86_64: u16 = 62;
+pub const EM_PDSP: u16 = 63;
+pub const EM_FX66: u16 = 66;
+pub const EM_ST9PLUS: u16 = 67;
+pub const EM_ST7: u16 = 68;
+pub const EM_68HC16: u16 = 69;
+pub const EM_68HC11: u16 = 70;
+pub const EM_68HC08: u16 = 71;
+pub const EM_68HC05: u16 = 72;
+pub const EM_SVX: u16 = 73;
+pub const EM_ST19: u16 = 74;
+pub const EM_VAX: u16 = 75;
+pub const EM_CRIS: u16 = 76;
+pub const EM_JAVELIN: u16 = 77;
+pub const EM_FIREPATH: u16 = 78;
+pub const EM_ZSP: u16 = 79;
+pub const EM_MMIX: u16 = 80;
+pub const EM_HUANY: u16 = 81;
+pub const EM_PRISM: u16 = 82;
+pub const EM_AVR: u16 = 83;
+pub const EM_FR30: u16 = 84;
+pub const EM_D10V: u16 = 85;
+pub const EM_D30V: u16 = 86;
+pub const EM_V850: u16 = 87;
+pub const EM_M32R: u16 = 88;
+pub const EM_MN10300: u16 = 89;
+pub const EM_MN10200: u16 = 90;
+pub const EM_PJ: u16 = 91;
+pub const EM_OPENRISC: u16 = 92;
+pub const EM_ARC_A5: u16 = 93;
+pub const EM_XTENSA: u16 = 94;
+pub const EM_AARCH64: u16 = 183;
+pub const EM_TILEPRO: u16 = 188;
+pub const EM_TILEGX: u16 = 191;
+pub const EM_ALPHA: u16 = 0x9026;
+
+// elf.h - Legal values for e_version (version).
+pub const EV_NONE: u32 = 0;
+pub const EV_CURRENT: u32 = 1;
+pub const EV_NUM: u32 = 2;
+
+// elf.h - Legal values for p_type (segment type).
+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;
+pub const PT_LOSUNW: u32 = 0x6ffffffa;
+pub const PT_SUNWBSS: u32 = 0x6ffffffa;
+pub const PT_SUNWSTACK: u32 = 0x6ffffffb;
+pub const PT_HISUNW: u32 = 0x6fffffff;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+// Legal values for p_flags (segment flags).
+pub const PF_X: u32 = 1 << 0;
+pub const PF_W: u32 = 1 << 1;
+pub const PF_R: u32 = 1 << 2;
+pub const PF_MASKOS: u32 = 0x0ff00000;
+pub const PF_MASKPROC: u32 = 0xf0000000;
+
+// elf.h - Legal values for a_type (entry type).
pub const AT_NULL: ::c_ulong = 0;
pub const AT_IGNORE: ::c_ulong = 1;
pub const AT_EXECFD: ::c_ulong = 2;
@@ -1261,6 +1583,10 @@ pub const AT_HWCAP2: ::c_ulong = 26;
pub const AT_EXECFN: ::c_ulong = 31;
+// defined in arch//include/uapi/asm/auxvec.h but has the same value
+// wherever it is defined.
+pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
+
pub const GLOB_ERR: ::c_int = 1 << 0;
pub const GLOB_MARK: ::c_int = 1 << 1;
pub const GLOB_NOSORT: ::c_int = 1 << 2;
@@ -1277,6 +1603,8 @@ pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_SPAWN_USEVFORK: ::c_int = 64;
+pub const POSIX_SPAWN_SETSID: ::c_int = 128;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
@@ -1423,7 +1751,15 @@ pub const RTLD_NOW: ::c_int = 0x2;
pub const AT_EACCESS: ::c_int = 0x200;
-pub const TCP_MD5SIG: ::c_int = 14;
+// linux/mempolicy.h
+pub const MPOL_DEFAULT: ::c_int = 0;
+pub const MPOL_PREFERRED: ::c_int = 1;
+pub const MPOL_BIND: ::c_int = 2;
+pub const MPOL_INTERLEAVE: ::c_int = 3;
+pub const MPOL_LOCAL: ::c_int = 4;
+pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13;
+pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14;
+pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
align_const! {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
@@ -1440,6 +1776,11 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const PTHREAD_PRIO_NONE: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
@@ -1456,6 +1797,8 @@ pub const SCHED_IDLE: ::c_int = 5;
pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
+pub const CLONE_PIDFD: ::c_int = 0x1000;
+
// netinet/in.h
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
@@ -1485,6 +1828,7 @@ pub const MSG_INFO: ::c_int = 12;
pub const MSG_NOERROR: ::c_int = 0o10000;
pub const MSG_EXCEPT: ::c_int = 0o20000;
+pub const MSG_ZEROCOPY: ::c_int = 0x4000000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
@@ -1500,11 +1844,6 @@ pub const SHM_HUGETLB: ::c_int = 0o4000;
#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
pub const SHM_NORESERVE: ::c_int = 0o10000;
-pub const EPOLLRDHUP: ::c_int = 0x2000;
-pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
pub const QFMT_VFS_V1: ::c_int = 4;
@@ -1565,7 +1904,6 @@ cfg_if! {
pub const LIO_WAIT: ::c_int = 0;
pub const LIO_NOWAIT: ::c_int = 1;
pub const RUSAGE_THREAD: ::c_int = 1;
- pub const TCP_ULP: ::c_int = 31;
pub const MSG_COPY: ::c_int = 0o40000;
pub const SHM_EXEC: ::c_int = 0o100000;
pub const IPV6_MULTICAST_ALL: ::c_int = 29;
@@ -1579,6 +1917,7 @@ cfg_if! {
pub const MREMAP_MAYMOVE: ::c_int = 1;
pub const MREMAP_FIXED: ::c_int = 2;
+pub const MREMAP_DONTUNMAP: ::c_int = 4;
pub const PR_SET_PDEATHSIG: ::c_int = 1;
pub const PR_GET_PDEATHSIG: ::c_int = 2;
@@ -1700,13 +2039,34 @@ 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 PR_SET_VMA: ::c_int = 0x53564d41;
+pub const PR_SET_VMA_ANON_NAME: ::c_int = 0;
+
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;
+pub const GRND_INSECURE: ::c_uint = 0x0004;
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 SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1;
+pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2;
+pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4;
+
+pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000;
+pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000;
+pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD;
+pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000;
+pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000;
+pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000;
+pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000;
+pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000;
+
+pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000;
+pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000;
+pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff;
+
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
@@ -1714,9 +2074,7 @@ pub const ITIMER_PROF: ::c_int = 2;
pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
pub const TFD_TIMER_ABSTIME: ::c_int = 1;
-
-pub const XATTR_CREATE: ::c_int = 0x1;
-pub const XATTR_REPLACE: ::c_int = 0x2;
+pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2;
pub const _POSIX_VDISABLE: ::cc_t = 0;
@@ -1748,6 +2106,17 @@ pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+// SO_MEMINFO offsets
+pub const SK_MEMINFO_RMEM_ALLOC: ::c_int = 0;
+pub const SK_MEMINFO_RCVBUF: ::c_int = 1;
+pub const SK_MEMINFO_WMEM_ALLOC: ::c_int = 2;
+pub const SK_MEMINFO_SNDBUF: ::c_int = 3;
+pub const SK_MEMINFO_FWD_ALLOC: ::c_int = 4;
+pub const SK_MEMINFO_WMEM_QUEUED: ::c_int = 5;
+pub const SK_MEMINFO_OPTMEM: ::c_int = 6;
+pub const SK_MEMINFO_BACKLOG: ::c_int = 7;
+pub const SK_MEMINFO_DROPS: ::c_int = 8;
+
pub const IUTF8: ::tcflag_t = 0x00004000;
#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
pub const CMSPAR: ::tcflag_t = 0o10000000000;
@@ -1755,23 +2124,95 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
pub const MFD_HUGETLB: ::c_uint = 0x0004;
-
-// 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;
+pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
+pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
+pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
+pub const MFD_HUGE_2MB: ::c_uint = 0x54000000;
+pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000;
+pub const MFD_HUGE_16MB: ::c_uint = 0x60000000;
+pub const MFD_HUGE_32MB: ::c_uint = 0x64000000;
+pub const MFD_HUGE_256MB: ::c_uint = 0x70000000;
+pub const MFD_HUGE_512MB: ::c_uint = 0x74000000;
+pub const MFD_HUGE_1GB: ::c_uint = 0x78000000;
+pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000;
+pub const MFD_HUGE_16GB: ::c_uint = 0x88000000;
+pub const MFD_HUGE_MASK: ::c_uint = 63;
+pub const MFD_HUGE_SHIFT: ::c_uint = 26;
+
+// linux/close_range.h
+pub const CLOSE_RANGE_UNSHARE: ::c_uint = 1 << 1;
+pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2;
+
+// linux/filter.h
+pub const SKF_AD_OFF: ::c_int = -0x1000;
+pub const SKF_AD_PROTOCOL: ::c_int = 0;
+pub const SKF_AD_PKTTYPE: ::c_int = 4;
+pub const SKF_AD_IFINDEX: ::c_int = 8;
+pub const SKF_AD_NLATTR: ::c_int = 12;
+pub const SKF_AD_NLATTR_NEST: ::c_int = 16;
+pub const SKF_AD_MARK: ::c_int = 20;
+pub const SKF_AD_QUEUE: ::c_int = 24;
+pub const SKF_AD_HATYPE: ::c_int = 28;
+pub const SKF_AD_RXHASH: ::c_int = 32;
+pub const SKF_AD_CPU: ::c_int = 36;
+pub const SKF_AD_ALU_XOR_X: ::c_int = 40;
+pub const SKF_AD_VLAN_TAG: ::c_int = 44;
+pub const SKF_AD_VLAN_TAG_PRESENT: ::c_int = 48;
+pub const SKF_AD_PAY_OFFSET: ::c_int = 52;
+pub const SKF_AD_RANDOM: ::c_int = 56;
+pub const SKF_AD_VLAN_TPID: ::c_int = 60;
+pub const SKF_AD_MAX: ::c_int = 64;
+pub const SKF_NET_OFF: ::c_int = -0x100000;
+pub const SKF_LL_OFF: ::c_int = -0x200000;
+pub const BPF_NET_OFF: ::c_int = SKF_NET_OFF;
+pub const BPF_LL_OFF: ::c_int = SKF_LL_OFF;
+pub const BPF_MEMWORDS: ::c_int = 16;
+pub const BPF_MAXINSNS: ::c_int = 4096;
+
+// linux/bpf_common.h
+pub const BPF_LD: ::__u32 = 0x00;
+pub const BPF_LDX: ::__u32 = 0x01;
+pub const BPF_ST: ::__u32 = 0x02;
+pub const BPF_STX: ::__u32 = 0x03;
+pub const BPF_ALU: ::__u32 = 0x04;
+pub const BPF_JMP: ::__u32 = 0x05;
+pub const BPF_RET: ::__u32 = 0x06;
+pub const BPF_MISC: ::__u32 = 0x07;
+pub const BPF_W: ::__u32 = 0x00;
+pub const BPF_H: ::__u32 = 0x08;
+pub const BPF_B: ::__u32 = 0x10;
+pub const BPF_IMM: ::__u32 = 0x00;
+pub const BPF_ABS: ::__u32 = 0x20;
+pub const BPF_IND: ::__u32 = 0x40;
+pub const BPF_MEM: ::__u32 = 0x60;
+pub const BPF_LEN: ::__u32 = 0x80;
+pub const BPF_MSH: ::__u32 = 0xa0;
+pub const BPF_ADD: ::__u32 = 0x00;
+pub const BPF_SUB: ::__u32 = 0x10;
+pub const BPF_MUL: ::__u32 = 0x20;
+pub const BPF_DIV: ::__u32 = 0x30;
+pub const BPF_OR: ::__u32 = 0x40;
+pub const BPF_AND: ::__u32 = 0x50;
+pub const BPF_LSH: ::__u32 = 0x60;
+pub const BPF_RSH: ::__u32 = 0x70;
+pub const BPF_NEG: ::__u32 = 0x80;
+pub const BPF_MOD: ::__u32 = 0x90;
+pub const BPF_XOR: ::__u32 = 0xa0;
+pub const BPF_JA: ::__u32 = 0x00;
+pub const BPF_JEQ: ::__u32 = 0x10;
+pub const BPF_JGT: ::__u32 = 0x20;
+pub const BPF_JGE: ::__u32 = 0x30;
+pub const BPF_JSET: ::__u32 = 0x40;
+pub const BPF_K: ::__u32 = 0x00;
+pub const BPF_X: ::__u32 = 0x08;
+
+// linux/openat2.h
+pub const RESOLVE_NO_XDEV: ::__u64 = 0x01;
+pub const RESOLVE_NO_MAGICLINKS: ::__u64 = 0x02;
+pub const RESOLVE_NO_SYMLINKS: ::__u64 = 0x04;
+pub const RESOLVE_BENEATH: ::__u64 = 0x08;
+pub const RESOLVE_IN_ROOT: ::__u64 = 0x10;
+pub const RESOLVE_CACHED: ::__u64 = 0x20;
// linux/if_ether.h
pub const ETH_ALEN: ::c_int = 6;
@@ -1888,6 +2329,7 @@ pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5;
pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6;
pub const NFNLGRP_NFTABLES: ::c_int = 7;
pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8;
+pub const NFNLGRP_NFTRACE: ::c_int = 9;
pub const NFNETLINK_V0: ::c_int = 0;
@@ -1903,15 +2345,23 @@ pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8;
pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9;
pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
-pub const NFNL_SUBSYS_COUNT: ::c_int = 12;
+pub const NFNL_SUBSYS_HOOK: ::c_int = 12;
+pub const NFNL_SUBSYS_COUNT: ::c_int = 13;
pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
+pub const NFNL_BATCH_UNSPEC: ::c_int = 0;
+pub const NFNL_BATCH_GENID: ::c_int = 1;
+
// linux/netfilter/nfnetlink_log.h
pub const NFULNL_MSG_PACKET: ::c_int = 0;
pub const NFULNL_MSG_CONFIG: ::c_int = 1;
+pub const NFULA_VLAN_UNSPEC: ::c_int = 0;
+pub const NFULA_VLAN_PROTO: ::c_int = 1;
+pub const NFULA_VLAN_TCI: ::c_int = 2;
+
pub const NFULA_UNSPEC: ::c_int = 0;
pub const NFULA_PACKET_HDR: ::c_int = 1;
pub const NFULA_MARK: ::c_int = 2;
@@ -1932,6 +2382,8 @@ pub const NFULA_HWHEADER: ::c_int = 16;
pub const NFULA_HWLEN: ::c_int = 17;
pub const NFULA_CT: ::c_int = 18;
pub const NFULA_CT_INFO: ::c_int = 19;
+pub const NFULA_VLAN: ::c_int = 20;
+pub const NFULA_L2HDR: ::c_int = 21;
pub const NFULNL_CFG_CMD_NONE: ::c_int = 0;
pub const NFULNL_CFG_CMD_BIND: ::c_int = 1;
@@ -1955,7 +2407,7 @@ pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001;
pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002;
pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004;
-// linux/netfilter/nfnetlink_log.h
+// linux/netfilter/nfnetlink_queue.h
pub const NFQNL_MSG_PACKET: ::c_int = 0;
pub const NFQNL_MSG_VERDICT: ::c_int = 1;
pub const NFQNL_MSG_CONFIG: ::c_int = 2;
@@ -1980,18 +2432,13 @@ pub const NFQA_EXP: ::c_int = 15;
pub const NFQA_UID: ::c_int = 16;
pub const NFQA_GID: ::c_int = 17;
pub const NFQA_SECCTX: ::c_int = 18;
-/*
- FIXME: These are not yet available in musl sanitized kernel headers and
- make the tests fail. Enable them once musl has them.
-
- See https://github.com/rust-lang/libc/pull/1628 for more details.
pub const NFQA_VLAN: ::c_int = 19;
pub const NFQA_L2HDR: ::c_int = 20;
+pub const NFQA_PRIORITY: ::c_int = 21;
pub const NFQA_VLAN_UNSPEC: ::c_int = 0;
pub const NFQA_VLAN_PROTO: ::c_int = 1;
pub const NFQA_VLAN_TCI: ::c_int = 2;
-*/
pub const NFQNL_CFG_CMD_NONE: ::c_int = 0;
pub const NFQNL_CFG_CMD_BIND: ::c_int = 1;
@@ -2021,6 +2468,8 @@ pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
pub const NFQA_SKB_GSO: ::c_int = 0x0002;
pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;
+// linux/genetlink.h
+
pub const GENL_NAMSIZ: ::c_int = 16;
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
@@ -2101,6 +2550,11 @@ 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;
+pub const NFPROTO_INET: ::c_int = 1;
+pub const NFPROTO_NETDEV: ::c_int = 5;
+
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
// linux/netfilter_ipv4.h
pub const NF_IP_PRE_ROUTING: ::c_int = 0;
@@ -2179,6 +2633,24 @@ pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929;
pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930;
pub const SIOCADDMULTI: ::c_ulong = 0x00008931;
pub const SIOCDELMULTI: ::c_ulong = 0x00008932;
+pub const SIOCGIFINDEX: ::c_ulong = 0x00008933;
+pub const SIOGIFINDEX: ::c_ulong = SIOCGIFINDEX;
+pub const SIOCSIFPFLAGS: ::c_ulong = 0x00008934;
+pub const SIOCGIFPFLAGS: ::c_ulong = 0x00008935;
+pub const SIOCDIFADDR: ::c_ulong = 0x00008936;
+pub const SIOCSIFHWBROADCAST: ::c_ulong = 0x00008937;
+pub const SIOCGIFCOUNT: ::c_ulong = 0x00008938;
+pub const SIOCGIFBR: ::c_ulong = 0x00008940;
+pub const SIOCSIFBR: ::c_ulong = 0x00008941;
+pub const SIOCGIFTXQLEN: ::c_ulong = 0x00008942;
+pub const SIOCSIFTXQLEN: ::c_ulong = 0x00008943;
+pub const SIOCETHTOOL: ::c_ulong = 0x00008946;
+pub const SIOCGMIIPHY: ::c_ulong = 0x00008947;
+pub const SIOCGMIIREG: ::c_ulong = 0x00008948;
+pub const SIOCSMIIREG: ::c_ulong = 0x00008949;
+pub const SIOCWANDEV: ::c_ulong = 0x0000894A;
+pub const SIOCOUTQNSD: ::c_ulong = 0x0000894B;
+pub const SIOCGSKNS: ::c_ulong = 0x0000894C;
pub const SIOCDARP: ::c_ulong = 0x00008953;
pub const SIOCGARP: ::c_ulong = 0x00008954;
pub const SIOCSARP: ::c_ulong = 0x00008955;
@@ -2320,6 +2792,8 @@ pub const NETLINK_TX_RING: ::c_int = 7;
pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
pub const NETLINK_CAP_ACK: ::c_int = 10;
+pub const NETLINK_EXT_ACK: ::c_int = 11;
+pub const NETLINK_GET_STRICT_CHK: ::c_int = 12;
pub const NLA_F_NESTED: ::c_int = 1 << 15;
pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
@@ -2456,11 +2930,61 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02;
pub const ARPD_FLUSH: ::c_ushort = 0x03;
pub const ATF_MAGIC: ::c_int = 0x80;
-#[cfg(not(target_arch = "sparc64"))]
-pub const SO_TIMESTAMPING: ::c_int = 37;
-#[cfg(target_arch = "sparc64")]
-pub const SO_TIMESTAMPING: ::c_int = 35;
-pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+// userspace compat definitions for RTNLGRP_*
+pub const RTMGRP_LINK: ::c_int = 0x00001;
+pub const RTMGRP_NOTIFY: ::c_int = 0x00002;
+pub const RTMGRP_NEIGH: ::c_int = 0x00004;
+pub const RTMGRP_TC: ::c_int = 0x00008;
+pub const RTMGRP_IPV4_IFADDR: ::c_int = 0x00010;
+pub const RTMGRP_IPV4_MROUTE: ::c_int = 0x00020;
+pub const RTMGRP_IPV4_ROUTE: ::c_int = 0x00040;
+pub const RTMGRP_IPV4_RULE: ::c_int = 0x00080;
+pub const RTMGRP_IPV6_IFADDR: ::c_int = 0x00100;
+pub const RTMGRP_IPV6_MROUTE: ::c_int = 0x00200;
+pub const RTMGRP_IPV6_ROUTE: ::c_int = 0x00400;
+pub const RTMGRP_IPV6_IFINFO: ::c_int = 0x00800;
+pub const RTMGRP_DECnet_IFADDR: ::c_int = 0x01000;
+pub const RTMGRP_DECnet_ROUTE: ::c_int = 0x04000;
+pub const RTMGRP_IPV6_PREFIX: ::c_int = 0x20000;
+
+// enum rtnetlink_groups
+pub const RTNLGRP_NONE: ::c_uint = 0x00;
+pub const RTNLGRP_LINK: ::c_uint = 0x01;
+pub const RTNLGRP_NOTIFY: ::c_uint = 0x02;
+pub const RTNLGRP_NEIGH: ::c_uint = 0x03;
+pub const RTNLGRP_TC: ::c_uint = 0x04;
+pub const RTNLGRP_IPV4_IFADDR: ::c_uint = 0x05;
+pub const RTNLGRP_IPV4_MROUTE: ::c_uint = 0x06;
+pub const RTNLGRP_IPV4_ROUTE: ::c_uint = 0x07;
+pub const RTNLGRP_IPV4_RULE: ::c_uint = 0x08;
+pub const RTNLGRP_IPV6_IFADDR: ::c_uint = 0x09;
+pub const RTNLGRP_IPV6_MROUTE: ::c_uint = 0x0a;
+pub const RTNLGRP_IPV6_ROUTE: ::c_uint = 0x0b;
+pub const RTNLGRP_IPV6_IFINFO: ::c_uint = 0x0c;
+pub const RTNLGRP_DECnet_IFADDR: ::c_uint = 0x0d;
+pub const RTNLGRP_NOP2: ::c_uint = 0x0e;
+pub const RTNLGRP_DECnet_ROUTE: ::c_uint = 0x0f;
+pub const RTNLGRP_DECnet_RULE: ::c_uint = 0x10;
+pub const RTNLGRP_NOP4: ::c_uint = 0x11;
+pub const RTNLGRP_IPV6_PREFIX: ::c_uint = 0x12;
+pub const RTNLGRP_IPV6_RULE: ::c_uint = 0x13;
+pub const RTNLGRP_ND_USEROPT: ::c_uint = 0x14;
+pub const RTNLGRP_PHONET_IFADDR: ::c_uint = 0x15;
+pub const RTNLGRP_PHONET_ROUTE: ::c_uint = 0x16;
+pub const RTNLGRP_DCB: ::c_uint = 0x17;
+pub const RTNLGRP_IPV4_NETCONF: ::c_uint = 0x18;
+pub const RTNLGRP_IPV6_NETCONF: ::c_uint = 0x19;
+pub const RTNLGRP_MDB: ::c_uint = 0x1a;
+pub const RTNLGRP_MPLS_ROUTE: ::c_uint = 0x1b;
+pub const RTNLGRP_NSID: ::c_uint = 0x1c;
+pub const RTNLGRP_MPLS_NETCONF: ::c_uint = 0x1d;
+pub const RTNLGRP_IPV4_MROUTE_R: ::c_uint = 0x1e;
+pub const RTNLGRP_IPV6_MROUTE_R: ::c_uint = 0x1f;
+pub const RTNLGRP_NEXTHOP: ::c_uint = 0x20;
+pub const RTNLGRP_BRVLAN: ::c_uint = 0x21;
+pub const RTNLGRP_MCTP_IFADDR: ::c_uint = 0x22;
+pub const RTNLGRP_TUNNEL: ::c_uint = 0x23;
+pub const RTNLGRP_STATS: ::c_uint = 0x24;
// linux/module.h
pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
@@ -2474,6 +2998,16 @@ pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
+pub const SOF_TIMESTAMPING_OPT_ID: ::c_uint = 1 << 7;
+pub const SOF_TIMESTAMPING_TX_SCHED: ::c_uint = 1 << 8;
+pub const SOF_TIMESTAMPING_TX_ACK: ::c_uint = 1 << 9;
+pub const SOF_TIMESTAMPING_OPT_CMSG: ::c_uint = 1 << 10;
+pub const SOF_TIMESTAMPING_OPT_TSONLY: ::c_uint = 1 << 11;
+pub const SOF_TIMESTAMPING_OPT_STATS: ::c_uint = 1 << 12;
+pub const SOF_TIMESTAMPING_OPT_PKTINFO: ::c_uint = 1 << 13;
+pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14;
+pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
+pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
// linux/if_alg.h
pub const ALG_SET_KEY: ::c_int = 1;
@@ -2496,6 +3030,7 @@ pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
// include/uapi/asm-generic/mman-common.h
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
+pub const MLOCK_ONFAULT: ::c_uint = 0x01;
// uapi/linux/vm_sockets.h
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
@@ -2530,7 +3065,7 @@ pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
pub const IN_IGNORED: u32 = 0x0000_8000;
pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
-// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
// linux/keyctl.h
pub const KEY_SPEC_THREAD_KEYRING: i32 = -1;
@@ -2576,8 +3111,8 @@ pub const KEYCTL_INSTANTIATE_IOV: u32 = 20;
pub const KEYCTL_INVALIDATE: u32 = 21;
pub const KEYCTL_GET_PERSISTENT: u32 = 22;
-// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
-// pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_ISDIR: u32 = 0x4000_0000;
pub const IN_ONESHOT: u32 = 0x8000_0000;
@@ -2597,6 +3132,193 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+// uapi/linux/netfilter/nf_tables.h
+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 = 25;
+
+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;
+
// linux/input.h
pub const FF_MAX: ::__u16 = 0x7f;
pub const FF_CNT: usize = FF_MAX as usize + 1;
@@ -2685,11 +3407,11 @@ pub const FUTEX_WAIT_BITSET: ::c_int = 9;
pub const FUTEX_WAKE_BITSET: ::c_int = 10;
pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
+pub const FUTEX_LOCK_PI2: ::c_int = 13;
pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
-pub const FUTEX_CMD_MASK: ::c_int =
- !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
// linux/reboot.h
pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
@@ -2815,6 +3537,56 @@ pub const SOL_CAN_BASE: ::c_int = 100;
pub const CAN_INV_FILTER: canid_t = 0x20000000;
pub const CAN_RAW_FILTER_MAX: ::c_int = 512;
+// linux/can/raw.h
+pub const SOL_CAN_RAW: ::c_int = SOL_CAN_BASE + CAN_RAW;
+pub const CAN_RAW_FILTER: ::c_int = 1;
+pub const CAN_RAW_ERR_FILTER: ::c_int = 2;
+pub const CAN_RAW_LOOPBACK: ::c_int = 3;
+pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4;
+pub const CAN_RAW_FD_FRAMES: ::c_int = 5;
+pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6;
+
+// linux/can/j1939.h
+pub const SOL_CAN_J1939: ::c_int = SOL_CAN_BASE + CAN_J1939;
+
+pub const J1939_MAX_UNICAST_ADDR: ::c_uchar = 0xfd;
+pub const J1939_IDLE_ADDR: ::c_uchar = 0xfe;
+pub const J1939_NO_ADDR: ::c_uchar = 0xff;
+pub const J1939_NO_NAME: ::c_ulong = 0;
+pub const J1939_PGN_REQUEST: ::c_uint = 0x0ea00;
+pub const J1939_PGN_ADDRESS_CLAIMED: ::c_uint = 0x0ee00;
+pub const J1939_PGN_ADDRESS_COMMANDED: ::c_uint = 0x0fed8;
+pub const J1939_PGN_PDU1_MAX: ::c_uint = 0x3ff00;
+pub const J1939_PGN_MAX: ::c_uint = 0x3ffff;
+pub const J1939_NO_PGN: ::c_uint = 0x40000;
+
+pub const SO_J1939_FILTER: ::c_int = 1;
+pub const SO_J1939_PROMISC: ::c_int = 2;
+pub const SO_J1939_SEND_PRIO: ::c_int = 3;
+pub const SO_J1939_ERRQUEUE: ::c_int = 4;
+
+pub const SCM_J1939_DEST_ADDR: ::c_int = 1;
+pub const SCM_J1939_DEST_NAME: ::c_int = 2;
+pub const SCM_J1939_PRIO: ::c_int = 3;
+pub const SCM_J1939_ERRQUEUE: ::c_int = 4;
+
+pub const J1939_NLA_PAD: ::c_int = 0;
+pub const J1939_NLA_BYTES_ACKED: ::c_int = 1;
+pub const J1939_NLA_TOTAL_SIZE: ::c_int = 2;
+pub const J1939_NLA_PGN: ::c_int = 3;
+pub const J1939_NLA_SRC_NAME: ::c_int = 4;
+pub const J1939_NLA_DEST_NAME: ::c_int = 5;
+pub const J1939_NLA_SRC_ADDR: ::c_int = 6;
+pub const J1939_NLA_DEST_ADDR: ::c_int = 7;
+
+pub const J1939_EE_INFO_NONE: ::c_int = 0;
+pub const J1939_EE_INFO_TX_ABORT: ::c_int = 1;
+pub const J1939_EE_INFO_RX_RTS: ::c_int = 2;
+pub const J1939_EE_INFO_RX_DPO: ::c_int = 3;
+pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;
+
+pub const J1939_FILTER_MAX: ::c_int = 512;
+
f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
@@ -2904,17 +3676,6 @@ f! {
minor as ::c_uint
}
- pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
- let major = major as ::dev_t;
- let minor = minor as ::dev_t;
- let mut dev = 0;
- dev |= (major & 0x00000fff) << 8;
- dev |= (major & 0xfffff000) << 32;
- dev |= (minor & 0x000000ff) << 0;
- dev |= (minor & 0xffffff00) << 12;
- dev
- }
-
pub fn IPTOS_TOS(tos: u8) -> u8 {
tos & IPTOS_TOS_MASK
}
@@ -2938,6 +3699,35 @@ f! {
pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
ee.offset(1) as *mut ::sockaddr
}
+
+ pub fn BPF_RVAL(code: ::__u32) -> ::__u32 {
+ code & 0x18
+ }
+
+ pub fn BPF_MISCOP(code: ::__u32) -> ::__u32 {
+ code & 0xf8
+ }
+
+ pub fn BPF_STMT(code: ::__u16, k: ::__u32) -> sock_filter {
+ sock_filter{code: code, jt: 0, jf: 0, k: k}
+ }
+
+ pub fn BPF_JUMP(code: ::__u16, k: ::__u32, jt: ::__u8, jf: ::__u8) -> sock_filter {
+ sock_filter{code: code, jt: jt, jf: jf, k: k}
+ }
+}
+
+safe_f! {
+ pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= (major & 0x00000fff) << 8;
+ dev |= (major & 0xfffff000) << 32;
+ dev |= (minor & 0x000000ff) << 0;
+ dev |= (minor & 0xffffff00) << 12;
+ dev
+ }
}
cfg_if! {
@@ -3011,18 +3801,23 @@ cfg_if! {
extern "C" {
#[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")]
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
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 drand48() -> ::c_double;
+ pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+ pub fn lrand48() -> ::c_long;
+ pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn mrand48() -> ::c_long;
+ pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn srand48(seed: ::c_long);
+ pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn lcong48(p: *mut ::c_ushort);
+
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn setpwent();
@@ -3047,40 +3842,18 @@ extern "C" {
spbufp: *mut *mut spwd,
) -> ::c_int;
- pub fn shm_open(
- name: *const c_char,
- oflag: ::c_int,
- mode: mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
// System V IPC
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ 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;
- pub fn shmctl(
- shmid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::shmid_ds,
- ) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
- pub fn semop(
- semid: ::c_int,
- sops: *mut ::sembuf,
- nsops: ::size_t,
- ) -> ::c_int;
- pub fn semctl(
- semid: ::c_int,
- semnum: ::c_int,
- cmd: ::c_int,
- ...
- ) -> ::c_int;
- pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds)
- -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgrcv(
msqid: ::c_int,
@@ -3096,17 +3869,10 @@ extern "C" {
msgflg: ::c_int,
) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn __errno_location() -> *mut ::c_int;
- pub fn fopen64(
- filename: *const c_char,
- mode: *const c_char,
- ) -> *mut ::FILE;
+ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn freopen64(
filename: *const c_char,
mode: *const c_char,
@@ -3115,39 +3881,13 @@ extern "C" {
pub fn tmpfile64() -> *mut ::FILE;
pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
- pub fn fseeko64(
- stream: *mut ::FILE,
- offset: ::off64_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
- pub fn fallocate(
- fd: ::c_int,
- mode: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn fallocate64(
- fd: ::c_int,
- mode: ::c_int,
- offset: ::off64_t,
- len: ::off64_t,
- ) -> ::c_int;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
- pub fn posix_fallocate64(
- fd: ::c_int,
- offset: ::off64_t,
- len: ::off64_t,
- ) -> ::c_int;
- pub fn readahead(
- fd: ::c_int,
- offset: ::off64_t,
- count: ::size_t,
- ) -> ::ssize_t;
+ pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+ pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
pub fn getxattr(
path: *const c_char,
name: *const c_char,
@@ -3187,34 +3927,15 @@ extern "C" {
size: ::size_t,
flags: ::c_int,
) -> ::c_int;
- pub fn listxattr(
- path: *const c_char,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
- pub fn llistxattr(
- path: *const c_char,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
- pub fn flistxattr(
- filedes: ::c_int,
- list: *mut c_char,
- size: ::size_t,
- ) -> ::ssize_t;
+ pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+ pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t;
pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
- pub fn signalfd(
- fd: ::c_int,
- mask: *const ::sigset_t,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
- pub fn timerfd_gettime(
- fd: ::c_int,
- curr_value: *mut itimerspec,
- ) -> ::c_int;
+ pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
+ pub fn timerfd_create(clockid: ::clockid_t, flags: ::c_int) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
pub fn timerfd_settime(
fd: ::c_int,
flags: ::c_int,
@@ -3257,11 +3978,7 @@ extern "C" {
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
- pub fn mq_setattr(
- mqd: ::mqd_t,
- newattr: *const ::mq_attr,
- oldattr: *mut ::mq_attr,
- ) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
pub fn epoll_pwait(
epfd: ::c_int,
events: *mut ::epoll_event,
@@ -3271,39 +3988,37 @@ extern "C" {
) -> ::c_int;
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
- pub fn mkostemps(
- template: *mut ::c_char,
- suffixlen: ::c_int,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
- -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
len: *mut ::socklen_t,
flg: ::c_int,
) -> ::c_int;
- pub fn pthread_setschedprio(
- native: ::pthread_t,
- priority: ::c_int,
+ pub fn pthread_getaffinity_np(
+ thread: ::pthread_t,
+ cpusetsize: ::size_t,
+ cpuset: *mut ::cpu_set_t,
+ ) -> ::c_int;
+ pub fn pthread_setaffinity_np(
+ thread: ::pthread_t,
+ cpusetsize: ::size_t,
+ cpuset: *const ::cpu_set_t,
) -> ::c_int;
+ pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
pub fn reboot(how_to: ::c_int) -> ::c_int;
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
// Not available now on Android
- pub fn mkfifoat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn sync_file_range(
@@ -3323,35 +4038,21 @@ extern "C" {
pub fn glob(
pattern: *const c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::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,
@@ -3375,12 +4076,10 @@ extern "C" {
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn vhangup() -> ::c_int;
pub fn sync();
+ pub fn syncfs(fd: ::c_int) -> ::c_int;
pub fn syscall(num: ::c_long, ...) -> ::c_long;
- pub fn sched_getaffinity(
- pid: ::pid_t,
- cpusetsize: ::size_t,
- cpuset: *mut cpu_set_t,
- ) -> ::c_int;
+ pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+ -> ::c_int;
pub fn sched_setaffinity(
pid: ::pid_t,
cpusetsize: ::size_t,
@@ -3394,12 +4093,8 @@ extern "C" {
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;
+ pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+ -> ::c_int;
pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
@@ -3408,16 +4103,8 @@ extern "C" {
pub fn unshare(flags: ::c_int) -> ::c_int;
pub fn umount(target: *const ::c_char) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
- pub fn tee(
- fd_in: ::c_int,
- fd_out: ::c_int,
- len: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
- pub fn settimeofday(
- tv: *const ::timeval,
- tz: *const ::timezone,
- ) -> ::c_int;
+ pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn splice(
fd_in: ::c_int,
off_in: *mut ::loff_t,
@@ -3427,19 +4114,12 @@ extern "C" {
flags: ::c_uint,
) -> ::ssize_t;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
- pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec)
- -> ::c_int;
- pub fn sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
- pub fn sched_setparam(
- pid: ::pid_t,
- param: *const ::sched_param,
- ) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
- pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+ pub fn swapoff(path: *const ::c_char) -> ::c_int;
pub fn vmsplice(
fd: ::c_int,
iov: *const ::iovec,
@@ -3462,10 +4142,24 @@ extern "C" {
timeout: *const ::timespec,
sigmask: *const sigset_t,
) -> ::c_int;
+ pub fn pthread_mutexattr_getprotocol(
+ attr: *const pthread_mutexattr_t,
+ protocol: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setprotocol(
+ attr: *mut pthread_mutexattr_t,
+ protocol: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
pub fn clone(
cb: extern "C" fn(*mut ::c_void) -> ::c_int,
child_stack: *mut ::c_void,
@@ -3534,11 +4228,7 @@ extern "C" {
result: *mut *mut ::group,
) -> ::c_int;
pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
@@ -3576,6 +4266,14 @@ extern "C" {
attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
+ pub fn pthread_mutexattr_getrobust(
+ attr: *const pthread_mutexattr_t,
+ robustness: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut pthread_mutexattr_t,
+ robustness: ::c_int,
+ ) -> ::c_int;
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn faccessat(
dirfd: ::c_int,
@@ -3600,17 +4298,11 @@ extern "C" {
data: *mut ::c_void,
) -> ::c_int;
- pub fn setmntent(
- filename: *const ::c_char,
- ty: *const ::c_char,
- ) -> *mut ::FILE;
+ 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 hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
pub fn posix_spawn(
pid: *mut ::pid_t,
@@ -3650,26 +4342,17 @@ extern "C" {
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_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_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_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,
@@ -3679,12 +4362,8 @@ extern "C" {
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_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,
@@ -3710,18 +4389,10 @@ extern "C" {
pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
pub fn inotify_init() -> ::c_int;
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
- pub fn inotify_add_watch(
- fd: ::c_int,
- path: *const ::c_char,
- mask: u32,
- ) -> ::c_int;
+ pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
pub fn fanotify_init(flags: ::c_uint, event_f_flags: ::c_uint) -> ::c_int;
- pub fn regcomp(
- preg: *mut ::regex_t,
- pattern: *const ::c_char,
- cflags: ::c_int,
- ) -> ::c_int;
+ pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regexec(
preg: *const ::regex_t,
@@ -3740,10 +4411,7 @@ extern "C" {
pub fn regfree(preg: *mut ::regex_t);
- pub fn iconv_open(
- tocode: *const ::c_char,
- fromcode: *const ::c_char,
- ) -> iconv_t;
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
@@ -3754,6 +4422,42 @@ extern "C" {
pub fn iconv_close(cd: iconv_t) -> ::c_int;
pub fn gettid() -> ::pid_t;
+
+ pub fn timer_create(
+ clockid: ::clockid_t,
+ sevp: *mut ::sigevent,
+ timerid: *mut ::timer_t,
+ ) -> ::c_int;
+ pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: ::timer_t,
+ flags: ::c_int,
+ new_value: *const ::itimerspec,
+ old_value: *mut ::itimerspec,
+ ) -> ::c_int;
+
+ pub fn gethostid() -> ::c_long;
+
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+ pub fn memmem(
+ haystack: *const ::c_void,
+ haystacklen: ::size_t,
+ needle: *const ::c_void,
+ needlelen: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn sched_getcpu() -> ::c_int;
+
+ pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+ pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
}
cfg_if! {
@@ -3769,6 +4473,9 @@ cfg_if! {
}
}
+mod arch;
+pub use self::arch::*;
+
cfg_if! {
if #[cfg(libc_align)] {
#[macro_use]
@@ -3779,3 +4486,10 @@ cfg_if! {
}
}
expand_align!();
+
+cfg_if! {
+ if #[cfg(libc_non_exhaustive)] {
+ mod non_exhaustive;
+ pub use self::non_exhaustive::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/src/unix/linux_like/linux/musl/b32/arm/mod.rs
index d05d03af255aa..c47fa2c4cfda9 100644
--- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs
@@ -150,6 +150,77 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct mcontext_t {
+ pub trap_no: ::c_ulong,
+ pub error_code: ::c_ulong,
+ pub oldmask: ::c_ulong,
+ pub arm_r0: ::c_ulong,
+ pub arm_r1: ::c_ulong,
+ pub arm_r2: ::c_ulong,
+ pub arm_r3: ::c_ulong,
+ pub arm_r4: ::c_ulong,
+ pub arm_r5: ::c_ulong,
+ pub arm_r6: ::c_ulong,
+ pub arm_r7: ::c_ulong,
+ pub arm_r8: ::c_ulong,
+ pub arm_r9: ::c_ulong,
+ pub arm_r10: ::c_ulong,
+ pub arm_fp: ::c_ulong,
+ pub arm_ip: ::c_ulong,
+ pub arm_sp: ::c_ulong,
+ pub arm_lr: ::c_ulong,
+ pub arm_pc: ::c_ulong,
+ pub arm_cpsr: ::c_ulong,
+ pub fault_address: ::c_ulong,
+ }
+}
+
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ 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,
+ pub uc_regspace: [::c_ulonglong; 64],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for ucontext_t {
+ fn eq(&self, other: &ucontext_t) -> bool {
+ self.uc_flags == other.uc_flags
+ && self.uc_link == other.uc_link
+ && self.uc_stack == other.uc_stack
+ && self.uc_mcontext == other.uc_mcontext
+ && self.uc_sigmask == other.uc_sigmask
+ }
+ }
+ impl Eq for ucontext_t {}
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_flags", &self.uc_link)
+ .field("uc_link", &self.uc_link)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_sigmask", &self.uc_sigmask)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for ucontext_t {
+ fn hash(&self, state: &mut H) {
+ self.uc_flags.hash(state);
+ self.uc_link.hash(state);
+ self.uc_stack.hash(state);
+ self.uc_mcontext.hash(state);
+ self.uc_sigmask.hash(state);
+ }
+ }
+ }
}
pub const SIGSTKSZ: ::size_t = 8192;
@@ -161,17 +232,6 @@ pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_LARGEFILE: ::c_int = 0o400000;
-pub const FIOCLEX: ::c_int = 0x5451;
-pub const FIONCLEX: ::c_int = 0x5450;
-pub const FIONBIO: ::c_int = 0x5421;
-
-pub const RLIMIT_RSS: ::c_int = 5;
-pub const RLIMIT_NOFILE: ::c_int = 7;
-pub const RLIMIT_AS: ::c_int = 9;
-pub const RLIMIT_NPROC: ::c_int = 6;
-pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -268,8 +328,6 @@ pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 1;
-
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
@@ -356,35 +414,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
@@ -434,55 +463,9 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
-pub const TCGETS: ::c_int = 0x5401;
-pub const TCSETS: ::c_int = 0x5402;
-pub const TCSETSW: ::c_int = 0x5403;
-pub const TCSETSF: ::c_int = 0x5404;
-pub const TCGETA: ::c_int = 0x5405;
-pub const TCSETA: ::c_int = 0x5406;
-pub const TCSETAW: ::c_int = 0x5407;
-pub const TCSETAF: ::c_int = 0x5408;
-pub const TCSBRK: ::c_int = 0x5409;
-pub const TCXONC: ::c_int = 0x540A;
-pub const TCFLSH: ::c_int = 0x540B;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x540F;
-pub const TIOCSPGRP: ::c_int = 0x5410;
-pub const TIOCOUTQ: ::c_int = 0x5411;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x5413;
-pub const TIOCSWINSZ: ::c_int = 0x5414;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x541B;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -854,13 +837,17 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs
index 0006197625094..f83d208d5fe8f 100644
--- a/src/unix/linux_like/linux/musl/b32/hexagon.rs
+++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs
@@ -129,17 +129,6 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const AF_FILE: ::c_int = 1;
@@ -234,12 +223,6 @@ pub const F_GETOWN: ::c_int = 9;
pub const F_GETOWNER_UIDS: ::c_int = 17;
pub const F_GETOWN_EX: ::c_int = 16;
pub const F_GETSIG: ::c_int = 11;
-pub const FIOASYNC: ::c_int = 21586;
-pub const FIOCLEX: ::c_int = 21585;
-pub const FIONBIO: ::c_int = 21537;
-pub const FIONCLEX: ::c_int = 21584;
-pub const FIONREAD: ::c_int = 21531;
-pub const FIOQSIZE: ::c_int = 21600;
pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024;
pub const FLUSHO: ::c_int = 4096;
pub const F_OFD_GETLK: ::c_int = 36;
@@ -282,13 +265,7 @@ pub const PF_FILE: ::c_int = 1;
pub const PF_KCM: ::c_int = 41;
pub const PF_MAX: ::c_int = 43;
pub const PF_QIPCRTR: ::c_int = 42;
-pub const RLIMIT_AS: ::c_int = 9;
-pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NOFILE: ::c_int = 7;
-pub const RLIMIT_NPROC: ::c_int = 6;
-pub const RLIMIT_RSS: ::c_int = 5;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
-pub const RLIM_NLIMITS: ::c_int = 16;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
@@ -317,65 +294,19 @@ pub const SIGXFSZ: ::c_int = 25;
pub const SIG_SETMASK: ::c_int = 2; // FIXME check these
pub const SIG_BLOCK: ::c_int = 0x000000;
pub const SIG_UNBLOCK: ::c_int = 0x01;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
-pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_NONBLOCK: ::c_int = 2048;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOCK_STREAM: ::c_int = 1;
-pub const SO_CNX_ADVICE: ::c_int = 53;
-pub const SO_DETACH_BPF: ::c_int = 27;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_GET_FILTER: ::c_int = 26;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_KEEPALIVE: ::c_int = 9;
pub const SOL_CAIF: ::c_int = 278;
-pub const SO_LINGER: ::c_int = 13;
pub const SOL_IUCV: ::c_int = 277;
pub const SOL_KCM: ::c_int = 281;
pub const SOL_NFC: ::c_int = 280;
-pub const SO_LOCK_FILTER: ::c_int = 44;
pub const SOL_PNPIPE: ::c_int = 275;
pub const SOL_PPPOL2TP: ::c_int = 273;
pub const SOL_RDS: ::c_int = 276;
pub const SOL_RXRPC: ::c_int = 272;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_WIFI_STATUS: ::c_int = 41;
+
pub const SYS3264_fadvise64: ::c_int = 223;
pub const SYS3264_fcntl: ::c_int = 25;
pub const SYS3264_fstatat: ::c_int = 79;
@@ -712,83 +643,29 @@ pub const SYS_waitid: ::c_int = 95;
pub const SYS_write: ::c_int = 64;
pub const SYS_writev: ::c_int = 66;
pub const SYS_statx: ::c_int = 291;
-pub const TCFLSH: ::c_int = 21515;
-pub const TCGETA: ::c_int = 21509;
-pub const TCGETS: ::c_int = 21505;
-pub const TCGETX: ::c_int = 21554;
-pub const TCSBRK: ::c_int = 21513;
-pub const TCSBRKP: ::c_int = 21541;
-pub const TCSETA: ::c_int = 21510;
-pub const TCSETAF: ::c_int = 21512;
-pub const TCSETAW: ::c_int = 21511;
-pub const TCSETS: ::c_int = 21506;
-pub const TCSETSF: ::c_int = 21508;
-pub const TCSETSW: ::c_int = 21507;
-pub const TCSETX: ::c_int = 21555;
-pub const TCSETXF: ::c_int = 21556;
-pub const TCSETXW: ::c_int = 21557;
-pub const TCXONC: ::c_int = 21514;
-pub const TIOCCONS: ::c_int = 21533;
-pub const TIOCEXCL: ::c_int = 21516;
-pub const TIOCGETD: ::c_int = 21540;
-pub const TIOCGICOUNT: ::c_int = 21597;
-pub const TIOCGLCKTRMIOS: ::c_int = 21590;
-pub const TIOCGPGRP: ::c_int = 21519;
-pub const TIOCGRS485: ::c_int = 21550;
-pub const TIOCGSERIAL: ::c_int = 21534;
-pub const TIOCGSID: ::c_int = 21545;
-pub const TIOCGSOFTCAR: ::c_int = 21529;
-pub const TIOCGWINSZ: ::c_int = 21523;
-pub const TIOCLINUX: ::c_int = 21532;
-pub const TIOCMBIC: ::c_int = 21527;
-pub const TIOCMBIS: ::c_int = 21526;
-pub const TIOCM_CAR: ::c_int = 64;
-pub const TIOCM_CD: ::c_int = 64;
-pub const TIOCM_CTS: ::c_int = 32;
-pub const TIOCM_DSR: ::c_int = 256;
-pub const TIOCM_DTR: ::c_int = 2;
-pub const TIOCMGET: ::c_int = 21525;
-pub const TIOCMIWAIT: ::c_int = 21596;
-pub const TIOCM_LE: ::c_int = 1;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
pub const TIOCM_LOOP: ::c_int = 32768;
pub const TIOCM_OUT1: ::c_int = 8192;
pub const TIOCM_OUT2: ::c_int = 16384;
-pub const TIOCM_RI: ::c_int = 128;
-pub const TIOCM_RNG: ::c_int = 128;
-pub const TIOCM_RTS: ::c_int = 4;
-pub const TIOCMSET: ::c_int = 21528;
-pub const TIOCM_SR: ::c_int = 16;
-pub const TIOCM_ST: ::c_int = 8;
-pub const TIOCNOTTY: ::c_int = 21538;
-pub const TIOCNXCL: ::c_int = 21517;
-pub const TIOCOUTQ: ::c_int = 21521;
-pub const TIOCPKT: ::c_int = 21536;
-pub const TIOCPKT_DATA: ::c_int = 0;
-pub const TIOCPKT_DOSTOP: ::c_int = 32;
-pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
-pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
-pub const TIOCPKT_IOCTL: ::c_int = 64;
-pub const TIOCPKT_NOSTOP: ::c_int = 16;
-pub const TIOCPKT_START: ::c_int = 8;
-pub const TIOCPKT_STOP: ::c_int = 4;
-pub const TIOCSCTTY: ::c_int = 21518;
-pub const TIOCSERCONFIG: ::c_int = 21587;
-pub const TIOCSERGETLSR: ::c_int = 21593;
-pub const TIOCSERGETMULTI: ::c_int = 21594;
-pub const TIOCSERGSTRUCT: ::c_int = 21592;
-pub const TIOCSERGWILD: ::c_int = 21588;
-pub const TIOCSERSETMULTI: ::c_int = 21595;
-pub const TIOCSERSWILD: ::c_int = 21589;
pub const TIOCSER_TEMT: ::c_int = 1;
-pub const TIOCSETD: ::c_int = 21539;
-pub const TIOCSLCKTRMIOS: ::c_int = 21591;
-pub const TIOCSPGRP: ::c_int = 21520;
-pub const TIOCSRS485: ::c_int = 21551;
-pub const TIOCSSERIAL: ::c_int = 21535;
-pub const TIOCSSOFTCAR: ::c_int = 21530;
-pub const TIOCSTI: ::c_int = 21522;
-pub const TIOCSWINSZ: ::c_int = 21524;
-pub const TIOCVHANGUP: ::c_int = 21559;
pub const TOSTOP: ::c_int = 256;
pub const VEOF: ::c_int = 4;
pub const VEOL2: ::c_int = 16;
diff --git a/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/src/unix/linux_like/linux/musl/b32/mips/mod.rs
index 8e328fcb5d9a0..40b507bcd0633 100644
--- a/src/unix/linux_like/linux/musl/b32/mips/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/mips/mod.rs
@@ -172,17 +172,6 @@ pub const O_NOFOLLOW: ::c_int = 0o400000;
pub const O_ASYNC: ::c_int = 0o10000;
pub const O_LARGEFILE: ::c_int = 0x2000;
-pub const FIOCLEX: ::c_int = 0x6601;
-pub const FIONCLEX: ::c_int = 0x6602;
-pub const FIONBIO: ::c_int = 0x667E;
-
-pub const RLIMIT_RSS: ::c_int = 7;
-pub const RLIMIT_NOFILE: ::c_int = 5;
-pub const RLIMIT_AS: ::c_int = 6;
-pub const RLIMIT_NPROC: ::c_int = 8;
-pub const RLIMIT_MEMLOCK: ::c_int = 9;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -363,36 +352,6 @@ pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 65535;
-
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_ACCEPTCONN: ::c_int = 0x1009;
-pub const SO_PROTOCOL: ::c_int = 0x1028;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_PASSCRED: ::c_int = 17;
-pub const SO_PEERCRED: ::c_int = 18;
-pub const SO_PEERSEC: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 31;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 8;
pub const SA_NOCLDWAIT: ::c_int = 0x10000;
@@ -442,55 +401,9 @@ pub const IEXTEN: ::tcflag_t = 0o000400;
pub const TOSTOP: ::tcflag_t = 0o100000;
pub const FLUSHO: ::tcflag_t = 0o020000;
-pub const TCGETS: ::c_int = 0x540D;
-pub const TCSETS: ::c_int = 0x540E;
-pub const TCSETSW: ::c_int = 0x540F;
-pub const TCSETSF: ::c_int = 0x5410;
-pub const TCGETA: ::c_int = 0x5401;
-pub const TCSETA: ::c_int = 0x5402;
-pub const TCSETAW: ::c_int = 0x5403;
-pub const TCSETAF: ::c_int = 0x5404;
-pub const TCSBRK: ::c_int = 0x5405;
-pub const TCXONC: ::c_int = 0x5406;
-pub const TCFLSH: ::c_int = 0x5407;
-pub const TIOCGSOFTCAR: ::c_int = 0x5481;
-pub const TIOCSSOFTCAR: ::c_int = 0x5482;
-pub const TIOCLINUX: ::c_int = 0x5483;
-pub const TIOCGSERIAL: ::c_int = 0x5484;
-pub const TIOCEXCL: ::c_int = 0x740D;
-pub const TIOCNXCL: ::c_int = 0x740E;
-pub const TIOCSCTTY: ::c_int = 0x5480;
-pub const TIOCGPGRP: ::c_int = 0x40047477;
-pub const TIOCSPGRP: ::c_int = 0x80047476;
-pub const TIOCOUTQ: ::c_int = 0x7472;
-pub const TIOCSTI: ::c_int = 0x5472;
-pub const TIOCGWINSZ: ::c_int = 0x40087468;
-pub const TIOCSWINSZ: ::c_int = 0x80087467;
-pub const TIOCMGET: ::c_int = 0x741D;
-pub const TIOCMBIS: ::c_int = 0x741B;
-pub const TIOCMBIC: ::c_int = 0x741C;
-pub const TIOCMSET: ::c_int = 0x741A;
-pub const FIONREAD: ::c_int = 0x467F;
-pub const TIOCCONS: ::c_int = 0x80047478;
-
-pub const TIOCGRS485: ::c_int = 0x4020542E;
-pub const TIOCSRS485: ::c_int = 0xC020542F;
-
pub const POLLWRNORM: ::c_short = 0x4;
pub const POLLWRBAND: ::c_short = 0x100;
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x010;
-pub const TIOCM_SR: ::c_int = 0x020;
-pub const TIOCM_CTS: ::c_int = 0x040;
-pub const TIOCM_CAR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RNG: ::c_int = 0x200;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-pub const TIOCM_DSR: ::c_int = 0x400;
-
pub const SYS_syscall: ::c_long = 4000 + 0;
pub const SYS_exit: ::c_long = 4000 + 1;
pub const SYS_fork: ::c_long = 4000 + 2;
@@ -864,6 +777,14 @@ pub const SYS_faccessat2: ::c_long = 4000 + 439;
pub const SYS_process_madvise: ::c_long = 4000 + 440;
pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/src/unix/linux_like/linux/musl/b32/mod.rs b/src/unix/linux_like/linux/musl/b32/mod.rs
index f54e5d9c8cae9..63824fbf561e4 100644
--- a/src/unix/linux_like/linux/musl/b32/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/mod.rs
@@ -3,6 +3,7 @@ pub type c_ulong = u32;
pub type nlink_t = u32;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type regoff_t = ::c_int;
s! {
@@ -38,12 +39,6 @@ s! {
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
-pub const TIOCINQ: ::c_int = ::FIONREAD;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
-}
-
cfg_if! {
if #[cfg(any(target_arch = "x86"))] {
mod x86;
@@ -60,6 +55,9 @@ cfg_if! {
} else if #[cfg(any(target_arch = "hexagon"))] {
mod hexagon;
pub use self::hexagon::*;
+ } else if #[cfg(any(target_arch = "riscv32"))] {
+ mod riscv32;
+ pub use self::riscv32::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/linux_like/linux/musl/b32/powerpc.rs b/src/unix/linux_like/linux/musl/b32/powerpc.rs
index eef11f1b07812..5b1bf17ed8c22 100644
--- a/src/unix/linux_like/linux/musl/b32/powerpc.rs
+++ b/src/unix/linux_like/linux/musl/b32/powerpc.rs
@@ -165,17 +165,6 @@ pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_LARGEFILE: ::c_int = 0x10000;
-pub const FIOCLEX: ::c_int = 0x20006601;
-pub const FIONCLEX: ::c_int = 0x20006602;
-pub const FIONBIO: ::c_int = 0x8004667E;
-
-pub const RLIMIT_RSS: ::c_int = 5;
-pub const RLIMIT_NOFILE: ::c_int = 7;
-pub const RLIMIT_AS: ::c_int = 9;
-pub const RLIMIT_NPROC: ::c_int = 6;
-pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
pub const CBAUD: ::tcflag_t = 0o0000377;
@@ -270,8 +259,6 @@ pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 1;
-
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
@@ -358,34 +345,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_RCVLOWAT: ::c_int = 16;
-pub const SO_SNDLOWAT: ::c_int = 17;
-pub const SO_RCVTIMEO: ::c_int = 18;
-pub const SO_SNDTIMEO: ::c_int = 19;
-pub const SO_PASSCRED: ::c_int = 20;
-pub const SO_PEERCRED: ::c_int = 21;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
@@ -435,55 +394,9 @@ pub const IEXTEN: ::tcflag_t = 0x00000400;
pub const TOSTOP: ::tcflag_t = 0x00400000;
pub const FLUSHO: ::tcflag_t = 0x00800000;
-pub const TCGETS: ::c_int = 0x402C7413;
-pub const TCSETS: ::c_int = 0x802C7414;
-pub const TCSETSW: ::c_int = 0x802C7415;
-pub const TCSETSF: ::c_int = 0x802C7416;
-pub const TCGETA: ::c_int = 0x40147417;
-pub const TCSETA: ::c_int = 0x80147418;
-pub const TCSETAW: ::c_int = 0x80147419;
-pub const TCSETAF: ::c_int = 0x8014741C;
-pub const TCSBRK: ::c_int = 0x2000741D;
-pub const TCXONC: ::c_int = 0x2000741E;
-pub const TCFLSH: ::c_int = 0x2000741F;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x40047477;
-pub const TIOCSPGRP: ::c_int = 0x80047476;
-pub const TIOCOUTQ: ::c_int = 0x40047473;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x40087468;
-pub const TIOCSWINSZ: ::c_int = 0x80087467;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x4004667F;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCGRS485: ::c_int = 0x542e;
-pub const TIOCSRS485: ::c_int = 0x542f;
-
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -877,11 +790,15 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
extern "C" {
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}
diff --git a/src/unix/linux_like/linux/musl/b32/riscv32/align.rs b/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
new file mode 100644
index 0000000000000..048268c96b7a7
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ #[repr(align(8))]
+ pub struct max_align_t {
+ priv_: (i64, f64)
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
new file mode 100644
index 0000000000000..573624620728a
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
@@ -0,0 +1,808 @@
+//! RISC-V-specific definitions for 32-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+s! {
+ pub struct pthread_attr_t {
+ __size: [::c_ulong; 7],
+ }
+
+ 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,
+ pub __pad1: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub __pad2: ::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_int; 2usize],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino64_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,
+ pub __pad1: ::dev_t,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::blksize_t,
+ pub __pad2: ::c_int,
+ 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,
+ __unused: [::c_int; 2],
+ }
+
+ pub struct statfs {
+ pub f_type: ::c_long,
+ pub f_bsize: ::c_long,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::c_long,
+ pub f_frsize: ::c_long,
+ pub f_flags: ::c_long,
+ pub f_spare: [::c_long; 4],
+ }
+
+ pub struct statvfs {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_favail: ::fsfilcnt_t,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ pub __f_spare: [::c_int; 6],
+ }
+
+ pub struct statfs64 {
+ pub f_type: ::c_ulong,
+ pub f_bsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_flags: ::c_ulong,
+ pub f_spare: [::c_ulong; 4],
+ }
+
+ pub struct statvfs64 {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_favail: u64,
+ pub f_fsid: ::c_ulong,
+ __f_unused: ::c_int,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ __f_spare: [::c_int; 6],
+ }
+
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_errno: ::c_int,
+ pub si_code: ::c_int,
+ #[doc(hidden)]
+ #[deprecated(
+ since="0.2.54",
+ note="Please leave a comment on \
+ https://github.com/rust-lang/libc/pull/1316 if you're using \
+ this field"
+ )]
+ pub _pad: [::c_int; 29],
+ _align: [u64; 0],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_flags: ::c_int,
+ pub ss_size: ::size_t,
+ }
+
+ pub struct sigaction {
+ pub sa_sigaction: ::sighandler_t,
+ pub sa_mask: ::sigset_t,
+ pub sa_flags: ::c_int,
+ pub sa_restorer: ::Option,
+ }
+
+ pub struct ipc_perm {
+ pub __key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::c_ushort,
+ __pad1: ::c_ushort,
+ pub __seq: ::c_ushort,
+ __pad2: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_atime: ::time_t,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_nattch: ::shmatt_t,
+ __unused5: ::c_ulong,
+ __unused6: ::c_ulong,
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_stime: ::time_t,
+ __unused1: ::c_int,
+ pub msg_rtime: ::time_t,
+ __unused2: ::c_int,
+ pub msg_ctime: ::time_t,
+ __unused3: ::c_int,
+ __msg_cbytes: ::c_ulong,
+ pub msg_qnum: ::msgqnum_t,
+ pub msg_qbytes: ::msglen_t,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ __pad1: ::c_ulong,
+ __pad2: ::c_ulong,
+ }
+
+ pub struct flock {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct flock64 {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off64_t,
+ pub l_len: ::off64_t,
+ pub l_pid: ::pid_t,
+ }
+}
+
+//pub const RLIM_INFINITY: ::rlim_t = !0;
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const TIOCGSOFTCAR: ::c_ulong = 21529;
+pub const TIOCSSOFTCAR: ::c_ulong = 21530;
+pub const TIOCGRS485: ::c_int = 21550;
+pub const TIOCSRS485: ::c_int = 21551;
+//pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+//pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+//pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+//pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+//pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 1052672;
+pub const MAP_GROWSDOWN: ::c_int = 256;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SA_ONSTACK: ::c_int = 8;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const POLLWRNORM: ::c_short = 256;
+pub const POLLWRBAND: ::c_short = 512;
+pub const O_ASYNC: ::c_int = 8192;
+pub const O_NDELAY: ::c_int = 2048;
+pub const EFD_NONBLOCK: ::c_int = 2048;
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const SFD_NONBLOCK: ::c_int = 2048;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const TIOCLINUX: ::c_ulong = 21532;
+pub const TIOCGSERIAL: ::c_ulong = 21534;
+pub const TIOCEXCL: ::c_ulong = 21516;
+pub const TIOCNXCL: ::c_ulong = 21517;
+pub const TIOCSCTTY: ::c_ulong = 21518;
+pub const TIOCSTI: ::c_ulong = 21522;
+pub const TIOCMGET: ::c_ulong = 21525;
+pub const TIOCMBIS: ::c_ulong = 21526;
+pub const TIOCMBIC: ::c_ulong = 21527;
+pub const TIOCMSET: ::c_ulong = 21528;
+pub const TIOCCONS: ::c_ulong = 21533;
+pub const TIOCM_ST: ::c_int = 8;
+pub const TIOCM_SR: ::c_int = 16;
+pub const TIOCM_CTS: ::c_int = 32;
+pub const TIOCM_CAR: ::c_int = 64;
+pub const TIOCM_RNG: ::c_int = 128;
+pub const TIOCM_DSR: ::c_int = 256;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const O_DIRECT: ::c_int = 16384;
+pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_NOFOLLOW: ::c_int = 131072;
+pub const MAP_HUGETLB: ::c_int = 262144;
+pub const MAP_LOCKED: ::c_int = 8192;
+pub const MAP_NORESERVE: ::c_int = 16384;
+pub const MAP_ANON: ::c_int = 32;
+pub const MAP_ANONYMOUS: ::c_int = 32;
+pub const MAP_DENYWRITE: ::c_int = 2048;
+pub const MAP_EXECUTABLE: ::c_int = 4096;
+pub const MAP_POPULATE: ::c_int = 32768;
+pub const MAP_NONBLOCK: ::c_int = 65536;
+pub const MAP_STACK: ::c_int = 131072;
+pub const MAP_SYNC: ::c_int = 0x080000;
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const FIOCLEX: ::c_int = 21585;
+pub const FIONCLEX: ::c_int = 21584;
+pub const FIONBIO: ::c_int = 21537;
+pub const MCL_CURRENT: ::c_int = 1;
+pub const MCL_FUTURE: ::c_int = 2;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::tcflag_t = 16384;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::tcflag_t = 65536;
+pub const TCGETS: ::c_int = 21505;
+pub const TCSETS: ::c_int = 21506;
+pub const TCSETSW: ::c_int = 21507;
+pub const TCSETSF: ::c_int = 21508;
+pub const TCGETA: ::c_int = 21509;
+pub const TCSETA: ::c_int = 21510;
+pub const TCSETAW: ::c_int = 21511;
+pub const TCSETAF: ::c_int = 21512;
+pub const TCSBRK: ::c_int = 21513;
+pub const TCXONC: ::c_int = 21514;
+pub const TCFLSH: ::c_int = 21515;
+pub const TIOCINQ: ::c_int = 21531;
+pub const TIOCGPGRP: ::c_int = 21519;
+pub const TIOCSPGRP: ::c_int = 21520;
+pub const TIOCOUTQ: ::c_int = 21521;
+pub const TIOCGWINSZ: ::c_int = 21523;
+pub const TIOCSWINSZ: ::c_int = 21524;
+pub const FIONREAD: ::c_int = 21531;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+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_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+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_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+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_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_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+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_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+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_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+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_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+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_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+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_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/src/unix/linux_like/linux/musl/b32/x86/mod.rs
index 8cb280bee516c..c319b91b61434 100644
--- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs
@@ -221,17 +221,6 @@ pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_LARGEFILE: ::c_int = 0o0100000;
-pub const FIOCLEX: ::c_int = 0x5451;
-pub const FIONCLEX: ::c_int = 0x5450;
-pub const FIONBIO: ::c_int = 0x5421;
-
-pub const RLIMIT_RSS: ::c_int = 5;
-pub const RLIMIT_NOFILE: ::c_int = 7;
-pub const RLIMIT_AS: ::c_int = 9;
-pub const RLIMIT_NPROC: ::c_int = 6;
-pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -328,8 +317,6 @@ pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 1;
-
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
@@ -416,35 +403,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
@@ -495,55 +453,9 @@ pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
-pub const TCGETS: ::c_int = 0x5401;
-pub const TCSETS: ::c_int = 0x5402;
-pub const TCSETSW: ::c_int = 0x5403;
-pub const TCSETSF: ::c_int = 0x5404;
-pub const TCGETA: ::c_int = 0x5405;
-pub const TCSETA: ::c_int = 0x5406;
-pub const TCSETAW: ::c_int = 0x5407;
-pub const TCSETAF: ::c_int = 0x5408;
-pub const TCSBRK: ::c_int = 0x5409;
-pub const TCXONC: ::c_int = 0x540A;
-pub const TCFLSH: ::c_int = 0x540B;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x540F;
-pub const TIOCSPGRP: ::c_int = 0x5410;
-pub const TIOCOUTQ: ::c_int = 0x5411;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x5413;
-pub const TIOCSWINSZ: ::c_int = 0x5414;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x541B;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
@@ -944,6 +856,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
@@ -965,11 +885,7 @@ pub const UESP: ::c_int = 15;
pub const SS: ::c_int = 16;
extern "C" {
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
index 81c55c64ad822..a4bf9bff4f147 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
@@ -24,4 +24,19 @@ s! {
pub pstate: ::c_ulong,
__reserved: [[u64; 32]; 16],
}
+
+ #[repr(align(8))]
+ pub struct clone_args {
+ pub flags: ::c_ulonglong,
+ pub pidfd: ::c_ulonglong,
+ pub child_tid: ::c_ulonglong,
+ pub parent_tid: ::c_ulonglong,
+ pub exit_signal: ::c_ulonglong,
+ pub stack: ::c_ulonglong,
+ pub stack_size: ::c_ulonglong,
+ pub tls: ::c_ulonglong,
+ pub set_tid: ::c_ulonglong,
+ pub set_tid_size: ::c_ulonglong,
+ pub cgroup: ::c_ulonglong,
+ }
}
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs b/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
index aa5ed67a1e2a6..14b4bc6d68b87 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -1,5 +1,6 @@
pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type wchar_t = u32;
pub type nlink_t = u32;
pub type blksize_t = ::c_int;
@@ -49,6 +50,13 @@ s! {
__unused: [::c_uint; 2],
}
+ pub struct user_regs_struct {
+ pub regs: [::c_ulonglong; 31],
+ pub sp: ::c_ulonglong,
+ pub pc: ::c_ulonglong,
+ pub pstate: ::c_ulonglong,
+ }
+
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
@@ -160,6 +168,40 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
+// bits/hwcap.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
@@ -174,27 +216,6 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_INCOMING_CPU: ::c_int = 49;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
@@ -535,9 +556,15 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -607,19 +634,9 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const FIOCLEX: ::c_int = 0x5451;
-pub const FIONCLEX: ::c_int = 0x5450;
-pub const FIONBIO: ::c_int = 0x5421;
pub const EDEADLK: ::c_int = 35;
pub const EDEADLOCK: ::c_int = EDEADLK;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
+
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
@@ -627,55 +644,6 @@ pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
-pub const TCGETS: ::c_int = 0x5401;
-pub const TCSETS: ::c_int = 0x5402;
-pub const TCSETSW: ::c_int = 0x5403;
-pub const TCSETSF: ::c_int = 0x5404;
-pub const TCGETA: ::c_int = 0x5405;
-pub const TCSETA: ::c_int = 0x5406;
-pub const TCSETAW: ::c_int = 0x5407;
-pub const TCSETAF: ::c_int = 0x5408;
-pub const TCSBRK: ::c_int = 0x5409;
-pub const TCXONC: ::c_int = 0x540A;
-pub const TCFLSH: ::c_int = 0x540B;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x540F;
-pub const TIOCSPGRP: ::c_int = 0x5410;
-pub const TIOCOUTQ: ::c_int = 0x5411;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x5413;
-pub const TIOCSWINSZ: ::c_int = 0x5414;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x541B;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
-}
cfg_if! {
if #[cfg(libc_align)] {
@@ -683,3 +651,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs
index 2b63da49c349d..22ac916909346 100644
--- a/src/unix/linux_like/linux/musl/b64/mips64.rs
+++ b/src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -1,6 +1,7 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
pub type nlink_t = u64;
pub type blksize_t = i64;
@@ -444,6 +445,14 @@ pub const SYS_faccessat2: ::c_long = 5000 + 439;
pub const SYS_process_madvise: ::c_long = 5000 + 440;
pub const SYS_epoll_pwait2: ::c_long = 5000 + 441;
pub const SYS_mount_setattr: ::c_long = 5000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 5000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 5000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 5000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 5000 + 446;
+pub const SYS_memfd_secret: ::c_long = 5000 + 447;
+pub const SYS_process_mrelease: ::c_long = 5000 + 448;
+pub const SYS_futex_waitv: ::c_long = 5000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 5000 + 450;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
@@ -458,6 +467,7 @@ pub const O_SYNC: ::c_int = 0x4010;
pub const O_RSYNC: ::c_int = 0x4010;
pub const O_DSYNC: ::c_int = 0x10;
pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_LARGEFILE: ::c_int = 0x2000;
pub const EDEADLK: ::c_int = 45;
pub const ENAMETOOLONG: ::c_int = 78;
@@ -505,6 +515,7 @@ pub const ENOPROTOOPT: ::c_int = 99;
pub const EPROTONOSUPPORT: ::c_int = 120;
pub const ESOCKTNOSUPPORT: ::c_int = 121;
pub const EOPNOTSUPP: ::c_int = 122;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 123;
pub const EAFNOSUPPORT: ::c_int = 124;
pub const EADDRINUSE: ::c_int = 125;
@@ -557,59 +568,6 @@ pub const MAP_HUGETLB: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_ACCEPTCONN: ::c_int = 0x1009;
-pub const SO_PROTOCOL: ::c_int = 0x1028;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_PASSCRED: ::c_int = 17;
-pub const SO_PEERCRED: ::c_int = 18;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_PEERSEC: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 31;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-pub const SO_INCOMING_CPU: ::c_int = 49;
-pub const SO_ATTACH_BPF: ::c_int = 50;
-pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
-
-pub const FIOCLEX: ::c_int = 0x6601;
-pub const FIONCLEX: ::c_int = 0x6602;
-pub const FIONBIO: ::c_int = 0x667e;
-
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000008;
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
@@ -658,38 +616,6 @@ pub const F_OFD_GETLK: ::c_int = 36;
pub const F_OFD_SETLK: ::c_int = 37;
pub const F_OFD_SETLKW: ::c_int = 38;
-pub const TCGETS: ::c_int = 0x540d;
-pub const TCSETS: ::c_int = 0x540e;
-pub const TCSETSW: ::c_int = 0x540f;
-pub const TCSETSF: ::c_int = 0x5410;
-pub const TCGETA: ::c_int = 0x5401;
-pub const TCSETA: ::c_int = 0x5402;
-pub const TCSETAW: ::c_int = 0x5403;
-pub const TCSETAF: ::c_int = 0x5404;
-pub const TCSBRK: ::c_int = 0x5405;
-pub const TCXONC: ::c_int = 0x5406;
-pub const TCFLSH: ::c_int = 0x5407;
-pub const TIOCGSOFTCAR: ::c_int = 0x5481;
-pub const TIOCSSOFTCAR: ::c_int = 0x5482;
-pub const TIOCINQ: ::c_int = 0x467f;
-pub const TIOCLINUX: ::c_int = 0x5483;
-pub const TIOCGSERIAL: ::c_int = 0x5484;
-pub const TIOCEXCL: ::c_int = 0x740d;
-pub const TIOCNXCL: ::c_int = 0x740e;
-pub const TIOCSCTTY: ::c_int = 0x5480;
-pub const TIOCGPGRP: ::c_int = 0x40047477;
-pub const TIOCSPGRP: ::c_int = 0x80047476_u32 as i32;
-pub const TIOCOUTQ: ::c_int = 0x7472;
-pub const TIOCSTI: ::c_int = 0x5472;
-pub const TIOCGWINSZ: ::c_int = 0x40087468;
-pub const TIOCSWINSZ: ::c_int = 0x80087467_u32 as i32;
-pub const TIOCMGET: ::c_int = 0x741d;
-pub const TIOCMBIS: ::c_int = 0x741b;
-pub const TIOCMBIC: ::c_int = 0x741c;
-pub const TIOCMSET: ::c_int = 0x741a;
-pub const FIONREAD: ::c_int = 0x467f;
-pub const TIOCCONS: ::c_int = 0x80047478_u32 as i32;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -745,7 +671,6 @@ pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -762,15 +687,4 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const TIOCM_ST: ::c_int = 0x010;
-pub const TIOCM_SR: ::c_int = 0x020;
-pub const TIOCM_CTS: ::c_int = 0x040;
-pub const TIOCM_CAR: ::c_int = 0x100;
-pub const TIOCM_RNG: ::c_int = 0x200;
-pub const TIOCM_DSR: ::c_int = 0x400;
-
pub const EHWPOISON: ::c_int = 168;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
-}
diff --git a/src/unix/linux_like/linux/musl/b64/mod.rs b/src/unix/linux_like/linux/musl/b64/mod.rs
index b3c79b06a9dd6..34c63bc69cc8b 100644
--- a/src/unix/linux_like/linux/musl/b64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/mod.rs
@@ -133,22 +133,12 @@ s! {
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
-pub const RLIMIT_RSS: ::c_int = 5;
-pub const RLIMIT_NOFILE: ::c_int = 7;
-pub const RLIMIT_AS: ::c_int = 9;
-pub const RLIMIT_NPROC: ::c_int = 6;
-pub const RLIMIT_MEMLOCK: ::c_int = 8;
-
pub const SOCK_NONBLOCK: ::c_int = 2048;
pub const SOCK_SEQPACKET: ::c_int = 5;
extern "C" {
- pub fn getrandom(
- buf: *mut ::c_void,
- buflen: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}
cfg_if! {
@@ -167,6 +157,9 @@ cfg_if! {
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
+ } else if #[cfg(any(target_arch = "riscv64"))] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/src/unix/linux_like/linux/musl/b64/powerpc64.rs
index f5688501d3f20..0bb4cf837d268 100644
--- a/src/unix/linux_like/linux/musl/b64/powerpc64.rs
+++ b/src/unix/linux_like/linux/musl/b64/powerpc64.rs
@@ -1,6 +1,7 @@
pub type c_char = u8;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
@@ -174,26 +175,6 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
@@ -620,20 +601,18 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
-pub const FIOCLEX: ::c_int = 0x20006601;
-pub const FIONCLEX: ::c_int = 0x20006602;
-pub const FIONBIO: ::c_int = 0x8004667e;
pub const EDEADLK: ::c_int = 58;
pub const EDEADLOCK: ::c_int = EDEADLK;
-pub const SO_PASSCRED: ::c_int = 20;
-pub const SO_PEERCRED: ::c_int = 21;
-pub const SO_RCVLOWAT: ::c_int = 16;
-pub const SO_SNDLOWAT: ::c_int = 17;
-pub const SO_RCVTIMEO: ::c_int = 18;
-pub const SO_SNDTIMEO: ::c_int = 19;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
+
pub const EXTPROC: ::tcflag_t = 0x10000000;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
@@ -641,52 +620,7 @@ pub const VMIN: usize = 5;
pub const IEXTEN: ::tcflag_t = 0x00000400;
pub const TOSTOP: ::tcflag_t = 0x00400000;
pub const FLUSHO: ::tcflag_t = 0x00800000;
-pub const TCGETS: ::c_int = 0x403c7413;
-pub const TCSETS: ::c_int = 0x803c7414;
-pub const TCSETSW: ::c_int = 0x803c7415;
-pub const TCSETSF: ::c_int = 0x803c7416;
-pub const TCGETA: ::c_int = 0x40147417;
-pub const TCSETA: ::c_int = 0x80147418;
-pub const TCSETAW: ::c_int = 0x80147419;
-pub const TCSETAF: ::c_int = 0x8014741c;
-pub const TCSBRK: ::c_int = 0x2000741d;
-pub const TCXONC: ::c_int = 0x2000741e;
-pub const TCFLSH: ::c_int = 0x2000741f;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x40047477;
-pub const TIOCSPGRP: ::c_int = 0x80047476;
-pub const TIOCOUTQ: ::c_int = 0x40047473;
-pub const TIOCGWINSZ: ::c_int = 0x40087468;
-pub const TIOCSWINSZ: ::c_int = 0x80087467;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x4004667f;
-pub const TIOCCONS: ::c_int = 0x541D;
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
pub const CBAUD: ::tcflag_t = 0xff;
@@ -758,7 +692,3 @@ pub const B2500000: ::speed_t = 0o00033;
pub const B3000000: ::speed_t = 0o00034;
pub const B3500000: ::speed_t = 0o00035;
pub const B4000000: ::speed_t = 0o00036;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
-}
diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/align.rs b/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
new file mode 100644
index 0000000000000..48d152a5721ec
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+ #[allow(missing_debug_implementations)]
+ pub struct ucontext_t {
+ pub __uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: mcontext_t,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub __gregs: [::c_ulong; 32],
+ pub __fpregs: __riscv_mc_fp_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub union __riscv_mc_fp_state {
+ pub __f: __riscv_mc_f_ext_state,
+ pub __d: __riscv_mc_d_ext_state,
+ pub __q: __riscv_mc_q_ext_state,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_f_ext_state {
+ pub __f: [::c_uint; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ pub struct __riscv_mc_d_ext_state {
+ pub __f: [::c_ulonglong; 32],
+ pub __fcsr: ::c_uint,
+ }
+
+ #[allow(missing_debug_implementations)]
+ #[repr(align(16))]
+ pub struct __riscv_mc_q_ext_state {
+ pub __f: [::c_ulonglong; 64],
+ pub __fcsr: ::c_uint,
+ pub __glibc_reserved: [::c_uint; 3],
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
new file mode 100644
index 0000000000000..f354293e0d05c
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
@@ -0,0 +1,742 @@
+//! RISC-V-specific definitions for 64-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+pub type nlink_t = ::c_uint;
+pub type blksize_t = ::c_int;
+pub type fsblkcnt64_t = ::c_ulong;
+pub type fsfilcnt64_t = ::c_ulong;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+ pub struct pthread_attr_t {
+ __size: [::c_ulong; 7],
+ }
+
+ 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,
+ pub __pad1: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub __pad2: ::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_int; 2usize],
+ }
+
+ pub struct stat64 {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino64_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,
+ pub __pad1: ::dev_t,
+ pub st_size: ::off64_t,
+ pub st_blksize: ::blksize_t,
+ pub __pad2: ::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_int; 2],
+ }
+
+ pub struct statfs {
+ pub f_type: ::c_long,
+ pub f_bsize: ::c_long,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::c_long,
+ pub f_frsize: ::c_long,
+ pub f_flags: ::c_long,
+ pub f_spare: [::c_long; 4],
+ }
+
+ pub struct statfs64 {
+ pub f_type: ::c_long,
+ pub f_bsize: ::c_long,
+ pub f_blocks: ::fsblkcnt64_t,
+ pub f_bfree: ::fsblkcnt64_t,
+ pub f_bavail: ::fsblkcnt64_t,
+ pub f_files: ::fsfilcnt64_t,
+ pub f_ffree: ::fsfilcnt64_t,
+ pub f_fsid: ::fsid_t,
+ pub f_namelen: ::c_long,
+ pub f_frsize: ::c_long,
+ pub f_flags: ::c_long,
+ pub f_spare: [::c_long; 4],
+ }
+
+ pub struct statvfs {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_favail: ::fsfilcnt_t,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ pub __f_spare: [::c_int; 6],
+ }
+
+ pub struct statvfs64 {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt64_t,
+ pub f_bfree: ::fsblkcnt64_t,
+ pub f_bavail: ::fsblkcnt64_t,
+ pub f_files: ::fsfilcnt64_t,
+ pub f_ffree: ::fsfilcnt64_t,
+ pub f_favail: ::fsfilcnt64_t,
+ pub f_fsid: ::c_ulong,
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ pub __f_spare: [::c_int; 6],
+ }
+
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_errno: ::c_int,
+ pub si_code: ::c_int,
+ #[doc(hidden)]
+ #[deprecated(
+ since="0.2.54",
+ note="Please leave a comment on \
+ https://github.com/rust-lang/libc/pull/1316 if you're using \
+ this field"
+ )]
+ pub _pad: [::c_int; 29],
+ _align: [u64; 0],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_flags: ::c_int,
+ pub ss_size: ::size_t,
+ }
+
+ pub struct sigaction {
+ pub sa_sigaction: ::sighandler_t,
+ pub sa_mask: ::sigset_t,
+ pub sa_flags: ::c_int,
+ pub sa_restorer: ::Option,
+ }
+
+ pub struct ipc_perm {
+ pub __key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::c_ushort,
+ __pad1: ::c_ushort,
+ pub __seq: ::c_ushort,
+ __pad2: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_atime: ::time_t,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_nattch: ::shmatt_t,
+ __unused5: ::c_ulong,
+ __unused6: ::c_ulong,
+ }
+
+ pub struct flock {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ }
+
+ pub struct flock64 {
+ pub l_type: ::c_short,
+ pub l_whence: ::c_short,
+ pub l_start: ::off64_t,
+ pub l_len: ::off64_t,
+ pub l_pid: ::pid_t,
+ }
+}
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+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_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+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_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+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_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_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+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_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+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_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+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_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+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_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+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_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
+
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/s390x.rs b/src/unix/linux_like/linux/musl/b64/s390x.rs
index 4536bd2b9eb94..60bfc8d3e0b24 100644
--- a/src/unix/linux_like/linux/musl/b64/s390x.rs
+++ b/src/unix/linux_like/linux/musl/b64/s390x.rs
@@ -4,6 +4,7 @@ pub type nlink_t = u64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
+pub type __s64 = i64;
s! {
pub struct ipc_perm {
@@ -141,9 +142,6 @@ pub const EDEADLK: ::c_int = 35;
pub const ENOSYS: ::c_int = 38;
pub const ENOTCONN: ::c_int = 107;
pub const ETIMEDOUT: ::c_int = 110;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
-pub const FIONBIO: ::c_ulong = 0x5421;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
@@ -155,14 +153,6 @@ pub const SIGBUS: ::c_int = 7;
pub const SIGSTKSZ: ::size_t = 0x2000;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const SIG_SETMASK: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -232,6 +222,7 @@ pub const ENOPROTOOPT: ::c_int = 92;
pub const EPROTONOSUPPORT: ::c_int = 93;
pub const ESOCKTNOSUPPORT: ::c_int = 94;
pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 96;
pub const EAFNOSUPPORT: ::c_int = 97;
pub const ENETDOWN: ::c_int = 100;
@@ -259,24 +250,6 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
@@ -322,45 +295,6 @@ pub const F_OFD_GETLK: ::c_int = 36;
pub const F_OFD_SETLK: ::c_int = 37;
pub const F_OFD_SETLKW: ::c_int = 38;
-pub const TCGETS: ::c_int = 0x5401;
-pub const TCSETS: ::c_int = 0x5402;
-pub const TCSETSW: ::c_int = 0x5403;
-pub const TCSETSF: ::c_int = 0x5404;
-pub const TCGETA: ::c_int = 0x5405;
-pub const TCSETA: ::c_int = 0x5406;
-pub const TCSETAW: ::c_int = 0x5407;
-pub const TCSETAF: ::c_int = 0x5408;
-pub const TCSBRK: ::c_int = 0x5409;
-pub const TCXONC: ::c_int = 0x540A;
-pub const TCFLSH: ::c_int = 0x540B;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCINQ: ::c_int = 0x541B;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x540F;
-pub const TIOCSPGRP: ::c_int = 0x5410;
-pub const TIOCOUTQ: ::c_int = 0x5411;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x5413;
-pub const TIOCSWINSZ: ::c_int = 0x5414;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x541B;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-
pub const VTIME: usize = 5;
pub const VSWTC: usize = 7;
pub const VSTART: usize = 8;
@@ -400,7 +334,6 @@ pub const PARODD: ::tcflag_t = 0o001000;
pub const HUPCL: ::tcflag_t = 0o002000;
pub const CLOCAL: ::tcflag_t = 0o004000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
-pub const BOTHER: ::speed_t = 0o010000;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
@@ -778,3 +711,11 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
index 7ca870fd02b71..94391a01a727e 100644
--- a/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
+++ b/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
@@ -4,4 +4,22 @@ s_no_extra_traits! {
pub struct max_align_t {
priv_: [f64; 4]
}
+
+}
+
+s! {
+ #[repr(align(8))]
+ pub struct clone_args {
+ pub flags: ::c_ulonglong,
+ pub pidfd: ::c_ulonglong,
+ pub child_tid: ::c_ulonglong,
+ pub parent_tid: ::c_ulonglong,
+ pub exit_signal: ::c_ulonglong,
+ pub stack: ::c_ulonglong,
+ pub stack_size: ::c_ulonglong,
+ pub tls: ::c_ulonglong,
+ pub set_tid: ::c_ulonglong,
+ pub set_tid_size: ::c_ulonglong,
+ pub cgroup: ::c_ulonglong,
+ }
}
diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
index b96954a7837dd..8198dc2f35168 100644
--- a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
@@ -3,6 +3,7 @@ pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type greg_t = i64;
s! {
@@ -599,6 +600,14 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
@@ -673,9 +682,6 @@ pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
pub const O_ASYNC: ::c_int = 0x2000;
-pub const TIOCGRS485: ::c_int = 0x542E;
-pub const TIOCSRS485: ::c_int = 0x542F;
-
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
@@ -807,27 +813,6 @@ pub const POLLWRBAND: ::c_short = 0x200;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_TYPE: ::c_int = 3;
-pub const SO_ERROR: ::c_int = 4;
-pub const SO_DONTROUTE: ::c_int = 5;
-pub const SO_BROADCAST: ::c_int = 6;
-pub const SO_SNDBUF: ::c_int = 7;
-pub const SO_RCVBUF: ::c_int = 8;
-pub const SO_KEEPALIVE: ::c_int = 9;
-pub const SO_OOBINLINE: ::c_int = 10;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_LINGER: ::c_int = 13;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_REUSEPORT: ::c_int = 15;
-pub const SO_ACCEPTCONN: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 32;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PROTOCOL: ::c_int = 38;
-pub const SO_DOMAIN: ::c_int = 39;
-pub const SO_INCOMING_CPU: ::c_int = 49;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
@@ -841,8 +826,6 @@ pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
-pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -912,19 +895,9 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const FIOCLEX: ::c_int = 0x5451;
-pub const FIONCLEX: ::c_int = 0x5450;
-pub const FIONBIO: ::c_int = 0x5421;
pub const EDEADLK: ::c_int = 35;
pub const EDEADLOCK: ::c_int = EDEADLK;
-pub const SO_PASSCRED: ::c_int = 16;
-pub const SO_PEERCRED: ::c_int = 17;
-pub const SO_RCVLOWAT: ::c_int = 18;
-pub const SO_SNDLOWAT: ::c_int = 19;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
+
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
@@ -932,52 +905,6 @@ pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
-pub const TCGETS: ::c_int = 0x5401;
-pub const TCSETS: ::c_int = 0x5402;
-pub const TCSETSW: ::c_int = 0x5403;
-pub const TCSETSF: ::c_int = 0x5404;
-pub const TCGETA: ::c_int = 0x5405;
-pub const TCSETA: ::c_int = 0x5406;
-pub const TCSETAW: ::c_int = 0x5407;
-pub const TCSETAF: ::c_int = 0x5408;
-pub const TCSBRK: ::c_int = 0x5409;
-pub const TCXONC: ::c_int = 0x540A;
-pub const TCFLSH: ::c_int = 0x540B;
-pub const TIOCGSOFTCAR: ::c_int = 0x5419;
-pub const TIOCSSOFTCAR: ::c_int = 0x541A;
-pub const TIOCLINUX: ::c_int = 0x541C;
-pub const TIOCGSERIAL: ::c_int = 0x541E;
-pub const TIOCEXCL: ::c_int = 0x540C;
-pub const TIOCNXCL: ::c_int = 0x540D;
-pub const TIOCSCTTY: ::c_int = 0x540E;
-pub const TIOCGPGRP: ::c_int = 0x540F;
-pub const TIOCSPGRP: ::c_int = 0x5410;
-pub const TIOCOUTQ: ::c_int = 0x5411;
-pub const TIOCSTI: ::c_int = 0x5412;
-pub const TIOCGWINSZ: ::c_int = 0x5413;
-pub const TIOCSWINSZ: ::c_int = 0x5414;
-pub const TIOCMGET: ::c_int = 0x5415;
-pub const TIOCMBIS: ::c_int = 0x5416;
-pub const TIOCMBIC: ::c_int = 0x5417;
-pub const TIOCMSET: ::c_int = 0x5418;
-pub const FIONREAD: ::c_int = 0x541B;
-pub const TIOCCONS: ::c_int = 0x541D;
-
-pub const TIOCM_LE: ::c_int = 0x001;
-pub const TIOCM_DTR: ::c_int = 0x002;
-pub const TIOCM_RTS: ::c_int = 0x004;
-pub const TIOCM_ST: ::c_int = 0x008;
-pub const TIOCM_SR: ::c_int = 0x010;
-pub const TIOCM_CTS: ::c_int = 0x020;
-pub const TIOCM_CAR: ::c_int = 0x040;
-pub const TIOCM_RNG: ::c_int = 0x080;
-pub const TIOCM_DSR: ::c_int = 0x100;
-pub const TIOCM_CD: ::c_int = TIOCM_CAR;
-pub const TIOCM_RI: ::c_int = TIOCM_RNG;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
-}
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index c722b679c6f4f..2a894a602502e 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -24,6 +24,16 @@ pub type rlim_t = ::c_ulonglong;
pub type flock64 = flock;
+cfg_if! {
+ if #[cfg(doc)] {
+ // Used in `linux::arch` to define ioctl constants.
+ pub(crate) type Ioctl = ::c_int;
+ } else {
+ #[doc(hidden)]
+ pub type Ioctl = ::c_int;
+ }
+}
+
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
#[repr(C)]
@@ -133,24 +143,6 @@ s! {
__dummy4: [::c_char; 16],
}
- pub struct nlmsghdr {
- pub nlmsg_len: u32,
- pub nlmsg_type: u16,
- pub nlmsg_flags: u16,
- pub nlmsg_seq: u32,
- pub nlmsg_pid: u32,
- }
-
- pub struct nlmsgerr {
- pub error: ::c_int,
- pub msg: nlmsghdr,
- }
-
- pub struct nlattr {
- pub nla_len: u16,
- pub nla_type: u16,
- }
-
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
@@ -226,12 +218,6 @@ s! {
pub rt_irtt: ::c_ushort,
}
- pub struct ip_mreqn {
- pub imr_multiaddr: ::in_addr,
- pub imr_address: ::in_addr,
- pub imr_ifindex: ::c_int,
- }
-
pub struct __exit_status {
pub e_termination: ::c_short,
pub e_exit: ::c_short,
@@ -249,6 +235,36 @@ s! {
pub ch_size: ::Elf32_Word,
pub ch_addralign: ::Elf32_Word,
}
+
+ pub struct timex {
+ pub modes: ::c_uint,
+ pub offset: ::c_long,
+ pub freq: ::c_long,
+ pub maxerror: ::c_long,
+ pub esterror: ::c_long,
+ pub status: ::c_int,
+ pub constant: ::c_long,
+ pub precision: ::c_long,
+ pub tolerance: ::c_long,
+ pub time: ::timeval,
+ pub tick: ::c_long,
+ pub ppsfreq: ::c_long,
+ pub jitter: ::c_long,
+ pub shift: ::c_int,
+ pub stabil: ::c_long,
+ pub jitcnt: ::c_long,
+ pub calcnt: ::c_long,
+ pub errcnt: ::c_long,
+ pub stbcnt: ::c_long,
+ pub tai: ::c_int,
+ pub __padding: [::c_int; 11],
+ }
+
+ pub struct ntptimeval {
+ pub time: ::timeval,
+ pub maxerror: ::c_long,
+ pub esterror: ::c_long,
+ }
}
s_no_extra_traits! {
@@ -508,25 +524,12 @@ pub const PTHREAD_STACK_MIN: ::size_t = 2048;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
-pub const RLIM_INFINITY: ::rlim_t = !0;
-pub const RLIMIT_RTTIME: ::c_int = 15;
-
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const SOCK_DCCP: ::c_int = 6;
pub const SOCK_PACKET: ::c_int = 10;
-pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
-pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
-pub const TCP_THIN_DUPACK: ::c_int = 17;
-pub const TCP_USER_TIMEOUT: ::c_int = 18;
-pub const TCP_REPAIR: ::c_int = 19;
-pub const TCP_REPAIR_QUEUE: ::c_int = 20;
-pub const TCP_QUEUE_SEQ: ::c_int = 21;
-pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
-pub const TCP_FASTOPEN: ::c_int = 23;
-pub const TCP_TIMESTAMP: ::c_int = 24;
-pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
+pub const SOMAXCONN: ::c_int = 128;
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
pub const SIGUNUSED: ::c_int = ::SIGSYS;
@@ -587,6 +590,8 @@ pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint;
+
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
@@ -615,33 +620,70 @@ pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_BUSY_POLL: ::c_int = 46;
-
-pub const RLIMIT_CPU: ::c_int = 0;
-pub const RLIMIT_FSIZE: ::c_int = 1;
-pub const RLIMIT_DATA: ::c_int = 2;
-pub const RLIMIT_STACK: ::c_int = 3;
-pub const RLIMIT_CORE: ::c_int = 4;
-pub const RLIMIT_LOCKS: ::c_int = 10;
-pub const RLIMIT_SIGPENDING: ::c_int = 11;
-pub const RLIMIT_MSGQUEUE: ::c_int = 12;
-pub const RLIMIT_NICE: ::c_int = 13;
-pub const RLIMIT_RTPRIO: ::c_int = 14;
-
pub const REG_OK: ::c_int = 0;
-pub const TIOCSBRK: ::c_int = 0x5427;
-pub const TIOCCBRK: ::c_int = 0x5428;
-
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const ADJ_OFFSET: ::c_uint = 0x0001;
+pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
+pub const ADJ_MAXERROR: ::c_uint = 0x0004;
+pub const ADJ_ESTERROR: ::c_uint = 0x0008;
+pub const ADJ_STATUS: ::c_uint = 0x0010;
+pub const ADJ_TIMECONST: ::c_uint = 0x0020;
+pub const ADJ_TAI: ::c_uint = 0x0080;
+pub const ADJ_SETOFFSET: ::c_uint = 0x0100;
+pub const ADJ_MICRO: ::c_uint = 0x1000;
+pub const ADJ_NANO: ::c_uint = 0x2000;
+pub const ADJ_TICK: ::c_uint = 0x4000;
+pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001;
+pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001;
+pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET;
+pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY;
+pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR;
+pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR;
+pub const MOD_STATUS: ::c_uint = ADJ_STATUS;
+pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST;
+pub const MOD_CLKB: ::c_uint = ADJ_TICK;
+pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT;
+pub const MOD_TAI: ::c_uint = ADJ_TAI;
+pub const MOD_MICRO: ::c_uint = ADJ_MICRO;
+pub const MOD_NANO: ::c_uint = ADJ_NANO;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+ | STA_PPSJITTER
+ | STA_PPSWANDER
+ | STA_PPSERROR
+ | STA_CLOCKERR
+ | STA_NANO
+ | STA_MODE
+ | STA_CLK;
+
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+pub const TIME_BAD: ::c_int = TIME_ERROR;
+pub const MAXTC: ::c_long = 6;
+
cfg_if! {
if #[cfg(target_arch = "s390x")] {
pub const POSIX_FADV_DONTNEED: ::c_int = 6;
@@ -684,27 +726,11 @@ extern "C" {
old_limit: *mut ::rlimit64,
) -> ::c_int;
+ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
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 pthread_getaffinity_np(
- thread: ::pthread_t,
- cpusetsize: ::size_t,
- cpuset: *mut ::cpu_set_t,
- ) -> ::c_int;
- pub fn pthread_setaffinity_np(
- thread: ::pthread_t,
- cpusetsize: ::size_t,
- cpuset: *const ::cpu_set_t,
- ) -> ::c_int;
- pub fn sched_getcpu() -> ::c_int;
- pub fn memmem(
- haystack: *const ::c_void,
- haystacklen: ::size_t,
- needle: *const ::c_void,
- needlelen: ::size_t,
- ) -> *mut ::c_void;
// Musl targets need the `mask` argument of `fanotify_mark` be specified
// `::c_ulonglong` instead of `u64` or there will be a type mismatch between
// `long long unsigned int` and the expected `uint64_t`.
@@ -716,6 +742,36 @@ extern "C" {
path: *const ::c_char,
) -> ::c_int;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+
+ // Added in `musl` 1.1.20
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+ // Added in `musl` 1.2.2
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn adjtimex(buf: *mut ::timex) -> ::c_int;
+ pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
+
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
+ pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+
+ pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+ pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+ pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn strftime(
+ s: *mut ::c_char,
+ max: ::size_t,
+ format: *const ::c_char,
+ tm: *const ::tm,
+ ) -> ::size_t;
+ pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
@@ -723,13 +779,15 @@ cfg_if! {
target_arch = "aarch64",
target_arch = "mips64",
target_arch = "powerpc64",
- target_arch = "s390x"))] {
+ target_arch = "s390x",
+ target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
} else if #[cfg(any(target_arch = "x86",
target_arch = "mips",
target_arch = "powerpc",
target_arch = "hexagon",
+ target_arch = "riscv32",
target_arch = "arm"))] {
mod b32;
pub use self::b32::*;
diff --git a/src/unix/linux_like/linux/no_align.rs b/src/unix/linux_like/linux/no_align.rs
index de64be5a39cc6..2b5abb3bed4b3 100644
--- a/src/unix/linux_like/linux/no_align.rs
+++ b/src/unix/linux_like/linux/no_align.rs
@@ -9,6 +9,7 @@ macro_rules! expand_align {
target_arch = "sparc64",
target_arch = "riscv64",
target_arch = "riscv32",
+ target_arch = "loongarch64",
all(target_arch = "aarch64",
target_env = "musl")))]
__align: [::c_int; 0],
@@ -19,6 +20,7 @@ macro_rules! expand_align {
target_arch = "sparc64",
target_arch = "riscv64",
target_arch = "riscv32",
+ target_arch = "loongarch64",
all(target_arch = "aarch64",
target_env = "musl"))))]
__align: [::c_long; 0],
@@ -62,6 +64,7 @@ macro_rules! expand_align {
pub struct pthread_mutex_t {
#[cfg(any(target_arch = "mips",
target_arch = "arm",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
all(target_arch = "x86_64",
@@ -69,6 +72,7 @@ macro_rules! expand_align {
__align: [::c_long; 0],
#[cfg(not(any(target_arch = "mips",
target_arch = "arm",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
all(target_arch = "x86_64",
@@ -80,6 +84,7 @@ macro_rules! expand_align {
pub struct pthread_rwlock_t {
#[cfg(any(target_arch = "mips",
target_arch = "arm",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
all(target_arch = "x86_64",
@@ -87,6 +92,7 @@ macro_rules! expand_align {
__align: [::c_long; 0],
#[cfg(not(any(target_arch = "mips",
target_arch = "arm",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
all(target_arch = "x86_64",
diff --git a/src/unix/linux_like/linux/non_exhaustive.rs b/src/unix/linux_like/linux/non_exhaustive.rs
new file mode 100644
index 0000000000000..e2e2cb847ac65
--- /dev/null
+++ b/src/unix/linux_like/linux/non_exhaustive.rs
@@ -0,0 +1,9 @@
+s! {
+ // linux/openat2.h
+ #[non_exhaustive]
+ pub struct open_how {
+ pub flags: ::__u64,
+ pub mode: ::__u64,
+ pub resolve: ::__u64,
+ }
+}
diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs
index 60e526bd78908..25125bcc9b3d8 100644
--- a/src/unix/linux_like/linux/uclibc/arm/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs
@@ -10,7 +10,6 @@ pub type fsfilcnt_t = ::c_ulong;
pub type ino_t = ::c_ulong;
pub type off_t = ::c_long;
pub type pthread_t = ::c_ulong;
-pub type rlim_t = ::c_ulong;
pub type suseconds_t = ::c_long;
pub type nlink_t = ::c_uint;
@@ -20,6 +19,7 @@ pub type blkcnt_t = ::c_long;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct cmsghdr {
@@ -44,14 +44,14 @@ s! {
pub struct stat {
pub st_dev: ::c_ulonglong,
- pub __pad1: ::c_ushort,
+ __pad1: ::c_ushort,
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: ::c_ulonglong,
- pub __pad2: ::c_ushort,
+ __pad2: ::c_ushort,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
@@ -61,8 +61,8 @@ s! {
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
- pub __uclibc_unused4: ::c_ulong,
- pub __uclibc_unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
pub struct stat64
@@ -202,49 +202,48 @@ s! {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::c_ushort,
- pub __pad1: ::c_ushort,
+ __pad1: ::c_ushort,
pub __seq: ::c_ushort,
- pub __pad2: ::c_ushort,
- pub __uclibc_unused1: ::c_ulong,
- pub __uclibc_unused2: ::c_ulong,
+ __pad2: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
- pub __uclibc_unused1: ::c_ulong,
+ __unused1: ::c_ulong,
pub msg_rtime: ::time_t,
- pub __uclibc_unused2: ::c_ulong,
+ __unused2: ::c_ulong,
pub msg_ctime: ::time_t,
- pub __uclibc_unused3: ::c_ulong,
- pub __msg_cbytes: ::c_ulong,
+ __unused3: ::c_ulong,
+ __msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
- pub __uclibc_unused4: ::c_ulong,
- pub __uclibc_unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
- pub __uclibc_unused1: ::c_ulong,
+ __unused1: ::c_ulong,
pub shm_dtime: ::time_t,
- pub __uclibc_unused2: ::c_ulong,
+ __unused2: ::c_ulong,
pub shm_ctime: ::time_t,
- pub __uclibc_unused3: ::c_ulong,
+ __unused3: ::c_ulong,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
- pub __uclibc_unused4: ::c_ulong,
- pub __uclibc_unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
}
pub const O_CLOEXEC: ::c_int = 0o2000000;
-pub const RLIM_INFINITY: rlim_t = !0;
pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
@@ -259,11 +258,6 @@ pub const NCCS: usize = 32;
// I wasn't able to find those constants
// in uclibc build environment for armv7
pub const MAP_HUGETLB: ::c_int = 0x040000; // from linux/other/mod.rs
-pub const SO_BUSY_POLL: ::c_int = 46; // from src/unix/linux_like/mod.rs
-pub const SO_PEEK_OFF: ::c_int = 42; // from src/unix/linux_like/mod.rs
-pub const SO_REUSEPORT: ::c_int = 15; // from src/unix/linux_like/mod.rs
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
// autogenerated constants with hand tuned types
pub const B0: ::speed_t = 0;
@@ -422,9 +416,6 @@ pub const EUSERS: ::c_int = 0x57;
pub const EXFULL: ::c_int = 0x36;
pub const FF1: ::c_int = 0x8000;
pub const FFDLY: ::c_int = 0x8000;
-pub const FIONBIO: ::c_ulong = 0x5421;
-pub const FIOCLEX: ::c_ulong = 0x5451;
-pub const FIONCLEX: ::c_ulong = 0x5450;
pub const FLUSHO: ::tcflag_t = 0x1000;
pub const F_GETLK: ::c_int = 0x5;
pub const F_SETLK: ::c_int = 0x6;
@@ -474,6 +465,7 @@ pub const PENDIN: ::tcflag_t = 0x4000;
pub const POLLWRBAND: ::c_short = 0x200;
pub const POLLWRNORM: ::c_short = 0x100;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+pub const RTLD_GLOBAL: ::c_int = 0x00100;
// These are typed unsigned to match sigaction
pub const SA_NOCLDSTOP: ::c_ulong = 0x1;
@@ -513,34 +505,7 @@ pub const SOCK_DGRAM: ::c_int = 0x2;
pub const SOCK_NONBLOCK: ::c_int = 0o0004000;
pub const SOCK_SEQPACKET: ::c_int = 0x5;
pub const SOCK_STREAM: ::c_int = 0x1;
-pub const SOL_SOCKET: ::c_int = 0x1;
-pub const SO_ACCEPTCONN: ::c_int = 0x1e;
-pub const SO_BINDTODEVICE: ::c_int = 0x19;
-pub const SO_BROADCAST: ::c_int = 0x6;
-pub const SO_BSDCOMPAT: ::c_int = 0xe;
-pub const SO_DOMAIN: ::c_int = 0x27;
-pub const SO_DONTROUTE: ::c_int = 0x5;
-pub const SO_ERROR: ::c_int = 0x4;
-pub const SO_KEEPALIVE: ::c_int = 0x9;
-pub const SO_LINGER: ::c_int = 0xd;
-pub const SO_MARK: ::c_int = 0x24;
-pub const SO_OOBINLINE: ::c_int = 0xa;
-pub const SO_PASSCRED: ::c_int = 0x10;
-pub const SO_PEERCRED: ::c_int = 0x11;
-pub const SO_PRIORITY: ::c_int = 0xc;
-pub const SO_PROTOCOL: ::c_int = 0x26;
-pub const SO_RCVBUF: ::c_int = 0x8;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_RCVLOWAT: ::c_int = 0x12;
-pub const SO_RCVTIMEO: ::c_int = 0x14;
-pub const SO_REUSEADDR: ::c_int = 0x2;
-pub const SO_RXQ_OVFL: ::c_int = 0x28;
-pub const SO_SNDBUF: ::c_int = 0x7;
-pub const SO_SNDBUFFORCE: ::c_int = 0x20;
-pub const SO_SNDLOWAT: ::c_int = 0x13;
-pub const SO_SNDTIMEO: ::c_int = 0x15;
-pub const SO_TIMESTAMP: ::c_int = 0x1d;
-pub const SO_TYPE: ::c_int = 0x3;
+
pub const TAB1: ::c_int = 0x800;
pub const TAB2: ::c_int = 0x1000;
pub const TAB3: ::c_int = 0x1800;
@@ -918,10 +883,11 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
-
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
-}
+pub const SYS_statx: ::c_int = 397;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_pidfd_getfd: ::c_long = 438;
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
index 6b34faeade347..7f9d3c03137ac 100644
--- a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
@@ -12,8 +12,8 @@ pub type blksize_t = i32;
pub type nlink_t = u32;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
-pub type rlim_t = ::c_ulong;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
@@ -265,8 +265,6 @@ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
-pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
-
pub const SYS_syscall: ::c_long = 4000 + 0;
pub const SYS_exit: ::c_long = 4000 + 1;
pub const SYS_fork: ::c_long = 4000 + 2;
@@ -625,6 +623,7 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362;
pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
pub const SYS_pkey_free: ::c_long = 4000 + 365;
+pub const SYS_clone3: ::c_long = 4000 + 435;
#[link(name = "util")]
extern "C" {
@@ -636,13 +635,10 @@ extern "C" {
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
- pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn glob64(
pattern: *const ::c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut glob64_t,
) -> ::c_int;
pub fn globfree64(pglob: *mut glob64_t);
diff --git a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
index 735eb851ef7d4..be6d2813d52fa 100644
--- a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
@@ -8,7 +8,6 @@ pub type fsfilcnt_t = ::c_ulong;
pub type ino_t = u64;
pub type nlink_t = u64;
pub type off_t = i64;
-pub type rlim_t = ::c_ulong;
pub type suseconds_t = i64;
pub type time_t = i64;
pub type wchar_t = i32;
@@ -193,15 +192,8 @@ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
-
pub const SYS_gettid: ::c_long = 5178; // Valid for n64
-#[link(name = "util")]
-extern "C" {
- pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
-}
-
cfg_if! {
if #[cfg(libc_align)] {
mod align;
diff --git a/src/unix/linux_like/linux/uclibc/mips/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mod.rs
index 26408ff82ab84..61684094fa9f8 100644
--- a/src/unix/linux_like/linux/uclibc/mips/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/mips/mod.rs
@@ -32,23 +32,12 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EFD_CLOEXEC: ::c_int = 0x80000;
-pub const BUFSIZ: ::c_uint = 4096;
pub const TMP_MAX: ::c_uint = 238328;
-pub const FOPEN_MAX: ::c_uint = 16;
-pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const _SC_2_C_VERSION: ::c_int = 96;
pub const O_ACCMODE: ::c_int = 3;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
-pub const NI_MAXHOST: ::socklen_t = 1025;
-
-pub const RLIMIT_NOFILE: ::c_int = 5;
-pub const RLIMIT_AS: ::c_int = 6;
-pub const RLIMIT_RSS: ::c_int = 7;
-pub const RLIMIT_NPROC: ::c_int = 8;
-pub const RLIMIT_MEMLOCK: ::c_int = 9;
-pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 256;
@@ -86,7 +75,6 @@ pub const EXFULL: ::c_int = 52;
pub const ENOANO: ::c_int = 53;
pub const EBADRQC: ::c_int = 54;
pub const EBADSLT: ::c_int = 55;
-pub const EDEADLOCK: ::c_int = 56;
pub const EMULTIHOP: ::c_int = 74;
pub const EOVERFLOW: ::c_int = 79;
pub const ENOTUNIQ: ::c_int = 80;
@@ -163,63 +151,6 @@ pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
pub const SOCK_SEQPACKET: ::c_int = 5;
-pub const SOL_SOCKET: ::c_int = 0xffff;
-
-pub const SO_REUSEADDR: ::c_int = 0x0004;
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
-pub const SO_DONTROUTE: ::c_int = 0x0010;
-pub const SO_BROADCAST: ::c_int = 0x0020;
-pub const SO_LINGER: ::c_int = 0x0080;
-pub const SO_OOBINLINE: ::c_int = 0x0100;
-pub const SO_REUSEPORT: ::c_int = 0x0200;
-pub const SO_TYPE: ::c_int = 0x1008;
-pub const SO_STYLE: ::c_int = SO_TYPE;
-pub const SO_ERROR: ::c_int = 0x1007;
-pub const SO_SNDBUF: ::c_int = 0x1001;
-pub const SO_RCVBUF: ::c_int = 0x1002;
-pub const SO_SNDLOWAT: ::c_int = 0x1003;
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
-pub const SO_SNDTIMEO: ::c_int = 0x1005;
-pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_ACCEPTCONN: ::c_int = 0x1009;
-pub const SO_PROTOCOL: ::c_int = 0x1028;
-pub const SO_DOMAIN: ::c_int = 0x1029;
-pub const SO_NO_CHECK: ::c_int = 11;
-pub const SO_PRIORITY: ::c_int = 12;
-pub const SO_BSDCOMPAT: ::c_int = 14;
-pub const SO_PASSCRED: ::c_int = 17;
-pub const SO_PEERCRED: ::c_int = 18;
-pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
-pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
-pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
-pub const SO_BINDTODEVICE: ::c_int = 25;
-pub const SO_ATTACH_FILTER: ::c_int = 26;
-pub const SO_DETACH_FILTER: ::c_int = 27;
-pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
-pub const SO_PEERNAME: ::c_int = 28;
-pub const SO_TIMESTAMP: ::c_int = 29;
-pub const SO_PEERSEC: ::c_int = 30;
-pub const SO_SNDBUFFORCE: ::c_int = 31;
-pub const SO_RCVBUFFORCE: ::c_int = 33;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const SO_TIMESTAMPNS: ::c_int = 35;
-pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
-pub const SO_MARK: ::c_int = 36;
-pub const SO_RXQ_OVFL: ::c_int = 40;
-pub const SO_WIFI_STATUS: ::c_int = 41;
-pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
-pub const SO_PEEK_OFF: ::c_int = 42;
-pub const SO_NOFCS: ::c_int = 43;
-pub const SO_LOCK_FILTER: ::c_int = 44;
-pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
-pub const SO_BUSY_POLL: ::c_int = 46;
-pub const SO_MAX_PACING_RATE: ::c_int = 47;
-pub const SO_BPF_EXTENSIONS: ::c_int = 48;
-
-pub const FIOCLEX: ::c_ulong = 0x6601;
-pub const FIONCLEX: ::c_ulong = 0x6602;
-pub const FIONBIO: ::c_ulong = 0x667e;
-
pub const SA_ONSTACK: ::c_uint = 0x08000000;
pub const SA_SIGINFO: ::c_uint = 0x00000008;
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
@@ -241,7 +172,6 @@ pub const SIGTSTP: ::c_int = 24;
pub const SIGURG: ::c_int = 21;
pub const SIGIO: ::c_int = 22;
pub const SIGSYS: ::c_int = 12;
-pub const SIGPOLL: ::c_int = 22;
pub const SIGPWR: ::c_int = 19;
pub const SIG_SETMASK: ::c_int = 3;
pub const SIG_BLOCK: ::c_int = 0x1;
@@ -268,47 +198,12 @@ pub const CPU_SETSIZE: ::c_int = 0x400;
pub const EFD_NONBLOCK: ::c_int = 0x80;
pub const F_GETLK: ::c_int = 14;
-pub const F_GETOWN: ::c_int = 23;
-pub const F_SETOWN: ::c_int = 24;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
pub const SFD_NONBLOCK: ::c_int = 0x80;
-pub const TCGETS: ::c_ulong = 0x540d;
-pub const TCSETS: ::c_ulong = 0x540e;
-pub const TCSETSW: ::c_ulong = 0x540f;
-pub const TCSETSF: ::c_ulong = 0x5410;
-pub const TCGETA: ::c_ulong = 0x5401;
-pub const TCSETA: ::c_ulong = 0x5402;
-pub const TCSETAW: ::c_ulong = 0x5403;
-pub const TCSETAF: ::c_ulong = 0x5404;
-pub const TCSBRK: ::c_ulong = 0x5405;
-pub const TCXONC: ::c_ulong = 0x5406;
-pub const TCFLSH: ::c_ulong = 0x5407;
-pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
-pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
-pub const TIOCINQ: ::c_ulong = 0x467f;
-pub const TIOCLINUX: ::c_ulong = 0x5483;
-pub const TIOCGSERIAL: ::c_ulong = 0x5484;
-pub const TIOCEXCL: ::c_ulong = 0x740d;
-pub const TIOCNXCL: ::c_ulong = 0x740e;
-pub const TIOCSCTTY: ::c_ulong = 0x5480;
-pub const TIOCGPGRP: ::c_ulong = 0x40047477;
-pub const TIOCSPGRP: ::c_ulong = 0x80047476;
-pub const TIOCOUTQ: ::c_ulong = 0x7472;
-pub const TIOCSTI: ::c_ulong = 0x5472;
-pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
-pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
-pub const TIOCMGET: ::c_ulong = 0x741d;
-pub const TIOCMBIS: ::c_ulong = 0x741b;
-pub const TIOCMBIC: ::c_ulong = 0x741c;
-pub const TIOCMSET: ::c_ulong = 0x741a;
-pub const FIONREAD: ::c_ulong = 0x467f;
-pub const TIOCCONS: ::c_ulong = 0x80047478;
-
pub const RTLD_GLOBAL: ::c_int = 0x4;
-pub const RTLD_NOLOAD: ::c_int = 0x8;
pub const SIGSTKSZ: ::size_t = 8192;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -368,8 +263,6 @@ pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
-pub const EXTA: ::speed_t = B19200;
-pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs
index cc5d5cdce9e74..4a01e0cd81c85 100644
--- a/src/unix/linux_like/linux/uclibc/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/mod.rs
@@ -2,6 +2,19 @@ pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type regoff_t = ::c_int;
+pub type rlim_t = ::c_ulong;
+pub type __rlimit_resource_t = ::c_ulong;
+pub type __priority_which_t = ::c_uint;
+
+cfg_if! {
+ if #[cfg(doc)] {
+ // Used in `linux::arch` to define ioctl constants.
+ pub(crate) type Ioctl = ::c_ulong;
+ } else {
+ #[doc(hidden)]
+ pub type Ioctl = ::c_ulong;
+ }
+}
s! {
pub struct statvfs { // Different than GNU!
@@ -34,6 +47,64 @@ s! {
__re_nsub: ::size_t,
__bitfield: u8,
}
+
+ pub struct rtentry {
+ pub rt_pad1: ::c_ulong,
+ pub rt_dst: ::sockaddr,
+ pub rt_gateway: ::sockaddr,
+ pub rt_genmask: ::sockaddr,
+ pub rt_flags: ::c_ushort,
+ pub rt_pad2: ::c_short,
+ pub rt_pad3: ::c_ulong,
+ pub rt_tos: ::c_uchar,
+ pub rt_class: ::c_uchar,
+ #[cfg(target_pointer_width = "64")]
+ pub rt_pad4: [::c_short; 3usize],
+ #[cfg(not(target_pointer_width = "64"))]
+ pub rt_pad4: ::c_short,
+ pub rt_metric: ::c_short,
+ pub rt_dev: *mut ::c_char,
+ pub rt_mtu: ::c_ulong,
+ pub rt_window: ::c_ulong,
+ pub rt_irtt: ::c_ushort,
+ }
+
+ pub struct __exit_status {
+ pub e_termination: ::c_short,
+ pub e_exit: ::c_short,
+ }
+
+ pub struct ptrace_peeksiginfo_args {
+ pub off: ::__u64,
+ pub flags: ::__u32,
+ pub nr: ::__s32,
+ }
+}
+
+impl siginfo_t {
+ pub unsafe fn si_addr(&self) -> *mut ::c_void {
+ #[repr(C)]
+ struct siginfo_sigfault {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ si_addr: *mut ::c_void,
+ }
+ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
+ }
+
+ pub unsafe fn si_value(&self) -> ::sigval {
+ #[repr(C)]
+ struct siginfo_si_value {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ _si_timerid: ::c_int,
+ _si_overrun: ::c_int,
+ si_value: ::sigval,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+ }
}
pub const MCL_CURRENT: ::c_int = 0x0001;
@@ -41,55 +112,12 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGEV_THREAD_ID: ::c_int = 4;
-pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
-pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
-pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
-pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
+pub const AF_VSOCK: ::c_int = 40;
+
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
-pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
-pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
-pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
-pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
-pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
-pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
-pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
-pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
-pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
-pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
-pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
-pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
-pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
-pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
-pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
-pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
-pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
-pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
-pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
-pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
-pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
-pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
-pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
-pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
-pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
-pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
-pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
-pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
-pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
-pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
-pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
-pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
-pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
-pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
-pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
-pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
-pub const SYSFS_MAGIC: ::c_long = 0x62656572;
-pub const TMPFS_MAGIC: ::c_long = 0x01021994;
-pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
-pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
-pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
-pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
pub const PTRACE_TRACEME: ::c_int = 0;
@@ -120,22 +148,10 @@ pub const PTRACE_SETREGSET: ::c_int = 0x4205;
pub const PTRACE_SEIZE: ::c_int = 0x4206;
pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
pub const PTRACE_LISTEN: ::c_int = 0x4208;
-pub const PTRACE_O_MASK: ::c_int = 0x000000ff;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
-pub const RLIMIT_CPU: ::c_int = 0;
-pub const RLIMIT_FSIZE: ::c_int = 1;
-pub const RLIMIT_DATA: ::c_int = 2;
-pub const RLIMIT_STACK: ::c_int = 3;
-pub const RLIMIT_CORE: ::c_int = 4;
-pub const RLIMIT_LOCKS: ::c_int = 10;
-pub const RLIMIT_SIGPENDING: ::c_int = 11;
-pub const RLIMIT_MSGQUEUE: ::c_int = 12;
-pub const RLIMIT_NICE: ::c_int = 13;
-pub const RLIMIT_RTPRIO: ::c_int = 14;
-
// These are different than GNU!
pub const LC_CTYPE: ::c_int = 0;
pub const LC_NUMERIC: ::c_int = 1;
@@ -147,8 +163,7 @@ pub const LC_ALL: ::c_int = 6;
// end different section
// MS_ flags for mount(2)
-pub const MS_RMT_MASK: ::c_ulong =
- ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::MS_I_VERSION;
+pub const MS_RMT_MASK: ::c_ulong = ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::MS_I_VERSION;
pub const ENOTSUP: ::c_int = EOPNOTSUPP;
@@ -220,9 +235,67 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const SOMAXCONN: ::c_int = 128;
+
pub const ST_RELATIME: ::c_ulong = 4096;
+pub const AF_NFC: ::c_int = PF_NFC;
+pub const BUFSIZ: ::c_int = 4096;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTA: ::c_uint = B19200;
+pub const EXTB: ::c_uint = B38400;
+pub const EXTPROC: ::tcflag_t = 0200000;
+pub const FAN_MARK_FILESYSTEM: ::c_int = 0x00000100;
+pub const FAN_MARK_INODE: ::c_int = 0x00000000;
+pub const FAN_MARK_MOUNT: ::c_int = 0x10;
+pub const FOPEN_MAX: ::c_int = 16;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_WRLCK: ::c_int = 1;
+pub const IPV6_MULTICAST_ALL: ::c_int = 29;
+pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30;
+pub const MAP_HUGE_SHIFT: ::c_int = 26;
+pub const MAP_HUGE_MASK: ::c_int = 0x3f;
+pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;
+pub const MINSIGSTKSZ: ::c_int = 2048;
+pub const MSG_COPY: ::c_int = 040000;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+pub const PACKET_MR_UNICAST: ::c_int = 3;
+pub const PF_NFC: ::c_int = 39;
+pub const PF_VSOCK: ::c_int = 40;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const PTRACE_EVENT_STOP: ::c_int = 128;
+pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+pub const RTLD_NOLOAD: ::c_int = 0x00004;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const SHM_EXEC: ::c_int = 0100000;
+pub const SIGPOLL: ::c_int = SIGIO;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+pub const UDP_GRO: ::c_int = 104;
+pub const UDP_SEGMENT: ::c_int = 103;
+pub const YESEXPR: ::c_int = ((5) << 8) | (0);
+
extern "C" {
+ pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
pub fn pthread_rwlockattr_getkind_np(
@@ -286,6 +359,21 @@ extern "C" {
iovcnt: ::c_int,
offset: ::off64_t,
) -> ::ssize_t;
+
+ pub fn sethostid(hostid: ::c_long) -> ::c_int;
+ pub fn fanotify_mark(
+ fd: ::c_int,
+ flags: ::c_uint,
+ mask: u64,
+ dirfd: ::c_int,
+ path: *const ::c_char,
+ ) -> ::c_int;
+ pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+ pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
+ pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
index 16ec0ef966473..c7cbafa16ecf3 100644
--- a/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
+++ b/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
@@ -46,3 +46,8 @@ pub struct pthread_attr_t {
// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but
// somewhere in the core libraries. uClibc wants 16k, but that's not enough.
pub const PTHREAD_STACK_MIN: usize = 65536;
+
+// Misc other constants required for building.
+pub const SIGIO: ::c_int = 29;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
index af42d0fb10b14..43ac79296b368 100644
--- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
@@ -11,7 +11,6 @@ pub type fsword_t = ::c_long;
pub type ino_t = ::c_ulong;
pub type nlink_t = ::c_uint;
pub type off_t = ::c_long;
-pub type rlim_t = c_ulong;
// [uClibc docs] Note stat64 has the same shape as stat for x86-64.
pub type stat64 = stat;
pub type suseconds_t = ::c_long;
@@ -21,6 +20,7 @@ pub type wchar_t = ::c_int;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
s! {
pub struct ipc_perm {
@@ -292,8 +292,13 @@ s_no_extra_traits! {
}
// constants
+pub const ENAMETOOLONG: ::c_int = 36; // File name too long
+pub const ENOTEMPTY: ::c_int = 39; // Directory not empty
+pub const ELOOP: ::c_int = 40; // Too many symbolic links encountered
pub const EADDRINUSE: ::c_int = 98; // Address already in use
pub const EADDRNOTAVAIL: ::c_int = 99; // Cannot assign requested address
+pub const ENETDOWN: ::c_int = 100; // Network is down
+pub const ENETUNREACH: ::c_int = 101; // Network is unreachable
pub const ECONNABORTED: ::c_int = 103; // Software caused connection abort
pub const ECONNREFUSED: ::c_int = 111; // Connection refused
pub const ECONNRESET: ::c_int = 104; // Connection reset by peer
@@ -301,6 +306,9 @@ pub const EDEADLK: ::c_int = 35; // Resource deadlock would occur
pub const ENOSYS: ::c_int = 38; // Function not implemented
pub const ENOTCONN: ::c_int = 107; // Transport endpoint is not connected
pub const ETIMEDOUT: ::c_int = 110; // connection timed out
+pub const ESTALE: ::c_int = 116; // Stale file handle
+pub const EHOSTUNREACH: ::c_int = 113; // No route to host
+pub const EDQUOT: ::c_int = 122; // Quota exceeded
pub const EOPNOTSUPP: ::c_int = 0x5f;
pub const ENODATA: ::c_int = 0x3d;
pub const O_APPEND: ::c_int = 02000;
@@ -309,24 +317,15 @@ pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_CREAT: ::c_int = 0100;
pub const O_DIRECTORY: ::c_int = 0200000;
pub const O_EXCL: ::c_int = 0200;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_NONBLOCK: ::c_int = 04000;
pub const O_TRUNC: ::c_int = 01000;
pub const NCCS: usize = 32;
pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-pub const SO_BROADCAST: ::c_int = 6;
pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams
pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h
-pub const SO_ERROR: ::c_int = 4;
-pub const SOL_SOCKET: ::c_int = 1;
-pub const SO_RCVTIMEO: ::c_int = 20;
-pub const SO_REUSEADDR: ::c_int = 2;
-pub const SO_SNDTIMEO: ::c_int = 21;
-pub const SO_TIMESTAMP: ::c_int = 0x1d;
-pub const SO_PEERSEC: ::c_int = 31;
-pub const SO_PASSSEC: ::c_int = 34;
-pub const RLIM_INFINITY: u64 = 0xffffffffffffffff;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index cd4247d3bdc45..e2e73b3300e2a 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -2,6 +2,7 @@ pub type sa_family_t = u16;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type clockid_t = ::c_int;
+pub type timer_t = *mut ::c_void;
pub type key_t = ::c_int;
pub type id_t = ::c_uint;
@@ -24,6 +25,12 @@ s! {
pub imr_interface: in_addr,
}
+ pub struct ip_mreqn {
+ pub imr_multiaddr: in_addr,
+ pub imr_address: in_addr,
+ pub imr_ifindex: ::c_int,
+ }
+
pub struct ip_mreq_source {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
@@ -224,11 +231,11 @@ s_no_extra_traits! {
pub struct sockaddr_storage {
pub ss_family: sa_family_t,
- __ss_align: ::size_t,
#[cfg(target_pointer_width = "32")]
- __ss_pad2: [u8; 128 - 2 * 4],
+ __ss_pad2: [u8; 128 - 2 - 4],
#[cfg(target_pointer_width = "64")]
- __ss_pad2: [u8; 128 - 2 * 8],
+ __ss_pad2: [u8; 128 - 2 - 8],
+ __ss_align: ::size_t,
}
pub struct utsname {
@@ -546,6 +553,9 @@ pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
+pub const XATTR_CREATE: ::c_int = 0x1;
+pub const XATTR_REPLACE: ::c_int = 0x2;
+
cfg_if! {
if #[cfg(not(target_env = "uclibc"))] {
pub const LC_CTYPE: ::c_int = 0;
@@ -602,6 +612,7 @@ pub const MS_RELATIME: ::c_ulong = 0x200000;
pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
pub const MS_I_VERSION: ::c_ulong = 0x800000;
pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
+pub const MS_LAZYTIME: ::c_ulong = 0x2000000;
pub const MS_ACTIVE: ::c_ulong = 0x40000000;
pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
@@ -748,8 +759,6 @@ pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
pub const PF_CAIF: ::c_int = AF_CAIF;
pub const PF_ALG: ::c_int = AF_ALG;
-pub const SOMAXCONN: ::c_int = 128;
-
pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
pub const MSG_DONTROUTE: ::c_int = 4;
@@ -872,6 +881,8 @@ pub const IPPROTO_MH: ::c_int = 135;
pub const IPPROTO_UDPLITE: ::c_int = 136;
/// raw IP packet
pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+pub const IPPROTO_MPLS: ::c_int = 137;
pub const MCAST_EXCLUDE: ::c_int = 0;
pub const MCAST_INCLUDE: ::c_int = 1;
@@ -908,6 +919,7 @@ pub const IPV6_JOIN_ANYCAST: ::c_int = 27;
pub const IPV6_LEAVE_ANYCAST: ::c_int = 28;
pub const IPV6_IPSEC_POLICY: ::c_int = 34;
pub const IPV6_XFRM_POLICY: ::c_int = 35;
+pub const IPV6_HDRINCL: ::c_int = 36;
pub const IPV6_RECVPKTINFO: ::c_int = 49;
pub const IPV6_PKTINFO: ::c_int = 50;
pub const IPV6_RECVHOPLIMIT: ::c_int = 51;
@@ -943,6 +955,8 @@ pub const IPV6_PMTUDISC_DONT: ::c_int = 0;
pub const IPV6_PMTUDISC_WANT: ::c_int = 1;
pub const IPV6_PMTUDISC_DO: ::c_int = 2;
pub const IPV6_PMTUDISC_PROBE: ::c_int = 3;
+pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4;
+pub const IPV6_PMTUDISC_OMIT: ::c_int = 5;
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
@@ -957,6 +971,43 @@ pub const TCP_WINDOW_CLAMP: ::c_int = 10;
pub const TCP_INFO: ::c_int = 11;
pub const TCP_QUICKACK: ::c_int = 12;
pub const TCP_CONGESTION: ::c_int = 13;
+pub const TCP_MD5SIG: ::c_int = 14;
+cfg_if! {
+ if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "musl")))] {
+ // WARN: deprecated
+ pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+ }
+}
+pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
+pub const TCP_THIN_DUPACK: ::c_int = 17;
+pub const TCP_USER_TIMEOUT: ::c_int = 18;
+pub const TCP_REPAIR: ::c_int = 19;
+pub const TCP_REPAIR_QUEUE: ::c_int = 20;
+pub const TCP_QUEUE_SEQ: ::c_int = 21;
+pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
+pub const TCP_FASTOPEN: ::c_int = 23;
+pub const TCP_TIMESTAMP: ::c_int = 24;
+pub const TCP_NOTSENT_LOWAT: ::c_int = 25;
+pub const TCP_CC_INFO: ::c_int = 26;
+pub const TCP_SAVE_SYN: ::c_int = 27;
+pub const TCP_SAVED_SYN: ::c_int = 28;
+cfg_if! {
+ if #[cfg(not(target_os = "emscripten"))] {
+ // NOTE: emscripten doesn't support these options yet.
+
+ pub const TCP_REPAIR_WINDOW: ::c_int = 29;
+ pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
+ pub const TCP_ULP: ::c_int = 31;
+ pub const TCP_MD5SIG_EXT: ::c_int = 32;
+ pub const TCP_FASTOPEN_KEY: ::c_int = 33;
+ pub const TCP_FASTOPEN_NO_COOKIE: ::c_int = 34;
+ pub const TCP_ZEROCOPY_RECEIVE: ::c_int = 35;
+ pub const TCP_INQ: ::c_int = 36;
+ pub const TCP_CM_INQ: ::c_int = TCP_INQ;
+ // NOTE: Some CI images doesn't have this option yet.
+ // pub const TCP_TX_DELAY: ::c_int = 37;
+ }
+}
pub const SO_DEBUG: ::c_int = 1;
@@ -981,21 +1032,27 @@ pub const FD_SETSIZE: usize = 1024;
pub const EPOLLIN: ::c_int = 0x1;
pub const EPOLLPRI: ::c_int = 0x2;
pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
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 EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const EPOLLET: ::c_int = 0x80000000;
pub const EPOLL_CTL_ADD: ::c_int = 1;
pub const EPOLL_CTL_MOD: ::c_int = 3;
pub const EPOLL_CTL_DEL: ::c_int = 2;
+pub const MNT_FORCE: ::c_int = 0x1;
pub const MNT_DETACH: ::c_int = 0x2;
pub const MNT_EXPIRE: ::c_int = 0x4;
+pub const UMOUNT_NOFOLLOW: ::c_int = 0x8;
pub const Q_GETFMT: ::c_int = 0x800004;
pub const Q_GETINFO: ::c_int = 0x800005;
@@ -1011,8 +1068,6 @@ pub const QIF_USAGE: u32 = 10;
pub const QIF_TIMES: u32 = 48;
pub const QIF_ALL: u32 = 63;
-pub const MNT_FORCE: ::c_int = 0x1;
-
pub const Q_SYNC: ::c_int = 0x800001;
pub const Q_QUOTAON: ::c_int = 0x800002;
pub const Q_QUOTAOFF: ::c_int = 0x800003;
@@ -1075,6 +1130,7 @@ pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
pub const CLONE_DETACHED: ::c_int = 0x400000;
pub const CLONE_UNTRACED: ::c_int = 0x800000;
pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
+pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
pub const CLONE_NEWUTS: ::c_int = 0x04000000;
pub const CLONE_NEWIPC: ::c_int = 0x08000000;
pub const CLONE_NEWUSER: ::c_int = 0x10000000;
@@ -1090,11 +1146,15 @@ pub const WCONTINUED: ::c_int = 0x00000008;
pub const WNOWAIT: ::c_int = 0x01000000;
// Options for personality(2).
+pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000;
pub const MMAP_PAGE_ZERO: ::c_int = 0x0100000;
+pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000;
+pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000;
pub const ADDR_LIMIT_32BIT: ::c_int = 0x0800000;
pub const SHORT_INODE: ::c_int = 0x1000000;
pub const WHOLE_SECONDS: ::c_int = 0x2000000;
pub const STICKY_TIMEOUTS: ::c_int = 0x4000000;
+pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000;
// Options set using PTRACE_SETOPTIONS.
pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
@@ -1105,6 +1165,9 @@ pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
+pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
+pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
+pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
// Wait extended result codes for the above trace options.
pub const PTRACE_EVENT_FORK: ::c_int = 1;
@@ -1148,6 +1211,15 @@ pub const PIPE_BUF: usize = 4096;
pub const SI_LOAD_SHIFT: ::c_uint = 16;
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+// Linux-specific si_code values for SIGBUS signal
+pub const BUS_MCEERR_AR: ::c_int = 4;
+pub const BUS_MCEERR_AO: ::c_int = 5;
+
+// si_code values for SIGCHLD signal
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
pub const CLD_DUMPED: ::c_int = 3;
@@ -1179,6 +1251,10 @@ pub const POLLHUP: ::c_short = 0x10;
pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLRDBAND: ::c_short = 0x080;
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
+pub const POLLRDHUP: ::c_short = 0x2000;
+#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
+pub const POLLRDHUP: ::c_short = 0x800;
pub const IPTOS_LOWDELAY: u8 = 0x10;
pub const IPTOS_THROUGHPUT: u8 = 0x08;
@@ -1265,6 +1341,7 @@ pub const ARPHRD_ADAPT: u16 = 264;
pub const ARPHRD_ROSE: u16 = 270;
pub const ARPHRD_X25: u16 = 271;
pub const ARPHRD_HWX25: u16 = 272;
+pub const ARPHRD_CAN: u16 = 280;
pub const ARPHRD_PPP: u16 = 512;
pub const ARPHRD_CISCO: u16 = 513;
pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
@@ -1302,20 +1379,116 @@ pub const ARPHRD_VOID: u16 = 0xFFFF;
pub const ARPHRD_NONE: u16 = 0xFFFE;
cfg_if! {
- if #[cfg(not(target_env = "uclibc"))] {
- pub const IPPROTO_BEETPH: ::c_int = 94;
- pub const IPPROTO_MPLS: ::c_int = 137;
- pub const IPV6_HDRINCL: ::c_int = 36;
- pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4;
- pub const IPV6_PMTUDISC_OMIT: ::c_int = 5;
- pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
- pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000;
- pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000;
- pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000;
- pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000;
- pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
- pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
- pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
+ if #[cfg(target_os = "emscripten")] {
+ // Emscripten does not define any `*_SUPER_MAGIC` constants.
+ } else if #[cfg(not(target_arch = "s390x"))] {
+ pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
+ pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
+ pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
+ pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
+ pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
+ pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
+ pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
+ pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
+ pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
+ pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
+ pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
+ pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
+ pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
+ pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
+ pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
+ pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
+ pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
+ pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
+ pub const FUSE_SUPER_MAGIC: ::c_long = 0x65735546;
+ pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
+ pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
+ pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
+ pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
+ pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
+ pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
+ pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
+ pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
+ pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
+ pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
+ pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
+ pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
+ pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
+ pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
+ pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
+ pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
+ pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
+ pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
+ pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
+ pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
+ pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
+ pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
+ pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
+ pub const SECURITYFS_MAGIC: ::c_long = 0x73636673;
+ pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c;
+ pub const SMACK_MAGIC: ::c_long = 0x43415d53;
+ pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
+ pub const SYSFS_MAGIC: ::c_long = 0x62656572;
+ pub const TMPFS_MAGIC: ::c_long = 0x01021994;
+ pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
+ pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
+ pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
+ pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
+ pub const NSFS_MAGIC: ::c_long = 0x6e736673;
+ } else if #[cfg(target_arch = "s390x")] {
+ pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
+ pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
+ pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
+ pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
+ pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
+ pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
+ pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
+ pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
+ pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
+ pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
+ pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
+ pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
+ pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
+ pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
+ pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+ pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+ pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+ pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
+ pub const FUSE_SUPER_MAGIC: ::c_uint = 0x65735546;
+ pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
+ pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
+ pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
+ pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
+ pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
+ pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
+ pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
+ pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
+ pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
+ pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
+ pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
+ pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
+ pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
+ pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
+ pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
+ pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
+ pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
+ pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
+ pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
+ pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
+ pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
+ pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
+ pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
+ pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673;
+ pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c;
+ pub const SMACK_MAGIC: ::c_uint = 0x43415d53;
+ pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
+ pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
+ pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
+ pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
+ pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
+ pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
+ pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
+ pub const NSFS_MAGIC: ::c_uint = 0x6e736673;
}
}
@@ -1354,7 +1527,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
@@ -1375,6 +1548,14 @@ f! {
}
safe_f! {
+ pub fn SIGRTMAX() -> ::c_int {
+ unsafe { __libc_current_sigrtmax() }
+ }
+
+ pub fn SIGRTMIN() -> ::c_int {
+ unsafe { __libc_current_sigrtmin() }
+ }
+
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0xff) == 0x7f
}
@@ -1434,39 +1615,35 @@ safe_f! {
pub {const} fn IPTOS_ECN(x: u8) -> u8 {
x & ::IPTOS_ECN_MASK
}
+
+ #[allow(ellipsis_inclusive_range_patterns)]
+ pub {const} fn KERNEL_VERSION(a: u32, b: u32, c: u32) -> u32 {
+ ((a << 16) + (b << 8)) + match c {
+ 0 ... 255 => c,
+ _ => 255,
+ }
+ }
}
extern "C" {
+ #[doc(hidden)]
+ pub fn __libc_current_sigrtmax() -> ::c_int;
+ #[doc(hidden)]
+ pub fn __libc_current_sigrtmin() -> ::c_int;
+
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
- pub fn mincore(
- addr: *mut ::c_void,
- len: ::size_t,
- vec: *mut ::c_uchar,
- ) -> ::c_int;
+ pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
- pub fn clock_settime(
- clk_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
- pub fn clock_getcpuclockid(
- pid: ::pid_t,
- clk_id: *mut ::clockid_t,
- ) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
- pub fn pthread_getattr_np(
- native: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
+ pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
@@ -1481,18 +1658,9 @@ extern "C" {
pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
- pub fn memrchr(
- cx: *const ::c_void,
- c: ::c_int,
- n: ::size_t,
- ) -> *mut ::c_void;
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
- pub fn posix_fadvise(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- advise: ::c_int,
- ) -> ::c_int;
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn posix_fadvise64(
fd: ::c_int,
offset: ::off64_t,
@@ -1508,11 +1676,7 @@ extern "C" {
) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
@@ -1534,18 +1698,8 @@ extern "C" {
offset: off64_t,
) -> *mut ::c_void;
pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
- pub fn openat64(
- fd: ::c_int,
- path: *const c_char,
- oflag: ::c_int,
- ...
- ) -> ::c_int;
- pub fn pread64(
- fd: ::c_int,
- buf: *mut ::c_void,
- count: ::size_t,
- offset: off64_t,
- ) -> ::ssize_t;
+ pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+ pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
pub fn pwrite64(
fd: ::c_int,
buf: *const ::c_void,
@@ -1575,10 +1729,7 @@ extern "C" {
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
- pub fn pthread_condattr_setpshared(
- attr: *mut pthread_condattr_t,
- pshared: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_mutexattr_setpshared(
attr: *mut pthread_mutexattr_t,
pshared: ::c_int,
@@ -1587,34 +1738,13 @@ extern "C" {
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
- pub fn pthread_rwlockattr_setpshared(
- attr: *mut pthread_rwlockattr_t,
- val: ::c_int,
- ) -> ::c_int;
- pub fn ptsname_r(
- fd: ::c_int,
- buf: *mut ::c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn clearenv() -> ::c_int;
- pub fn waitid(
- idtype: idtype_t,
- id: id_t,
- infop: *mut ::siginfo_t,
- options: ::c_int,
- ) -> ::c_int;
- pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
- pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
- pub fn getresuid(
- ruid: *mut ::uid_t,
- euid: *mut ::uid_t,
- suid: *mut ::uid_t,
- ) -> ::c_int;
- pub fn getresgid(
- rgid: *mut ::gid_t,
- egid: *mut ::gid_t,
- sgid: *mut ::gid_t,
- ) -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
+ pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+ pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
@@ -1644,33 +1774,13 @@ extern "C" {
) -> ::c_int;
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
- pub fn sendmsg(
- fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recvmsg(
- fd: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
}
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index b3c0b47141b45..826b835182a82 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -23,13 +23,24 @@ pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type pid_t = i32;
-pub type uid_t = u32;
-pub type gid_t = u32;
pub type in_addr_t = u32;
pub type in_port_t = u16;
pub type sighandler_t = ::size_t;
pub type cc_t = ::c_uchar;
+cfg_if! {
+ if #[cfg(any(target_os = "espidf", target_os = "horizon"))] {
+ pub type uid_t = ::c_ushort;
+ pub type gid_t = ::c_ushort;
+ } else if #[cfg(target_os = "nto")] {
+ pub type uid_t = i32;
+ pub type gid_t = i32;
+ } else {
+ pub type uid_t = u32;
+ pub type gid_t = u32;
+ }
+}
+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
impl ::Copy for DIR {}
@@ -201,25 +212,31 @@ pub const INT_MAX: c_int = 2147483647;
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;
-pub const DT_BLK: u8 = 6;
-pub const DT_REG: u8 = 8;
-pub const DT_LNK: u8 = 10;
-pub const DT_SOCK: u8 = 12;
-
+cfg_if! {
+ if #[cfg(not(target_os = "nto"))] {
+ pub const DT_UNKNOWN: u8 = 0;
+ pub const DT_FIFO: u8 = 1;
+ pub const DT_CHR: u8 = 2;
+ pub const DT_DIR: u8 = 4;
+ pub const DT_BLK: u8 = 6;
+ pub const DT_REG: u8 = 8;
+ pub const DT_LNK: u8 = 10;
+ pub const DT_SOCK: u8 = 12;
+ }
+}
cfg_if! {
if #[cfg(not(target_os = "redox"))] {
pub const FD_CLOEXEC: ::c_int = 0x1;
}
}
-pub const USRQUOTA: ::c_int = 0;
-pub const GRPQUOTA: ::c_int = 1;
-
+cfg_if! {
+ if #[cfg(not(target_os = "nto"))]
+ {
+ pub const USRQUOTA: ::c_int = 0;
+ pub const GRPQUOTA: ::c_int = 1;
+ }
+}
pub const SIGIOT: ::c_int = 6;
pub const S_ISUID: ::mode_t = 0x800;
@@ -273,9 +290,13 @@ cfg_if! {
pub const LOG_PRIMASK: ::c_int = 7;
pub const LOG_FACMASK: ::c_int = 0x3f8;
-pub const PRIO_MIN: ::c_int = -20;
-pub const PRIO_MAX: ::c_int = 20;
-
+cfg_if! {
+ if #[cfg(not(target_os = "nto"))]
+ {
+ pub const PRIO_MIN: ::c_int = -20;
+ pub const PRIO_MAX: ::c_int = 20;
+ }
+}
pub const IPPROTO_ICMP: ::c_int = 1;
pub const IPPROTO_ICMPV6: ::c_int = 58;
pub const IPPROTO_TCP: ::c_int = 6;
@@ -297,29 +318,31 @@ pub const ATF_PUBL: ::c_int = 0x08;
pub const ATF_USETRAILERS: ::c_int = 0x10;
cfg_if! {
- if #[cfg(target_os = "l4re")] {
- // required libraries for L4Re are linked externally, ATM
+ if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
+ // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(all(target_os = "linux",
any(target_env = "gnu", target_env = "uclibc"),
feature = "rustc-dep-of-std"))] {
- #[link(name = "util", kind = "static-nobundle",
+ #[link(name = "util", kind = "static", modifiers = "-bundle",
+ cfg(target_feature = "crt-static"))]
+ #[link(name = "rt", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "rt", kind = "static-nobundle",
+ #[link(name = "pthread", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "pthread", kind = "static-nobundle",
+ #[link(name = "m", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "m", kind = "static-nobundle",
+ #[link(name = "dl", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "dl", kind = "static-nobundle",
+ #[link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "c", kind = "static-nobundle",
+ #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "gcc_eh", kind = "static-nobundle",
+ #[link(name = "gcc", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
- #[link(name = "gcc", kind = "static-nobundle",
+ #[link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
#[link(name = "util", cfg(not(target_feature = "crt-static")))]
#[link(name = "rt", cfg(not(target_feature = "crt-static")))]
@@ -330,7 +353,7 @@ cfg_if! {
extern {}
} else if #[cfg(target_env = "musl")] {
#[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", kind = "static",
+ link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static"))))]
@@ -338,18 +361,22 @@ cfg_if! {
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
- } else if #[cfg(all(target_os = "netbsd",
- feature = "rustc-dep-of-std",
- target_vendor = "rumprun"))] {
- // 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.
- #[link(name = "m")]
+ } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
+ #[link(name = "c", kind = "static", modifiers = "-bundle",
+ cfg(target_feature = "crt-static"))]
+ #[link(name = "m", kind = "static", modifiers = "-bundle",
+ cfg(target_feature = "crt-static"))]
+ #[link(name = "m", cfg(not(target_feature = "crt-static")))]
+ #[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
+ target_os = "tvos",
+ target_os = "watchos",
target_os = "android",
- target_os = "openbsd"))] {
+ target_os = "openbsd",
+ target_os = "nto",
+ ))] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
@@ -372,7 +399,7 @@ cfg_if! {
extern {}
} else if #[cfg(target_os = "redox")] {
#[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", kind = "static-nobundle",
+ link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static"))))]
@@ -422,18 +449,14 @@ extern "C" {
base: *mut c_void,
num: size_t,
size: size_t,
- compar: ::Option<
- unsafe extern "C" fn(*const c_void, *const c_void) -> c_int,
- >,
+ compar: ::Option c_int>,
);
pub fn bsearch(
key: *const c_void,
base: *const c_void,
num: size_t,
size: size_t,
- compar: ::Option<
- unsafe extern "C" fn(*const c_void, *const c_void) -> c_int,
- >,
+ compar: ::Option c_int>,
) -> *mut c_void;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -444,38 +467,19 @@ extern "C" {
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 fmemopen(
- buf: *mut c_void,
- size: size_t,
- mode: *const c_char,
- ) -> *mut FILE;
- pub fn open_memstream(
- ptr: *mut *mut c_char,
- sizeloc: *mut size_t,
- ) -> *mut FILE;
+ 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 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 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"),
@@ -484,22 +488,12 @@ extern "C" {
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;
+ 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 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);
@@ -511,22 +505,20 @@ extern "C" {
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn clearerr(stream: *mut FILE);
pub fn perror(s: *const c_char);
+ pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
+ pub fn atol(s: *const c_char) -> c_long;
+ pub fn atoll(s: *const c_char) -> c_longlong;
#[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 strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
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;
@@ -534,7 +526,6 @@ extern "C" {
pub fn abort() -> !;
pub fn exit(status: c_int) -> !;
pub fn _exit(status: c_int) -> !;
- pub fn atexit(cb: extern "C" fn()) -> c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "system$UNIX2003"
@@ -543,17 +534,10 @@ extern "C" {
pub fn getenv(s: *const c_char) -> *mut c_char;
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 strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+ pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *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 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;
@@ -566,11 +550,7 @@ extern "C" {
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 strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
- pub fn strncasecmp(
- s1: *const c_char,
- s2: *const c_char,
- n: size_t,
- ) -> c_int;
+ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
#[cfg_attr(
@@ -579,28 +559,17 @@ extern "C" {
)]
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 strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char;
pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
pub fn strsignal(sig: c_int) -> *mut c_char;
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 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 wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
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 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;
}
@@ -610,28 +579,15 @@ extern "C" {
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")]
pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
- pub fn fprintf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
- pub fn snprintf(
- s: *mut ::c_char,
- n: ::size_t,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
#[cfg_attr(
all(target_os = "linux", not(target_env = "uclibc")),
link_name = "__isoc99_fscanf"
)]
- pub fn fscanf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
#[cfg_attr(
all(target_os = "linux", not(target_env = "uclibc")),
link_name = "__isoc99_scanf"
@@ -641,8 +597,7 @@ extern "C" {
all(target_os = "linux", not(target_env = "uclibc")),
link_name = "__isoc99_sscanf"
)]
- pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...)
- -> ::c_int;
+ pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
@@ -653,6 +608,7 @@ extern "C" {
)))]
#[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
#[cfg(not(all(
libc_cfg_target_vendor,
@@ -664,15 +620,13 @@ extern "C" {
link_name = "connect$UNIX2003"
)]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_connect")]
- pub fn connect(
- socket: ::c_int,
- address: *const sockaddr,
- len: socklen_t,
- ) -> ::c_int;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")]
+ pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "listen$UNIX2003"
)]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")]
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
#[cfg(not(all(
libc_cfg_target_vendor,
@@ -683,11 +637,8 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "accept$UNIX2003"
)]
- pub fn accept(
- socket: ::c_int,
- address: *mut sockaddr,
- address_len: *mut socklen_t,
- ) -> ::c_int;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")]
+ pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
#[cfg(not(all(
libc_cfg_target_vendor,
target_arch = "powerpc",
@@ -697,6 +648,7 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "getpeername$UNIX2003"
)]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")]
pub fn getpeername(
socket: ::c_int,
address: *mut sockaddr,
@@ -711,11 +663,13 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "getsockname$UNIX2003"
)]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")]
pub fn getsockname(
socket: ::c_int,
address: *mut sockaddr,
address_len: *mut socklen_t,
) -> ::c_int;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")]
pub fn setsockopt(
socket: ::c_int,
level: ::c_int,
@@ -744,6 +698,7 @@ extern "C" {
link_name = "sendto$UNIX2003"
)]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_sendto")]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")]
pub fn sendto(
socket: ::c_int,
buf: *const ::c_void,
@@ -752,6 +707,7 @@ extern "C" {
addr: *const sockaddr,
addrlen: socklen_t,
) -> ::ssize_t;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")]
pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
#[cfg_attr(
@@ -895,11 +851,7 @@ extern "C" {
newdirfd: ::c_int,
linkpath: *const ::c_char,
) -> ::c_int;
- pub fn unlinkat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
pub fn alarm(seconds: ::c_uint) -> ::c_uint;
@@ -923,16 +875,8 @@ extern "C" {
pub fn dup(fd: ::c_int) -> ::c_int;
pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
- pub fn execle(
- path: *const ::c_char,
- arg0: *const ::c_char,
- ...
- ) -> ::c_int;
- pub fn execlp(
- file: *const ::c_char,
- arg0: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+ pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
pub fn execve(
prog: *const c_char,
@@ -953,11 +897,7 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "getopt$UNIX2003"
)]
- pub fn getopt(
- argc: ::c_int,
- argv: *const *mut c_char,
- optstr: *const c_char,
- ) -> ::c_int;
+ pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
pub fn getpgid(pid: pid_t) -> pid_t;
pub fn getpgrp() -> pid_t;
pub fn getpid() -> pid_t;
@@ -968,17 +908,12 @@ extern "C" {
pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pipe(fds: *mut ::c_int) -> ::c_int;
- pub fn posix_memalign(
- memptr: *mut *mut ::c_void,
- align: ::size_t,
- size: ::size_t,
- ) -> ::c_int;
+ pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "read$UNIX2003"
)]
- pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
- -> ::ssize_t;
+ pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
pub fn rmdir(path: *const c_char) -> ::c_int;
pub fn seteuid(uid: uid_t) -> ::c_int;
pub fn setegid(gid: gid_t) -> ::c_int;
@@ -986,6 +921,8 @@ extern "C" {
pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
pub fn setsid() -> pid_t;
pub fn setuid(uid: uid_t) -> ::c_int;
+ pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int;
+ pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sleep$UNIX2003"
@@ -1005,11 +942,7 @@ extern "C" {
link_name = "ttyname_r$UNIX2003"
)]
#[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
- pub fn ttyname_r(
- fd: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn unlink(c: *const c_char) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -1020,40 +953,22 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "waitpid$UNIX2003"
)]
- pub fn waitpid(
- pid: pid_t,
- status: *mut ::c_int,
- options: ::c_int,
- ) -> pid_t;
+ pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "write$UNIX2003"
)]
- pub fn write(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- ) -> ::ssize_t;
+ pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pread$UNIX2003"
)]
- pub fn pread(
- fd: ::c_int,
- buf: *mut ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
+ pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pwrite$UNIX2003"
)]
- pub fn pwrite(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
+ pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pub fn umask(mask: mode_t) -> mode_t;
#[cfg_attr(target_os = "netbsd", link_name = "__utime50")]
@@ -1094,10 +1009,7 @@ extern "C" {
pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
- pub fn if_indextoname(
- ifindex: ::c_uint,
- ifname: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
@@ -1120,11 +1032,7 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "setenv$UNIX2003"
)]
- pub fn setenv(
- name: *const c_char,
- val: *const c_char,
- overwrite: ::c_int,
- ) -> ::c_int;
+ pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "unsetenv$UNIX2003"
@@ -1142,13 +1050,15 @@ extern "C" {
pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
#[cfg_attr(
- any(target_os = "macos", target_os = "ios"),
+ any(
+ target_os = "macos",
+ target_os = "ios",
+ target_os = "tvos",
+ target_os = "watchos"
+ ),
link_name = "realpath$DARWIN_EXTSN"
)]
- pub fn realpath(
- pathname: *const ::c_char,
- resolved: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
@@ -1160,21 +1070,12 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_join$UNIX2003"
)]
- pub fn pthread_join(
- native: ::pthread_t,
- value: *mut *mut ::c_void,
- ) -> ::c_int;
+ pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
pub fn pthread_exit(value: *mut ::c_void) -> !;
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_destroy(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_attr_setdetachstate(
- attr: *mut ::pthread_attr_t,
- state: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
+ pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")]
pub fn sched_yield() -> ::c_int;
@@ -1184,10 +1085,7 @@ extern "C" {
) -> ::c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
- pub fn pthread_setspecific(
- key: pthread_key_t,
- value: *const ::c_void,
- ) -> ::c_int;
+ pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
pub fn pthread_mutex_init(
lock: *mut pthread_mutex_t,
attr: *const pthread_mutexattr_t,
@@ -1202,30 +1100,20 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_mutexattr_destroy$UNIX2003"
)]
- pub fn pthread_mutexattr_destroy(
- attr: *mut pthread_mutexattr_t,
- ) -> ::c_int;
- pub fn pthread_mutexattr_settype(
- attr: *mut pthread_mutexattr_t,
- _type: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
+ pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cond_init$UNIX2003"
)]
- pub fn pthread_cond_init(
- cond: *mut pthread_cond_t,
- attr: *const pthread_condattr_t,
- ) -> ::c_int;
+ pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
+ -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cond_wait$UNIX2003"
)]
- pub fn pthread_cond_wait(
- cond: *mut pthread_cond_t,
- lock: *mut pthread_mutex_t,
- ) -> ::c_int;
+ pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cond_timedwait$UNIX2003"
@@ -1278,13 +1166,11 @@ extern "C" {
link_name = "pthread_rwlock_unlock$UNIX2003"
)]
pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
- pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t)
- -> ::c_int;
- pub fn pthread_rwlockattr_destroy(
- attr: *mut pthread_rwlockattr_t,
- ) -> ::c_int;
+ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+ pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
#[cfg_attr(target_os = "illumos", link_name = "__xnet_getsockopt")]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")]
pub fn getsockopt(
sockfd: ::c_int,
level: ::c_int,
@@ -1293,24 +1179,12 @@ extern "C" {
optlen: *mut ::socklen_t,
) -> ::c_int;
pub fn raise(signum: ::c_int) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
- pub fn sigaction(
- signum: ::c_int,
- act: *const sigaction,
- oldact: *mut sigaction,
- ) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
- pub fn utimes(
- filename: *const ::c_char,
- times: *const ::timeval,
- ) -> ::c_int;
+ pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
pub fn dlerror() -> *mut ::c_char;
- pub fn dlsym(
- handle: *mut ::c_void,
- symbol: *const ::c_char,
- ) -> *mut ::c_void;
+ pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
@@ -1320,6 +1194,7 @@ extern "C" {
target_vendor = "nintendo"
)))]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")]
pub fn getaddrinfo(
node: *const c_char,
service: *const c_char,
@@ -1331,7 +1206,9 @@ extern "C" {
target_arch = "powerpc",
target_vendor = "nintendo"
)))]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")]
pub fn freeaddrinfo(res: *mut addrinfo);
+ pub fn hstrerror(errcode: ::c_int) -> *const ::c_char;
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
#[cfg_attr(
any(
@@ -1343,7 +1220,12 @@ extern "C" {
link_name = "__res_init"
)]
#[cfg_attr(
- any(target_os = "macos", target_os = "ios"),
+ any(
+ target_os = "macos",
+ target_os = "ios",
+ target_os = "tvos",
+ target_os = "watchos"
+ ),
link_name = "res_9_init"
)]
pub fn res_init() -> ::c_int;
@@ -1390,21 +1272,11 @@ extern "C" {
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "mknod@FBSD_1.0"
)]
- pub fn mknod(
- pathname: *const ::c_char,
- mode: ::mode_t,
- dev: ::dev_t,
- ) -> ::c_int;
+ pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn endservent();
- pub fn getservbyname(
- name: *const ::c_char,
- proto: *const ::c_char,
- ) -> *mut servent;
- pub fn getservbyport(
- port: ::c_int,
- proto: *const ::c_char,
- ) -> *mut servent;
+ pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
+ pub fn getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent;
pub fn getservent() -> *mut servent;
pub fn setservent(stayopen: ::c_int);
pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
@@ -1419,22 +1291,14 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "send$UNIX2003"
)]
- pub fn send(
- socket: ::c_int,
- buf: *const ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_send")]
+ pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recv$UNIX2003"
)]
- pub fn recv(
- socket: ::c_int,
- buf: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")]
+ pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "putenv$UNIX2003"
@@ -1457,16 +1321,13 @@ extern "C" {
#[cfg_attr(target_os = "netbsd", link_name = "__select50")]
pub fn select(
nfds: ::c_int,
- readfs: *mut fd_set,
+ readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *mut timeval,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")]
- pub fn setlocale(
- category: ::c_int,
- locale: *const ::c_char,
- ) -> *mut ::c_char;
+ pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
pub fn localeconv() -> *mut lconv;
#[cfg_attr(
@@ -1479,12 +1340,6 @@ extern "C" {
pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
- pub fn readlink(
- path: *const c_char,
- buf: *mut c_char,
- bufsz: ::size_t,
- ) -> ::ssize_t;
-
#[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
@@ -1497,11 +1352,7 @@ extern "C" {
pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")]
- pub fn sigprocmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
@@ -1509,28 +1360,7 @@ extern "C" {
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
- #[cfg_attr(
- all(target_os = "macos", target_arch = "x86_64"),
- link_name = "pselect$1050"
- )]
- #[cfg_attr(
- all(target_os = "macos", target_arch = "x86"),
- link_name = "pselect$UNIX2003"
- )]
- #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
- pub fn pselect(
- nfds: ::c_int,
- readfs: *mut fd_set,
- writefds: *mut fd_set,
- errorfds: *mut fd_set,
- timeout: *const timespec,
- sigmask: *const sigset_t,
- ) -> ::c_int;
- pub fn fseeko(
- stream: *mut ::FILE,
- offset: ::off_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -1542,11 +1372,7 @@ extern "C" {
pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
- pub fn tcsetattr(
- fd: ::c_int,
- optional_actions: ::c_int,
- termios: *const ::termios,
- ) -> ::c_int;
+ pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
@@ -1573,17 +1399,25 @@ extern "C" {
pub fn unlockpt(fd: ::c_int) -> ::c_int;
pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
- pub fn getline(
- lineptr: *mut *mut c_char,
- n: *mut size_t,
- stream: *mut FILE,
- ) -> ssize_t;
+ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int;
+
+}
+cfg_if! {
+ if #[cfg(not(any(target_os = "emscripten",
+ target_os = "android",
+ target_os = "haiku",
+ target_os = "nto")))] {
+ extern "C" {
+ pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
+ pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+ }
+ }
}
cfg_if! {
- if #[cfg(not(target_env = "uclibc"))] {
+ if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
extern "C" {
pub fn open_wmemstream(
ptr: *mut *mut wchar_t,
@@ -1602,12 +1436,8 @@ cfg_if! {
link_name = "pause$UNIX2003")]
pub fn pause() -> ::c_int;
- pub fn readlinkat(dirfd: ::c_int,
- pathname: *const ::c_char,
- buf: *mut ::c_char,
- bufsiz: ::size_t) -> ::ssize_t;
pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::mode_t) -> ::c_int;
+ mode: ::mode_t) -> ::c_int;
pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
flags: ::c_int, ...) -> ::c_int;
@@ -1638,7 +1468,64 @@ cfg_if! {
}
cfg_if! {
- if #[cfg(not(any(target_os = "solaris", target_os = "illumos")))] {
+ if #[cfg(target_os = "nto")] {
+ extern {
+ pub fn readlinkat(dirfd: ::c_int,
+ pathname: *const ::c_char,
+ buf: *mut ::c_char,
+ bufsiz: ::size_t) -> ::c_int;
+ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::c_int;
+ pub fn pselect(
+ nfds: ::c_int,
+ readfds: *mut fd_set,
+ writefds: *mut fd_set,
+ errorfds: *mut fd_set,
+ timeout: *mut timespec,
+ sigmask: *const sigset_t,
+ ) -> ::c_int;
+ }
+ } else {
+ extern {
+ pub fn readlinkat(dirfd: ::c_int,
+ pathname: *const ::c_char,
+ buf: *mut ::c_char,
+ bufsiz: ::size_t) -> ::ssize_t;
+ pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
+ pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
+ pub fn atexit(cb: extern "C" fn()) -> c_int;
+ #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
+ pub fn sigaction(
+ signum: ::c_int,
+ act: *const sigaction,
+ oldact: *mut sigaction
+ ) -> ::c_int;
+ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86_64"),
+ link_name = "pselect$1050"
+ )]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "pselect$UNIX2003"
+ )]
+ #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
+ pub fn pselect(
+ nfds: ::c_int,
+ readfds: *mut fd_set,
+ writefds: *mut fd_set,
+ errorfds: *mut fd_set,
+ timeout: *const timespec,
+ sigmask: *const sigset_t,
+ ) -> ::c_int;
+ }
+ }
+}
+
+cfg_if! {
+ if #[cfg(not(any(target_os = "solaris",
+ target_os = "illumos",
+ target_os = "nto",
+ )))] {
extern {
pub fn cfmakeraw(termios: *mut ::termios);
pub fn cfsetspeed(termios: *mut ::termios,
@@ -1659,6 +1546,8 @@ cfg_if! {
pub use self::linux_like::*;
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
+ target_os = "tvos",
+ target_os = "watchos",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
@@ -1678,6 +1567,9 @@ cfg_if! {
} else if #[cfg(target_os = "redox")] {
mod redox;
pub use self::redox::*;
+ } else if #[cfg(target_os = "nto")] {
+ mod nto;
+ pub use self::nto::*;
} else {
// Unknown target_os
}
diff --git a/src/unix/newlib/aarch64/mod.rs b/src/unix/newlib/aarch64/mod.rs
index 71aa894922bbe..d686b3692d86d 100644
--- a/src/unix/newlib/aarch64/mod.rs
+++ b/src/unix/newlib/aarch64/mod.rs
@@ -50,3 +50,5 @@ pub const MSG_DONTROUTE: ::c_int = 0;
pub const MSG_WAITALL: ::c_int = 0;
pub const MSG_MORE: ::c_int = 0;
pub const MSG_NOSIGNAL: ::c_int = 0;
+
+pub use crate::unix::newlib::generic::{sigset_t, stat};
diff --git a/src/unix/newlib/arm/mod.rs b/src/unix/newlib/arm/mod.rs
index 78bea276533d5..f644349cb997f 100644
--- a/src/unix/newlib/arm/mod.rs
+++ b/src/unix/newlib/arm/mod.rs
@@ -52,3 +52,5 @@ pub const MSG_DONTROUTE: ::c_int = 0;
pub const MSG_WAITALL: ::c_int = 0;
pub const MSG_MORE: ::c_int = 0;
pub const MSG_NOSIGNAL: ::c_int = 0;
+
+pub use crate::unix::newlib::generic::{sigset_t, stat};
diff --git a/src/unix/newlib/xtensa/mod.rs b/src/unix/newlib/espidf/mod.rs
similarity index 73%
rename from src/unix/newlib/xtensa/mod.rs
rename to src/unix/newlib/espidf/mod.rs
index bc31506b5d574..804cd66454f46 100644
--- a/src/unix/newlib/xtensa/mod.rs
+++ b/src/unix/newlib/espidf/mod.rs
@@ -83,24 +83,28 @@ pub const MSG_DONTROUTE: ::c_int = 0x4;
pub const MSG_WAITALL: ::c_int = 0x02;
pub const MSG_MORE: ::c_int = 0x10;
pub const MSG_NOSIGNAL: ::c_int = 0x20;
+pub const MSG_TRUNC: ::c_int = 0x04;
+pub const MSG_CTRUNC: ::c_int = 0x08;
+pub const MSG_EOR: ::c_int = 0x08;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 768;
extern "C" {
- pub fn sendmsg(
- s: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recvmsg(
- s: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
-
- pub fn writev(s: ::c_int, iov: *const ::iovec, iovcnt: ::c_int)
- -> ::c_int;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
+
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+ #[link_name = "lwip_sendmsg"]
+ pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+ #[link_name = "lwip_recvmsg"]
+ pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+ pub fn eventfd(initval: ::c_uint, flags: ::c_int) -> ::c_int;
}
+
+pub use crate::unix::newlib::generic::{sigset_t, stat};
diff --git a/src/unix/newlib/generic.rs b/src/unix/newlib/generic.rs
new file mode 100644
index 0000000000000..db7797f17c297
--- /dev/null
+++ b/src/unix/newlib/generic.rs
@@ -0,0 +1,27 @@
+//! Common types used by most newlib platforms
+
+s! {
+ pub struct sigset_t {
+ __val: [::c_ulong; 16],
+ }
+
+ 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,
+ pub st_size: ::off_t,
+ pub st_atime: ::time_t,
+ pub st_spare1: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_spare2: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_spare3: ::c_long,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_spare4: [::c_long; 2usize],
+ }
+}
diff --git a/src/unix/newlib/horizon/mod.rs b/src/unix/newlib/horizon/mod.rs
new file mode 100644
index 0000000000000..bcb93ad9df4f1
--- /dev/null
+++ b/src/unix/newlib/horizon/mod.rs
@@ -0,0 +1,268 @@
+//! ARMv6K Nintendo 3DS C Newlib definitions
+
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub type wchar_t = ::c_uint;
+
+pub type u_register_t = ::c_uint;
+pub type u_char = ::c_uchar;
+pub type u_short = ::c_ushort;
+pub type u_int = ::c_uint;
+pub type u_long = c_ulong;
+pub type ushort = ::c_ushort;
+pub type uint = ::c_uint;
+pub type ulong = c_ulong;
+pub type clock_t = c_ulong;
+pub type daddr_t = c_long;
+pub type caddr_t = *mut c_char;
+pub type sbintime_t = ::c_longlong;
+pub type sigset_t = ::c_ulong;
+
+s! {
+ pub struct sockaddr {
+ pub sa_family: ::sa_family_t,
+ pub sa_data: [::c_char; 26usize],
+ }
+
+ pub struct sockaddr_storage {
+ pub ss_family: ::sa_family_t,
+ pub __ss_padding: [::c_char; 26usize],
+ }
+
+ 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_un {
+ pub sun_len: ::c_uchar,
+ pub sun_family: ::sa_family_t,
+ pub sun_path: [::c_char; 104usize],
+ }
+
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ }
+
+ 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,
+ pub st_size: ::off_t,
+ pub st_atim: ::timespec,
+ pub st_mtim: ::timespec,
+ pub st_ctim: ::timespec,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_spare4: [::c_long; 2usize],
+ }
+}
+
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_SIGNAL: ::c_int = 2;
+pub const SIGEV_THREAD: ::c_int = 3;
+pub const SA_NOCLDSTOP: ::c_int = 1;
+pub const MINSIGSTKSZ: ::c_int = 2048;
+pub const SIGSTKSZ: ::c_int = 8192;
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 0;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGURG: ::c_int = 16;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGCLD: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGIO: ::c_int = 23;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGLOST: ::c_int = 29;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const NSIG: ::c_int = 32;
+pub const CLOCK_ENABLED: ::c_uint = 1;
+pub const CLOCK_DISABLED: ::c_uint = 0;
+pub const CLOCK_ALLOWED: ::c_uint = 1;
+pub const CLOCK_DISALLOWED: ::c_uint = 0;
+pub const TIMER_ABSTIME: ::c_uint = 4;
+pub const SOL_SOCKET: ::c_int = 65535;
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTWAIT: ::c_int = 4;
+pub const MSG_DONTROUTE: ::c_int = 0;
+pub const MSG_WAITALL: ::c_int = 0;
+pub const MSG_MORE: ::c_int = 0;
+pub const MSG_NOSIGNAL: ::c_int = 0;
+pub const SOL_CONFIG: ::c_uint = 65534;
+
+pub const _SC_PAGESIZE: ::c_int = 8;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 4096;
+pub const WNOHANG: ::c_int = 1;
+
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLPRI: ::c_short = 0x0002;
+pub const POLLOUT: ::c_short = 0x0004;
+pub const POLLRDNORM: ::c_short = 0x0040;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0080;
+pub const POLLWRBAND: ::c_short = 0x0100;
+pub const POLLERR: ::c_short = 0x0008;
+pub const POLLHUP: ::c_short = 0x0010;
+pub const POLLNVAL: ::c_short = 0x0020;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_BADHINTS: ::c_int = 12;
+pub const EAI_PROTOCOL: ::c_int = 13;
+pub const EAI_OVERFLOW: ::c_int = 14;
+pub const EAI_MAX: ::c_int = 15;
+
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET6: ::c_int = 23;
+
+pub const FIONBIO: ::c_ulong = 1;
+
+pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;
+
+// For pthread get/setschedparam
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
+// For getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+
+// Horizon OS works doesn't or can't hold any of this information
+safe_f! {
+ pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool {
+ false
+ }
+
+ pub {const} fn WSTOPSIG(_status: ::c_int) -> ::c_int {
+ 0
+ }
+
+ pub {const} fn WIFCONTINUED(_status: ::c_int) -> bool {
+ true
+ }
+
+ pub {const} fn WIFSIGNALED(_status: ::c_int) -> bool {
+ false
+ }
+
+ pub {const} fn WTERMSIG(_status: ::c_int) -> ::c_int {
+ 0
+ }
+
+ pub {const} fn WIFEXITED(_status: ::c_int) -> bool {
+ true
+ }
+
+ pub {const} fn WEXITSTATUS(_status: ::c_int) -> ::c_int {
+ 0
+ }
+
+ pub {const} fn WCOREDUMP(_status: ::c_int) -> bool {
+ false
+ }
+}
+
+extern "C" {
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
+
+ pub fn pthread_attr_getschedparam(
+ attr: *const ::pthread_attr_t,
+ param: *mut sched_param,
+ ) -> ::c_int;
+
+ pub fn pthread_attr_setschedparam(
+ attr: *mut ::pthread_attr_t,
+ param: *const sched_param,
+ ) -> ::c_int;
+
+ pub fn pthread_attr_getprocessorid_np(
+ attr: *const ::pthread_attr_t,
+ processor_id: *mut ::c_int,
+ ) -> ::c_int;
+
+ pub fn pthread_attr_setprocessorid_np(
+ attr: *mut ::pthread_attr_t,
+ processor_id: ::c_int,
+ ) -> ::c_int;
+
+ pub fn pthread_getschedparam(
+ native: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut ::sched_param,
+ ) -> ::c_int;
+
+ pub fn pthread_setschedparam(
+ native: ::pthread_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+
+ pub fn pthread_condattr_getclock(
+ attr: *const ::pthread_condattr_t,
+ clock_id: *mut ::clockid_t,
+ ) -> ::c_int;
+
+ pub fn pthread_condattr_setclock(
+ attr: *mut ::pthread_condattr_t,
+ clock_id: ::clockid_t,
+ ) -> ::c_int;
+
+ pub fn pthread_getprocessorid_np() -> ::c_int;
+
+ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+ pub fn gethostid() -> ::c_long;
+}
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index 270dd7b92f839..3875f1cb4e9d3 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -1,28 +1,53 @@
pub type blkcnt_t = i32;
pub type blksize_t = i32;
pub type clockid_t = ::c_ulong;
-pub type dev_t = u32;
+
+cfg_if! {
+ if #[cfg(target_os = "espidf")] {
+ pub type dev_t = ::c_short;
+ pub type ino_t = ::c_ushort;
+ pub type off_t = ::c_long;
+ } else {
+ pub type dev_t = u32;
+ pub type ino_t = u32;
+ pub type off_t = i64;
+ }
+}
+
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u32;
pub type id_t = u32;
-pub type ino_t = u32;
pub type key_t = ::c_int;
pub type loff_t = ::c_longlong;
pub type mode_t = ::c_uint;
pub type nfds_t = u32;
pub type nlink_t = ::c_ushort;
-pub type off_t = i64;
pub type pthread_t = ::c_ulong;
pub type pthread_key_t = ::c_uint;
pub type rlim_t = u32;
-pub type sa_family_t = u8;
+
+cfg_if! {
+ if #[cfg(target_os = "horizon")] {
+ pub type sa_family_t = u16;
+ } else {
+ pub type sa_family_t = u8;
+ }
+}
+
pub type socklen_t = u32;
pub type speed_t = u32;
pub type suseconds_t = i32;
pub type tcflag_t = ::c_uint;
-pub type time_t = i32;
pub type useconds_t = u32;
+cfg_if! {
+ if #[cfg(any(target_os = "horizon", all(target_os = "espidf", espidf_time64)))] {
+ pub type time_t = ::c_longlong;
+ } else {
+ pub type time_t = i32;
+ }
+}
+
s! {
// The order of the `ai_addr` field in this struct is crucial
// for converting between the Rust and C types.
@@ -33,16 +58,14 @@ s! {
pub ai_protocol: ::c_int,
pub ai_addrlen: socklen_t,
- #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc",
- target_vendor = "nintendo")))]
- #[cfg(target_arch = "xtensa")]
+ #[cfg(target_os = "espidf")]
pub ai_addr: *mut sockaddr,
pub ai_canonname: *mut ::c_char,
- #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc",
- target_vendor = "nintendo")))]
- #[cfg(not(target_arch = "xtensa"))]
+ #[cfg(not(any(
+ target_os = "espidf",
+ all(libc_cfg_target_vendor, target_arch = "powerpc", target_vendor = "nintendo"))))]
pub ai_addr: *mut sockaddr,
pub ai_next: *mut addrinfo,
@@ -116,26 +139,6 @@ s! {
pub tm_isdst: ::c_int,
}
- 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,
- pub st_size: off_t,
- pub st_atime: time_t,
- pub st_spare1: ::c_long,
- pub st_mtime: time_t,
- pub st_spare2: ::c_long,
- pub st_ctime: time_t,
- pub st_spare3: ::c_long,
- pub st_blksize: blksize_t,
- pub st_blocks: blkcnt_t,
- pub st_spare4: [::c_long; 2usize],
- }
-
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
@@ -150,10 +153,6 @@ s! {
pub f_namemax: ::c_ulong,
}
- pub struct sigset_t {
- __val: [::c_ulong; 16],
- }
-
pub struct sigaction {
pub sa_handler: extern fn(arg1: ::c_int),
pub sa_mask: sigset_t,
@@ -232,23 +231,37 @@ s! {
// unverified constants
align_const! {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_MUTEX_T],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- size: [0; __SIZEOF_PTHREAD_COND_T],
+ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_COND_T],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_RWLOCK_T],
};
}
pub const NCCS: usize = 32;
-pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56;
-pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
-pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
-pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
-pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+cfg_if! {
+ if #[cfg(target_os = "espidf")] {
+ const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff;
+ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
+ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4;
+ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 12;
+ pub const __SIZEOF_PTHREAD_COND_T: usize = 4;
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
+ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4;
+ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12;
+ } else {
+ const __PTHREAD_INITIALIZER_BYTE: u8 = 0;
+ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56;
+ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+ pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+ }
+}
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1;
@@ -256,7 +269,14 @@ pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
-pub const FD_SETSIZE: usize = 1024;
+
+cfg_if! {
+ if #[cfg(target_os = "horizon")] {
+ pub const FD_SETSIZE: usize = 64;
+ } else {
+ pub const FD_SETSIZE: usize = 1024;
+ }
+}
// intentionally not public, only used for fd_set
const ULONG_SIZE: usize = 32;
@@ -465,7 +485,13 @@ pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
-pub const SO_ERROR: ::c_int = 0x1007;
+cfg_if! {
+ if #[cfg(target_os = "horizon")] {
+ pub const SO_ERROR: ::c_int = 0x1009;
+ } else {
+ pub const SO_ERROR: ::c_int = 0x1007;
+ }
+}
pub const SO_TYPE: ::c_int = 0x1008;
pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
@@ -500,7 +526,13 @@ pub const TCP_KEEPIDLE: ::c_int = 256;
pub const TCP_KEEPINTVL: ::c_int = 512;
pub const TCP_KEEPCNT: ::c_int = 1024;
-pub const IP_TOS: ::c_int = 3;
+cfg_if! {
+ if #[cfg(target_os = "horizon")] {
+ pub const IP_TOS: ::c_int = 7;
+ } else {
+ pub const IP_TOS: ::c_int = 3;
+ }
+}
pub const IP_TTL: ::c_int = 8;
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
@@ -558,7 +590,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
@@ -583,21 +615,12 @@ extern "C" {
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
#[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")]
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
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);
@@ -607,20 +630,12 @@ extern "C" {
target_arch = "powerpc",
target_vendor = "nintendo"
)))]
- pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t)
- -> ::c_int;
- pub fn clock_settime(
- clock_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
- pub fn clock_gettime(
- clock_id: ::clockid_t,
- tp: *mut ::timespec,
- ) -> ::c_int;
- pub fn clock_getres(
- clock_id: ::clockid_t,
- res: *mut ::timespec,
- ) -> ::c_int;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_bind")]
+ pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
+ pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_close")]
pub fn closesocket(sockfd: ::c_int) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
#[cfg(not(all(
@@ -628,6 +643,7 @@ extern "C" {
target_arch = "powerpc",
target_vendor = "nintendo"
)))]
+ #[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")]
pub fn recvfrom(
fd: ::c_int,
buf: *mut ::c_void,
@@ -674,11 +690,7 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
@@ -709,16 +721,21 @@ extern "C" {
pub fn uname(buf: *mut ::utsname) -> ::c_int;
}
+mod generic;
+
cfg_if! {
- if #[cfg(target_arch = "arm")] {
+ if #[cfg(target_os = "espidf")] {
+ mod espidf;
+ pub use self::espidf::*;
+ } else if #[cfg(target_os = "horizon")] {
+ mod horizon;
+ pub use self::horizon::*;
+ } else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
- } else if #[cfg(target_arch = "xtensa")] {
- mod xtensa;
- pub use self::xtensa::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
diff --git a/src/unix/newlib/no_align.rs b/src/unix/newlib/no_align.rs
index 316c464ed59a8..ce3aca4ed5723 100644
--- a/src/unix/newlib/no_align.rs
+++ b/src/unix/newlib/no_align.rs
@@ -47,5 +47,5 @@ macro_rules! expand_align {
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
}
- }
+ };
}
diff --git a/src/unix/newlib/powerpc/mod.rs b/src/unix/newlib/powerpc/mod.rs
index 4289658cd6623..6bed1ce27acbf 100644
--- a/src/unix/newlib/powerpc/mod.rs
+++ b/src/unix/newlib/powerpc/mod.rs
@@ -5,6 +5,8 @@ pub type wchar_t = ::c_int;
pub type c_long = i32;
pub type c_ulong = u32;
+pub use crate::unix::newlib::generic::{sigset_t, stat};
+
// the newlib shipped with devkitPPC does not support the following components:
// - sockaddr
// - AF_INET6
diff --git a/src/unix/nto/aarch64.rs b/src/unix/nto/aarch64.rs
new file mode 100644
index 0000000000000..6faf8159c7172
--- /dev/null
+++ b/src/unix/nto/aarch64.rs
@@ -0,0 +1,36 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type time_t = i64;
+
+s! {
+ pub struct aarch64_qreg_t {
+ pub qlo: u64,
+ pub qhi: u64,
+ }
+
+ pub struct aarch64_fpu_registers {
+ pub reg: [::aarch64_qreg_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+
+ pub struct aarch64_cpu_registers {
+ pub gpr: [u64; 32],
+ pub elr: u64,
+ pub pstate: u64,
+ }
+
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub cpu: ::aarch64_cpu_registers,
+ pub fpu: ::aarch64_fpu_registers,
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_size: ::size_t,
+ pub ss_flags: ::c_int,
+ }
+}
diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs
new file mode 100644
index 0000000000000..45e97ceacef9a
--- /dev/null
+++ b/src/unix/nto/mod.rs
@@ -0,0 +1,3286 @@
+pub type clock_t = u32;
+
+pub type sa_family_t = u8;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type clockid_t = ::c_int;
+pub type timer_t = ::c_int;
+pub type key_t = ::c_uint;
+pub type id_t = ::c_int;
+
+pub type useconds_t = u32;
+pub type dev_t = u32;
+pub type socklen_t = u32;
+pub type mode_t = u32;
+pub type rlim64_t = u64;
+pub type mqd_t = ::c_int;
+pub type nfds_t = ::c_uint;
+pub type idtype_t = ::c_uint;
+pub type errno_t = ::c_int;
+pub type rsize_t = c_ulong;
+
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+pub type Elf32_Lword = u64;
+pub type Elf32_Sword = i32;
+
+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 type Elf64_Sxword = i64;
+pub type Elf64_Lword = u64;
+pub type Elf64_Sword = i32;
+
+pub type Elf32_Section = u16;
+pub type Elf64_Section = u16;
+
+pub type _Time32t = u32;
+
+pub type pthread_t = ::c_int;
+pub type regoff_t = ::ssize_t;
+
+pub type nlink_t = u32;
+pub type blksize_t = u32;
+pub type suseconds_t = i32;
+
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = u64;
+pub type msgqnum_t = u64;
+pub type msglen_t = u64;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type rlim_t = u64;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type posix_spawnattr_t = ::uintptr_t;
+
+pub type pthread_mutex_t = ::sync_t;
+pub type pthread_mutexattr_t = ::_sync_attr;
+pub type pthread_cond_t = ::sync_t;
+pub type pthread_condattr_t = ::_sync_attr;
+pub type pthread_rwlockattr_t = ::_sync_attr;
+pub type pthread_key_t = ::c_int;
+pub type pthread_spinlock_t = sync_t;
+pub type pthread_barrierattr_t = _sync_attr;
+pub type sem_t = sync_t;
+
+pub type nl_item = ::c_int;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+ fn clone(&self) -> timezone {
+ *self
+ }
+}
+
+s! {
+ pub struct ip_mreq {
+ pub imr_multiaddr: in_addr,
+ pub imr_interface: in_addr,
+ }
+
+ #[repr(packed)]
+ pub struct in_addr {
+ pub s_addr: ::in_addr_t,
+ }
+
+ pub struct sockaddr {
+ pub sa_len: u8,
+ pub sa_family: sa_family_t,
+ pub sa_data: [::c_char; 14],
+ }
+
+ pub struct sockaddr_in {
+ pub sin_len: u8,
+ pub sin_family: sa_family_t,
+ pub sin_port: ::in_port_t,
+ pub sin_addr: ::in_addr,
+ pub sin_zero: [i8; 8],
+ }
+
+ pub struct sockaddr_in6 {
+ pub sin6_len: u8,
+ 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,
+ }
+
+ // The order of the `ai_addr` field in this struct is crucial
+ // for converting between the Rust and C types.
+ 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_canonname: *mut c_char,
+ pub ai_addr: *mut ::sockaddr,
+ pub ai_next: *mut addrinfo,
+ }
+
+ pub struct fd_set {
+ fds_bits: [::c_uint; 2 * FD_SETSIZE / ULONG_SIZE],
+ }
+
+ pub struct tm {
+ pub tm_sec: ::c_int,
+ pub tm_min: ::c_int,
+ pub tm_hour: ::c_int,
+ pub tm_mday: ::c_int,
+ pub tm_mon: ::c_int,
+ pub tm_year: ::c_int,
+ pub tm_wday: ::c_int,
+ pub tm_yday: ::c_int,
+ pub tm_isdst: ::c_int,
+ pub tm_gmtoff: ::c_long,
+ pub tm_zone: *const ::c_char,
+ }
+
+ #[repr(align(8))]
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ pub sched_curpriority: ::c_int,
+ pub reserved: [::c_int; 10],
+ }
+
+ #[repr(align(8))]
+ pub struct __sched_param {
+ pub __sched_priority: ::c_int,
+ pub __sched_curpriority: ::c_int,
+ pub reserved: [::c_int; 10],
+ }
+
+ pub struct Dl_info {
+ pub dli_fname: *const ::c_char,
+ pub dli_fbase: *mut ::c_void,
+ pub dli_sname: *const ::c_char,
+ pub dli_saddr: *mut ::c_void,
+ }
+
+ pub struct lconv {
+ pub currency_symbol: *mut ::c_char,
+ pub int_curr_symbol: *mut ::c_char,
+ pub mon_decimal_point: *mut ::c_char,
+ pub mon_grouping: *mut ::c_char,
+ pub mon_thousands_sep: *mut ::c_char,
+ pub negative_sign: *mut ::c_char,
+ pub positive_sign: *mut ::c_char,
+ pub frac_digits: ::c_char,
+ pub int_frac_digits: ::c_char,
+ pub n_cs_precedes: ::c_char,
+ pub n_sep_by_space: ::c_char,
+ pub n_sign_posn: ::c_char,
+ pub p_cs_precedes: ::c_char,
+ pub p_sep_by_space: ::c_char,
+ pub p_sign_posn: ::c_char,
+
+ pub int_n_cs_precedes: ::c_char,
+ pub int_n_sep_by_space: ::c_char,
+ pub int_n_sign_posn: ::c_char,
+ pub int_p_cs_precedes: ::c_char,
+ pub int_p_sep_by_space: ::c_char,
+ pub int_p_sign_posn: ::c_char,
+
+ pub decimal_point: *mut ::c_char,
+ pub grouping: *mut ::c_char,
+ pub thousands_sep: *mut ::c_char,
+
+ pub _Frac_grouping: *mut ::c_char,
+ pub _Frac_sep: *mut ::c_char,
+ pub _False: *mut ::c_char,
+ pub _True: *mut ::c_char,
+
+ pub _No: *mut ::c_char,
+ pub _Yes: *mut ::c_char,
+ pub _Nostr: *mut ::c_char,
+ pub _Yesstr: *mut ::c_char,
+ pub _Reserved: [*mut ::c_char; 8],
+ }
+
+ pub struct in_pktinfo {
+ pub ipi_addr: ::in_addr,
+ pub ipi_ifindex: ::c_uint,
+ }
+
+ pub struct ifaddrs {
+ pub ifa_next: *mut ifaddrs,
+ pub ifa_name: *mut c_char,
+ pub ifa_flags: ::c_uint,
+ pub ifa_addr: *mut ::sockaddr,
+ pub ifa_netmask: *mut ::sockaddr,
+ pub ifa_dstaddr: *mut ::sockaddr,
+ pub ifa_data: *mut ::c_void
+ }
+
+ pub struct arpreq {
+ pub arp_pa: ::sockaddr,
+ pub arp_ha: ::sockaddr,
+ pub arp_flags: ::c_int,
+ }
+
+ #[repr(packed)]
+ pub struct arphdr {
+ pub ar_hrd: u16,
+ pub ar_pro: u16,
+ pub ar_hln: u8,
+ pub ar_pln: u8,
+ pub ar_op: u16,
+ }
+
+ pub struct mmsghdr {
+ pub msg_hdr: ::msghdr,
+ pub msg_len: ::c_uint,
+ }
+
+ #[repr(align(8))]
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_code: ::c_int,
+ pub si_errno: ::c_int,
+ __data: [u8; 36], // union
+ }
+
+ pub struct sigaction {
+ pub sa_sigaction: ::sighandler_t,
+ pub sa_flags: ::c_int,
+ pub sa_mask: ::sigset_t,
+ }
+
+ pub struct _sync {
+ _union: ::c_uint,
+ __owner: ::c_uint,
+ }
+ pub struct rlimit64 {
+ pub rlim_cur: rlim64_t,
+ pub rlim_max: rlim64_t,
+ }
+
+ pub struct glob_t {
+ pub gl_pathc: ::size_t,
+ pub gl_matchc: ::c_int,
+ pub gl_pathv: *mut *mut c_char,
+ pub gl_offs: ::size_t,
+ pub gl_flags: ::c_int,
+ pub gl_errfunc: extern "C" fn(*const ::c_char, ::c_int) -> ::c_int,
+
+ __unused1: *mut ::c_void,
+ __unused2: *mut ::c_void,
+ __unused3: *mut ::c_void,
+ __unused4: *mut ::c_void,
+ __unused5: *mut ::c_void,
+ }
+
+ pub struct passwd {
+ pub pw_name: *mut ::c_char,
+ pub pw_passwd: *mut ::c_char,
+ pub pw_uid: ::uid_t,
+ pub pw_gid: ::gid_t,
+ pub pw_age: *mut ::c_char,
+ pub pw_comment: *mut ::c_char,
+ pub pw_gecos: *mut ::c_char,
+ pub pw_dir: *mut ::c_char,
+ pub pw_shell: *mut ::c_char,
+ }
+
+ pub struct if_nameindex {
+ pub if_index: ::c_uint,
+ pub if_name: *mut ::c_char,
+ }
+
+ pub struct sembuf {
+ pub sem_num: ::c_ushort,
+ pub sem_op: ::c_short,
+ pub sem_flg: ::c_short,
+ }
+
+ pub struct Elf32_Ehdr {
+ pub e_ident: [::c_uchar; 16],
+ pub e_type: Elf32_Half,
+ pub e_machine: Elf32_Half,
+ pub e_version: Elf32_Word,
+ pub e_entry: Elf32_Addr,
+ pub e_phoff: Elf32_Off,
+ pub e_shoff: Elf32_Off,
+ pub e_flags: Elf32_Word,
+ pub e_ehsize: Elf32_Half,
+ pub e_phentsize: Elf32_Half,
+ pub e_phnum: Elf32_Half,
+ pub e_shentsize: Elf32_Half,
+ pub e_shnum: Elf32_Half,
+ pub e_shstrndx: Elf32_Half,
+ }
+
+ pub struct Elf64_Ehdr {
+ pub e_ident: [::c_uchar; 16],
+ pub e_type: Elf64_Half,
+ pub e_machine: Elf64_Half,
+ pub e_version: Elf64_Word,
+ pub e_entry: Elf64_Addr,
+ pub e_phoff: Elf64_Off,
+ pub e_shoff: Elf64_Off,
+ pub e_flags: Elf64_Word,
+ pub e_ehsize: Elf64_Half,
+ pub e_phentsize: Elf64_Half,
+ pub e_phnum: Elf64_Half,
+ pub e_shentsize: Elf64_Half,
+ pub e_shnum: Elf64_Half,
+ pub e_shstrndx: Elf64_Half,
+ }
+
+ pub struct Elf32_Sym {
+ pub st_name: Elf32_Word,
+ pub st_value: Elf32_Addr,
+ pub st_size: Elf32_Word,
+ pub st_info: ::c_uchar,
+ pub st_other: ::c_uchar,
+ pub st_shndx: Elf32_Section,
+ }
+
+ pub struct Elf64_Sym {
+ pub st_name: Elf64_Word,
+ pub st_info: ::c_uchar,
+ pub st_other: ::c_uchar,
+ pub st_shndx: Elf64_Section,
+ pub st_value: Elf64_Addr,
+ pub st_size: Elf64_Xword,
+ }
+
+ 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 Elf32_Shdr {
+ pub sh_name: Elf32_Word,
+ pub sh_type: Elf32_Word,
+ pub sh_flags: Elf32_Word,
+ pub sh_addr: Elf32_Addr,
+ pub sh_offset: Elf32_Off,
+ pub sh_size: Elf32_Word,
+ pub sh_link: Elf32_Word,
+ pub sh_info: Elf32_Word,
+ pub sh_addralign: Elf32_Word,
+ pub sh_entsize: Elf32_Word,
+ }
+
+ pub struct Elf64_Shdr {
+ pub sh_name: Elf64_Word,
+ pub sh_type: Elf64_Word,
+ pub sh_flags: Elf64_Xword,
+ pub sh_addr: Elf64_Addr,
+ pub sh_offset: Elf64_Off,
+ pub sh_size: Elf64_Xword,
+ pub sh_link: Elf64_Word,
+ pub sh_info: Elf64_Word,
+ pub sh_addralign: Elf64_Xword,
+ pub sh_entsize: Elf64_Xword,
+ }
+
+ pub struct in6_pktinfo {
+ pub ipi6_addr: ::in6_addr,
+ pub ipi6_ifindex: ::c_uint,
+ }
+
+ pub struct inotify_event {
+ pub wd: ::c_int,
+ pub mask: u32,
+ pub cookie: u32,
+ pub len: u32
+ }
+
+ pub struct regmatch_t {
+ pub rm_so: regoff_t,
+ pub rm_eo: regoff_t,
+ }
+
+ pub struct msghdr {
+ pub msg_name: *mut ::c_void,
+ pub msg_namelen: ::socklen_t,
+ pub msg_iov: *mut ::iovec,
+ pub msg_iovlen: ::c_int,
+ pub msg_control: *mut ::c_void,
+ pub msg_controllen: ::socklen_t,
+ pub msg_flags: ::c_int,
+ }
+
+ pub struct cmsghdr {
+ pub cmsg_len: ::socklen_t,
+ pub cmsg_level: ::c_int,
+ pub cmsg_type: ::c_int,
+ }
+
+ pub struct termios {
+ pub c_iflag: ::tcflag_t,
+ pub c_oflag: ::tcflag_t,
+ pub c_cflag: ::tcflag_t,
+ pub c_lflag: ::tcflag_t,
+ pub c_cc: [::cc_t; ::NCCS],
+ __reserved: [::c_uint; 3],
+ pub c_ispeed: ::speed_t,
+ pub c_ospeed: ::speed_t,
+ }
+
+ 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 flock {
+ pub l_type: i16,
+ pub l_whence: i16,
+ pub l_zero1: i32,
+ pub l_start: ::off_t,
+ pub l_len: ::off_t,
+ pub l_pid: ::pid_t,
+ pub l_sysid: u32,
+ }
+
+ pub struct statvfs {
+ pub f_bsize: ::c_ulong,
+ pub f_frsize: ::c_ulong,
+ pub f_blocks: ::fsblkcnt_t,
+ pub f_bfree: ::fsblkcnt_t,
+ pub f_bavail: ::fsblkcnt_t,
+ pub f_files: ::fsfilcnt_t,
+ pub f_ffree: ::fsfilcnt_t,
+ pub f_favail: ::fsfilcnt_t,
+ pub f_fsid: ::c_ulong,
+ pub f_basetype: [::c_char; 16],
+ pub f_flag: ::c_ulong,
+ pub f_namemax: ::c_ulong,
+ f_filler: [::c_uint; 21],
+ }
+
+ pub struct aiocb {
+ pub aio_fildes: ::c_int,
+ pub aio_reqprio: ::c_int,
+ pub aio_offset: off_t,
+ pub aio_buf: *mut ::c_void,
+ pub aio_nbytes: ::size_t,
+ pub aio_sigevent: ::sigevent,
+ pub aio_lio_opcode: ::c_int,
+ pub _aio_lio_state: *mut ::c_void,
+ _aio_pad: [::c_int; 3],
+ pub _aio_next: *mut ::aiocb,
+ pub _aio_flag: ::c_uint,
+ pub _aio_iotype: ::c_uint,
+ pub _aio_result: ::ssize_t,
+ pub _aio_error: ::c_uint,
+ pub _aio_suspend: *mut ::c_void,
+ pub _aio_plist: *mut ::c_void,
+ pub _aio_policy: ::c_int,
+ pub _aio_param: ::__sched_param,
+ }
+
+ pub struct pthread_attr_t {
+ __data1: ::c_long,
+ __data2: [u8; 96]
+ }
+
+ 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_uint,
+ pub key: ::key_t,
+ _reserved: [::c_int; 4],
+ }
+
+ pub struct regex_t {
+ re_magic: ::c_int,
+ re_nsub: ::size_t,
+ re_endp: *const ::c_char,
+ re_g: *mut ::c_void,
+ }
+
+ pub struct _thread_attr {
+ pub __flags: ::c_int,
+ pub __stacksize: ::size_t,
+ pub __stackaddr: *mut ::c_void,
+ pub __exitfunc: ::Option,
+ pub __policy: ::c_int,
+ pub __param: ::__sched_param,
+ pub __guardsize: ::c_uint,
+ pub __prealloc: ::c_uint,
+ __spare: [::c_int; 2],
+ }
+
+ pub struct _sync_attr {
+ pub __protocol: ::c_int,
+ pub __flags: ::c_int,
+ pub __prioceiling: ::c_int,
+ pub __clockid: ::c_int,
+ pub __count: ::c_int,
+ __reserved: [::c_int; 3],
+ }
+
+ pub struct sockcred {
+ 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 bpf_program {
+ pub bf_len: ::c_uint,
+ pub bf_insns: *mut ::bpf_insn,
+ }
+
+ pub struct bpf_stat {
+ pub bs_recv: u64,
+ pub bs_drop: u64,
+ pub bs_capt: u64,
+ bs_padding: [u64; 13],
+ }
+
+ pub struct bpf_version {
+ pub bv_major: ::c_ushort,
+ pub bv_minor: ::c_ushort,
+ }
+
+ pub struct bpf_hdr {
+ pub bh_tstamp: ::timeval,
+ pub bh_caplen: u32,
+ pub bh_datalen: u32,
+ pub bh_hdrlen: u16,
+ }
+
+ pub struct bpf_insn {
+ pub code: u16,
+ pub jt: ::c_uchar,
+ pub jf: ::c_uchar,
+ pub k: u32,
+ }
+
+ pub struct bpf_dltlist {
+ pub bfl_len: ::c_uint,
+ pub bfl_list: *mut ::c_uint,
+ }
+
+ pub struct unpcbid {
+ pub unp_pid: ::pid_t,
+ pub unp_euid: ::uid_t,
+ pub unp_egid: ::gid_t,
+ }
+
+ pub struct dl_phdr_info {
+ pub dlpi_addr: ::Elf64_Addr,
+ pub dlpi_name: *const ::c_char,
+ pub dlpi_phdr: *const ::Elf64_Phdr,
+ pub dlpi_phnum: ::Elf64_Half,
+ }
+
+ #[repr(align(8))]
+ pub struct ucontext_t {
+ pub uc_link: *mut ucontext_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_stack: stack_t,
+ pub uc_mcontext: mcontext_t,
+ }
+}
+
+s_no_extra_traits! {
+ pub struct sockaddr_un {
+ pub sun_len: u8,
+ pub sun_family: sa_family_t,
+ pub sun_path: [::c_char; 104]
+ }
+
+ pub struct sockaddr_storage {
+ pub ss_len: u8,
+ pub ss_family: sa_family_t,
+ __ss_pad1: [::c_char; 6],
+ __ss_align: i64,
+ __ss_pad2: [::c_char; 112],
+ }
+
+ pub struct utsname {
+ pub sysname: [::c_char; _SYSNAME_SIZE],
+ pub nodename: [::c_char; _SYSNAME_SIZE],
+ pub release: [::c_char; _SYSNAME_SIZE],
+ pub version: [::c_char; _SYSNAME_SIZE],
+ pub machine: [::c_char; _SYSNAME_SIZE],
+ }
+
+ pub struct sigevent {
+ pub sigev_notify: ::c_int,
+ __sigev_un1: usize, // union
+ pub sigev_value: ::sigval,
+ __sigev_un2: usize, // union
+
+ }
+ pub struct dirent {
+ pub d_ino: ::ino_t,
+ pub d_offset: ::off_t,
+ pub d_reclen: ::c_short,
+ pub d_namelen: ::c_short,
+ pub d_name: [::c_char; 1], // flex array
+ }
+
+ pub struct dirent_extra {
+ pub d_datalen: u16,
+ pub d_type: u16,
+ pub d_reserved: u32,
+ }
+
+ pub struct stat {
+ pub st_ino: ::ino_t,
+ pub st_size: ::off_t,
+ pub st_dev: ::dev_t,
+ pub st_rdev: ::dev_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub __old_st_mtime: ::_Time32t,
+ pub __old_st_atime: ::_Time32t,
+ pub __old_st_ctime: ::_Time32t,
+ pub st_mode: ::mode_t,
+ pub st_nlink: ::nlink_t,
+ pub st_blocksize: ::blksize_t,
+ pub st_nblocks: i32,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_mtim: ::timespec,
+ pub st_atim: ::timespec,
+ pub st_ctim: ::timespec,
+ }
+
+ pub struct sigset_t {
+ __val: [u32; 2],
+ }
+
+ pub struct mq_attr {
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_flags: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ pub mq_sendwait: ::c_long,
+ pub mq_recvwait: ::c_long,
+ }
+
+ pub struct msg {
+ pub msg_next: *mut ::msg,
+ pub msg_type: ::c_long,
+ pub msg_ts: ::c_ushort,
+ pub msg_spot: ::c_short,
+ _pad: [u8; 4],
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_first: *mut ::msg,
+ pub msg_last: *mut ::msg,
+ pub msg_cbytes: ::msglen_t,
+ pub msg_qnum: ::msgqnum_t,
+ pub msg_qbytes: ::msglen_t,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ pub msg_stime: ::time_t,
+ msg_pad1: ::c_long,
+ pub msg_rtime: ::time_t,
+ msg_pad2: ::c_long,
+ pub msg_ctime: ::time_t,
+ msg_pad3: ::c_long,
+ msg_pad4: [::c_long; 4],
+ }
+
+ pub struct sockaddr_dl {
+ pub sdl_len: ::c_uchar,
+ pub sdl_family: ::sa_family_t,
+ pub sdl_index: u16,
+ 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 sync_t {
+ __u: ::c_uint, // union
+ pub __owner: ::c_uint,
+ }
+
+ #[repr(align(4))]
+ pub struct pthread_barrier_t { // union
+ __pad: [u8; 28], // union
+ }
+
+ pub struct pthread_rwlock_t {
+ pub __active: ::c_int,
+ pub __blockedwriters: ::c_int,
+ pub __blockedreaders: ::c_int,
+ pub __heavy: ::c_int,
+ pub __lock: ::pthread_mutex_t, // union
+ pub __rcond: ::pthread_cond_t, // union
+ pub __wcond: ::pthread_cond_t, // union
+ pub __owner: ::c_uint,
+ pub __spare: ::c_uint,
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for sockaddr_un {
+ fn eq(&self, other: &sockaddr_un) -> bool {
+ self.sun_len == other.sun_len
+ && self.sun_family == other.sun_family
+ && self
+ .sun_path
+ .iter()
+ .zip(other.sun_path.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for sockaddr_un {}
+
+ impl ::fmt::Debug for sockaddr_un {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_un")
+ .field("sun_len", &self.sun_len)
+ .field("sun_family", &self.sun_family)
+ // FIXME: .field("sun_path", &self.sun_path)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for sockaddr_un {
+ fn hash(&self, state: &mut H) {
+ self.sun_len.hash(state);
+ self.sun_family.hash(state);
+ self.sun_path.hash(state);
+ }
+ }
+
+ impl PartialEq for utsname {
+ fn eq(&self, other: &utsname) -> bool {
+ self.sysname
+ .iter()
+ .zip(other.sysname.iter())
+ .all(|(a,b)| a == b)
+ && self
+ .nodename
+ .iter()
+ .zip(other.nodename.iter())
+ .all(|(a,b)| a == b)
+ && self
+ .release
+ .iter()
+ .zip(other.release.iter())
+ .all(|(a,b)| a == b)
+ && self
+ .version
+ .iter()
+ .zip(other.version.iter())
+ .all(|(a,b)| a == b)
+ && self
+ .machine
+ .iter()
+ .zip(other.machine.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for utsname {}
+
+ impl ::fmt::Debug for utsname {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("utsname")
+ // FIXME: .field("sysname", &self.sysname)
+ // FIXME: .field("nodename", &self.nodename)
+ // FIXME: .field("release", &self.release)
+ // FIXME: .field("version", &self.version)
+ // FIXME: .field("machine", &self.machine)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for utsname {
+ fn hash(&self, state: &mut H) {
+ self.sysname.hash(state);
+ self.nodename.hash(state);
+ self.release.hash(state);
+ self.version.hash(state);
+ self.machine.hash(state);
+ }
+ }
+
+ impl PartialEq for mq_attr {
+ fn eq(&self, other: &mq_attr) -> bool {
+ self.mq_maxmsg == other.mq_maxmsg &&
+ self.mq_msgsize == other.mq_msgsize &&
+ self.mq_flags == other.mq_flags &&
+ self.mq_curmsgs == other.mq_curmsgs &&
+ self.mq_msgsize == other.mq_msgsize &&
+ self.mq_sendwait == other.mq_sendwait &&
+ self.mq_recvwait == other.mq_recvwait
+ }
+ }
+
+ impl Eq for mq_attr {}
+
+ impl ::fmt::Debug for mq_attr {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mq_attr")
+ .field("mq_maxmsg", &self.mq_maxmsg)
+ .field("mq_msgsize", &self.mq_msgsize)
+ .field("mq_flags", &self.mq_flags)
+ .field("mq_curmsgs", &self.mq_curmsgs)
+ .field("mq_msgsize", &self.mq_msgsize)
+ .field("mq_sendwait", &self.mq_sendwait)
+ .field("mq_recvwait", &self.mq_recvwait)
+ .finish()
+ }
+ }
+
+ impl PartialEq for sockaddr_storage {
+ fn eq(&self, other: &sockaddr_storage) -> bool {
+ self.ss_len == other.ss_len
+ && self.ss_family == other.ss_family
+ && self.__ss_pad1 == other.__ss_pad1
+ && self.__ss_align == other.__ss_align
+ && self
+ .__ss_pad2
+ .iter()
+ .zip(other.__ss_pad2.iter())
+ .all(|(a, b)| a == b)
+ }
+ }
+
+ impl Eq for sockaddr_storage {}
+
+ impl ::fmt::Debug for sockaddr_storage {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_storage")
+ .field("ss_len", &self.ss_len)
+ .field("ss_family", &self.ss_family)
+ .field("__ss_pad1", &self.__ss_pad1)
+ .field("__ss_align", &self.__ss_align)
+ // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for sockaddr_storage {
+ fn hash(&self, state: &mut H) {
+ self.ss_len.hash(state);
+ self.ss_family.hash(state);
+ self.__ss_pad1.hash(state);
+ self.__ss_align.hash(state);
+ self.__ss_pad2.hash(state);
+ }
+ }
+
+ impl PartialEq for dirent {
+ fn eq(&self, other: &dirent) -> bool {
+ self.d_ino == other.d_ino
+ && self.d_offset == other.d_offset
+ && self.d_reclen == other.d_reclen
+ && self.d_namelen == other.d_namelen
+ && self
+ .d_name[..self.d_namelen as _]
+ .iter()
+ .zip(other.d_name.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for dirent {}
+
+ impl ::fmt::Debug for dirent {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("dirent")
+ .field("d_ino", &self.d_ino)
+ .field("d_offset", &self.d_offset)
+ .field("d_reclen", &self.d_reclen)
+ .field("d_namelen", &self.d_namelen)
+ .field("d_name", &&self.d_name[..self.d_namelen as _])
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for dirent {
+ fn hash(&self, state: &mut H) {
+ self.d_ino.hash(state);
+ self.d_offset.hash(state);
+ self.d_reclen.hash(state);
+ self.d_namelen.hash(state);
+ self.d_name[..self.d_namelen as _].hash(state);
+ }
+ }
+ }
+}
+
+pub const _SYSNAME_SIZE: usize = 256 + 1;
+pub const RLIM_INFINITY: ::rlim_t = 0xfffffffffffffffd;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+ if #[cfg(target_pointer_width = "32")] {
+ const ULONG_SIZE: usize = 32;
+ } else if #[cfg(target_pointer_width = "64")] {
+ const ULONG_SIZE: usize = 64;
+ } else {
+ // Unknown target_pointer_width
+ }
+}
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 32767;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 5;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 2;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const TIMER_ABSTIME: ::c_uint = 0x80000000;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const F_OK: ::c_int = 0;
+pub const X_OK: ::c_int = 1;
+pub const W_OK: ::c_int = 2;
+pub const R_OK: ::c_int = 4;
+
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0x00000000;
+pub const PROT_READ: ::c_int = 0x00000100;
+pub const PROT_WRITE: ::c_int = 0x00000200;
+pub const PROT_EXEC: ::c_int = 0x00000400;
+
+pub const MAP_FILE: ::c_int = 0;
+pub const MAP_SHARED: ::c_int = 1;
+pub const MAP_PRIVATE: ::c_int = 2;
+pub const MAP_FIXED: ::c_int = 0x10;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MS_ASYNC: ::c_int = 1;
+pub const MS_INVALIDATE: ::c_int = 4;
+pub const MS_SYNC: ::c_int = 2;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const SCM_TIMESTAMP: ::c_int = 0x02;
+pub const SCM_CREDS: ::c_int = 0x04;
+
+pub const MAP_TYPE: ::c_int = 0x3;
+
+pub const IFF_UP: ::c_int = 0x00000001;
+pub const IFF_BROADCAST: ::c_int = 0x00000002;
+pub const IFF_DEBUG: ::c_int = 0x00000004;
+pub const IFF_LOOPBACK: ::c_int = 0x00000008;
+pub const IFF_POINTOPOINT: ::c_int = 0x00000010;
+pub const IFF_NOTRAILERS: ::c_int = 0x00000020;
+pub const IFF_RUNNING: ::c_int = 0x00000040;
+pub const IFF_NOARP: ::c_int = 0x00000080;
+pub const IFF_PROMISC: ::c_int = 0x00000100;
+pub const IFF_ALLMULTI: ::c_int = 0x00000200;
+pub const IFF_MULTICAST: ::c_int = 0x00008000;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_INET6: ::c_int = 24;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_BLUETOOTH: ::c_int = 31;
+pub const AF_ISDN: ::c_int = 26;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = PF_LOCAL;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const pseudo_AF_KEY: ::c_int = 29;
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_SNA: ::c_int = AF_SNA;
+
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const MSG_OOB: ::c_int = 0x0001;
+pub const MSG_PEEK: ::c_int = 0x0002;
+pub const MSG_DONTROUTE: ::c_int = 0x0004;
+pub const MSG_CTRUNC: ::c_int = 0x0020;
+pub const MSG_TRUNC: ::c_int = 0x0010;
+pub const MSG_DONTWAIT: ::c_int = 0x0080;
+pub const MSG_EOR: ::c_int = 0x0008;
+pub const MSG_WAITALL: ::c_int = 0x0040;
+pub const MSG_NOSIGNAL: ::c_int = 0x0800;
+pub const MSG_WAITFORONE: ::c_int = 0x2000;
+
+pub const IP_TOS: ::c_int = 3;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_OPTIONS: ::c_int = 1;
+pub const IP_RECVOPTS: ::c_int = 5;
+pub const IP_RETOPTS: ::c_int = 8;
+pub const IP_PKTINFO: ::c_int = 25;
+pub const IP_IPSEC_POLICY_COMPAT: ::c_int = 22;
+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 IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
+pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
+
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+pub const IPPROTO_IGMP: ::c_int = 2;
+pub const IPPROTO_IPIP: ::c_int = 4;
+pub const IPPROTO_EGP: ::c_int = 8;
+pub const IPPROTO_PUP: ::c_int = 12;
+pub const IPPROTO_IDP: ::c_int = 22;
+pub const IPPROTO_TP: ::c_int = 29;
+pub const IPPROTO_ROUTING: ::c_int = 43;
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+pub const IPPROTO_RSVP: ::c_int = 46;
+pub const IPPROTO_GRE: ::c_int = 47;
+pub const IPPROTO_ESP: ::c_int = 50;
+pub const IPPROTO_AH: ::c_int = 51;
+pub const IPPROTO_NONE: ::c_int = 59;
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_ENCAP: ::c_int = 98;
+pub const IPPROTO_PIM: ::c_int = 103;
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+pub const IPPROTO_CARP: ::c_int = 112;
+pub const IPPROTO_DIVERT: ::c_int = 259;
+pub const IPPROTO_DONE: ::c_int = 257;
+pub const IPPROTO_EON: ::c_int = 80;
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+pub const IPPROTO_GGP: ::c_int = 3;
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+pub const IPPROTO_MOBILE: ::c_int = 55;
+
+pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
+pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+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_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+pub const IPV6_CHECKSUM: ::c_int = 26;
+pub const IPV6_V6ONLY: ::c_int = 27;
+pub const IPV6_IPSEC_POLICY_COMPAT: ::c_int = 28;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 35;
+pub const IPV6_RECVPKTINFO: ::c_int = 36;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
+pub const IPV6_RECVRTHDR: ::c_int = 38;
+pub const IPV6_RECVHOPOPTS: ::c_int = 39;
+pub const IPV6_RECVDSTOPTS: ::c_int = 40;
+pub const IPV6_RECVPATHMTU: ::c_int = 43;
+pub const IPV6_PATHMTU: ::c_int = 44;
+pub const IPV6_PKTINFO: ::c_int = 46;
+pub const IPV6_HOPLIMIT: ::c_int = 47;
+pub const IPV6_NEXTHOP: ::c_int = 48;
+pub const IPV6_HOPOPTS: ::c_int = 49;
+pub const IPV6_DSTOPTS: ::c_int = 50;
+pub const IPV6_RECVTCLASS: ::c_int = 57;
+pub const IPV6_TCLASS: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+
+pub const TCP_NODELAY: ::c_int = 0x01;
+pub const TCP_MAXSEG: ::c_int = 0x02;
+pub const TCP_MD5SIG: ::c_int = 0x10;
+pub const TCP_KEEPALIVE: ::c_int = 0x04;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 0x1;
+pub const LOCK_EX: ::c_int = 0x2;
+pub const LOCK_NB: ::c_int = 0x4;
+pub const LOCK_UN: ::c_int = 0x8;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+
+pub const PATH_MAX: ::c_int = 1024;
+
+pub const UIO_MAXIOV: ::c_int = 1024;
+
+pub const FD_SETSIZE: usize = 256;
+
+pub const TCIOFF: ::c_int = 0x0002;
+pub const TCION: ::c_int = 0x0003;
+pub const TCOOFF: ::c_int = 0x0000;
+pub const TCOON: ::c_int = 0x0001;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const NL0: ::tcflag_t = 0x000;
+pub const NL1: ::tcflag_t = 0x100;
+pub const TAB0: ::tcflag_t = 0x0000;
+pub const CR0: ::tcflag_t = 0x000;
+pub const FF0: ::tcflag_t = 0x0000;
+pub const BS0: ::tcflag_t = 0x0000;
+pub const VT0: ::tcflag_t = 0x0000;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VLNEXT: usize = 15;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const CS5: ::tcflag_t = 0x00;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+
+pub const WNOHANG: ::c_int = 0x0040;
+pub const WUNTRACED: ::c_int = 0x0004;
+pub const WSTOPPED: ::c_int = WUNTRACED;
+pub const WEXITED: ::c_int = 0x0001;
+pub const WCONTINUED: ::c_int = 0x0008;
+pub const WNOWAIT: ::c_int = 0x0080;
+pub const WTRAPPED: ::c_int = 0x0002;
+
+pub const RTLD_LOCAL: ::c_int = 0x0200;
+pub const RTLD_LAZY: ::c_int = 0x0001;
+
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 2;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 1;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_EACCESS: ::c_int = 0x0001;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0002;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0004;
+pub const AT_REMOVEDIR: ::c_int = 0x0008;
+
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+pub const PIPE_BUF: usize = 5120;
+
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const UTIME_OMIT: c_long = 0x40000002;
+pub const UTIME_NOW: c_long = 0x40000001;
+
+pub const POLLIN: ::c_short = POLLRDNORM | POLLRDBAND;
+pub const POLLPRI: ::c_short = 0x0008;
+pub const POLLOUT: ::c_short = 0x0002;
+pub const POLLERR: ::c_short = 0x0020;
+pub const POLLHUP: ::c_short = 0x0040;
+pub const POLLNVAL: ::c_short = 0x1000;
+pub const POLLRDNORM: ::c_short = 0x0001;
+pub const POLLRDBAND: ::c_short = 0x0004;
+
+pub const IPTOS_LOWDELAY: u8 = 0x10;
+pub const IPTOS_THROUGHPUT: u8 = 0x08;
+pub const IPTOS_RELIABILITY: u8 = 0x04;
+pub const IPTOS_MINCOST: u8 = 0x02;
+
+pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
+pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
+pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
+pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
+pub const IPTOS_PREC_FLASH: u8 = 0x60;
+pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
+pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
+pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
+
+pub const IPTOS_ECN_MASK: u8 = 0x03;
+pub const IPTOS_ECN_ECT1: u8 = 0x01;
+pub const IPTOS_ECN_ECT0: u8 = 0x02;
+pub const IPTOS_ECN_CE: u8 = 0x03;
+
+pub const IPOPT_CONTROL: u8 = 0x00;
+pub const IPOPT_RESERVED1: u8 = 0x20;
+pub const IPOPT_RESERVED2: u8 = 0x60;
+pub const IPOPT_LSRR: u8 = 131;
+pub const IPOPT_RR: u8 = 7;
+pub const IPOPT_SSRR: u8 = 137;
+pub const IPDEFTTL: u8 = 64;
+pub const IPOPT_OPTVAL: u8 = 0;
+pub const IPOPT_OLEN: u8 = 1;
+pub const IPOPT_OFFSET: u8 = 2;
+pub const IPOPT_MINOFF: u8 = 4;
+pub const IPOPT_NOP: u8 = 1;
+pub const IPOPT_EOL: u8 = 0;
+pub const IPOPT_TS: u8 = 68;
+pub const IPOPT_TS_TSONLY: u8 = 0;
+pub const IPOPT_TS_TSANDADDR: u8 = 1;
+pub const IPOPT_TS_PRESPEC: u8 = 3;
+
+pub const MAX_IPOPTLEN: u8 = 40;
+pub const IPVERSION: u8 = 4;
+pub const MAXTTL: u8 = 255;
+
+pub const ARPHRD_ETHER: u16 = 1;
+pub const ARPHRD_IEEE802: u16 = 6;
+pub const ARPHRD_ARCNET: u16 = 7;
+pub const ARPHRD_IEEE1394: u16 = 24;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_BINDTODEVICE: ::c_int = 0x0800;
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+
+pub const TIOCM_LE: ::c_int = 0x0100;
+pub const TIOCM_DTR: ::c_int = 0x0001;
+pub const TIOCM_RTS: ::c_int = 0x0002;
+pub const TIOCM_ST: ::c_int = 0x0200;
+pub const TIOCM_SR: ::c_int = 0x0400;
+pub const TIOCM_CTS: ::c_int = 0x1000;
+pub const TIOCM_CAR: ::c_int = TIOCM_CD;
+pub const TIOCM_CD: ::c_int = 0x8000;
+pub const TIOCM_RNG: ::c_int = TIOCM_RI;
+pub const TIOCM_RI: ::c_int = 0x4000;
+pub const TIOCM_DSR: ::c_int = 0x2000;
+
+pub const SCHED_OTHER: ::c_int = 3;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o001000;
+pub const IPC_EXCL: ::c_int = 0o002000;
+pub const IPC_NOWAIT: ::c_int = 0o004000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+
+pub const MSG_NOERROR: ::c_int = 0o010000;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const NI_NUMERICHOST: ::c_int = 0x00000002;
+pub const NI_NUMERICSERV: ::c_int = 0x00000008;
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NAMEREQD: ::c_int = 0x00000004;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x00000010;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x00000001;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x00000004;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x00000002;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x00000400;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x00000040;
+
+pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
+
+pub const RTF_UP: ::c_ushort = 0x0001;
+pub const RTF_GATEWAY: ::c_ushort = 0x0002;
+
+pub const RTF_HOST: ::c_ushort = 0x0004;
+pub const RTF_DYNAMIC: ::c_ushort = 0x0010;
+pub const RTF_MODIFIED: ::c_ushort = 0x0020;
+pub const RTF_REJECT: ::c_ushort = 0x0008;
+pub const RTF_STATIC: ::c_ushort = 0x0800;
+pub const RTF_XRESOLVE: ::c_ushort = 0x0200;
+pub const RTF_BROADCAST: u32 = 0x80000;
+pub const RTM_NEWADDR: u16 = 0xc;
+pub const RTM_DELADDR: u16 = 0xd;
+pub const RTA_DST: ::c_ushort = 0x1;
+pub const RTA_GATEWAY: ::c_ushort = 0x2;
+
+pub const UDP_ENCAP: ::c_int = 100;
+
+pub const IN_ACCESS: u32 = 0x00000001;
+pub const IN_MODIFY: u32 = 0x00000002;
+pub const IN_ATTRIB: u32 = 0x00000004;
+pub const IN_CLOSE_WRITE: u32 = 0x00000008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x00000010;
+pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
+pub const IN_OPEN: u32 = 0x00000020;
+pub const IN_MOVED_FROM: u32 = 0x00000040;
+pub const IN_MOVED_TO: u32 = 0x00000080;
+pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
+pub const IN_CREATE: u32 = 0x00000100;
+pub const IN_DELETE: u32 = 0x00000200;
+pub const IN_DELETE_SELF: u32 = 0x00000400;
+pub const IN_MOVE_SELF: u32 = 0x00000800;
+pub const IN_UNMOUNT: u32 = 0x00002000;
+pub const IN_Q_OVERFLOW: u32 = 0x00004000;
+pub const IN_IGNORED: u32 = 0x00008000;
+pub const IN_ONLYDIR: u32 = 0x01000000;
+pub const IN_DONT_FOLLOW: u32 = 0x02000000;
+
+pub const IN_ISDIR: u32 = 0x40000000;
+pub const IN_ONESHOT: u32 = 0x80000000;
+
+pub const REG_EXTENDED: ::c_int = 0o0001;
+pub const REG_ICASE: ::c_int = 0o0002;
+pub const REG_NEWLINE: ::c_int = 0o0010;
+pub const REG_NOSUB: ::c_int = 0o0004;
+
+pub const REG_NOTBOL: ::c_int = 0o00001;
+pub const REG_NOTEOL: ::c_int = 0o00002;
+
+pub const REG_ENOSYS: ::c_int = 17;
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+
+// errno.h
+pub const EOK: ::c_int = 0;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EDEADLK: ::c_int = 45;
+pub const ENOLCK: ::c_int = 46;
+pub const ECANCELED: ::c_int = 47;
+pub const EDQUOT: ::c_int = 49;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EBFONT: ::c_int = 57;
+pub const EOWNERDEAD: ::c_int = 58;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EBADMSG: ::c_int = 77;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ENOSYS: ::c_int = 89;
+pub const ELOOP: ::c_int = 90;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTRECOVERABLE: ::c_int = 95;
+pub const EOPNOTSUPP: ::c_int = 103;
+pub const EFPOS: ::c_int = 110;
+pub const ESTALE: ::c_int = 122;
+pub const EINPROGRESS: ::c_int = 236;
+pub const EALREADY: ::c_int = 237;
+pub const ENOTSOCK: ::c_int = 238;
+pub const EDESTADDRREQ: ::c_int = 239;
+pub const EMSGSIZE: ::c_int = 240;
+pub const EPROTOTYPE: ::c_int = 241;
+pub const ENOPROTOOPT: ::c_int = 242;
+pub const EPROTONOSUPPORT: ::c_int = 243;
+pub const ESOCKTNOSUPPORT: ::c_int = 244;
+pub const EPFNOSUPPORT: ::c_int = 246;
+pub const EAFNOSUPPORT: ::c_int = 247;
+pub const EADDRINUSE: ::c_int = 248;
+pub const EADDRNOTAVAIL: ::c_int = 249;
+pub const ENETDOWN: ::c_int = 250;
+pub const ENETUNREACH: ::c_int = 251;
+pub const ENETRESET: ::c_int = 252;
+pub const ECONNABORTED: ::c_int = 253;
+pub const ECONNRESET: ::c_int = 254;
+pub const ENOBUFS: ::c_int = 255;
+pub const EISCONN: ::c_int = 256;
+pub const ENOTCONN: ::c_int = 257;
+pub const ESHUTDOWN: ::c_int = 258;
+pub const ETOOMANYREFS: ::c_int = 259;
+pub const ETIMEDOUT: ::c_int = 260;
+pub const ECONNREFUSED: ::c_int = 261;
+pub const EHOSTDOWN: ::c_int = 264;
+pub const EHOSTUNREACH: ::c_int = 265;
+pub const EBADRPC: ::c_int = 272;
+pub const ERPCMISMATCH: ::c_int = 273;
+pub const EPROGUNAVAIL: ::c_int = 274;
+pub const EPROGMISMATCH: ::c_int = 275;
+pub const EPROCUNAVAIL: ::c_int = 276;
+pub const ENOREMOTE: ::c_int = 300;
+pub const ENONDP: ::c_int = 301;
+pub const EBADFSYS: ::c_int = 302;
+pub const EMORE: ::c_int = 309;
+pub const ECTRLTERM: ::c_int = 310;
+pub const ENOLIC: ::c_int = 311;
+pub const ESRVRFAULT: ::c_int = 312;
+pub const EENDIAN: ::c_int = 313;
+pub const ESECTYPEINVAL: ::c_int = 314;
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+pub const L_tmpnam: ::c_uint = 255;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 9;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 14;
+pub const _PC_ASYNC_IO: ::c_int = 12;
+pub const _PC_PRIO_IO: ::c_int = 13;
+pub const _PC_SOCK_MAXBUF: ::c_int = 15;
+pub const _PC_FILESIZEBITS: ::c_int = 16;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 22;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 23;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 24;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 25;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 21;
+pub const _PC_SYMLINK_MAX: ::c_int = 17;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_PASS_MAX: ::c_int = 9;
+pub const _SC_PAGESIZE: ::c_int = 11;
+pub const _SC_XOPEN_VERSION: ::c_int = 12;
+pub const _SC_STREAM_MAX: ::c_int = 13;
+pub const _SC_TZNAME_MAX: ::c_int = 14;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 15;
+pub const _SC_AIO_MAX: ::c_int = 16;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 17;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 18;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 19;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 20;
+pub const _SC_RTSIG_MAX: ::c_int = 21;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 22;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 23;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 24;
+pub const _SC_TIMER_MAX: ::c_int = 25;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 26;
+pub const _SC_FSYNC: ::c_int = 27;
+pub const _SC_MAPPED_FILES: ::c_int = 28;
+pub const _SC_MEMLOCK: ::c_int = 29;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 30;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 31;
+pub const _SC_MESSAGE_PASSING: ::c_int = 32;
+pub const _SC_PRIORITIZED_IO: ::c_int = 33;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 34;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 35;
+pub const _SC_SEMAPHORES: ::c_int = 36;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 37;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 38;
+pub const _SC_TIMERS: ::c_int = 39;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 40;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 41;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 42;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 43;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 44;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 45;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 46;
+pub const _SC_TTY_NAME_MAX: ::c_int = 47;
+pub const _SC_THREADS: ::c_int = 48;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 49;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 50;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 51;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 52;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 53;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 54;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 55;
+pub const _SC_2_CHAR_TERM: ::c_int = 56;
+pub const _SC_2_C_BIND: ::c_int = 57;
+pub const _SC_2_C_DEV: ::c_int = 58;
+pub const _SC_2_C_VERSION: ::c_int = 59;
+pub const _SC_2_FORT_DEV: ::c_int = 60;
+pub const _SC_2_FORT_RUN: ::c_int = 61;
+pub const _SC_2_LOCALEDEF: ::c_int = 62;
+pub const _SC_2_SW_DEV: ::c_int = 63;
+pub const _SC_2_UPE: ::c_int = 64;
+pub const _SC_2_VERSION: ::c_int = 65;
+pub const _SC_ATEXIT_MAX: ::c_int = 66;
+pub const _SC_AVPHYS_PAGES: ::c_int = 67;
+pub const _SC_BC_BASE_MAX: ::c_int = 68;
+pub const _SC_BC_DIM_MAX: ::c_int = 69;
+pub const _SC_BC_SCALE_MAX: ::c_int = 70;
+pub const _SC_BC_STRING_MAX: ::c_int = 71;
+pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 72;
+pub const _SC_CHAR_BIT: ::c_int = 73;
+pub const _SC_CHAR_MAX: ::c_int = 74;
+pub const _SC_CHAR_MIN: ::c_int = 75;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 76;
+pub const _SC_EQUIV_CLASS_MAX: ::c_int = 77;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 78;
+pub const _SC_INT_MAX: ::c_int = 79;
+pub const _SC_INT_MIN: ::c_int = 80;
+pub const _SC_LINE_MAX: ::c_int = 81;
+pub const _SC_LONG_BIT: ::c_int = 82;
+pub const _SC_MB_LEN_MAX: ::c_int = 83;
+pub const _SC_NL_ARGMAX: ::c_int = 84;
+pub const _SC_NL_LANGMAX: ::c_int = 85;
+pub const _SC_NL_MSGMAX: ::c_int = 86;
+pub const _SC_NL_NMAX: ::c_int = 87;
+pub const _SC_NL_SETMAX: ::c_int = 88;
+pub const _SC_NL_TEXTMAX: ::c_int = 89;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 90;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 91;
+pub const _SC_NZERO: ::c_int = 92;
+pub const _SC_PHYS_PAGES: ::c_int = 93;
+pub const _SC_PII: ::c_int = 94;
+pub const _SC_PII_INTERNET: ::c_int = 95;
+pub const _SC_PII_INTERNET_DGRAM: ::c_int = 96;
+pub const _SC_PII_INTERNET_STREAM: ::c_int = 97;
+pub const _SC_PII_OSI: ::c_int = 98;
+pub const _SC_PII_OSI_CLTS: ::c_int = 99;
+pub const _SC_PII_OSI_COTS: ::c_int = 100;
+pub const _SC_PII_OSI_M: ::c_int = 101;
+pub const _SC_PII_SOCKET: ::c_int = 102;
+pub const _SC_PII_XTI: ::c_int = 103;
+pub const _SC_POLL: ::c_int = 104;
+pub const _SC_RE_DUP_MAX: ::c_int = 105;
+pub const _SC_SCHAR_MAX: ::c_int = 106;
+pub const _SC_SCHAR_MIN: ::c_int = 107;
+pub const _SC_SELECT: ::c_int = 108;
+pub const _SC_SHRT_MAX: ::c_int = 109;
+pub const _SC_SHRT_MIN: ::c_int = 110;
+pub const _SC_SSIZE_MAX: ::c_int = 111;
+pub const _SC_T_IOV_MAX: ::c_int = 112;
+pub const _SC_UCHAR_MAX: ::c_int = 113;
+pub const _SC_UINT_MAX: ::c_int = 114;
+pub const _SC_UIO_MAXIOV: ::c_int = 115;
+pub const _SC_ULONG_MAX: ::c_int = 116;
+pub const _SC_USHRT_MAX: ::c_int = 117;
+pub const _SC_WORD_BIT: ::c_int = 118;
+pub const _SC_XOPEN_CRYPT: ::c_int = 119;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 120;
+pub const _SC_XOPEN_SHM: ::c_int = 121;
+pub const _SC_XOPEN_UNIX: ::c_int = 122;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 123;
+pub const _SC_XOPEN_XPG2: ::c_int = 124;
+pub const _SC_XOPEN_XPG3: ::c_int = 125;
+pub const _SC_XOPEN_XPG4: ::c_int = 126;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 127;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 128;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 129;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 130;
+pub const _SC_ADVISORY_INFO: ::c_int = 131;
+pub const _SC_CPUTIME: ::c_int = 132;
+pub const _SC_SPAWN: ::c_int = 133;
+pub const _SC_SPORADIC_SERVER: ::c_int = 134;
+pub const _SC_THREAD_CPUTIME: ::c_int = 135;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 136;
+pub const _SC_TIMEOUTS: ::c_int = 137;
+pub const _SC_BARRIERS: ::c_int = 138;
+pub const _SC_CLOCK_SELECTION: ::c_int = 139;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 140;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 141;
+pub const _SC_SPIN_LOCKS: ::c_int = 142;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 143;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 144;
+pub const _SC_TRACE: ::c_int = 145;
+pub const _SC_TRACE_INHERIT: ::c_int = 146;
+pub const _SC_TRACE_LOG: ::c_int = 147;
+pub const _SC_2_PBS: ::c_int = 148;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 149;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 150;
+pub const _SC_2_PBS_LOCATE: ::c_int = 151;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 152;
+pub const _SC_2_PBS_TRACK: ::c_int = 153;
+pub const _SC_HOST_NAME_MAX: ::c_int = 154;
+pub const _SC_IOV_MAX: ::c_int = 155;
+pub const _SC_IPV6: ::c_int = 156;
+pub const _SC_RAW_SOCKETS: ::c_int = 157;
+pub const _SC_REGEXP: ::c_int = 158;
+pub const _SC_SHELL: ::c_int = 159;
+pub const _SC_SS_REPL_MAX: ::c_int = 160;
+pub const _SC_SYMLOOP_MAX: ::c_int = 161;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 162;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 163;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 164;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 165;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 166;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 167;
+pub const _SC_V6_LP64_OFF64: ::c_int = 168;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 169;
+pub const _SC_XOPEN_REALTIME: ::c_int = 170;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 171;
+pub const _SC_XOPEN_LEGACY: ::c_int = 172;
+pub const _SC_XOPEN_STREAMS: ::c_int = 173;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V7_LP64_OFF64: ::c_int = 178;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 179;
+
+pub const GLOB_ERR: ::c_int = 0x0001;
+pub const GLOB_MARK: ::c_int = 0x0002;
+pub const GLOB_NOSORT: ::c_int = 0x0004;
+pub const GLOB_DOOFFS: ::c_int = 0x0008;
+pub const GLOB_NOCHECK: ::c_int = 0x0010;
+pub const GLOB_APPEND: ::c_int = 0x0020;
+pub const GLOB_NOESCAPE: ::c_int = 0x0040;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const S_IEXEC: mode_t = ::S_IXUSR;
+pub const S_IWRITE: mode_t = ::S_IWUSR;
+pub const S_IREAD: mode_t = ::S_IRUSR;
+
+pub const S_IFIFO: ::mode_t = 0x1000;
+pub const S_IFCHR: ::mode_t = 0x2000;
+pub const S_IFDIR: ::mode_t = 0x4000;
+pub const S_IFBLK: ::mode_t = 0x6000;
+pub const S_IFREG: ::mode_t = 0x8000;
+pub const S_IFLNK: ::mode_t = 0xA000;
+pub const S_IFSOCK: ::mode_t = 0xC000;
+pub const S_IFMT: ::mode_t = 0xF000;
+
+pub const S_IXOTH: ::mode_t = 0o000001;
+pub const S_IWOTH: ::mode_t = 0o000002;
+pub const S_IROTH: ::mode_t = 0o000004;
+pub const S_IRWXO: ::mode_t = 0o000007;
+pub const S_IXGRP: ::mode_t = 0o000010;
+pub const S_IWGRP: ::mode_t = 0o000020;
+pub const S_IRGRP: ::mode_t = 0o000040;
+pub const S_IRWXG: ::mode_t = 0o000070;
+pub const S_IXUSR: ::mode_t = 0o000100;
+pub const S_IWUSR: ::mode_t = 0o000200;
+pub const S_IRUSR: ::mode_t = 0o000400;
+pub const S_IRWXU: ::mode_t = 0o000700;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const ST_RDONLY: ::c_ulong = 0x01;
+pub const ST_NOSUID: ::c_ulong = 0x04;
+pub const ST_NOEXEC: ::c_ulong = 0x02;
+pub const ST_NOATIME: ::c_ulong = 0x20;
+
+pub const RTLD_NEXT: *mut ::c_void = -3i64 as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = -2i64 as *mut ::c_void;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOW: ::c_int = 0x0002;
+
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 4;
+pub const OLD_TIME: ::c_short = 3;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+
+pub const ENOTSUP: ::c_int = 48;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 26 * 26 * 26;
+pub const FOPEN_MAX: ::c_uint = 16;
+pub const FILENAME_MAX: ::c_uint = 255;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const M_KEEP: ::c_int = 4;
+pub const REG_STARTEND: ::c_int = 0o00004;
+pub const VEOF: usize = 4;
+
+pub const RTLD_GLOBAL: ::c_int = 0x0100;
+pub const RTLD_NOLOAD: ::c_int = 0x0004;
+
+pub const O_RDONLY: ::c_int = 0o000000;
+pub const O_WRONLY: ::c_int = 0o000001;
+pub const O_RDWR: ::c_int = 0o000002;
+
+pub const O_EXEC: ::c_int = 0o00003;
+pub const O_ASYNC: ::c_int = 0o0200000;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const O_TRUNC: ::c_int = 0o001000;
+pub const O_CLOEXEC: ::c_int = 0o020000;
+pub const O_DIRECTORY: ::c_int = 0o4000000;
+pub const O_ACCMODE: ::c_int = 0o000007;
+pub const O_APPEND: ::c_int = 0o000010;
+pub const O_CREAT: ::c_int = 0o000400;
+pub const O_EXCL: ::c_int = 0o002000;
+pub const O_NOCTTY: ::c_int = 0o004000;
+pub const O_NONBLOCK: ::c_int = 0o000200;
+pub const O_SYNC: ::c_int = 0o000040;
+pub const O_RSYNC: ::c_int = 0o000100;
+pub const O_DSYNC: ::c_int = 0o000020;
+pub const O_NOFOLLOW: ::c_int = 0o010000;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
+
+pub const SA_SIGINFO: ::c_int = 0x0002;
+pub const SA_NOCLDWAIT: ::c_int = 0x0020;
+pub const SA_NODEFER: ::c_int = 0x0010;
+pub const SA_RESETHAND: ::c_int = 0x0004;
+pub const SA_NOCLDSTOP: ::c_int = 0x0001;
+
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = SIGPOLL;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+
+pub const POLLWRNORM: ::c_short = ::POLLOUT;
+pub const POLLWRBAND: ::c_short = 0x0010;
+
+pub const F_SETLK: ::c_int = 106;
+pub const F_SETLKW: ::c_int = 107;
+pub const F_ALLOCSP: ::c_int = 110;
+pub const F_FREESP: ::c_int = 111;
+pub const F_GETLK: ::c_int = 114;
+
+pub const F_RDLCK: ::c_int = 1;
+pub const F_WRLCK: ::c_int = 2;
+pub const F_UNLCK: ::c_int = 3;
+
+pub const NCCS: usize = 40;
+
+pub const MAP_ANON: ::c_int = MAP_ANONYMOUS;
+pub const MAP_ANONYMOUS: ::c_int = 0x00080000;
+
+pub const MCL_CURRENT: ::c_int = 0x000000001;
+pub const MCL_FUTURE: ::c_int = 0x000000002;
+
+pub const _TIO_CBAUD: ::tcflag_t = 15;
+pub const CBAUD: ::tcflag_t = _TIO_CBAUD;
+pub const TAB1: ::tcflag_t = 0x0800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::tcflag_t = 0x4000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 17;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0x1800;
+
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 57600;
+pub const B115200: ::speed_t = 115200;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 16;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+
+pub const TCSANOW: ::c_int = 0x0001;
+pub const TCSADRAIN: ::c_int = 0x0002;
+pub const TCSAFLUSH: ::c_int = 0x0004;
+
+pub const HW_MACHINE: ::c_int = 1;
+pub const HW_MODEL: ::c_int = 2;
+pub const HW_NCPU: ::c_int = 3;
+pub const HW_BYTEORDER: ::c_int = 4;
+pub const HW_PHYSMEM: ::c_int = 5;
+pub const HW_USERMEM: ::c_int = 6;
+pub const HW_PAGESIZE: ::c_int = 7;
+pub const HW_DISKNAMES: ::c_int = 8;
+pub const HW_IOSTATS: ::c_int = 9;
+pub const HW_MACHINE_ARCH: ::c_int = 10;
+pub const HW_ALIGNBYTES: ::c_int = 11;
+pub const HW_CNMAGIC: ::c_int = 12;
+pub const HW_PHYSMEM64: ::c_int = 13;
+pub const HW_USERMEM64: ::c_int = 14;
+pub const HW_IOSTATNAMES: ::c_int = 15;
+pub const HW_MAXID: ::c_int = 15;
+
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_QNX: ::c_int = 9;
+pub const CTL_PROC: ::c_int = 10;
+pub const CTL_VENDOR: ::c_int = 11;
+pub const CTL_EMUL: ::c_int = 12;
+pub const CTL_SECURITY: ::c_int = 13;
+pub const CTL_MAXID: ::c_int = 14;
+
+pub const DAY_1: ::nl_item = 8;
+pub const DAY_2: ::nl_item = 9;
+pub const DAY_3: ::nl_item = 10;
+pub const DAY_4: ::nl_item = 11;
+pub const DAY_5: ::nl_item = 12;
+pub const DAY_6: ::nl_item = 13;
+pub const DAY_7: ::nl_item = 14;
+
+pub const MON_1: ::nl_item = 22;
+pub const MON_2: ::nl_item = 23;
+pub const MON_3: ::nl_item = 24;
+pub const MON_4: ::nl_item = 25;
+pub const MON_5: ::nl_item = 26;
+pub const MON_6: ::nl_item = 27;
+pub const MON_7: ::nl_item = 28;
+pub const MON_8: ::nl_item = 29;
+pub const MON_9: ::nl_item = 30;
+pub const MON_10: ::nl_item = 31;
+pub const MON_11: ::nl_item = 32;
+pub const MON_12: ::nl_item = 33;
+
+pub const ABDAY_1: ::nl_item = 15;
+pub const ABDAY_2: ::nl_item = 16;
+pub const ABDAY_3: ::nl_item = 17;
+pub const ABDAY_4: ::nl_item = 18;
+pub const ABDAY_5: ::nl_item = 19;
+pub const ABDAY_6: ::nl_item = 20;
+pub const ABDAY_7: ::nl_item = 21;
+
+pub const ABMON_1: ::nl_item = 34;
+pub const ABMON_2: ::nl_item = 35;
+pub const ABMON_3: ::nl_item = 36;
+pub const ABMON_4: ::nl_item = 37;
+pub const ABMON_5: ::nl_item = 38;
+pub const ABMON_6: ::nl_item = 39;
+pub const ABMON_7: ::nl_item = 40;
+pub const ABMON_8: ::nl_item = 41;
+pub const ABMON_9: ::nl_item = 42;
+pub const ABMON_10: ::nl_item = 43;
+pub const ABMON_11: ::nl_item = 44;
+pub const ABMON_12: ::nl_item = 45;
+
+pub const AF_ARP: ::c_int = 28;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_CNT: ::c_int = 21;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_E164: ::c_int = 26;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_IEEE80211: ::c_int = 32;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_LINK: ::c_int = 18;
+pub const AF_NATM: ::c_int = 27;
+pub const AF_NS: ::c_int = 6;
+pub const AF_OSI: ::c_int = 7;
+pub const AF_PUP: ::c_int = 4;
+pub const ALT_DIGITS: ::nl_item = 50;
+pub const AM_STR: ::nl_item = 6;
+pub const B76800: ::speed_t = 76800;
+
+pub const BIOCFLUSH: ::c_int = 17000;
+pub const BIOCGBLEN: ::c_int = 1074020966;
+pub const BIOCGDLT: ::c_int = 1074020970;
+pub const BIOCGDLTLIST: ::c_int = -1072676233;
+pub const BIOCGETIF: ::c_int = 1083196011;
+pub const BIOCGHDRCMPLT: ::c_int = 1074020980;
+pub const BIOCGRTIMEOUT: ::c_int = 1074807406;
+pub const BIOCGSEESENT: ::c_int = 1074020984;
+pub const BIOCGSTATS: ::c_int = 1082147439;
+pub const BIOCIMMEDIATE: ::c_int = -2147204496;
+pub const BIOCPROMISC: ::c_int = 17001;
+pub const BIOCSBLEN: ::c_int = -1073462682;
+pub const BIOCSDLT: ::c_int = -2147204490;
+pub const BIOCSETF: ::c_int = -2146418073;
+pub const BIOCSETIF: ::c_int = -2138029460;
+pub const BIOCSHDRCMPLT: ::c_int = -2147204491;
+pub const BIOCSRTIMEOUT: ::c_int = -2146418067;
+pub const BIOCSSEESENT: ::c_int = -2147204487;
+pub const BIOCVERSION: ::c_int = 1074020977;
+
+pub const BPF_ALIGNMENT: usize = ::mem::size_of::<::c_long>();
+pub const CHAR_BIT: usize = 8;
+pub const CODESET: ::nl_item = 1;
+pub const CRNCYSTR: ::nl_item = 55;
+
+pub const D_FLAG_FILTER: ::c_int = 0x00000001;
+pub const D_FLAG_STAT: ::c_int = 0x00000002;
+pub const D_FLAG_STAT_FORM_MASK: ::c_int = 0x000000f0;
+pub const D_FLAG_STAT_FORM_T32_2001: ::c_int = 0x00000010;
+pub const D_FLAG_STAT_FORM_T32_2008: ::c_int = 0x00000020;
+pub const D_FLAG_STAT_FORM_T64_2008: ::c_int = 0x00000030;
+pub const D_FLAG_STAT_FORM_UNSET: ::c_int = 0x00000000;
+
+pub const D_FMT: ::nl_item = 3;
+pub const D_GETFLAG: ::c_int = 1;
+pub const D_SETFLAG: ::c_int = 2;
+pub const D_T_FMT: ::nl_item = 2;
+pub const ERA: ::nl_item = 46;
+pub const ERA_D_FMT: ::nl_item = 47;
+pub const ERA_D_T_FMT: ::nl_item = 48;
+pub const ERA_T_FMT: ::nl_item = 49;
+pub const RADIXCHAR: ::nl_item = 51;
+pub const THOUSEP: ::nl_item = 52;
+pub const YESEXPR: ::nl_item = 53;
+pub const NOEXPR: ::nl_item = 54;
+pub const F_GETOWN: ::c_int = 35;
+
+pub const FIONBIO: ::c_int = -2147195266;
+pub const FIOASYNC: ::c_int = -2147195267;
+pub const FIOCLEX: ::c_int = 26113;
+pub const FIOGETOWN: ::c_int = 1074030203;
+pub const FIONCLEX: ::c_int = 26114;
+pub const FIONREAD: ::c_int = 1074030207;
+pub const FIONSPACE: ::c_int = 1074030200;
+pub const FIONWRITE: ::c_int = 1074030201;
+pub const FIOSETOWN: ::c_int = -2147195268;
+
+pub const F_SETOWN: ::c_int = 36;
+pub const IFF_ACCEPTRTADV: ::c_int = 0x40000000;
+pub const IFF_IP6FORWARDING: ::c_int = 0x20000000;
+pub const IFF_LINK0: ::c_int = 0x00001000;
+pub const IFF_LINK1: ::c_int = 0x00002000;
+pub const IFF_LINK2: ::c_int = 0x00004000;
+pub const IFF_OACTIVE: ::c_int = 0x00000400;
+pub const IFF_SHIM: ::c_int = 0x80000000;
+pub const IFF_SIMPLEX: ::c_int = 0x00000800;
+pub const IHFLOW: tcflag_t = 0x00000001;
+pub const IIDLE: tcflag_t = 0x00000008;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IPTOS_ECN_NOTECT: u8 = 0x00;
+pub const IUCLC: tcflag_t = 0x00000200;
+pub const IUTF8: tcflag_t = 0x0004000;
+
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_ARND: ::c_int = 81;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_IOV_MAX: ::c_int = 38;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_LOGSIGEXIT: ::c_int = 46;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_MAXID: ::c_int = 83;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_ARGS: ::c_int = 48;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_GID: ::c_int = 7;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_RGID: ::c_int = 8;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_VNODE: ::c_int = 13;
+
+pub const LC_ALL: ::c_int = 63;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MESSAGES: ::c_int = 32;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_NUMERIC: ::c_int = 8;
+pub const LC_TIME: ::c_int = 16;
+
+pub const LOCAL_CONNWAIT: ::c_int = 0x0002;
+pub const LOCAL_CREDS: ::c_int = 0x0001;
+pub const LOCAL_PEEREID: ::c_int = 0x0003;
+
+pub const MAP_STACK: ::c_int = 0x00001000;
+pub const MNT_NOEXEC: ::c_int = 0x02;
+pub const MNT_NOSUID: ::c_int = 0x04;
+pub const MNT_RDONLY: ::c_int = 0x01;
+
+pub const MSG_NOTIFICATION: ::c_int = 0x0400;
+
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 4;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
+pub const OHFLOW: tcflag_t = 0x00000002;
+pub const P_ALL: idtype_t = 0;
+pub const PARSTK: tcflag_t = 0x00000004;
+pub const PF_ARP: ::c_int = 28;
+pub const PF_CCITT: ::c_int = 10;
+pub const PF_CHAOS: ::c_int = 5;
+pub const PF_CNT: ::c_int = 21;
+pub const PF_COIP: ::c_int = 20;
+pub const PF_DATAKIT: ::c_int = 9;
+pub const PF_DECnet: ::c_int = 12;
+pub const PF_DLI: ::c_int = 13;
+pub const PF_ECMA: ::c_int = 8;
+pub const PF_HYLINK: ::c_int = 15;
+pub const PF_IMPLINK: ::c_int = 3;
+pub const PF_ISO: ::c_int = 7;
+pub const PF_LAT: ::c_int = 14;
+pub const PF_LINK: ::c_int = 18;
+pub const PF_NATM: ::c_int = 27;
+pub const PF_OSI: ::c_int = 7;
+pub const PF_PIP: ::c_int = 25;
+pub const PF_PUP: ::c_int = 4;
+pub const PF_RTIP: ::c_int = 22;
+pub const PF_XTP: ::c_int = 19;
+pub const PM_STR: ::nl_item = 7;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 2;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 1;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const _POSIX_VDISABLE: ::c_int = 0;
+pub const P_PGID: idtype_t = 2;
+pub const P_PID: idtype_t = 1;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_USER: ::c_int = 2;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const REG_ASSERT: ::c_int = 15;
+pub const REG_ATOI: ::c_int = 255;
+pub const REG_BACKR: ::c_int = 0x400;
+pub const REG_BASIC: ::c_int = 0x00;
+pub const REG_DUMP: ::c_int = 0x80;
+pub const REG_EMPTY: ::c_int = 14;
+pub const REG_INVARG: ::c_int = 16;
+pub const REG_ITOA: ::c_int = 0o400;
+pub const REG_LARGE: ::c_int = 0x200;
+pub const REG_NOSPEC: ::c_int = 0x10;
+pub const REG_OK: ::c_int = 0;
+pub const REG_PEND: ::c_int = 0x20;
+pub const REG_TRACE: ::c_int = 0x100;
+
+pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_MEMLOCK: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 5;
+pub const RLIMIT_NPROC: ::c_int = 8;
+pub const RLIMIT_RSS: ::c_int = 6;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_VMEM: ::c_int = 6;
+pub const RLIM_NLIMITS: ::c_int = 14;
+
+pub const SCHED_ADJTOHEAD: ::c_int = 5;
+pub const SCHED_ADJTOTAIL: ::c_int = 6;
+pub const SCHED_MAXPOLICY: ::c_int = 7;
+pub const SCHED_SETPRIO: ::c_int = 7;
+pub const SCHED_SPORADIC: ::c_int = 4;
+
+pub const SHM_ANON: *mut ::c_char = -1isize as *mut ::c_char;
+pub const SIGCLD: ::c_int = SIGCHLD;
+pub const SIGDEADLK: ::c_int = 7;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 129;
+pub const SIGEV_THREAD: ::c_int = 135;
+pub const SIOCGIFADDR: ::c_int = -1064277727;
+pub const SO_FIB: ::c_int = 0x100a;
+pub const SO_OVERFLOWED: ::c_int = 0x1009;
+pub const SO_SETFIB: ::c_int = 0x100a;
+pub const SO_TXPRIO: ::c_int = 0x100b;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_VLANPRIO: ::c_int = 0x100c;
+pub const _SS_ALIGNSIZE: usize = ::mem::size_of::();
+pub const _SS_MAXSIZE: usize = 128;
+pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2;
+pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE;
+pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD;
+pub const TCGETS: ::c_int = 0x404c540d;
+pub const TC_IPOSIX: tcflag_t =
+ BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK;
+pub const TC_LPOSIX: tcflag_t =
+ ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP;
+pub const TC_OPOSIX: tcflag_t = OPOST;
+pub const T_FMT_AMPM: ::nl_item = 5;
+
+pub const TIOCCBRK: ::c_int = 29818;
+pub const TIOCCDTR: ::c_int = 29816;
+pub const TIOCDRAIN: ::c_int = 29790;
+pub const TIOCEXCL: ::c_int = 29709;
+pub const TIOCFLUSH: ::c_int = -2147191792;
+pub const TIOCGETA: ::c_int = 1078752275;
+pub const TIOCGPGRP: ::c_int = 1074033783;
+pub const TIOCGWINSZ: ::c_int = 1074295912;
+pub const TIOCMBIC: ::c_int = -2147191701;
+pub const TIOCMBIS: ::c_int = -2147191700;
+pub const TIOCMGET: ::c_int = 1074033770;
+pub const TIOCMSET: ::c_int = -2147191699;
+pub const TIOCNOTTY: ::c_int = 29809;
+pub const TIOCNXCL: ::c_int = 29710;
+pub const TIOCOUTQ: ::c_int = 1074033779;
+pub const TIOCPKT: ::c_int = -2147191696;
+pub const TIOCPKT_DATA: ::c_int = 0x00;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 0x01;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x02;
+pub const TIOCPKT_IOCTL: ::c_int = 0x40;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_START: ::c_int = 0x08;
+pub const TIOCPKT_STOP: ::c_int = 0x04;
+pub const TIOCSBRK: ::c_int = 29819;
+pub const TIOCSCTTY: ::c_int = 29793;
+pub const TIOCSDTR: ::c_int = 29817;
+pub const TIOCSETA: ::c_int = -2142473196;
+pub const TIOCSETAF: ::c_int = -2142473194;
+pub const TIOCSETAW: ::c_int = -2142473195;
+pub const TIOCSPGRP: ::c_int = -2147191690;
+pub const TIOCSTART: ::c_int = 29806;
+pub const TIOCSTI: ::c_int = -2147388302;
+pub const TIOCSTOP: ::c_int = 29807;
+pub const TIOCSWINSZ: ::c_int = -2146929561;
+
+pub const USER_CS_PATH: ::c_int = 1;
+pub const USER_BC_BASE_MAX: ::c_int = 2;
+pub const USER_BC_DIM_MAX: ::c_int = 3;
+pub const USER_BC_SCALE_MAX: ::c_int = 4;
+pub const USER_BC_STRING_MAX: ::c_int = 5;
+pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
+pub const USER_EXPR_NEST_MAX: ::c_int = 7;
+pub const USER_LINE_MAX: ::c_int = 8;
+pub const USER_RE_DUP_MAX: ::c_int = 9;
+pub const USER_POSIX2_VERSION: ::c_int = 10;
+pub const USER_POSIX2_C_BIND: ::c_int = 11;
+pub const USER_POSIX2_C_DEV: ::c_int = 12;
+pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
+pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
+pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
+pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
+pub const USER_POSIX2_SW_DEV: ::c_int = 17;
+pub const USER_POSIX2_UPE: ::c_int = 18;
+pub const USER_STREAM_MAX: ::c_int = 19;
+pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_ATEXIT_MAX: ::c_int = 21;
+pub const USER_MAXID: ::c_int = 22;
+
+pub const VDOWN: usize = 31;
+pub const VINS: usize = 32;
+pub const VDEL: usize = 33;
+pub const VRUB: usize = 34;
+pub const VCAN: usize = 35;
+pub const VHOME: usize = 36;
+pub const VEND: usize = 37;
+pub const VSPARE3: usize = 38;
+pub const VSPARE4: usize = 39;
+pub const VSWTCH: usize = 7;
+pub const VDSUSP: usize = 11;
+pub const VFWD: usize = 18;
+pub const VLOGIN: usize = 19;
+pub const VPREFIX: usize = 20;
+pub const VSUFFIX: usize = 24;
+pub const VLEFT: usize = 28;
+pub const VRIGHT: usize = 29;
+pub const VUP: usize = 30;
+pub const XCASE: tcflag_t = 0x00000004;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0x00;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x01;
+
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
+pub const PTHREAD_STACK_MIN: ::size_t = 256;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0x00;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 0x10;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0x00;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 0x01;
+
+pub const PTHREAD_KEYS_MAX: usize = 128;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ __u: 0x80000000,
+ __owner: 0xffffffff,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ __u: CLOCK_REALTIME as u32,
+ __owner: 0xfffffffb,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ __active: 0,
+ __blockedwriters: 0,
+ __blockedreaders: 0,
+ __heavy: 0,
+ __lock: PTHREAD_MUTEX_INITIALIZER,
+ __rcond: PTHREAD_COND_INITIALIZER,
+ __wcond: PTHREAD_COND_INITIALIZER,
+ __owner: -2i32 as ::c_uint,
+ __spare: 0,
+};
+
+const_fn! {
+ {const} fn _CMSG_ALIGN(len: usize) -> usize {
+ len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1)
+ }
+
+ {const} fn _ALIGN(p: usize, b: usize) -> usize {
+ (p + b - 1) & !(b-1)
+ }
+}
+
+f! {
+ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+ if (*mhdr).msg_controllen as usize >= ::mem::size_of::() {
+ (*mhdr).msg_control as *mut cmsghdr
+ } else {
+ 0 as *mut cmsghdr
+ }
+ }
+
+ pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+ -> *mut ::cmsghdr
+ {
+ let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize);
+ let next = cmsg as usize + msg + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+ if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize {
+ 0 as *mut ::cmsghdr
+ } else {
+ (cmsg as usize + msg) as *mut ::cmsghdr
+ }
+ }
+
+ pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+ (cmsg as *mut ::c_uchar)
+ .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+ }
+
+ pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+ }
+
+ pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+ (_CMSG_ALIGN(::mem::size_of::()) + _CMSG_ALIGN(length as usize) )
+ as ::c_uint
+ }
+
+ pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+ let fd = fd as usize;
+ let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+ (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+ return
+ }
+
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+ let fd = fd as usize;
+ let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+ }
+
+ pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+ let fd = fd as usize;
+ let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+ (*set).fds_bits[fd / size] |= 1 << (fd % size);
+ return
+ }
+
+ pub fn FD_ZERO(set: *mut fd_set) -> () {
+ for slot in (*set).fds_bits.iter_mut() {
+ *slot = 0;
+ }
+ }
+
+ pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut ::dirent_extra {
+ let _f = &((*(_d)).d_name) as *const _;
+ let _s = _d as usize;
+
+ _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut ::dirent_extra
+ }
+
+ pub fn _DEXTRA_VALID(_x: *const ::dirent_extra, _d: *const dirent) -> bool {
+ let sz = _x as usize - _d as usize + ::mem::size_of::<::dirent_extra>();
+ let rsz = (*_d).d_reclen as usize;
+
+ if sz > rsz || sz + (*_x).d_datalen as usize > rsz {
+ false
+ } else {
+ true
+ }
+ }
+
+ pub fn _DEXTRA_NEXT(_x: *const ::dirent_extra) -> *mut ::dirent_extra {
+ _ALIGN(
+ _x as usize + ::mem::size_of::<::dirent_extra>() + (*_x).d_datalen as usize, 8
+ ) as *mut ::dirent_extra
+ }
+
+ pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+ let ngrps = if ngrps > 0 {
+ ngrps - 1
+ } else {
+ 0
+ };
+ ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
+ }
+}
+
+safe_f! {
+ pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+ (status & 0xff) == 0x7f
+ }
+
+ pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+ (status >> 8) & 0xff
+ }
+
+ pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+ status == 0xffff
+ }
+
+ pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+ ((status & 0x7f) + 1) as i8 >= 2
+ }
+
+ pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+ status & 0x7f
+ }
+
+ pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+ (status & 0x7f) == 0
+ }
+
+ pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+ (status >> 8) & 0xff
+ }
+
+ pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+ (status & 0x80) != 0
+ }
+
+ pub {const} fn IPTOS_ECN(x: u8) -> u8 {
+ x & ::IPTOS_ECN_MASK
+ }
+}
+
+// Network related functions are provided by libsocket and regex
+// functions are provided by libregex.
+#[link(name = "socket")]
+#[link(name = "regex")]
+
+extern "C" {
+ pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+ pub fn fdatasync(fd: ::c_int) -> ::c_int;
+ 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 mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+
+ pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+ pub fn pthread_attr_getstack(
+ attr: *const ::pthread_attr_t,
+ stackaddr: *mut *mut ::c_void,
+ stacksize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+ pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+ pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+ pub fn utimensat(
+ dirfd: ::c_int,
+ path: *const ::c_char,
+ times: *const ::timespec,
+ flag: ::c_int,
+ ) -> ::c_int;
+
+ pub fn pthread_condattr_getclock(
+ attr: *const pthread_condattr_t,
+ clock_id: *mut clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setclock(
+ attr: *mut pthread_condattr_t,
+ clock_id: ::clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_mutexattr_setpshared(
+ attr: *mut pthread_mutexattr_t,
+ pshared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_getpshared(
+ attr: *const pthread_rwlockattr_t,
+ val: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> *mut ::c_char;
+ pub fn clearenv() -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
+ pub fn wait4(
+ pid: ::pid_t,
+ status: *mut ::c_int,
+ options: ::c_int,
+ rusage: *mut ::rusage,
+ ) -> ::pid_t;
+ pub fn execvpe(
+ file: *const ::c_char,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
+
+ pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+ pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn openpty(
+ amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut termios,
+ winp: *mut ::winsize,
+ ) -> ::c_int;
+ pub fn forkpty(
+ amaster: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *mut termios,
+ winp: *mut ::winsize,
+ ) -> ::pid_t;
+ pub fn login_tty(fd: ::c_int) -> ::c_int;
+
+ pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+ pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
+
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+ 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 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 shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+
+ pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+ pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+ pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn sigtimedwait(
+ set: *const sigset_t,
+ info: *mut siginfo_t,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+ pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+
+ pub fn if_nameindex() -> *mut if_nameindex;
+ pub fn if_freenameindex(ptr: *mut if_nameindex);
+
+ pub fn glob(
+ pattern: *const c_char,
+ flags: ::c_int,
+ errfunc: ::Option ::c_int>,
+ pglob: *mut ::glob_t,
+ ) -> ::c_int;
+ pub fn globfree(pglob: *mut ::glob_t);
+
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+ pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+ pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+
+ pub fn msync(addr: *mut ::c_void, len: ::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;
+ pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::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;
+ pub fn sync();
+ pub fn pthread_getschedparam(
+ native: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut ::sched_param,
+ ) -> ::c_int;
+ pub fn umount(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+ pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+ pub fn mount(
+ special_device: *const ::c_char,
+ mount_directory: *const ::c_char,
+ flags: ::c_int,
+ mount_type: *const ::c_char,
+ mount_data: *const ::c_void,
+ mount_datalen: ::c_int,
+ ) -> ::c_int;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+ pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+ pub fn pthread_mutex_timedlock(
+ lock: *mut pthread_mutex_t,
+ abstime: *const ::timespec,
+ ) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_barrierattr_init(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ __attr: *const ::pthread_barrierattr_t,
+ __pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ __attr: *mut ::pthread_barrierattr_t,
+ __pshared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrier_init(
+ __barrier: *mut ::pthread_barrier_t,
+ __attr: *const ::pthread_barrierattr_t,
+ __count: ::c_uint,
+ ) -> ::c_int;
+ pub fn pthread_barrier_destroy(__barrier: *mut ::pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_wait(__barrier: *mut ::pthread_barrier_t) -> ::c_int;
+
+ pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+ pub fn clock_nanosleep(
+ clk_id: ::clockid_t,
+ flags: ::c_int,
+ rqtp: *const ::timespec,
+ rmtp: *mut ::timespec,
+ ) -> ::c_int;
+ pub fn pthread_attr_getguardsize(
+ attr: *const ::pthread_attr_t,
+ guardsize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn pthread_condattr_getpshared(
+ attr: *const pthread_condattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_setschedparam(
+ native: ::pthread_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn sched_setscheduler(
+ pid: ::pid_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+ pub fn getgrgid_r(
+ gid: ::gid_t,
+ grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group,
+ ) -> ::c_int;
+ pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+ pub fn getdtablesize() -> ::c_int;
+ pub fn getgrnam_r(
+ name: *const ::c_char,
+ grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group,
+ ) -> ::c_int;
+ pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+ pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+ pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+ pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+ pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+ pub fn getpwnam_r(
+ name: *const ::c_char,
+ pwd: *mut passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut passwd,
+ ) -> ::c_int;
+ pub fn getpwuid_r(
+ uid: ::uid_t,
+ pwd: *mut passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut passwd,
+ ) -> ::c_int;
+ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+ pub fn pthread_atfork(
+ prepare: ::Option,
+ parent: ::Option,
+ child: ::Option,
+ ) -> ::c_int;
+ pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+ pub fn getgrouplist(
+ user: *const ::c_char,
+ group: ::gid_t,
+ groups: *mut ::gid_t,
+ ngroups: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getpshared(
+ attr: *const pthread_mutexattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getrobust(
+ attr: *const pthread_mutexattr_t,
+ robustness: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut pthread_mutexattr_t,
+ robustness: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+ pub fn setitimer(
+ which: ::c_int,
+ value: *const ::itimerval,
+ ovalue: *mut ::itimerval,
+ ) -> ::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;
+ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+ pub fn faccessat(
+ dirfd: ::c_int,
+ pathname: *const ::c_char,
+ mode: ::c_int,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
+ pub fn inotify_init() -> ::c_int;
+ pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
+
+ pub fn gettid() -> ::pid_t;
+
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+ pub fn getnameinfo(
+ sa: *const ::sockaddr,
+ salen: ::socklen_t,
+ host: *mut ::c_char,
+ hostlen: ::socklen_t,
+ serv: *mut ::c_char,
+ sevlen: ::socklen_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+
+ pub fn sendmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn recvmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_uint,
+ timeout: *mut ::timespec,
+ ) -> ::c_int;
+
+ pub fn mallopt(param: ::c_int, value: i64) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+ pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+
+ pub fn mallinfo() -> ::mallinfo;
+ pub fn getpwent_r(
+ pwd: *mut ::passwd,
+ buf: *mut ::c_char,
+ __bufsize: ::c_int,
+ __result: *mut *mut ::passwd,
+ ) -> ::c_int;
+ pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::c_int) -> ::c_int;
+ pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+
+ pub fn sysctl(
+ _: *const ::c_int,
+ _: ::c_uint,
+ _: *mut ::c_void,
+ _: *mut ::size_t,
+ _: *const ::c_void,
+ _: ::size_t,
+ ) -> ::c_int;
+
+ pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::c_int, rlp: *const ::rlimit) -> ::c_int;
+
+ pub fn lio_listio(
+ __mode: ::c_int,
+ __list: *const *mut aiocb,
+ __nent: ::c_int,
+ __sig: *mut sigevent,
+ ) -> ::c_int;
+
+ pub fn dl_iterate_phdr(
+ callback: ::Option<
+ unsafe extern "C" fn(
+ info: *const dl_phdr_info,
+ size: ::size_t,
+ data: *mut ::c_void,
+ ) -> ::c_int,
+ >,
+ data: *mut ::c_void,
+ ) -> ::c_int;
+
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+
+ pub fn regcomp(
+ __preg: *mut ::regex_t,
+ __pattern: *const ::c_char,
+ __cflags: ::c_int,
+ ) -> ::c_int;
+ pub fn regexec(
+ __preg: *const ::regex_t,
+ __str: *const ::c_char,
+ __nmatch: ::size_t,
+ __pmatch: *mut ::regmatch_t,
+ __eflags: ::c_int,
+ ) -> ::c_int;
+ pub fn regerror(
+ __errcode: ::c_int,
+ __preg: *const ::regex_t,
+ __errbuf: *mut ::c_char,
+ __errbuf_size: ::size_t,
+ ) -> ::size_t;
+ pub fn regfree(__preg: *mut ::regex_t);
+ pub fn dirfd(__dirp: *mut ::DIR) -> ::c_int;
+ pub fn dircntl(dir: *mut ::DIR, cmd: ::c_int, ...) -> ::c_int;
+
+ pub fn aio_cancel(__fd: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_error(__aiocbp: *const ::aiocb) -> ::c_int;
+ pub fn aio_fsync(__operation: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_read(__aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_return(__aiocpb: *mut ::aiocb) -> ::ssize_t;
+ pub fn aio_suspend(
+ __list: *const *const ::aiocb,
+ __nent: ::c_int,
+ __timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn aio_write(__aiocpb: *mut ::aiocb) -> ::c_int;
+
+ pub fn mq_close(__mqdes: ::mqd_t) -> ::c_int;
+ pub fn mq_getattr(__mqdes: ::mqd_t, __mqstat: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_notify(__mqdes: ::mqd_t, __notification: *const ::sigevent) -> ::c_int;
+ pub fn mq_open(__name: *const ::c_char, __oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_receive(
+ __mqdes: ::mqd_t,
+ __msg_ptr: *mut ::c_char,
+ __msg_len: ::size_t,
+ __msg_prio: *mut ::c_uint,
+ ) -> ::ssize_t;
+ pub fn mq_send(
+ __mqdes: ::mqd_t,
+ __msg_ptr: *const ::c_char,
+ __msg_len: ::size_t,
+ __msg_prio: ::c_uint,
+ ) -> ::c_int;
+ pub fn mq_setattr(
+ __mqdes: ::mqd_t,
+ __mqstat: *const mq_attr,
+ __omqstat: *mut mq_attr,
+ ) -> ::c_int;
+ pub fn mq_timedreceive(
+ __mqdes: ::mqd_t,
+ __msg_ptr: *mut ::c_char,
+ __msg_len: ::size_t,
+ __msg_prio: *mut ::c_uint,
+ __abs_timeout: *const ::timespec,
+ ) -> ::ssize_t;
+ pub fn mq_timedsend(
+ __mqdes: ::mqd_t,
+ __msg_ptr: *const ::c_char,
+ __msg_len: ::size_t,
+ __msg_prio: ::c_uint,
+ __abs_timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn mq_unlink(__name: *const ::c_char) -> ::c_int;
+ pub fn __get_errno_ptr() -> *mut ::c_int;
+
+ // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html
+ pub static mut _syspage_ptr: *mut syspage_entry;
+
+ // Function on the stack after a call to pthread_create(). This is used
+ // as a sentinel to work around an infitnite loop in the unwinding code.
+ pub fn __my_thread_exit(value_ptr: *mut *const ::c_void);
+}
+
+// Models the implementation in stdlib.h. Ctest will fail if trying to use the
+// default symbol from libc
+pub unsafe fn atexit(cb: extern "C" fn()) -> ::c_int {
+ extern "C" {
+ static __dso_handle: *mut ::c_void;
+ pub fn __cxa_atexit(
+ cb: extern "C" fn(),
+ __arg: *mut ::c_void,
+ __dso: *mut ::c_void,
+ ) -> ::c_int;
+ }
+ __cxa_atexit(cb, 0 as *mut ::c_void, __dso_handle)
+}
+
+impl siginfo_t {
+ pub unsafe fn si_addr(&self) -> *mut ::c_void {
+ #[repr(C)]
+ struct siginfo_si_addr {
+ _pad: [u8; 32],
+ si_addr: *mut ::c_void,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr
+ }
+
+ pub unsafe fn si_value(&self) -> ::sigval {
+ #[repr(C)]
+ struct siginfo_si_value {
+ _pad: [u8; 32],
+ si_value: ::sigval,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ #[repr(C)]
+ struct siginfo_si_pid {
+ _pad: [u8; 16],
+ si_pid: ::pid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
+ #[repr(C)]
+ struct siginfo_si_uid {
+ _pad: [u8; 24],
+ si_uid: ::uid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid
+ }
+
+ pub unsafe fn si_status(&self) -> ::c_int {
+ #[repr(C)]
+ struct siginfo_si_status {
+ _pad: [u8; 28],
+ si_status: ::c_int,
+ }
+ (*(self as *const siginfo_t as *const siginfo_si_status)).si_status
+ }
+}
+
+cfg_if! {
+ 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 {
+ panic!("Unsupported arch");
+ }
+}
+
+mod neutrino;
+pub use self::neutrino::*;
diff --git a/src/unix/nto/neutrino.rs b/src/unix/nto/neutrino.rs
new file mode 100644
index 0000000000000..cedd2165962a8
--- /dev/null
+++ b/src/unix/nto/neutrino.rs
@@ -0,0 +1,1288 @@
+pub type nto_job_t = ::sync_t;
+
+s! {
+ pub struct intrspin {
+ pub value: ::c_uint, // volatile
+ }
+
+ pub struct iov_t {
+ pub iov_base: *mut ::c_void, // union
+ pub iov_len: ::size_t,
+ }
+
+ pub struct _itimer {
+ pub nsec: u64,
+ pub interval_nsec: u64,
+ }
+
+ pub struct _msg_info64 {
+ pub nd: u32,
+ pub srcnd: u32,
+ pub pid: ::pid_t,
+ pub tid: i32,
+ pub chid: i32,
+ pub scoid: i32,
+ pub coid: i32,
+ pub priority: i16,
+ pub flags: i16,
+ pub msglen: isize,
+ pub srcmsglen: isize,
+ pub dstmsglen: isize,
+ pub type_id: u32,
+ reserved: u32,
+ }
+
+ pub struct _cred_info {
+ pub ruid: ::uid_t,
+ pub euid: ::uid_t,
+ pub suid: ::uid_t,
+ pub rgid: ::gid_t,
+ pub egid: ::gid_t,
+ pub sgid: ::gid_t,
+ pub ngroups: u32,
+ pub grouplist: [::gid_t; 8],
+ }
+
+ pub struct _client_info {
+ pub nd: u32,
+ pub pid: ::pid_t,
+ pub sid: ::pid_t,
+ pub flags: u32,
+ pub cred: ::_cred_info,
+ }
+
+ pub struct _client_able {
+ pub ability: u32,
+ pub flags: u32,
+ pub range_lo: u64,
+ pub range_hi: u64,
+ }
+
+ pub struct nto_channel_config {
+ pub event: ::sigevent,
+ pub num_pulses: ::c_uint,
+ pub rearm_threshold: ::c_uint,
+ pub options: ::c_uint,
+ reserved: [::c_uint; 3],
+ }
+
+ // TODO: The following structures are defined in a header file which doesn't
+ // appear as part of the default headers found in a standard installation
+ // of Neutrino 7.1 SDP. Commented out for now.
+ //pub struct _asyncmsg_put_header {
+ // pub err: ::c_int,
+ // pub iov: *mut ::iov_t,
+ // pub parts: ::c_int,
+ // pub handle: ::c_uint,
+ // pub cb: ::Option<
+ // unsafe extern "C" fn(
+ // err: ::c_int,
+ // buf: *mut ::c_void,
+ // handle: ::c_uint,
+ // ) -> ::c_int>,
+ // pub put_hdr_flags: ::c_uint,
+ //}
+
+ //pub struct _asyncmsg_connection_attr {
+ // pub call_back: ::Option<
+ // unsafe extern "C" fn(
+ // err: ::c_int,
+ // buff: *mut ::c_void,
+ // handle: ::c_uint,
+ // ) -> ::c_int>,
+ // pub buffer_size: ::size_t,
+ // pub max_num_buffer: ::c_uint,
+ // pub trigger_num_msg: ::c_uint,
+ // pub trigger_time: ::_itimer,
+ // reserve: ::c_uint,
+ //}
+
+ //pub struct _asyncmsg_connection_descriptor {
+ // pub flags: ::c_uint,
+ // pub sendq_size: ::c_uint,
+ // pub sendq_head: ::c_uint,
+ // pub sendq_tail: ::c_uint,
+ // pub sendq_free: ::c_uint,
+ // pub err: ::c_int,
+ // pub ev: ::sigevent,
+ // pub num_curmsg: ::c_uint,
+ // pub ttimer: ::timer_t,
+ // pub block_con: ::pthread_cond_t,
+ // pub mu: ::pthread_mutex_t,
+ // reserved: ::c_uint,
+ // pub attr: ::_asyncmsg_connection_attr,
+ // pub reserves: [::c_uint; 3],
+ // pub sendq: [::_asyncmsg_put_header; 1], // flexarray
+ //}
+
+ pub struct __c_anonymous_struct_ev {
+ pub event: ::sigevent,
+ pub coid: ::c_int,
+ }
+
+ pub struct _channel_connect_attr { // union
+ pub ev: ::__c_anonymous_struct_ev,
+ }
+
+ pub struct _sighandler_info {
+ pub siginfo: ::siginfo_t,
+ pub handler: ::Option,
+ pub context: *mut ::c_void,
+ }
+
+ pub struct __c_anonymous_struct_time {
+ pub length: ::c_uint,
+ pub scale: ::c_uint,
+ }
+
+ pub struct _idle_hook {
+ pub hook_size: ::c_uint,
+ pub cmd: ::c_uint,
+ pub mode: ::c_uint,
+ pub latency: ::c_uint,
+ pub next_fire: u64,
+ pub curr_time: u64,
+ pub tod_adjust: u64,
+ pub resp: ::c_uint,
+ pub time: __c_anonymous_struct_time,
+ pub trigger: ::sigevent,
+ pub intrs: *mut ::c_uint,
+ pub block_stack_size: ::c_uint,
+ }
+
+ pub struct _clockadjust {
+ pub tick_count: u32,
+ pub tick_nsec_inc: i32,
+ }
+
+ pub struct qtime_entry {
+ pub cycles_per_sec: u64,
+ pub nsec_tod_adjust: u64, // volatile
+ pub nsec: u64, // volatile
+ pub nsec_inc: u32,
+ pub boot_time: u32,
+ pub adjust: _clockadjust,
+ pub timer_rate: u32,
+ pub timer_scale: i32,
+ pub timer_load: u32,
+ pub intr: i32,
+ pub epoch: u32,
+ pub flags: u32,
+ pub rr_interval_mul: u32,
+ pub timer_load_hi: u32,
+ pub nsec_stable: u64, // volatile
+ pub timer_load_max: u64,
+ pub timer_prog_time: u32,
+ spare: [u32; 7],
+ }
+
+ pub struct _sched_info {
+ pub priority_min: ::c_int,
+ pub priority_max: ::c_int,
+ pub interval: u64,
+ pub priority_priv: ::c_int,
+ reserved: [::c_int; 11],
+ }
+
+ pub struct _timer_info {
+ pub itime: ::_itimer,
+ pub otime: ::_itimer,
+ pub flags: u32,
+ pub tid: i32,
+ pub notify: i32,
+ pub clockid: ::clockid_t,
+ pub overruns: u32,
+ pub event: ::sigevent, // union
+ }
+
+ pub struct _clockperiod {
+ pub nsec: u32,
+ pub fract: i32,
+ }
+}
+
+s_no_extra_traits! {
+ pub struct syspage_entry_info {
+ pub entry_off: u16,
+ pub entry_size: u16,
+ }
+
+ pub struct syspage_array_info {
+ entry_off: u16,
+ entry_size: u16,
+ element_size: u16,
+ }
+
+ #[repr(align(8))]
+ pub struct syspage_entry {
+ pub size: u16,
+ pub total_size: u16,
+ pub type_: u16,
+ pub num_cpu: u16,
+ pub system_private: syspage_entry_info,
+ pub old_asinfo: syspage_entry_info,
+ pub __mangle_name_to_cause_compilation_errs_meminfo: syspage_entry_info,
+ pub hwinfo: syspage_entry_info,
+ pub old_cpuinfo: syspage_entry_info,
+ pub old_cacheattr: syspage_entry_info,
+ pub qtime: syspage_entry_info,
+ pub callout: syspage_entry_info,
+ pub callin: syspage_entry_info,
+ pub typed_strings: syspage_entry_info,
+ pub strings: syspage_entry_info,
+ pub old_intrinfo: syspage_entry_info,
+ pub smp: syspage_entry_info,
+ pub pminfo: syspage_entry_info,
+ pub old_mdriver: syspage_entry_info,
+ spare0: [u32; 1],
+ __reserved: [u8; 160], // anonymous union with architecture dependent structs
+ pub new_asinfo: syspage_array_info,
+ pub new_cpuinfo: syspage_array_info,
+ pub new_cacheattr: syspage_array_info,
+ pub new_intrinfo: syspage_array_info,
+ pub new_mdriver: syspage_array_info,
+ }
+}
+
+pub const SYSMGR_PID: u32 = 1;
+pub const SYSMGR_CHID: u32 = 1;
+pub const SYSMGR_COID: u32 = _NTO_SIDE_CHANNEL;
+pub const SYSMGR_HANDLE: u32 = 0;
+
+pub const STATE_DEAD: ::c_int = 0x00;
+pub const STATE_RUNNING: ::c_int = 0x01;
+pub const STATE_READY: ::c_int = 0x02;
+pub const STATE_STOPPED: ::c_int = 0x03;
+pub const STATE_SEND: ::c_int = 0x04;
+pub const STATE_RECEIVE: ::c_int = 0x05;
+pub const STATE_REPLY: ::c_int = 0x06;
+pub const STATE_STACK: ::c_int = 0x07;
+pub const STATE_WAITTHREAD: ::c_int = 0x08;
+pub const STATE_WAITPAGE: ::c_int = 0x09;
+pub const STATE_SIGSUSPEND: ::c_int = 0x0a;
+pub const STATE_SIGWAITINFO: ::c_int = 0x0b;
+pub const STATE_NANOSLEEP: ::c_int = 0x0c;
+pub const STATE_MUTEX: ::c_int = 0x0d;
+pub const STATE_CONDVAR: ::c_int = 0x0e;
+pub const STATE_JOIN: ::c_int = 0x0f;
+pub const STATE_INTR: ::c_int = 0x10;
+pub const STATE_SEM: ::c_int = 0x11;
+pub const STATE_WAITCTX: ::c_int = 0x12;
+pub const STATE_NET_SEND: ::c_int = 0x13;
+pub const STATE_NET_REPLY: ::c_int = 0x14;
+pub const STATE_MAX: ::c_int = 0x18;
+
+pub const _NTO_TIMEOUT_RECEIVE: i32 = 1 << STATE_RECEIVE;
+pub const _NTO_TIMEOUT_SEND: i32 = 1 << STATE_SEND;
+pub const _NTO_TIMEOUT_REPLY: i32 = 1 << STATE_REPLY;
+pub const _NTO_TIMEOUT_SIGSUSPEND: i32 = 1 << STATE_SIGSUSPEND;
+pub const _NTO_TIMEOUT_SIGWAITINFO: i32 = 1 << STATE_SIGWAITINFO;
+pub const _NTO_TIMEOUT_NANOSLEEP: i32 = 1 << STATE_NANOSLEEP;
+pub const _NTO_TIMEOUT_MUTEX: i32 = 1 << STATE_MUTEX;
+pub const _NTO_TIMEOUT_CONDVAR: i32 = 1 << STATE_CONDVAR;
+pub const _NTO_TIMEOUT_JOIN: i32 = 1 << STATE_JOIN;
+pub const _NTO_TIMEOUT_INTR: i32 = 1 << STATE_INTR;
+pub const _NTO_TIMEOUT_SEM: i32 = 1 << STATE_SEM;
+
+pub const _NTO_MI_ENDIAN_BIG: u32 = 1;
+pub const _NTO_MI_ENDIAN_DIFF: u32 = 2;
+pub const _NTO_MI_UNBLOCK_REQ: u32 = 256;
+pub const _NTO_MI_NET_CRED_DIRTY: u32 = 512;
+pub const _NTO_MI_CONSTRAINED: u32 = 1024;
+pub const _NTO_MI_CHROOT: u32 = 2048;
+pub const _NTO_MI_BITS_64: u32 = 4096;
+pub const _NTO_MI_BITS_DIFF: u32 = 8192;
+pub const _NTO_MI_SANDBOX: u32 = 16384;
+
+pub const _NTO_CI_ENDIAN_BIG: u32 = 1;
+pub const _NTO_CI_BKGND_PGRP: u32 = 4;
+pub const _NTO_CI_ORPHAN_PGRP: u32 = 8;
+pub const _NTO_CI_STOPPED: u32 = 128;
+pub const _NTO_CI_UNABLE: u32 = 256;
+pub const _NTO_CI_TYPE_ID: u32 = 512;
+pub const _NTO_CI_CHROOT: u32 = 2048;
+pub const _NTO_CI_BITS_64: u32 = 4096;
+pub const _NTO_CI_SANDBOX: u32 = 16384;
+pub const _NTO_CI_LOADER: u32 = 32768;
+pub const _NTO_CI_FULL_GROUPS: u32 = 2147483648;
+
+pub const _NTO_TI_ACTIVE: u32 = 1;
+pub const _NTO_TI_ABSOLUTE: u32 = 2;
+pub const _NTO_TI_EXPIRED: u32 = 4;
+pub const _NTO_TI_TOD_BASED: u32 = 8;
+pub const _NTO_TI_TARGET_PROCESS: u32 = 16;
+pub const _NTO_TI_REPORT_TOLERANCE: u32 = 32;
+pub const _NTO_TI_PRECISE: u32 = 64;
+pub const _NTO_TI_TOLERANT: u32 = 128;
+pub const _NTO_TI_WAKEUP: u32 = 256;
+pub const _NTO_TI_PROCESS_TOLERANT: u32 = 512;
+pub const _NTO_TI_HIGH_RESOLUTION: u32 = 1024;
+
+pub const _PULSE_TYPE: u32 = 0;
+pub const _PULSE_SUBTYPE: u32 = 0;
+pub const _PULSE_CODE_UNBLOCK: i32 = -32;
+pub const _PULSE_CODE_DISCONNECT: i32 = -33;
+pub const _PULSE_CODE_THREADDEATH: i32 = -34;
+pub const _PULSE_CODE_COIDDEATH: i32 = -35;
+pub const _PULSE_CODE_NET_ACK: i32 = -36;
+pub const _PULSE_CODE_NET_UNBLOCK: i32 = -37;
+pub const _PULSE_CODE_NET_DETACH: i32 = -38;
+pub const _PULSE_CODE_RESTART: i32 = -39;
+pub const _PULSE_CODE_NORESTART: i32 = -40;
+pub const _PULSE_CODE_UNBLOCK_RESTART: i32 = -41;
+pub const _PULSE_CODE_UNBLOCK_TIMER: i32 = -42;
+pub const _PULSE_CODE_MINAVAIL: u32 = 0;
+pub const _PULSE_CODE_MAXAVAIL: u32 = 127;
+
+pub const _NTO_HARD_FLAGS_END: u32 = 1;
+
+pub const _NTO_PULSE_IF_UNIQUE: u32 = 4096;
+pub const _NTO_PULSE_REPLACE: u32 = 8192;
+
+pub const _NTO_PF_NOCLDSTOP: u32 = 1;
+pub const _NTO_PF_LOADING: u32 = 2;
+pub const _NTO_PF_TERMING: u32 = 4;
+pub const _NTO_PF_ZOMBIE: u32 = 8;
+pub const _NTO_PF_NOZOMBIE: u32 = 16;
+pub const _NTO_PF_FORKED: u32 = 32;
+pub const _NTO_PF_ORPHAN_PGRP: u32 = 64;
+pub const _NTO_PF_STOPPED: u32 = 128;
+pub const _NTO_PF_DEBUG_STOPPED: u32 = 256;
+pub const _NTO_PF_BKGND_PGRP: u32 = 512;
+pub const _NTO_PF_NOISYNC: u32 = 1024;
+pub const _NTO_PF_CONTINUED: u32 = 2048;
+pub const _NTO_PF_CHECK_INTR: u32 = 4096;
+pub const _NTO_PF_COREDUMP: u32 = 8192;
+pub const _NTO_PF_RING0: u32 = 32768;
+pub const _NTO_PF_SLEADER: u32 = 65536;
+pub const _NTO_PF_WAITINFO: u32 = 131072;
+pub const _NTO_PF_DESTROYALL: u32 = 524288;
+pub const _NTO_PF_NOCOREDUMP: u32 = 1048576;
+pub const _NTO_PF_WAITDONE: u32 = 4194304;
+pub const _NTO_PF_TERM_WAITING: u32 = 8388608;
+pub const _NTO_PF_ASLR: u32 = 16777216;
+pub const _NTO_PF_EXECED: u32 = 33554432;
+pub const _NTO_PF_APP_STOPPED: u32 = 67108864;
+pub const _NTO_PF_64BIT: u32 = 134217728;
+pub const _NTO_PF_NET: u32 = 268435456;
+pub const _NTO_PF_NOLAZYSTACK: u32 = 536870912;
+pub const _NTO_PF_NOEXEC_STACK: u32 = 1073741824;
+pub const _NTO_PF_LOADER_PERMS: u32 = 2147483648;
+
+pub const _NTO_TF_INTR_PENDING: u32 = 65536;
+pub const _NTO_TF_DETACHED: u32 = 131072;
+pub const _NTO_TF_SHR_MUTEX: u32 = 262144;
+pub const _NTO_TF_SHR_MUTEX_EUID: u32 = 524288;
+pub const _NTO_TF_THREADS_HOLD: u32 = 1048576;
+pub const _NTO_TF_UNBLOCK_REQ: u32 = 4194304;
+pub const _NTO_TF_ALIGN_FAULT: u32 = 16777216;
+pub const _NTO_TF_SSTEP: u32 = 33554432;
+pub const _NTO_TF_ALLOCED_STACK: u32 = 67108864;
+pub const _NTO_TF_NOMULTISIG: u32 = 134217728;
+pub const _NTO_TF_LOW_LATENCY: u32 = 268435456;
+pub const _NTO_TF_IOPRIV: u32 = 2147483648;
+
+pub const _NTO_TCTL_IO_PRIV: u32 = 1;
+pub const _NTO_TCTL_THREADS_HOLD: u32 = 2;
+pub const _NTO_TCTL_THREADS_CONT: u32 = 3;
+pub const _NTO_TCTL_RUNMASK: u32 = 4;
+pub const _NTO_TCTL_ALIGN_FAULT: u32 = 5;
+pub const _NTO_TCTL_RUNMASK_GET_AND_SET: u32 = 6;
+pub const _NTO_TCTL_PERFCOUNT: u32 = 7;
+pub const _NTO_TCTL_ONE_THREAD_HOLD: u32 = 8;
+pub const _NTO_TCTL_ONE_THREAD_CONT: u32 = 9;
+pub const _NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT: u32 = 10;
+pub const _NTO_TCTL_NAME: u32 = 11;
+pub const _NTO_TCTL_RCM_GET_AND_SET: u32 = 12;
+pub const _NTO_TCTL_SHR_MUTEX: u32 = 13;
+pub const _NTO_TCTL_IO: u32 = 14;
+pub const _NTO_TCTL_NET_KIF_GET_AND_SET: u32 = 15;
+pub const _NTO_TCTL_LOW_LATENCY: u32 = 16;
+pub const _NTO_TCTL_ADD_EXIT_EVENT: u32 = 17;
+pub const _NTO_TCTL_DEL_EXIT_EVENT: u32 = 18;
+pub const _NTO_TCTL_IO_LEVEL: u32 = 19;
+pub const _NTO_TCTL_RESERVED: u32 = 2147483648;
+pub const _NTO_TCTL_IO_LEVEL_INHERIT: u32 = 1073741824;
+pub const _NTO_IO_LEVEL_NONE: u32 = 1;
+pub const _NTO_IO_LEVEL_1: u32 = 2;
+pub const _NTO_IO_LEVEL_2: u32 = 3;
+
+pub const _NTO_THREAD_NAME_MAX: u32 = 100;
+
+pub const _NTO_CHF_FIXED_PRIORITY: u32 = 1;
+pub const _NTO_CHF_UNBLOCK: u32 = 2;
+pub const _NTO_CHF_THREAD_DEATH: u32 = 4;
+pub const _NTO_CHF_DISCONNECT: u32 = 8;
+pub const _NTO_CHF_NET_MSG: u32 = 16;
+pub const _NTO_CHF_SENDER_LEN: u32 = 32;
+pub const _NTO_CHF_COID_DISCONNECT: u32 = 64;
+pub const _NTO_CHF_REPLY_LEN: u32 = 128;
+pub const _NTO_CHF_PULSE_POOL: u32 = 256;
+pub const _NTO_CHF_ASYNC_NONBLOCK: u32 = 512;
+pub const _NTO_CHF_ASYNC: u32 = 1024;
+pub const _NTO_CHF_GLOBAL: u32 = 2048;
+pub const _NTO_CHF_PRIVATE: u32 = 4096;
+pub const _NTO_CHF_MSG_PAUSING: u32 = 8192;
+pub const _NTO_CHF_INHERIT_RUNMASK: u32 = 16384;
+pub const _NTO_CHF_UNBLOCK_TIMER: u32 = 32768;
+
+pub const _NTO_CHO_CUSTOM_EVENT: u32 = 1;
+
+pub const _NTO_COF_CLOEXEC: u32 = 1;
+pub const _NTO_COF_DEAD: u32 = 2;
+pub const _NTO_COF_NOSHARE: u32 = 64;
+pub const _NTO_COF_NETCON: u32 = 128;
+pub const _NTO_COF_NONBLOCK: u32 = 256;
+pub const _NTO_COF_ASYNC: u32 = 512;
+pub const _NTO_COF_GLOBAL: u32 = 1024;
+pub const _NTO_COF_NOEVENT: u32 = 2048;
+pub const _NTO_COF_INSECURE: u32 = 4096;
+pub const _NTO_COF_REG_EVENTS: u32 = 8192;
+pub const _NTO_COF_UNREG_EVENTS: u32 = 16384;
+pub const _NTO_COF_MASK: u32 = 65535;
+
+pub const _NTO_SIDE_CHANNEL: u32 = 1073741824;
+
+pub const _NTO_CONNECTION_SCOID: u32 = 65536;
+pub const _NTO_GLOBAL_CHANNEL: u32 = 1073741824;
+
+pub const _NTO_TIMEOUT_MASK: u32 = (1 << STATE_MAX) - 1;
+pub const _NTO_TIMEOUT_ACTIVE: u32 = 1 << STATE_MAX;
+pub const _NTO_TIMEOUT_IMMEDIATE: u32 = 1 << (STATE_MAX + 1);
+
+pub const _NTO_IC_LATENCY: u32 = 0;
+
+pub const _NTO_INTR_FLAGS_END: u32 = 1;
+pub const _NTO_INTR_FLAGS_NO_UNMASK: u32 = 2;
+pub const _NTO_INTR_FLAGS_PROCESS: u32 = 4;
+pub const _NTO_INTR_FLAGS_TRK_MSK: u32 = 8;
+pub const _NTO_INTR_FLAGS_ARRAY: u32 = 16;
+pub const _NTO_INTR_FLAGS_EXCLUSIVE: u32 = 32;
+pub const _NTO_INTR_FLAGS_FPU: u32 = 64;
+
+pub const _NTO_INTR_CLASS_EXTERNAL: u32 = 0;
+pub const _NTO_INTR_CLASS_SYNTHETIC: u32 = 2147418112;
+
+pub const _NTO_INTR_SPARE: u32 = 2147483647;
+
+pub const _NTO_HOOK_IDLE: u32 = 2147418113;
+pub const _NTO_HOOK_OVERDRIVE: u32 = 2147418114;
+pub const _NTO_HOOK_LAST: u32 = 2147418114;
+pub const _NTO_HOOK_IDLE2_FLAG: u32 = 32768;
+
+pub const _NTO_IH_CMD_SLEEP_SETUP: u32 = 1;
+pub const _NTO_IH_CMD_SLEEP_BLOCK: u32 = 2;
+pub const _NTO_IH_CMD_SLEEP_WAKEUP: u32 = 4;
+pub const _NTO_IH_CMD_SLEEP_ONLINE: u32 = 8;
+pub const _NTO_IH_RESP_NEEDS_BLOCK: u32 = 1;
+pub const _NTO_IH_RESP_NEEDS_WAKEUP: u32 = 2;
+pub const _NTO_IH_RESP_NEEDS_ONLINE: u32 = 4;
+pub const _NTO_IH_RESP_SYNC_TIME: u32 = 16;
+pub const _NTO_IH_RESP_SYNC_TLB: u32 = 32;
+pub const _NTO_IH_RESP_SUGGEST_OFFLINE: u32 = 256;
+pub const _NTO_IH_RESP_SLEEP_MODE_REACHED: u32 = 512;
+pub const _NTO_IH_RESP_DELIVER_INTRS: u32 = 1024;
+
+pub const _NTO_READIOV_SEND: u32 = 0;
+pub const _NTO_READIOV_REPLY: u32 = 1;
+
+pub const _NTO_KEYDATA_VTID: u32 = 2147483648;
+
+pub const _NTO_KEYDATA_PATHSIGN: u32 = 32768;
+pub const _NTO_KEYDATA_OP_MASK: u32 = 255;
+pub const _NTO_KEYDATA_VERIFY: u32 = 0;
+pub const _NTO_KEYDATA_CALCULATE: u32 = 1;
+pub const _NTO_KEYDATA_CALCULATE_REUSE: u32 = 2;
+pub const _NTO_KEYDATA_PATHSIGN_VERIFY: u32 = 32768;
+pub const _NTO_KEYDATA_PATHSIGN_CALCULATE: u32 = 32769;
+pub const _NTO_KEYDATA_PATHSIGN_CALCULATE_REUSE: u32 = 32770;
+
+pub const _NTO_SCTL_SETPRIOCEILING: u32 = 1;
+pub const _NTO_SCTL_GETPRIOCEILING: u32 = 2;
+pub const _NTO_SCTL_SETEVENT: u32 = 3;
+pub const _NTO_SCTL_MUTEX_WAKEUP: u32 = 4;
+pub const _NTO_SCTL_MUTEX_CONSISTENT: u32 = 5;
+pub const _NTO_SCTL_SEM_VALUE: u32 = 6;
+
+pub const _NTO_CLIENTINFO_GETGROUPS: u32 = 1;
+pub const _NTO_CLIENTINFO_GETTYPEID: u32 = 2;
+
+extern "C" {
+ pub fn ChannelCreate(__flags: ::c_uint) -> ::c_int;
+ pub fn ChannelCreate_r(__flags: ::c_uint) -> ::c_int;
+ pub fn ChannelCreatePulsePool(
+ __flags: ::c_uint,
+ __config: *const nto_channel_config,
+ ) -> ::c_int;
+ pub fn ChannelCreateExt(
+ __flags: ::c_uint,
+ __mode: ::mode_t,
+ __bufsize: usize,
+ __maxnumbuf: ::c_uint,
+ __ev: *const ::sigevent,
+ __cred: *mut _cred_info,
+ ) -> ::c_int;
+ pub fn ChannelDestroy(__chid: ::c_int) -> ::c_int;
+ pub fn ChannelDestroy_r(__chid: ::c_int) -> ::c_int;
+ pub fn ConnectAttach(
+ __nd: u32,
+ __pid: ::pid_t,
+ __chid: ::c_int,
+ __index: ::c_uint,
+ __flags: ::c_int,
+ ) -> ::c_int;
+ pub fn ConnectAttach_r(
+ __nd: u32,
+ __pid: ::pid_t,
+ __chid: ::c_int,
+ __index: ::c_uint,
+ __flags: ::c_int,
+ ) -> ::c_int;
+
+ // TODO: The following function uses a structure defined in a header file
+ // which doesn't appear as part of the default headers found in a
+ // standard installation of Neutrino 7.1 SDP. Commented out for now.
+ //pub fn ConnectAttachExt(
+ // __nd: u32,
+ // __pid: ::pid_t,
+ // __chid: ::c_int,
+ // __index: ::c_uint,
+ // __flags: ::c_int,
+ // __cd: *mut _asyncmsg_connection_descriptor,
+ //) -> ::c_int;
+ pub fn ConnectDetach(__coid: ::c_int) -> ::c_int;
+ pub fn ConnectDetach_r(__coid: ::c_int) -> ::c_int;
+ pub fn ConnectServerInfo(__pid: ::pid_t, __coid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+ pub fn ConnectServerInfo_r(
+ __pid: ::pid_t,
+ __coid: ::c_int,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn ConnectClientInfoExtraArgs(
+ __scoid: ::c_int,
+ __info_pp: *mut _client_info,
+ __ngroups: ::c_int,
+ __abilities: *mut _client_able,
+ __nable: ::c_int,
+ __type_id: *mut ::c_uint,
+ ) -> ::c_int;
+ pub fn ConnectClientInfoExtraArgs_r(
+ __scoid: ::c_int,
+ __info_pp: *mut _client_info,
+ __ngroups: ::c_int,
+ __abilities: *mut _client_able,
+ __nable: ::c_int,
+ __type_id: *mut ::c_uint,
+ ) -> ::c_int;
+ pub fn ConnectClientInfo(
+ __scoid: ::c_int,
+ __info: *mut _client_info,
+ __ngroups: ::c_int,
+ ) -> ::c_int;
+ pub fn ConnectClientInfo_r(
+ __scoid: ::c_int,
+ __info: *mut _client_info,
+ __ngroups: ::c_int,
+ ) -> ::c_int;
+ pub fn ConnectClientInfoExt(
+ __scoid: ::c_int,
+ __info_pp: *mut *mut _client_info,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn ClientInfoExtFree(__info_pp: *mut *mut _client_info) -> ::c_int;
+ pub fn ConnectClientInfoAble(
+ __scoid: ::c_int,
+ __info_pp: *mut *mut _client_info,
+ flags: ::c_int,
+ abilities: *mut _client_able,
+ nable: ::c_int,
+ ) -> ::c_int;
+ pub fn ConnectFlags(
+ __pid: ::pid_t,
+ __coid: ::c_int,
+ __mask: ::c_uint,
+ __bits: ::c_uint,
+ ) -> ::c_int;
+ pub fn ConnectFlags_r(
+ __pid: ::pid_t,
+ __coid: ::c_int,
+ __mask: ::c_uint,
+ __bits: ::c_uint,
+ ) -> ::c_int;
+ pub fn ChannelConnectAttr(
+ __id: ::c_uint,
+ __old_attr: *mut _channel_connect_attr,
+ __new_attr: *mut _channel_connect_attr,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn MsgSend(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSend_r(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendnc(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendnc_r(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendsv(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendsv_r(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendsvnc(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendsvnc_r(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvs(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvs_r(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvsnc(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvsnc_r(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ ) -> ::c_long;
+ pub fn MsgSendv(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendv_r(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvnc(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgSendvnc_r(
+ __coid: ::c_int,
+ __siov: *const ::iovec,
+ __sparts: usize,
+ __riov: *const ::iovec,
+ __rparts: usize,
+ ) -> ::c_long;
+ pub fn MsgReceive(
+ __chid: ::c_int,
+ __msg: *mut ::c_void,
+ __bytes: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceive_r(
+ __chid: ::c_int,
+ __msg: *mut ::c_void,
+ __bytes: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivev(
+ __chid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivev_r(
+ __chid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivePulse(
+ __chid: ::c_int,
+ __pulse: *mut ::c_void,
+ __bytes: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivePulse_r(
+ __chid: ::c_int,
+ __pulse: *mut ::c_void,
+ __bytes: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivePulsev(
+ __chid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReceivePulsev_r(
+ __chid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __info: *mut _msg_info64,
+ ) -> ::c_int;
+ pub fn MsgReply(
+ __rcvid: ::c_int,
+ __status: ::c_long,
+ __msg: *const ::c_void,
+ __bytes: usize,
+ ) -> ::c_int;
+ pub fn MsgReply_r(
+ __rcvid: ::c_int,
+ __status: ::c_long,
+ __msg: *const ::c_void,
+ __bytes: usize,
+ ) -> ::c_int;
+ pub fn MsgReplyv(
+ __rcvid: ::c_int,
+ __status: ::c_long,
+ __iov: *const ::iovec,
+ __parts: usize,
+ ) -> ::c_int;
+ pub fn MsgReplyv_r(
+ __rcvid: ::c_int,
+ __status: ::c_long,
+ __iov: *const ::iovec,
+ __parts: usize,
+ ) -> ::c_int;
+ pub fn MsgReadiov(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ __flags: ::c_int,
+ ) -> isize;
+ pub fn MsgReadiov_r(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ __flags: ::c_int,
+ ) -> isize;
+ pub fn MsgRead(
+ __rcvid: ::c_int,
+ __msg: *mut ::c_void,
+ __bytes: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgRead_r(
+ __rcvid: ::c_int,
+ __msg: *mut ::c_void,
+ __bytes: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgReadv(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgReadv_r(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgWrite(
+ __rcvid: ::c_int,
+ __msg: *const ::c_void,
+ __bytes: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgWrite_r(
+ __rcvid: ::c_int,
+ __msg: *const ::c_void,
+ __bytes: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgWritev(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgWritev_r(
+ __rcvid: ::c_int,
+ __iov: *const ::iovec,
+ __parts: usize,
+ __offset: usize,
+ ) -> isize;
+ pub fn MsgSendPulse(
+ __coid: ::c_int,
+ __priority: ::c_int,
+ __code: ::c_int,
+ __value: ::c_int,
+ ) -> ::c_int;
+ pub fn MsgSendPulse_r(
+ __coid: ::c_int,
+ __priority: ::c_int,
+ __code: ::c_int,
+ __value: ::c_int,
+ ) -> ::c_int;
+ pub fn MsgSendPulsePtr(
+ __coid: ::c_int,
+ __priority: ::c_int,
+ __code: ::c_int,
+ __value: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn MsgSendPulsePtr_r(
+ __coid: ::c_int,
+ __priority: ::c_int,
+ __code: ::c_int,
+ __value: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn MsgDeliverEvent(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+ pub fn MsgDeliverEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+ pub fn MsgVerifyEvent(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+ pub fn MsgVerifyEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+ pub fn MsgRegisterEvent(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+ pub fn MsgRegisterEvent_r(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+ pub fn MsgUnregisterEvent(__event: *const ::sigevent) -> ::c_int;
+ pub fn MsgUnregisterEvent_r(__event: *const ::sigevent) -> ::c_int;
+ pub fn MsgInfo(__rcvid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+ pub fn MsgInfo_r(__rcvid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+ pub fn MsgKeyData(
+ __rcvid: ::c_int,
+ __oper: ::c_int,
+ __key: u32,
+ __newkey: *mut u32,
+ __iov: *const ::iovec,
+ __parts: ::c_int,
+ ) -> ::c_int;
+ pub fn MsgKeyData_r(
+ __rcvid: ::c_int,
+ __oper: ::c_int,
+ __key: u32,
+ __newkey: *mut u32,
+ __iov: *const ::iovec,
+ __parts: ::c_int,
+ ) -> ::c_int;
+ pub fn MsgError(__rcvid: ::c_int, __err: ::c_int) -> ::c_int;
+ pub fn MsgError_r(__rcvid: ::c_int, __err: ::c_int) -> ::c_int;
+ pub fn MsgCurrent(__rcvid: ::c_int) -> ::c_int;
+ pub fn MsgCurrent_r(__rcvid: ::c_int) -> ::c_int;
+ pub fn MsgSendAsyncGbl(
+ __coid: ::c_int,
+ __smsg: *const ::c_void,
+ __sbytes: usize,
+ __msg_prio: ::c_uint,
+ ) -> ::c_int;
+ pub fn MsgSendAsync(__coid: ::c_int) -> ::c_int;
+ pub fn MsgReceiveAsyncGbl(
+ __chid: ::c_int,
+ __rmsg: *mut ::c_void,
+ __rbytes: usize,
+ __info: *mut _msg_info64,
+ __coid: ::c_int,
+ ) -> ::c_int;
+ pub fn MsgReceiveAsync(__chid: ::c_int, __iov: *const ::iovec, __parts: ::c_uint) -> ::c_int;
+ pub fn MsgPause(__rcvid: ::c_int, __cookie: ::c_uint) -> ::c_int;
+ pub fn MsgPause_r(__rcvid: ::c_int, __cookie: ::c_uint) -> ::c_int;
+
+ pub fn SignalKill(
+ __nd: u32,
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __signo: ::c_int,
+ __code: ::c_int,
+ __value: ::c_int,
+ ) -> ::c_int;
+ pub fn SignalKill_r(
+ __nd: u32,
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __signo: ::c_int,
+ __code: ::c_int,
+ __value: ::c_int,
+ ) -> ::c_int;
+ pub fn SignalKillSigval(
+ __nd: u32,
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __signo: ::c_int,
+ __code: ::c_int,
+ __value: *const ::sigval,
+ ) -> ::c_int;
+ pub fn SignalKillSigval_r(
+ __nd: u32,
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __signo: ::c_int,
+ __code: ::c_int,
+ __value: *const ::sigval,
+ ) -> ::c_int;
+ pub fn SignalReturn(__info: *mut _sighandler_info) -> ::c_int;
+ pub fn SignalFault(__sigcode: ::c_uint, __regs: *mut ::c_void, __refaddr: usize) -> ::c_int;
+ pub fn SignalAction(
+ __pid: ::pid_t,
+ __sigstub: unsafe extern "C" fn(),
+ __signo: ::c_int,
+ __act: *const ::sigaction,
+ __oact: *mut ::sigaction,
+ ) -> ::c_int;
+ pub fn SignalAction_r(
+ __pid: ::pid_t,
+ __sigstub: unsafe extern "C" fn(),
+ __signo: ::c_int,
+ __act: *const ::sigaction,
+ __oact: *mut ::sigaction,
+ ) -> ::c_int;
+ pub fn SignalProcmask(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __how: ::c_int,
+ __set: *const ::sigset_t,
+ __oldset: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn SignalProcmask_r(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __how: ::c_int,
+ __set: *const ::sigset_t,
+ __oldset: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn SignalSuspend(__set: *const ::sigset_t) -> ::c_int;
+ pub fn SignalSuspend_r(__set: *const ::sigset_t) -> ::c_int;
+ pub fn SignalWaitinfo(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+ pub fn SignalWaitinfo_r(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+ pub fn SignalWaitinfoMask(
+ __set: *const ::sigset_t,
+ __info: *mut ::siginfo_t,
+ __mask: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn SignalWaitinfoMask_r(
+ __set: *const ::sigset_t,
+ __info: *mut ::siginfo_t,
+ __mask: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn ThreadCreate(
+ __pid: ::pid_t,
+ __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+ __arg: *mut ::c_void,
+ __attr: *const ::_thread_attr,
+ ) -> ::c_int;
+ pub fn ThreadCreate_r(
+ __pid: ::pid_t,
+ __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+ __arg: *mut ::c_void,
+ __attr: *const ::_thread_attr,
+ ) -> ::c_int;
+
+ pub fn ThreadDestroy(__tid: ::c_int, __priority: ::c_int, __status: *mut ::c_void) -> ::c_int;
+ pub fn ThreadDestroy_r(__tid: ::c_int, __priority: ::c_int, __status: *mut ::c_void)
+ -> ::c_int;
+ pub fn ThreadDetach(__tid: ::c_int) -> ::c_int;
+ pub fn ThreadDetach_r(__tid: ::c_int) -> ::c_int;
+ pub fn ThreadJoin(__tid: ::c_int, __status: *mut *mut ::c_void) -> ::c_int;
+ pub fn ThreadJoin_r(__tid: ::c_int, __status: *mut *mut ::c_void) -> ::c_int;
+ pub fn ThreadCancel(__tid: ::c_int, __canstub: unsafe extern "C" fn()) -> ::c_int;
+ pub fn ThreadCancel_r(__tid: ::c_int, __canstub: unsafe extern "C" fn()) -> ::c_int;
+ pub fn ThreadCtl(__cmd: ::c_int, __data: *mut ::c_void) -> ::c_int;
+ pub fn ThreadCtl_r(__cmd: ::c_int, __data: *mut ::c_void) -> ::c_int;
+ pub fn ThreadCtlExt(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __cmd: ::c_int,
+ __data: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn ThreadCtlExt_r(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __cmd: ::c_int,
+ __data: *mut ::c_void,
+ ) -> ::c_int;
+
+ pub fn InterruptHookTrace(
+ __handler: ::Option *const ::sigevent>,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptHookIdle(
+ __handler: ::Option,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptHookIdle2(
+ __handler: ::Option<
+ unsafe extern "C" fn(arg1: ::c_uint, arg2: *mut syspage_entry, arg3: *mut _idle_hook),
+ >,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptHookOverdriveEvent(__event: *const ::sigevent, __flags: ::c_uint) -> ::c_int;
+ pub fn InterruptAttachEvent(
+ __intr: ::c_int,
+ __event: *const ::sigevent,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptAttachEvent_r(
+ __intr: ::c_int,
+ __event: *const ::sigevent,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptAttach(
+ __intr: ::c_int,
+ __handler: ::Option<
+ unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const ::sigevent,
+ >,
+ __area: *const ::c_void,
+ __size: ::c_int,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptAttach_r(
+ __intr: ::c_int,
+ __handler: ::Option<
+ unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const ::sigevent,
+ >,
+ __area: *const ::c_void,
+ __size: ::c_int,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptAttachArray(
+ __intr: ::c_int,
+ __handler: ::Option<
+ unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const *const ::sigevent,
+ >,
+ __area: *const ::c_void,
+ __size: ::c_int,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptAttachArray_r(
+ __intr: ::c_int,
+ __handler: ::Option<
+ unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const *const ::sigevent,
+ >,
+ __area: *const ::c_void,
+ __size: ::c_int,
+ __flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptDetach(__id: ::c_int) -> ::c_int;
+ pub fn InterruptDetach_r(__id: ::c_int) -> ::c_int;
+ pub fn InterruptWait(__flags: ::c_int, __timeout: *const u64) -> ::c_int;
+ pub fn InterruptWait_r(__flags: ::c_int, __timeout: *const u64) -> ::c_int;
+ pub fn InterruptCharacteristic(
+ __type: ::c_int,
+ __id: ::c_int,
+ __new: *mut ::c_uint,
+ __old: *mut ::c_uint,
+ ) -> ::c_int;
+ pub fn InterruptCharacteristic_r(
+ __type: ::c_int,
+ __id: ::c_int,
+ __new: *mut ::c_uint,
+ __old: *mut ::c_uint,
+ ) -> ::c_int;
+
+ pub fn SchedGet(__pid: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+ pub fn SchedGet_r(__pid: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+ pub fn SchedGetCpuNum() -> ::c_uint;
+ pub fn SchedSet(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __algorithm: ::c_int,
+ __param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn SchedSet_r(
+ __pid: ::pid_t,
+ __tid: ::c_int,
+ __algorithm: ::c_int,
+ __param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn SchedInfo(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_sched_info) -> ::c_int;
+ pub fn SchedInfo_r(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_sched_info)
+ -> ::c_int;
+ pub fn SchedYield() -> ::c_int;
+ pub fn SchedYield_r() -> ::c_int;
+ pub fn SchedCtl(__cmd: ::c_int, __data: *mut ::c_void, __length: usize) -> ::c_int;
+ pub fn SchedCtl_r(__cmd: ::c_int, __data: *mut ::c_void, __length: usize) -> ::c_int;
+ pub fn SchedJobCreate(__job: *mut nto_job_t) -> ::c_int;
+ pub fn SchedJobCreate_r(__job: *mut nto_job_t) -> ::c_int;
+ pub fn SchedJobDestroy(__job: *mut nto_job_t) -> ::c_int;
+ pub fn SchedJobDestroy_r(__job: *mut nto_job_t) -> ::c_int;
+ pub fn SchedWaypoint(
+ __job: *mut nto_job_t,
+ __new: *const i64,
+ __max: *const i64,
+ __old: *mut i64,
+ ) -> ::c_int;
+ pub fn SchedWaypoint_r(
+ __job: *mut nto_job_t,
+ __new: *const i64,
+ __max: *const i64,
+ __old: *mut i64,
+ ) -> ::c_int;
+
+ pub fn TimerCreate(__id: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+ pub fn TimerCreate_r(__id: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+ pub fn TimerDestroy(__id: ::timer_t) -> ::c_int;
+ pub fn TimerDestroy_r(__id: ::timer_t) -> ::c_int;
+ pub fn TimerSettime(
+ __id: ::timer_t,
+ __flags: ::c_int,
+ __itime: *const ::_itimer,
+ __oitime: *mut ::_itimer,
+ ) -> ::c_int;
+ pub fn TimerSettime_r(
+ __id: ::timer_t,
+ __flags: ::c_int,
+ __itime: *const ::_itimer,
+ __oitime: *mut ::_itimer,
+ ) -> ::c_int;
+ pub fn TimerInfo(
+ __pid: ::pid_t,
+ __id: ::timer_t,
+ __flags: ::c_int,
+ __info: *mut ::_timer_info,
+ ) -> ::c_int;
+ pub fn TimerInfo_r(
+ __pid: ::pid_t,
+ __id: ::timer_t,
+ __flags: ::c_int,
+ __info: *mut ::_timer_info,
+ ) -> ::c_int;
+ pub fn TimerAlarm(
+ __id: ::clockid_t,
+ __itime: *const ::_itimer,
+ __otime: *mut ::_itimer,
+ ) -> ::c_int;
+ pub fn TimerAlarm_r(
+ __id: ::clockid_t,
+ __itime: *const ::_itimer,
+ __otime: *mut ::_itimer,
+ ) -> ::c_int;
+ pub fn TimerTimeout(
+ __id: ::clockid_t,
+ __flags: ::c_int,
+ __notify: *const ::sigevent,
+ __ntime: *const u64,
+ __otime: *mut u64,
+ ) -> ::c_int;
+ pub fn TimerTimeout_r(
+ __id: ::clockid_t,
+ __flags: ::c_int,
+ __notify: *const ::sigevent,
+ __ntime: *const u64,
+ __otime: *mut u64,
+ ) -> ::c_int;
+
+ pub fn SyncTypeCreate(
+ __type: ::c_uint,
+ __sync: *mut ::sync_t,
+ __attr: *const ::_sync_attr,
+ ) -> ::c_int;
+ pub fn SyncTypeCreate_r(
+ __type: ::c_uint,
+ __sync: *mut ::sync_t,
+ __attr: *const ::_sync_attr,
+ ) -> ::c_int;
+ pub fn SyncDestroy(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncDestroy_r(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncCtl(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+ pub fn SyncCtl_r(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+ pub fn SyncMutexEvent(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+ pub fn SyncMutexEvent_r(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+ pub fn SyncMutexLock(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncMutexLock_r(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncMutexUnlock(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncMutexUnlock_r(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncMutexRevive(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncMutexRevive_r(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncCondvarWait(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+ pub fn SyncCondvarWait_r(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+ pub fn SyncCondvarSignal(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+ pub fn SyncCondvarSignal_r(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+ pub fn SyncSemPost(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncSemPost_r(__sync: *mut ::sync_t) -> ::c_int;
+ pub fn SyncSemWait(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+ pub fn SyncSemWait_r(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+
+ pub fn ClockTime(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+ pub fn ClockTime_r(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+ pub fn ClockAdjust(
+ __id: ::clockid_t,
+ _new: *const ::_clockadjust,
+ __old: *mut ::_clockadjust,
+ ) -> ::c_int;
+ pub fn ClockAdjust_r(
+ __id: ::clockid_t,
+ _new: *const ::_clockadjust,
+ __old: *mut ::_clockadjust,
+ ) -> ::c_int;
+ pub fn ClockPeriod(
+ __id: ::clockid_t,
+ _new: *const ::_clockperiod,
+ __old: *mut ::_clockperiod,
+ __reserved: ::c_int,
+ ) -> ::c_int;
+ pub fn ClockPeriod_r(
+ __id: ::clockid_t,
+ _new: *const ::_clockperiod,
+ __old: *mut ::_clockperiod,
+ __reserved: ::c_int,
+ ) -> ::c_int;
+ pub fn ClockId(__pid: ::pid_t, __tid: ::c_int) -> ::c_int;
+ pub fn ClockId_r(__pid: ::pid_t, __tid: ::c_int) -> ::c_int;
+
+ //
+ //TODO: The following commented out functions are implemented in assembly.
+ // We can implmement them either via a C stub or rust's inline assembly.
+ //
+ //pub fn InterruptEnable();
+ //pub fn InterruptDisable();
+ pub fn InterruptMask(__intr: ::c_int, __id: ::c_int) -> ::c_int;
+ pub fn InterruptUnmask(__intr: ::c_int, __id: ::c_int) -> ::c_int;
+ //pub fn InterruptLock(__spin: *mut ::intrspin);
+ //pub fn InterruptUnlock(__spin: *mut ::intrspin);
+ //pub fn InterruptStatus() -> ::c_uint;
+}
diff --git a/src/unix/nto/x86_64.rs b/src/unix/nto/x86_64.rs
new file mode 100644
index 0000000000000..3a1d230bb98eb
--- /dev/null
+++ b/src/unix/nto/x86_64.rs
@@ -0,0 +1,132 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type time_t = i64;
+
+s! {
+ #[repr(align(8))]
+ pub struct x86_64_cpu_registers {
+ pub rdi: u64,
+ pub rsi: u64,
+ pub rdx: u64,
+ pub r10: u64,
+ pub r8: u64,
+ pub r9: u64,
+ pub rax: u64,
+ pub rbx: u64,
+ pub rbp: u64,
+ pub rcx: u64,
+ pub r11: u64,
+ pub r12: u64,
+ pub r13: u64,
+ pub r14: u64,
+ pub r15: u64,
+ pub rip: u64,
+ pub cs: u32,
+ rsvd1: u32,
+ pub rflags: u64,
+ pub rsp: u64,
+ pub ss: u32,
+ rsvd2: u32,
+ }
+
+ #[repr(align(8))]
+ pub struct mcontext_t {
+ pub cpu: x86_64_cpu_registers,
+ #[cfg(libc_union)]
+ pub fpu: x86_64_fpu_registers,
+ #[cfg(not(libc_union))]
+ __reserved: [u8; 1024],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_size: ::size_t,
+ pub ss_flags: ::c_int,
+ }
+
+ pub struct fsave_area_64 {
+ pub fpu_control_word: u32,
+ pub fpu_status_word: u32,
+ pub fpu_tag_word: u32,
+ pub fpu_ip: u32,
+ pub fpu_cs: u32,
+ pub fpu_op: u32,
+ pub fpu_ds: u32,
+ pub st_regs: [u8; 80],
+ }
+
+ pub struct fxsave_area_64 {
+ pub fpu_control_word: u16,
+ pub fpu_status_word: u16,
+ pub fpu_tag_word: u16,
+ pub fpu_operand: u16,
+ pub fpu_rip: u64,
+ pub fpu_rdp: u64,
+ pub mxcsr: u32,
+ pub mxcsr_mask: u32,
+ pub st_regs: [u8; 128],
+ pub xmm_regs: [u8; 128],
+ reserved2: [u8; 224],
+ }
+
+ pub struct fpu_extention_savearea_64 {
+ pub other: [u8; 512],
+ pub xstate_bv: u64,
+ pub xstate_undef: [u64; 7],
+ pub xstate_info: [u8; 224],
+ }
+}
+
+s_no_extra_traits! {
+ #[cfg(libc_union)]
+ pub union x86_64_fpu_registers {
+ pub fsave_area: fsave_area_64,
+ pub fxsave_area: fxsave_area_64,
+ pub xsave_area: fpu_extention_savearea_64,
+ pub data: [u8; 1024],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ #[cfg(libc_union)]
+ impl Eq for x86_64_fpu_registers {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for x86_64_fpu_registers {
+ fn eq(&self, other: &x86_64_fpu_registers) -> bool {
+ unsafe {
+ self.fsave_area == other.fsave_area
+ || self.fxsave_area == other.fxsave_area
+ || self.xsave_area == other.xsave_area
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for x86_64_fpu_registers {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("x86_64_fpu_registers")
+ .field("fsave_area", &self.fsave_area)
+ .field("fxsave_area", &self.fxsave_area)
+ .field("xsave_area", &self.xsave_area)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for x86_64_fpu_registers {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.fsave_area.hash(state);
+ self.fxsave_area.hash(state);
+ self.xsave_area.hash(state);
+ }
+ }
+ }
+ }
+}
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index faf8f0bf75021..afba67727799a 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -1,8 +1,20 @@
pub type c_char = i8;
-pub type c_long = i64;
-pub type c_ulong = u64;
pub type wchar_t = i32;
+cfg_if! {
+ if #[cfg(target_pointer_width = "32")] {
+ pub type c_long = i32;
+ pub type c_ulong = u32;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_pointer_width = "64")] {
+ pub type c_long = i64;
+ pub type c_ulong = u64;
+ }
+}
+
pub type blkcnt_t = ::c_ulong;
pub type blksize_t = ::c_long;
pub type clock_t = ::c_long;
@@ -14,7 +26,7 @@ pub type ino_t = ::c_ulong;
pub type mode_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type nlink_t = ::c_ulong;
-pub type off_t = ::c_long;
+pub type off_t = ::c_longlong;
pub type pthread_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
@@ -34,7 +46,7 @@ pub type socklen_t = u32;
pub type speed_t = u32;
pub type suseconds_t = ::c_int;
pub type tcflag_t = u32;
-pub type time_t = ::c_long;
+pub type time_t = ::c_longlong;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
@@ -151,12 +163,20 @@ s! {
}
pub struct sigaction {
- pub sa_handler: ::sighandler_t,
+ pub sa_sigaction: ::sighandler_t,
pub sa_flags: ::c_ulong,
pub sa_restorer: ::Option,
pub sa_mask: ::sigset_t,
}
+ pub struct siginfo_t {
+ pub si_signo: ::c_int,
+ pub si_errno: ::c_int,
+ pub si_code: ::c_int,
+ _pad: [::c_int; 29],
+ _align: [usize; 0],
+ }
+
pub struct sockaddr {
pub sa_family: ::sa_family_t,
pub sa_data: [::c_char; 14],
@@ -367,6 +387,7 @@ pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */
pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */
/* Operation not supported on transport endpoint */
pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */
/* Address family not supported by protocol */
pub const EAFNOSUPPORT: ::c_int = 97;
@@ -439,7 +460,25 @@ pub const O_SYMLINK: ::c_int = 0x4000_0000;
pub const O_NOFOLLOW: ::c_int = -0x8000_0000;
// netdb.h
+pub const AI_PASSIVE: ::c_int = 0x0001;
+pub const AI_CANONNAME: ::c_int = 0x0002;
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
+pub const AI_V4MAPPED: ::c_int = 0x0008;
+pub const AI_ALL: ::c_int = 0x0010;
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
+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_ADDRFAMILY: ::c_int = -9;
+pub const EAI_MEMORY: ::c_int = -10;
pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -12;
pub const NI_MAXHOST: ::c_int = 1025;
pub const NI_MAXSERV: ::c_int = 32;
pub const NI_NUMERICHOST: ::c_int = 0x0001;
@@ -589,6 +628,7 @@ pub const EXIT_FAILURE: ::c_int = 1;
// sys/ioctl.h
// FIXME: relibc {
+pub const FIONREAD: ::c_ulong = 0x541B;
pub const FIONBIO: ::c_ulong = 0x5421;
pub const FIOCLEX: ::c_ulong = 0x5451;
// }
@@ -606,6 +646,12 @@ pub const PROT_READ: ::c_int = 0x0004;
pub const PROT_WRITE: ::c_int = 0x0002;
pub const PROT_EXEC: ::c_int = 0x0001;
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_ANON: ::c_int = 0x0020;
@@ -635,6 +681,7 @@ pub const MSG_EOR: ::c_int = 128;
pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
pub const MSG_TRUNC: ::c_int = 32;
+pub const MSG_DONTWAIT: ::c_int = 64;
pub const MSG_WAITALL: ::c_int = 256;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -674,25 +721,24 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = 1;
// sys/termios.h
-pub const NCCS: usize = 32;
-
-pub const VINTR: usize = 0;
-pub const VQUIT: usize = 1;
-pub const VERASE: usize = 2;
-pub const VKILL: usize = 3;
-pub const VEOF: usize = 4;
-pub const VTIME: usize = 5;
-pub const VMIN: usize = 6;
+pub const VEOF: usize = 0;
+pub const VEOL: usize = 1;
+pub const VEOL2: usize = 2;
+pub const VERASE: usize = 3;
+pub const VWERASE: usize = 4;
+pub const VKILL: usize = 5;
+pub const VREPRINT: usize = 6;
pub const VSWTC: usize = 7;
-pub const VSTART: usize = 8;
-pub const VSTOP: usize = 9;
+pub const VINTR: usize = 8;
+pub const VQUIT: usize = 9;
pub const VSUSP: usize = 10;
-pub const VEOL: usize = 11;
-pub const VREPRINT: usize = 12;
-pub const VDISCARD: usize = 13;
-pub const VWERASE: usize = 14;
-pub const VLNEXT: usize = 15;
-pub const VEOL2: usize = 16;
+pub const VSTART: usize = 12;
+pub const VSTOP: usize = 13;
+pub const VLNEXT: usize = 14;
+pub const VDISCARD: usize = 15;
+pub const VMIN: usize = 16;
+pub const VTIME: usize = 17;
+pub const NCCS: usize = 32;
pub const IGNBRK: ::tcflag_t = 0o000_001;
pub const BRKINT: ::tcflag_t = 0o000_002;
@@ -703,25 +749,17 @@ pub const ISTRIP: ::tcflag_t = 0o000_040;
pub const INLCR: ::tcflag_t = 0o000_100;
pub const IGNCR: ::tcflag_t = 0o000_200;
pub const ICRNL: ::tcflag_t = 0o000_400;
-pub const IUCLC: ::tcflag_t = 0o001_000;
-pub const IXON: ::tcflag_t = 0o002_000;
-pub const IXANY: ::tcflag_t = 0o004_000;
-pub const IXOFF: ::tcflag_t = 0o010_000;
-pub const IMAXBEL: ::tcflag_t = 0o020_000;
-pub const IUTF8: ::tcflag_t = 0o040_000;
+pub const IXON: ::tcflag_t = 0o001_000;
+pub const IXOFF: ::tcflag_t = 0o002_000;
pub const OPOST: ::tcflag_t = 0o000_001;
-pub const OLCUC: ::tcflag_t = 0o000_002;
-pub const ONLCR: ::tcflag_t = 0o000_004;
+pub const ONLCR: ::tcflag_t = 0o000_002;
+pub const OLCUC: ::tcflag_t = 0o000_004;
pub const OCRNL: ::tcflag_t = 0o000_010;
pub const ONOCR: ::tcflag_t = 0o000_020;
-pub const ONLRET: ::tcflag_t = 0o00_0040;
-pub const OFILL: ::tcflag_t = 0o000_100;
-pub const OFDEL: ::tcflag_t = 0o000_200;
-
-pub const VTDLY: usize = 0o040_000;
-pub const VT0: usize = 0o000_000;
-pub const VT1: usize = 0o040_000;
+pub const ONLRET: ::tcflag_t = 0o000_040;
+pub const OFILL: ::tcflag_t = 0o0000_100;
+pub const OFDEL: ::tcflag_t = 0o0000_200;
pub const B0: speed_t = 0o000_000;
pub const B50: speed_t = 0o000_001;
@@ -740,43 +778,45 @@ pub const B9600: speed_t = 0o000_015;
pub const B19200: speed_t = 0o000_016;
pub const B38400: speed_t = 0o000_017;
-pub const B57600: speed_t = 0o010_001;
-pub const B115200: speed_t = 0o010_002;
-pub const B230400: speed_t = 0o010_003;
-pub const B460800: speed_t = 0o010_004;
-pub const B500000: speed_t = 0o010_005;
-pub const B576000: speed_t = 0o010_006;
-pub const B921600: speed_t = 0o010_007;
-pub const B1000000: speed_t = 0o010_010;
-pub const B1152000: speed_t = 0o010_011;
-pub const B1500000: speed_t = 0o010_012;
-pub const B2000000: speed_t = 0o010_013;
-pub const B2500000: speed_t = 0o010_014;
-pub const B3000000: speed_t = 0o010_015;
-pub const B3500000: speed_t = 0o010_016;
-pub const B4000000: speed_t = 0o010_017;
-
-pub const CSIZE: ::tcflag_t = 0o000_060;
+pub const B57600: speed_t = 0o0_020;
+pub const B115200: speed_t = 0o0_021;
+pub const B230400: speed_t = 0o0_022;
+pub const B460800: speed_t = 0o0_023;
+pub const B500000: speed_t = 0o0_024;
+pub const B576000: speed_t = 0o0_025;
+pub const B921600: speed_t = 0o0_026;
+pub const B1000000: speed_t = 0o0_027;
+pub const B1152000: speed_t = 0o0_030;
+pub const B1500000: speed_t = 0o0_031;
+pub const B2000000: speed_t = 0o0_032;
+pub const B2500000: speed_t = 0o0_033;
+pub const B3000000: speed_t = 0o0_034;
+pub const B3500000: speed_t = 0o0_035;
+pub const B4000000: speed_t = 0o0_036;
+
+pub const CSIZE: ::tcflag_t = 0o001_400;
pub const CS5: ::tcflag_t = 0o000_000;
-pub const CS6: ::tcflag_t = 0o000_020;
-pub const CS7: ::tcflag_t = 0o000_040;
-pub const CS8: ::tcflag_t = 0o000_060;
-pub const CSTOPB: ::tcflag_t = 0o000_100;
-pub const CREAD: ::tcflag_t = 0o000_200;
-pub const PARENB: ::tcflag_t = 0o000_400;
-pub const PARODD: ::tcflag_t = 0o001_000;
-pub const HUPCL: ::tcflag_t = 0o002_000;
-pub const CLOCAL: ::tcflag_t = 0o004_000;
-
-pub const ISIG: ::tcflag_t = 0o000_001;
-pub const ICANON: ::tcflag_t = 0o000_002;
-pub const ECHO: ::tcflag_t = 0o000_010;
-pub const ECHOE: ::tcflag_t = 0o000_020;
-pub const ECHOK: ::tcflag_t = 0o000_040;
-pub const ECHONL: ::tcflag_t = 0o000_100;
-pub const NOFLSH: ::tcflag_t = 0o000_200;
-pub const TOSTOP: ::tcflag_t = 0o000_400;
-pub const IEXTEN: ::tcflag_t = 0o100_000;
+pub const CS6: ::tcflag_t = 0o000_400;
+pub const CS7: ::tcflag_t = 0o001_000;
+pub const CS8: ::tcflag_t = 0o001_400;
+
+pub const CSTOPB: ::tcflag_t = 0o002_000;
+pub const CREAD: ::tcflag_t = 0o004_000;
+pub const PARENB: ::tcflag_t = 0o010_000;
+pub const PARODD: ::tcflag_t = 0o020_000;
+pub const HUPCL: ::tcflag_t = 0o040_000;
+
+pub const CLOCAL: ::tcflag_t = 0o0100000;
+
+pub const ISIG: ::tcflag_t = 0x0000_0080;
+pub const ICANON: ::tcflag_t = 0x0000_0100;
+pub const ECHO: ::tcflag_t = 0x0000_0008;
+pub const ECHOE: ::tcflag_t = 0x0000_0002;
+pub const ECHOK: ::tcflag_t = 0x0000_0004;
+pub const ECHONL: ::tcflag_t = 0x0000_0010;
+pub const NOFLSH: ::tcflag_t = 0x8000_0000;
+pub const TOSTOP: ::tcflag_t = 0x0040_0000;
+pub const IEXTEN: ::tcflag_t = 0x0000_0400;
pub const TCOOFF: ::c_int = 0;
pub const TCOON: ::c_int = 1;
@@ -808,6 +848,8 @@ pub const __WCLONE: ::c_int = 0x8000_0000;
// time.h
pub const CLOCK_REALTIME: ::c_int = 1;
pub const CLOCK_MONOTONIC: ::c_int = 4;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCKS_PER_SEC: ::clock_t = 1_000_000;
// unistd.h
// POSIX.1 {
@@ -880,7 +922,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
@@ -937,11 +979,7 @@ safe_f! {
extern "C" {
// errno.h
pub fn __errno_location() -> *mut ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
// unistd.h
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
@@ -949,6 +987,17 @@ extern "C" {
// malloc.h
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+ // netdb.h
+ pub fn getnameinfo(
+ addr: *const ::sockaddr,
+ addrlen: ::socklen_t,
+ host: *mut ::c_char,
+ hostlen: ::socklen_t,
+ serv: *mut ::c_char,
+ servlen: ::socklen_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+
// pthread.h
pub fn pthread_atfork(
prepare: ::Option,
@@ -981,6 +1030,8 @@ extern "C" {
set: *const ::sigset_t,
oldset: *mut ::sigset_t,
) -> ::c_int;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+ pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
// sys/epoll.h
pub fn epoll_create(size: ::c_int) -> ::c_int;
@@ -991,32 +1042,17 @@ extern "C" {
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;
+ pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+ -> ::c_int;
// sys/ioctl.h
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
// sys/mman.h
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
- 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,
- mode: mode_t,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ 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, mode: mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
// sys/resource.h
@@ -1024,11 +1060,7 @@ extern "C" {
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
// sys/socket.h
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
@@ -1042,16 +1074,8 @@ extern "C" {
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
// sys/uio.h
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// sys/utsname.h
pub fn uname(utsname: *mut utsname) -> ::c_int;
diff --git a/src/unix/solarish/compat.rs b/src/unix/solarish/compat.rs
index 6ada067550d41..cbf955a31edaa 100644
--- a/src/unix/solarish/compat.rs
+++ b/src/unix/solarish/compat.rs
@@ -1,21 +1,15 @@
// Common functions that are unfortunately missing on illumos and
// Solaris, but often needed by other crates.
+use core::cmp::min;
use unix::solarish::*;
const PTEM: &[u8] = b"ptem\0";
const LDTERM: &[u8] = b"ldterm\0";
pub unsafe fn cfmakeraw(termios: *mut ::termios) {
- (*termios).c_iflag &= !(IMAXBEL
- | IGNBRK
- | BRKINT
- | PARMRK
- | ISTRIP
- | INLCR
- | IGNCR
- | ICRNL
- | IXON);
+ (*termios).c_iflag &=
+ !(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
(*termios).c_oflag &= !OPOST;
(*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
(*termios).c_cflag &= !(CSIZE | PARENB);
@@ -38,10 +32,7 @@ pub unsafe fn cfmakeraw(termios: *mut ::termios) {
(*termios).c_cc[VTIME] = 0;
}
-pub unsafe fn cfsetspeed(
- termios: *mut ::termios,
- speed: ::speed_t,
-) -> ::c_int {
+pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
// Neither of these functions on illumos or Solaris actually ever
// return an error
::cfsetispeed(termios, speed);
@@ -100,9 +91,7 @@ pub unsafe fn openpty(
} else if setup == 0 {
// The line discipline is not present, so push the appropriate STREAMS
// modules for the subordinate device:
- if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0
- || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0
- {
+ if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 {
return bail(fdm, fds);
}
}
@@ -181,3 +170,51 @@ pub unsafe fn forkpty(
0
}
+
+pub unsafe fn getpwent_r(
+ pwd: *mut passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut passwd,
+) -> ::c_int {
+ let old_errno = *::___errno();
+ *::___errno() = 0;
+ *result = native_getpwent_r(
+ pwd,
+ buf,
+ min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
+ );
+
+ let ret = if (*result).is_null() {
+ *::___errno()
+ } else {
+ 0
+ };
+ *::___errno() = old_errno;
+
+ ret
+}
+
+pub unsafe fn getgrent_r(
+ grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group,
+) -> ::c_int {
+ let old_errno = *::___errno();
+ *::___errno() = 0;
+ *result = native_getgrent_r(
+ grp,
+ buf,
+ min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
+ );
+
+ let ret = if (*result).is_null() {
+ *::___errno()
+ } else {
+ 0
+ };
+ *::___errno() = old_errno;
+
+ ret
+}
diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs
index 184f73b522649..404f013da2f98 100644
--- a/src/unix/solarish/illumos.rs
+++ b/src/unix/solarish/illumos.rs
@@ -13,6 +13,12 @@ s! {
pub shm_ctime: ::time_t,
pub shm_pad4: [i64; 4],
}
+
+ pub struct fil_info {
+ pub fi_flags: ::c_int,
+ pub fi_pos: ::c_int,
+ pub fi_name: [::c_char; ::FILNAME_MAX as usize],
+ }
}
pub const AF_LOCAL: ::c_int = 1; // AF_UNIX
@@ -27,18 +33,56 @@ pub const TCP_KEEPCNT: ::c_int = 35;
pub const TCP_KEEPINTVL: ::c_int = 36;
pub const TCP_CONGESTION: ::c_int = 37;
-pub const F_OFD_GETLK: ::c_int = 50;
-pub const F_OFD_SETLKL: ::c_int = 51;
-pub const F_OFD_SETLKW: ::c_int = 52;
-pub const F_FLOCK: ::c_int = 55;
-pub const F_FLOCKW: ::c_int = 56;
+// These constants are correct for 64-bit programs or 32-bit programs that are
+// not using large-file mode. If Rust ever supports anything other than 64-bit
+// compilation on illumos, this may require adjustment:
+pub const F_OFD_GETLK: ::c_int = 47;
+pub const F_OFD_SETLK: ::c_int = 48;
+pub const F_OFD_SETLKW: ::c_int = 49;
+pub const F_FLOCK: ::c_int = 53;
+pub const F_FLOCKW: ::c_int = 54;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 37;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 36;
+
+pub const FIL_ATTACH: ::c_int = 0x1;
+pub const FIL_DETACH: ::c_int = 0x2;
+pub const FIL_LIST: ::c_int = 0x3;
+pub const FILNAME_MAX: ::c_int = 32;
+pub const FILF_PROG: ::c_int = 0x1;
+pub const FILF_AUTO: ::c_int = 0x2;
+pub const FILF_BYPASS: ::c_int = 0x4;
+pub const SOL_FILTER: ::c_int = 0xfffc;
+
+pub const MADV_PURGE: ::c_int = 9;
+
+pub const B1000000: ::speed_t = 24;
+pub const B1152000: ::speed_t = 25;
+pub const B1500000: ::speed_t = 26;
+pub const B2000000: ::speed_t = 27;
+pub const B2500000: ::speed_t = 28;
+pub const B3000000: ::speed_t = 29;
+pub const B3500000: ::speed_t = 30;
+pub const B4000000: ::speed_t = 31;
+
+// sys/systeminfo.h
+pub const SI_ADDRESS_WIDTH: ::c_int = 520;
extern "C" {
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
- pub fn mincore(
- addr: ::caddr_t,
- len: ::size_t,
- vec: *mut ::c_char,
+ pub fn mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+
+ pub fn pset_bind_lwp(
+ pset: ::psetid_t,
+ id: ::id_t,
+ pid: ::pid_t,
+ opset: *mut ::psetid_t,
) -> ::c_int;
+ pub fn pset_getloadavg(pset: ::psetid_t, load: *mut ::c_double, num: ::c_int) -> ::c_int;
+
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
+ pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
}
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 994ce7e52a333..99135d5f5940a 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -25,6 +25,10 @@ pub type wchar_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type projid_t = ::c_int;
pub type zoneid_t = ::c_int;
+pub type psetid_t = ::c_int;
+pub type processorid_t = ::c_int;
+pub type chipid_t = ::c_int;
+pub type ctid_t = ::id_t;
pub type suseconds_t = ::c_long;
pub type off_t = ::c_long;
@@ -33,6 +37,7 @@ pub type socklen_t = ::c_uint;
pub type sa_family_t = u16;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
+pub type thread_t = ::c_uint;
pub type blksize_t = ::c_int;
pub type nl_item = ::c_int;
pub type mqd_t = *mut ::c_void;
@@ -40,6 +45,16 @@ pub type id_t = ::c_int;
pub type idtype_t = ::c_uint;
pub type shmatt_t = ::c_ulong;
+pub type lgrp_rsrc_t = ::c_int;
+pub type lgrp_affinity_t = ::c_int;
+pub type lgrp_id_t = ::id_t;
+pub type lgrp_mem_size_t = ::c_longlong;
+pub type lgrp_cookie_t = ::uintptr_t;
+pub type lgrp_content_t = ::c_uint;
+pub type lgrp_lat_between_t = ::c_uint;
+pub type lgrp_mem_size_flag_t = ::c_uint;
+pub type lgrp_view_t = ::c_uint;
+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
@@ -68,6 +83,12 @@ s! {
pub imr_interface: in_addr,
}
+ pub struct ip_mreq_source {
+ pub imr_multiaddr: in_addr,
+ pub imr_sourceaddr: in_addr,
+ pub imr_interface: in_addr,
+ }
+
pub struct ipc_perm {
pub uid: ::uid_t,
pub gid: ::gid_t,
@@ -264,6 +285,13 @@ s! {
pub f_fstr: [::c_char; 32]
}
+ pub struct sendfilevec_t {
+ pub sfv_fd: ::c_int,
+ pub sfv_flag: ::c_uint,
+ pub sfv_off: ::off_t,
+ pub sfv_len: ::size_t,
+ }
+
pub struct sched_param {
pub sched_priority: ::c_int,
sched_pad: [::c_int; 8]
@@ -416,6 +444,35 @@ s! {
pub esterror: i32,
}
+ pub struct mmapobj_result_t {
+ pub mr_addr: ::caddr_t,
+ pub mr_msize: ::size_t,
+ pub mr_fsize: ::size_t,
+ pub mr_offset: ::size_t,
+ pub mr_prot: ::c_uint,
+ pub mr_flags: ::c_uint,
+ }
+
+ pub struct lgrp_affinity_args {
+ pub idtype: ::idtype_t,
+ pub id: ::id_t,
+ pub lgrp: ::lgrp_id_t,
+ pub aff: ::lgrp_affinity_t,
+ }
+
+ pub struct processor_info_t {
+ pub pi_state: ::c_int,
+ pub pi_processor_type: [::c_char; PI_TYPELEN as usize],
+ pub pi_fputypes: [::c_char; PI_FPUTYPE as usize],
+ pub pi_clock: ::c_int,
+ }
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -473,13 +530,15 @@ s_no_extra_traits! {
__ss_pad2: [u8; 240],
}
+ #[cfg_attr(all(target_pointer_width = "64", libc_align), repr(align(8)))]
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_code: ::c_int,
pub si_errno: ::c_int,
+ #[cfg(target_pointer_width = "64")]
pub si_pad: ::c_int,
- pub si_addr: *mut ::c_void,
- __pad: [u8; 232],
+
+ __data_pad: [::c_int; SIGINFO_DATA_SIZE],
}
pub struct sockaddr_dl {
@@ -500,6 +559,20 @@ s_no_extra_traits! {
pub sigev_notify_attributes: *const ::pthread_attr_t,
__sigev_pad2: ::c_int,
}
+
+ #[cfg(libc_union)]
+ #[cfg_attr(libc_align, repr(align(16)))]
+ pub union pad128_t {
+ // pub _q in this structure would be a "long double", of 16 bytes
+ pub _l: [i32; 4],
+ }
+
+ #[cfg(libc_union)]
+ #[cfg_attr(libc_align, repr(align(16)))]
+ pub union upad128_t {
+ // pub _q in this structure would be a "long double", of 16 bytes
+ pub _l: [u32; 4],
+ }
}
cfg_if! {
@@ -716,17 +789,52 @@ cfg_if! {
}
}
+ impl siginfo_t {
+ /// The siginfo_t will have differing contents based on the delivered signal. Based on
+ /// `si_signo`, this determines how many of the `c_int` pad fields contain valid data
+ /// exposed by the C unions.
+ ///
+ /// It is not yet exhausitive for the OS-defined types, and defaults to assuming the
+ /// entire data pad area is "valid" for otherwise unrecognized signal numbers.
+ fn data_field_count(&self) -> usize {
+ match self.si_signo {
+ ::SIGSEGV | ::SIGBUS | ::SIGILL | ::SIGTRAP | ::SIGFPE => {
+ ::mem::size_of::() / ::mem::size_of::<::c_int>()
+ }
+ ::SIGCLD => ::mem::size_of::() / ::mem::size_of::<::c_int>(),
+ ::SIGHUP
+ | ::SIGINT
+ | ::SIGQUIT
+ | ::SIGABRT
+ | ::SIGSYS
+ | ::SIGPIPE
+ | ::SIGALRM
+ | ::SIGTERM
+ | ::SIGUSR1
+ | ::SIGUSR2
+ | ::SIGPWR
+ | ::SIGWINCH
+ | ::SIGURG => ::mem::size_of::() / ::mem::size_of::<::c_int>(),
+ _ => SIGINFO_DATA_SIZE,
+ }
+ }
+ }
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
- self.si_signo == other.si_signo
+ if self.si_signo == other.si_signo
&& self.si_code == other.si_code
- && self.si_errno == other.si_errno
- && self.si_addr == other.si_addr
- && self
- .__pad
- .iter()
- .zip(other.__pad.iter())
- .all(|(a, b)| a == b)
+ && self.si_errno == other.si_errno {
+ // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored
+ // (for now) when doing comparisons.
+
+ let field_count = self.data_field_count();
+ self.__data_pad[..field_count]
+ .iter()
+ .zip(other.__data_pad[..field_count].iter())
+ .all(|(a, b)| a == b)
+ } else {
+ false
+ }
}
}
impl Eq for siginfo_t {}
@@ -736,7 +844,6 @@ cfg_if! {
.field("si_signo", &self.si_signo)
.field("si_code", &self.si_code)
.field("si_errno", &self.si_errno)
- .field("si_addr", &self.si_addr)
// FIXME: .field("__pad", &self.__pad)
.finish()
}
@@ -746,8 +853,12 @@ cfg_if! {
self.si_signo.hash(state);
self.si_code.hash(state);
self.si_errno.hash(state);
- self.si_addr.hash(state);
- self.__pad.hash(state);
+
+ // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored
+ // (for now) when doing hashing.
+
+ let field_count = self.data_field_count();
+ self.__data_pad[..field_count].hash(state)
}
}
@@ -825,6 +936,178 @@ cfg_if! {
}
}
+ #[cfg(libc_union)]
+ impl PartialEq for pad128_t {
+ fn eq(&self, other: &pad128_t) -> bool {
+ unsafe {
+ // FIXME: self._q == other._q ||
+ self._l == other._l
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for pad128_t {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for pad128_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("pad128_t")
+ // FIXME: .field("_q", &{self._q})
+ .field("_l", &{self._l})
+ .finish()
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for pad128_t {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ // FIXME: state.write_i64(self._q as i64);
+ self._l.hash(state);
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl PartialEq for upad128_t {
+ fn eq(&self, other: &upad128_t) -> bool {
+ unsafe {
+ // FIXME: self._q == other._q ||
+ self._l == other._l
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for upad128_t {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for upad128_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("upad128_t")
+ // FIXME: .field("_q", &{self._q})
+ .field("_l", &{self._l})
+ .finish()
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for upad128_t {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ // FIXME: state.write_i64(self._q as i64);
+ self._l.hash(state);
+ }
+ }
+ }
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_pointer_width = "64")] {
+ const SIGINFO_DATA_SIZE: usize = 60;
+ } else {
+ const SIGINFO_DATA_SIZE: usize = 29;
+ }
+}
+
+#[repr(C)]
+struct siginfo_fault {
+ addr: *mut ::c_void,
+ trapno: ::c_int,
+ pc: *mut ::caddr_t,
+}
+impl ::Copy for siginfo_fault {}
+impl ::Clone for siginfo_fault {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+#[repr(C)]
+struct siginfo_cldval {
+ utime: ::clock_t,
+ status: ::c_int,
+ stime: ::clock_t,
+}
+impl ::Copy for siginfo_cldval {}
+impl ::Clone for siginfo_cldval {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+#[repr(C)]
+struct siginfo_killval {
+ uid: ::uid_t,
+ value: ::sigval,
+ // Pad out to match the SIGCLD value size
+ _pad: *mut ::c_void,
+}
+impl ::Copy for siginfo_killval {}
+impl ::Clone for siginfo_killval {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+#[repr(C)]
+struct siginfo_sigcld {
+ pid: ::pid_t,
+ val: siginfo_cldval,
+ ctid: ::ctid_t,
+ zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_sigcld {}
+impl ::Clone for siginfo_sigcld {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+#[repr(C)]
+struct siginfo_kill {
+ pid: ::pid_t,
+ val: siginfo_killval,
+ ctid: ::ctid_t,
+ zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_kill {}
+impl ::Clone for siginfo_kill {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+
+impl siginfo_t {
+ unsafe fn sidata(&self) -> T {
+ *((&self.__data_pad) as *const ::c_int as *const T)
+ }
+ pub unsafe fn si_addr(&self) -> *mut ::c_void {
+ let sifault: siginfo_fault = self.sidata();
+ sifault.addr
+ }
+ pub unsafe fn si_uid(&self) -> ::uid_t {
+ let kill: siginfo_kill = self.sidata();
+ kill.val.uid
+ }
+ pub unsafe fn si_value(&self) -> ::sigval {
+ let kill: siginfo_kill = self.sidata();
+ kill.val.value
+ }
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ let sigcld: siginfo_sigcld = self.sidata();
+ sigcld.pid
+ }
+ pub unsafe fn si_status(&self) -> ::c_int {
+ let sigcld: siginfo_sigcld = self.sidata();
+ sigcld.val.status
+ }
+ pub unsafe fn si_utime(&self) -> ::c_long {
+ let sigcld: siginfo_sigcld = self.sidata();
+ sigcld.val.utime
+ }
+ pub unsafe fn si_stime(&self) -> ::c_long {
+ let sigcld: siginfo_sigcld = self.sidata();
+ sigcld.val.stime
}
}
@@ -936,6 +1219,7 @@ pub const FIOSETOWN: ::c_int = 0x8004667c;
pub const FIOGETOWN: ::c_int = 0x4004667b;
pub const SIGCHLD: ::c_int = 18;
+pub const SIGCLD: ::c_int = ::SIGCHLD;
pub const SIGBUS: ::c_int = 10;
pub const SIGINFO: ::c_int = 41;
pub const SIG_BLOCK: ::c_int = 1;
@@ -946,6 +1230,13 @@ pub const SIGEV_NONE: ::c_int = 1;
pub const SIGEV_SIGNAL: ::c_int = 2;
pub const SIGEV_THREAD: ::c_int = 3;
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
pub const IP_RECVDSTADDR: ::c_int = 0x7;
pub const IP_SEC_OPT: ::c_int = 0x22;
@@ -969,6 +1260,7 @@ pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
@@ -988,6 +1280,9 @@ pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 25;
pub const TMP_MAX: ::c_uint = 17576;
+pub const GRND_NONBLOCK: ::c_int = 0x0001;
+pub const GRND_RANDOM: ::c_int = 0x0002;
+
pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
@@ -1039,7 +1334,6 @@ pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
-pub const F_DUPFD_CLOEXEC: ::c_int = 37;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
pub const F_GETLK: ::c_int = 14;
@@ -1049,6 +1343,14 @@ pub const F_BLOCKS: ::c_int = 18;
pub const F_BLKSIZE: ::c_int = 19;
pub const F_SHARE: ::c_int = 40;
pub const F_UNSHARE: ::c_int = 41;
+pub const F_ISSTREAM: ::c_int = 13;
+pub const F_PRIV: ::c_int = 15;
+pub const F_NPRIV: ::c_int = 16;
+pub const F_QUOTACTL: ::c_int = 17;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+pub const F_REVOKE: ::c_int = 25;
+pub const F_HASREMOTELOCKS: ::c_int = 26;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
@@ -1112,6 +1414,20 @@ pub const P_CTID: idtype_t = 13;
pub const P_CPUID: idtype_t = 14;
pub const P_PSETID: idtype_t = 15;
+pub const PBIND_NONE: ::processorid_t = -1;
+pub const PBIND_QUERY: ::processorid_t = -2;
+pub const PBIND_HARD: ::processorid_t = -3;
+pub const PBIND_SOFT: ::processorid_t = -4;
+
+pub const PS_NONE: ::c_int = -1;
+pub const PS_QUERY: ::c_int = -2;
+pub const PS_MYID: ::c_int = -3;
+pub const PS_SOFT: ::c_int = -4;
+pub const PS_HARD: ::c_int = -5;
+pub const PS_QUERY_TYPE: ::c_int = -6;
+pub const PS_SYSTEM: ::c_int = 1;
+pub const PS_PRIVATE: ::c_int = 2;
+
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;
@@ -1131,6 +1447,7 @@ pub const MAP_RENAME: ::c_int = 0x20;
pub const MAP_ALIGN: ::c_int = 0x200;
pub const MAP_TEXT: ::c_int = 0x400;
pub const MAP_INITDATA: ::c_int = 0x800;
+pub const MAP_32BIT: ::c_int = 0x80;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MCL_CURRENT: ::c_int = 0x0001;
@@ -1140,6 +1457,11 @@ pub const MS_SYNC: ::c_int = 0x0004;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
+pub const MMOBJ_PADDING: ::c_uint = 0x10000;
+pub const MMOBJ_INTERPRET: ::c_uint = 0x20000;
+pub const MR_PADDING: ::c_uint = 0x1;
+pub const MR_HDR_ELF: ::c_uint = 0x2;
+
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
@@ -1276,9 +1598,16 @@ pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
pub const EAI_OVERFLOW: ::c_int = 12;
+pub const NI_NOFQDN: ::c_uint = 0x0001;
+pub const NI_NUMERICHOST: ::c_uint = 0x0002;
+pub const NI_NAMEREQD: ::c_uint = 0x0004;
+pub const NI_NUMERICSERV: ::c_uint = 0x0008;
+pub const NI_DGRAM: ::c_uint = 0x0010;
+pub const NI_WITHSCOPEID: ::c_uint = 0x0020;
+pub const NI_NUMERICSCOPE: ::c_uint = 0x0040;
+
pub const F_DUPFD: ::c_int = 0;
pub const F_DUP2FD: ::c_int = 9;
-pub const F_DUP2FD_CLOEXEC: ::c_int = 36;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
@@ -1362,6 +1691,9 @@ pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 5;
+pub const MADV_ACCESS_DEFAULT: ::c_int = 6;
+pub const MADV_ACCESS_LWP: ::c_int = 7;
+pub const MADV_ACCESS_MANY: ::c_int = 8;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_UNIX: ::c_int = 1;
@@ -1397,6 +1729,42 @@ pub const AF_INET_OFFLOAD: ::c_int = 30;
pub const AF_TRILL: ::c_int = 31;
pub const AF_PACKET: ::c_int = 32;
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_LOCAL: ::c_int = PF_UNIX;
+pub const PF_FILE: ::c_int = PF_UNIX;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NS: ::c_int = AF_NS;
+pub const PF_NBS: ::c_int = AF_NBS;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_NIT: ::c_int = AF_NIT;
+pub const PF_802: ::c_int = AF_802;
+pub const PF_OSI: ::c_int = AF_OSI;
+pub const PF_X25: ::c_int = AF_X25;
+pub const PF_OSINET: ::c_int = AF_OSINET;
+pub const PF_GOSIP: ::c_int = AF_GOSIP;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_KEY: ::c_int = AF_KEY;
+pub const PF_NCA: ::c_int = AF_NCA;
+pub const PF_POLICY: ::c_int = AF_POLICY;
+pub const PF_INET_OFFLOAD: ::c_int = AF_INET_OFFLOAD;
+pub const PF_TRILL: ::c_int = AF_TRILL;
+pub const PF_PACKET: ::c_int = AF_PACKET;
+
pub const SOCK_DGRAM: ::c_int = 1;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 4;
@@ -1411,6 +1779,10 @@ pub const IP_ADD_MEMBERSHIP: ::c_int = 19;
pub const IP_DROP_MEMBERSHIP: ::c_int = 20;
pub const IPV6_JOIN_GROUP: ::c_int = 9;
pub const IPV6_LEAVE_GROUP: ::c_int = 10;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 23;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 24;
+pub const IP_BLOCK_SOURCE: ::c_int = 21;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 22;
// These TCP socket options are common between illumos and Solaris, while higher
// numbers have generally diverged:
@@ -1433,6 +1805,8 @@ pub const TCP_LINGER2: ::c_int = 0x1c;
pub const UDP_NAT_T_ENDPOINT: ::c_int = 0x0103;
+pub const SOMAXCONN: ::c_int = 128;
+
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
@@ -1529,6 +1903,14 @@ pub const IPC_RMID: ::c_int = 10;
pub const IPC_SET: ::c_int = 11;
pub const IPC_SEAT: ::c_int = 12;
+// sys/shm.h
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_SHARE_MMU: ::c_int = 0o40000;
+pub const SHM_PAGEABLE: ::c_int = 0o100000;
+
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
@@ -1881,6 +2263,18 @@ pub const TIOCMGET: ::c_int = tIOC | 29;
pub const TIOCREMOTE: ::c_int = tIOC | 30;
pub const TIOCSIGNAL: ::c_int = tIOC | 31;
+pub const TIOCM_LE: ::c_int = 0o0001;
+pub const TIOCM_DTR: ::c_int = 0o0002;
+pub const TIOCM_RTS: ::c_int = 0o0004;
+pub const TIOCM_ST: ::c_int = 0o0010;
+pub const TIOCM_SR: ::c_int = 0o0020;
+pub const TIOCM_CTS: ::c_int = 0o0040;
+pub const TIOCM_CAR: ::c_int = 0o0100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0o0200;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0o0400;
+
pub const EPOLLIN: ::c_int = 0x1;
pub const EPOLLPRI: ::c_int = 0x2;
pub const EPOLLOUT: ::c_int = 0x4;
@@ -1929,6 +2323,10 @@ pub const B921600: speed_t = 23;
pub const CSTART: ::tcflag_t = 0o21;
pub const CSTOP: ::tcflag_t = 0o23;
pub const CSWTCH: ::tcflag_t = 0o32;
+pub const CBAUD: ::tcflag_t = 0o17;
+pub const CIBAUD: ::tcflag_t = 0o3600000;
+pub const CBAUDEXT: ::tcflag_t = 0o10000000;
+pub const CIBAUDEXT: ::tcflag_t = 0o20000000;
pub const CSIZE: ::tcflag_t = 0o000060;
pub const CS5: ::tcflag_t = 0;
pub const CS6: ::tcflag_t = 0o000020;
@@ -1952,20 +2350,26 @@ pub const ISTRIP: ::tcflag_t = 0o000040;
pub const INLCR: ::tcflag_t = 0o000100;
pub const IGNCR: ::tcflag_t = 0o000200;
pub const ICRNL: ::tcflag_t = 0o000400;
+pub const IUCLC: ::tcflag_t = 0o001000;
pub const IXON: ::tcflag_t = 0o002000;
pub const IXOFF: ::tcflag_t = 0o010000;
pub const IXANY: ::tcflag_t = 0o004000;
pub const IMAXBEL: ::tcflag_t = 0o020000;
+pub const DOSMODE: ::tcflag_t = 0o100000;
pub const OPOST: ::tcflag_t = 0o000001;
+pub const OLCUC: ::tcflag_t = 0o000002;
pub const ONLCR: ::tcflag_t = 0o000004;
pub const OCRNL: ::tcflag_t = 0o000010;
pub const ONOCR: ::tcflag_t = 0o000020;
pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o0000100;
+pub const OFDEL: ::tcflag_t = 0o0000200;
pub const CREAD: ::tcflag_t = 0o000200;
pub const PARENB: ::tcflag_t = 0o000400;
pub const PARODD: ::tcflag_t = 0o001000;
pub const HUPCL: ::tcflag_t = 0o002000;
pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CRTSXOFF: ::tcflag_t = 0o10000000000;
pub const CRTSCTS: ::tcflag_t = 0o20000000000;
pub const ISIG: ::tcflag_t = 0o000001;
pub const ICANON: ::tcflag_t = 0o000002;
@@ -2078,11 +2482,8 @@ pub const STA_PPSJITTER: i32 = 0x0200;
pub const STA_PPSWANDER: i32 = 0x0400;
pub const STA_PPSERROR: i32 = 0x0800;
pub const STA_CLOCKERR: i32 = 0x1000;
-pub const STA_RONLY: i32 = STA_PPSSIGNAL
- | STA_PPSJITTER
- | STA_PPSWANDER
- | STA_PPSERROR
- | STA_CLOCKERR;
+pub const STA_RONLY: i32 =
+ STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR;
pub const TIME_OK: i32 = 0;
pub const TIME_INS: i32 = 1;
pub const TIME_DEL: i32 = 2;
@@ -2094,6 +2495,86 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_SYS: ::c_int = 3;
+pub const SCHED_IA: ::c_int = 4;
+pub const SCHED_FSS: ::c_int = 5;
+pub const SCHED_FX: ::c_int = 6;
+
+// sys/priv.h
+pub const PRIV_DEBUG: ::c_uint = 0x0001;
+pub const PRIV_AWARE: ::c_uint = 0x0002;
+pub const PRIV_AWARE_INHERIT: ::c_uint = 0x0004;
+pub const __PROC_PROTECT: ::c_uint = 0x0008;
+pub const NET_MAC_AWARE: ::c_uint = 0x0010;
+pub const NET_MAC_AWARE_INHERIT: ::c_uint = 0x0020;
+pub const PRIV_AWARE_RESET: ::c_uint = 0x0040;
+pub const PRIV_XPOLICY: ::c_uint = 0x0080;
+pub const PRIV_PFEXEC: ::c_uint = 0x0100;
+pub const PRIV_USER: ::c_uint = PRIV_DEBUG
+ | NET_MAC_AWARE
+ | NET_MAC_AWARE_INHERIT
+ | PRIV_XPOLICY
+ | PRIV_AWARE_RESET
+ | PRIV_PFEXEC;
+
+// sys/systeminfo.h
+pub const SI_SYSNAME: ::c_int = 1;
+pub const SI_HOSTNAME: ::c_int = 2;
+pub const SI_RELEASE: ::c_int = 3;
+pub const SI_VERSION: ::c_int = 4;
+pub const SI_MACHINE: ::c_int = 5;
+pub const SI_ARCHITECTURE: ::c_int = 6;
+pub const SI_HW_SERIAL: ::c_int = 7;
+pub const SI_HW_PROVIDER: ::c_int = 8;
+pub const SI_SET_HOSTNAME: ::c_int = 258;
+pub const SI_SET_SRPC_DOMAIN: ::c_int = 265;
+pub const SI_PLATFORM: ::c_int = 513;
+pub const SI_ISALIST: ::c_int = 514;
+pub const SI_DHCP_CACHE: ::c_int = 515;
+pub const SI_ARCHITECTURE_32: ::c_int = 516;
+pub const SI_ARCHITECTURE_64: ::c_int = 517;
+pub const SI_ARCHITECTURE_K: ::c_int = 518;
+pub const SI_ARCHITECTURE_NATIVE: ::c_int = 519;
+
+// sys/lgrp_user.h
+pub const LGRP_COOKIE_NONE: ::lgrp_cookie_t = 0;
+pub const LGRP_AFF_NONE: ::lgrp_affinity_t = 0x0;
+pub const LGRP_AFF_WEAK: ::lgrp_affinity_t = 0x10;
+pub const LGRP_AFF_STRONG: ::lgrp_affinity_t = 0x100;
+pub const LGRP_RSRC_COUNT: ::lgrp_rsrc_t = 2;
+pub const LGRP_RSRC_CPU: ::lgrp_rsrc_t = 0;
+pub const LGRP_RSRC_MEM: ::lgrp_rsrc_t = 1;
+pub const LGRP_CONTENT_ALL: ::lgrp_content_t = 0;
+pub const LGRP_CONTENT_HIERARCHY: ::lgrp_content_t = LGRP_CONTENT_ALL;
+pub const LGRP_CONTENT_DIRECT: ::lgrp_content_t = 1;
+pub const LGRP_LAT_CPU_TO_MEM: ::lgrp_lat_between_t = 0;
+pub const LGRP_MEM_SZ_FREE: ::lgrp_mem_size_flag_t = 0;
+pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1;
+pub const LGRP_VIEW_CALLER: ::lgrp_view_t = 0;
+pub const LGRP_VIEW_OS: ::lgrp_view_t = 1;
+
+// sys/processor.h
+
+pub const P_OFFLINE: ::c_int = 0x001;
+pub const P_ONLINE: ::c_int = 0x002;
+pub const P_STATUS: ::c_int = 0x003;
+pub const P_FAULTED: ::c_int = 0x004;
+pub const P_POWEROFF: ::c_int = 0x005;
+pub const P_NOINTR: ::c_int = 0x006;
+pub const P_SPARE: ::c_int = 0x007;
+pub const P_DISABLED: ::c_int = 0x008;
+pub const P_FORCED: ::c_int = 0x10000000;
+pub const PI_TYPELEN: ::c_int = 16;
+pub const PI_FPUTYPE: ::c_int = 32;
+
+// sys/auxv.h
+pub const AT_SUN_HWCAP: ::c_uint = 2009;
+pub const AT_SUN_HWCAP2: ::c_uint = 2023;
+pub const AT_SUN_FPTYPE: ::c_uint = 2027;
+
// As per sys/socket.h, header alignment must be 8 bytes on SPARC
// and 4 bytes everywhere else:
#[cfg(target_arch = "sparc64")]
@@ -2160,7 +2641,7 @@ f! {
return
}
- pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
+ pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
@@ -2212,32 +2693,29 @@ safe_f! {
pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0x80) != 0
}
+
+ pub {const} fn MR_GET_TYPE(flags: ::c_uint) -> ::c_uint {
+ flags & 0x0000ffff
+ }
}
extern "C" {
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
- pub fn sem_init(
- sem: *mut sem_t,
- pshared: ::c_int,
- value: ::c_uint,
- ) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
- pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
+ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+ pub fn getrandom(bbuf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn settimeofday(tp: *const ::timeval, tz: *const ::c_void) -> ::c_int;
@@ -2245,14 +2723,16 @@ extern "C" {
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int;
+ pub fn getgrouplist(
+ name: *const ::c_char,
+ basegid: ::gid_t,
+ groups: *mut ::gid_t,
+ ngroups: *mut ::c_int,
+ ) -> ::c_int;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
- pub fn mprotect(
- addr: *const ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
+ pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn ___errno() -> *mut ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
@@ -2262,10 +2742,7 @@ extern "C" {
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
- pub fn clock_settime(
- clk_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
+ pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
@@ -2279,22 +2756,16 @@ extern "C" {
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
- -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
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;
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 setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
@@ -2302,11 +2773,7 @@ extern "C" {
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 mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
@@ -2329,78 +2796,47 @@ extern "C" {
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
- pub fn sem_timedwait(
- sem: *mut sem_t,
- abstime: *const ::timespec,
- ) -> ::c_int;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
- pub fn waitid(
- idtype: idtype_t,
- id: id_t,
- infop: *mut ::siginfo_t,
- options: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_getname_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+ pub fn pthread_setname_np(tid: ::pthread_t, name: *const ::c_char) -> ::c_int;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
#[cfg_attr(target_os = "illumos", link_name = "_glob_ext")]
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
- errfunc: ::Option<
- extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
- >,
+ errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
#[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")]
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn shmat(
- shmid: ::c_int,
- shmaddr: *const ::c_void,
- shmflg: ::c_int,
- ) -> *mut ::c_void;
+ pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
- pub fn shmctl(
- shmid: ::c_int,
- cmd: ::c_int,
- buf: *mut ::shmid_ds,
- ) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
- pub fn shm_open(
- name: *const ::c_char,
- oflag: ::c_int,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(
- addr: *mut ::c_void,
- len: ::size_t,
- advice: ::c_int,
- ) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
@@ -2413,11 +2849,7 @@ extern "C" {
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
- pub fn futimesat(
- fd: ::c_int,
- path: *const ::c_char,
- times: *const ::timeval,
- ) -> ::c_int;
+ pub fn futimesat(fd: ::c_int, path: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn futimens(dirfd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
@@ -2428,35 +2860,15 @@ extern "C" {
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
#[cfg_attr(target_os = "illumos", link_name = "__xnet_bind")]
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(target_os = "illumos", link_name = "__xnet_sendmsg")]
- pub fn sendmsg(
- fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(target_os = "illumos", link_name = "__xnet_recvmsg")]
- pub fn recvmsg(
- fd: ::c_int,
- msg: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn accept4(
fd: ::c_int,
address: *mut sockaddr,
@@ -2494,11 +2906,7 @@ extern "C" {
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
- pub fn mq_setattr(
- mqd: ::mqd_t,
- newattr: *const ::mq_attr,
- oldattr: *mut ::mq_attr,
- ) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
pub fn port_create() -> ::c_int;
pub fn port_associate(
port: ::c_int,
@@ -2507,16 +2915,8 @@ extern "C" {
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: *mut ::timespec,
- ) -> ::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: *mut ::timespec) -> ::c_int;
pub fn port_getn(
port: ::c_int,
pe_list: *mut port_event,
@@ -2524,11 +2924,7 @@ extern "C" {
nget: *mut ::c_uint,
timeout: *mut ::timespec,
) -> ::c_int;
- pub fn port_send(
- port: ::c_int,
- events: ::c_int,
- user: *mut ::c_void,
- ) -> ::c_int;
+ pub fn port_send(port: ::c_int, events: ::c_int, user: *mut ::c_void) -> ::c_int;
pub fn port_sendn(
port_list: *mut ::c_int,
error_list: *mut ::c_int,
@@ -2571,12 +2967,8 @@ extern "C" {
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;
+ pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+ -> ::c_int;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
@@ -2589,14 +2981,21 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
- pub fn pthread_sigmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn thr_self() -> ::thread_t;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
+ pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+ pub fn sched_setscheduler(
+ pid: ::pid_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::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(
@@ -2623,24 +3022,14 @@ extern "C" {
) -> ::c_int;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
- link_name = "__posix_getpwent_r"
+ link_name = "getpwent_r"
)]
- pub fn getpwent_r(
- pwd: *mut passwd,
- buf: *mut ::c_char,
- buflen: ::size_t,
- result: *mut *mut passwd,
- ) -> ::c_int;
+ fn native_getpwent_r(pwd: *mut passwd, buf: *mut ::c_char, buflen: ::c_int) -> *mut passwd;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
- link_name = "__posix_getgrent_r"
+ link_name = "getgrent_r"
)]
- pub fn getgrent_r(
- grp: *mut ::group,
- buf: *mut ::c_char,
- buflen: ::size_t,
- result: *mut *mut ::group,
- ) -> ::c_int;
+ fn native_getgrent_r(grp: *mut ::group, buf: *mut ::c_char, buflen: ::c_int) -> *mut ::group;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
link_name = "__posix_sigwait"
@@ -2687,11 +3076,7 @@ extern "C" {
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
- pub fn timer_create(
- clock_id: clockid_t,
- evp: *mut sigevent,
- timerid: *mut timer_t,
- ) -> ::c_int;
+ pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
pub fn timer_delete(timerid: timer_t) -> ::c_int;
pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
@@ -2713,17 +3098,158 @@ extern "C" {
pub fn ucred_getegid(ucred: *const ucred_t) -> ::gid_t;
pub fn ucred_getrgid(ucred: *const ucred_t) -> ::gid_t;
pub fn ucred_getsgid(ucred: *const ucred_t) -> ::gid_t;
- pub fn ucred_getgroups(
- ucred: *const ucred_t,
- groups: *mut *const ::gid_t,
- ) -> ::c_int;
+ pub fn ucred_getgroups(ucred: *const ucred_t, groups: *mut *const ::gid_t) -> ::c_int;
pub fn ucred_getpid(ucred: *const ucred_t) -> ::pid_t;
pub fn ucred_getprojid(ucred: *const ucred_t) -> projid_t;
pub fn ucred_getzoneid(ucred: *const ucred_t) -> zoneid_t;
- pub fn ucred_getpflags(ucred: *const ucred_t, flags: ::c_uint)
- -> ::c_uint;
+ pub fn ucred_getpflags(ucred: *const ucred_t, flags: ::c_uint) -> ::c_uint;
pub fn ucred_size() -> ::size_t;
+
+ pub fn pset_create(newpset: *mut ::psetid_t) -> ::c_int;
+ pub fn pset_destroy(pset: ::psetid_t) -> ::c_int;
+ pub fn pset_assign(pset: ::psetid_t, cpu: ::processorid_t, opset: *mut psetid_t) -> ::c_int;
+ pub fn pset_info(
+ pset: ::psetid_t,
+ tpe: *mut ::c_int,
+ numcpus: *mut ::c_uint,
+ cpulist: *mut processorid_t,
+ ) -> ::c_int;
+ pub fn pset_bind(
+ pset: ::psetid_t,
+ idtype: ::idtype_t,
+ id: ::id_t,
+ opset: *mut psetid_t,
+ ) -> ::c_int;
+ pub fn pset_list(pset: *mut psetid_t, numpsets: *mut ::c_uint) -> ::c_int;
+ pub fn pset_setattr(pset: psetid_t, attr: ::c_uint) -> ::c_int;
+ pub fn pset_getattr(pset: psetid_t, attr: *mut ::c_uint) -> ::c_int;
+ pub fn processor_bind(
+ idtype: ::idtype_t,
+ id: ::id_t,
+ new_binding: ::processorid_t,
+ old_binding: *mut processorid_t,
+ ) -> ::c_int;
+ pub fn p_online(processorid: ::processorid_t, flag: ::c_int) -> ::c_int;
+ pub fn processor_info(processorid: ::processorid_t, infop: *mut processor_info_t) -> ::c_int;
+
+ pub fn getexecname() -> *const ::c_char;
+
+ pub fn gethostid() -> ::c_long;
+
+ pub fn getpflags(flags: ::c_uint) -> ::c_uint;
+ pub fn setpflags(flags: ::c_uint, value: ::c_uint) -> ::c_int;
+
+ pub fn sysinfo(command: ::c_int, buf: *mut ::c_char, count: ::c_long) -> ::c_int;
+
+ pub fn faccessat(fd: ::c_int, path: *const ::c_char, amode: ::c_int, flag: ::c_int) -> ::c_int;
+
+ // #include
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ pub fn dl_iterate_phdr(
+ callback: ::Option<
+ unsafe extern "C" fn(
+ info: *mut dl_phdr_info,
+ size: usize,
+ data: *mut ::c_void,
+ ) -> ::c_int,
+ >,
+ data: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn getpagesize() -> ::c_int;
+ pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+ pub fn mmapobj(
+ fd: ::c_int,
+ flags: ::c_uint,
+ storage: *mut mmapobj_result_t,
+ elements: *mut ::c_uint,
+ arg: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn meminfo(
+ inaddr: *const u64,
+ addr_count: ::c_int,
+ info_req: *const ::c_uint,
+ info_count: ::c_int,
+ outdata: *mut u64,
+ validity: *mut ::c_uint,
+ ) -> ::c_int;
+
+ pub fn strcasecmp_l(s1: *const ::c_char, s2: *const ::c_char, loc: ::locale_t) -> ::c_int;
+ pub fn strncasecmp_l(
+ s1: *const ::c_char,
+ s2: *const ::c_char,
+ n: ::size_t,
+ loc: ::locale_t,
+ ) -> ::c_int;
+ pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
+
+ pub fn getisax(array: *mut u32, n: ::c_uint) -> ::c_uint;
+
+ pub fn backtrace(buffer: *mut *mut ::c_void, size: ::c_int) -> ::c_int;
+ pub fn backtrace_symbols(buffer: *const *mut ::c_void, size: ::c_int) -> *mut *mut ::c_char;
+ pub fn backtrace_symbols_fd(buffer: *const *mut ::c_void, size: ::c_int, fd: ::c_int);
+
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
+}
+
+#[link(name = "sendfile")]
+extern "C" {
+ pub fn sendfile(out_fd: ::c_int, in_fd: ::c_int, off: *mut ::off_t, len: ::size_t)
+ -> ::ssize_t;
+ pub fn sendfilev(
+ fildes: ::c_int,
+ vec: *const sendfilevec_t,
+ sfvcnt: ::c_int,
+ xferred: *mut ::size_t,
+ ) -> ::ssize_t;
+}
+
+#[link(name = "lgrp")]
+extern "C" {
+ pub fn lgrp_init(view: lgrp_view_t) -> lgrp_cookie_t;
+ pub fn lgrp_fini(cookie: lgrp_cookie_t) -> ::c_int;
+ pub fn lgrp_affinity_get(
+ idtype: ::idtype_t,
+ id: ::id_t,
+ lgrp: ::lgrp_id_t,
+ ) -> ::lgrp_affinity_t;
+ pub fn lgrp_affinity_set(
+ idtype: ::idtype_t,
+ id: ::id_t,
+ lgrp: ::lgrp_id_t,
+ aff: lgrp_affinity_t,
+ ) -> ::lgrp_affinity_t;
+ pub fn lgrp_cpus(
+ cookie: ::lgrp_cookie_t,
+ lgrp: ::lgrp_id_t,
+ cpuids: *mut ::processorid_t,
+ count: ::c_uint,
+ content: ::lgrp_content_t,
+ ) -> ::c_int;
+ pub fn lgrp_mem_size(
+ cookie: ::lgrp_cookie_t,
+ lgrp: ::lgrp_id_t,
+ tpe: ::lgrp_mem_size_flag_t,
+ content: ::lgrp_content_t,
+ ) -> ::lgrp_mem_size_t;
+ pub fn lgrp_nlgrps(cookie: ::lgrp_cookie_t) -> ::c_int;
+ pub fn lgrp_view(cookie: ::lgrp_cookie_t) -> ::lgrp_view_t;
+ pub fn lgrp_home(idtype: ::idtype_t, id: ::id_t) -> ::lgrp_id_t;
+ pub fn lgrp_version(version: ::c_int) -> ::c_int;
+ pub fn lgrp_resources(
+ cookie: ::lgrp_cookie_t,
+ lgrp: ::lgrp_id_t,
+ lgrps: *mut ::lgrp_id_t,
+ count: ::c_uint,
+ tpe: ::lgrp_rsrc_t,
+ ) -> ::c_int;
+ pub fn lgrp_root(cookie: ::lgrp_cookie_t) -> ::lgrp_id_t;
}
mod compat;
@@ -2740,3 +3266,17 @@ cfg_if! {
// Unknown target_os
}
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ mod x86_64;
+ mod x86_common;
+ pub use self::x86_64::*;
+ pub use self::x86_common::*;
+ } else if #[cfg(target_arch = "x86")] {
+ mod x86;
+ mod x86_common;
+ pub use self::x86::*;
+ pub use self::x86_common::*;
+ }
+}
diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs
index a07bc88a4991b..80bad281ea705 100644
--- a/src/unix/solarish/solaris.rs
+++ b/src/unix/solarish/solaris.rs
@@ -26,6 +26,30 @@ s! {
}
}
+s_no_extra_traits! {
+ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+ pub union door_desc_t__d_data {
+ pub d_desc: door_desc_t__d_data__d_desc,
+ d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
+ }
+
+ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+ pub struct door_desc_t {
+ pub d_attributes: door_attr_t,
+ pub d_data: door_desc_t__d_data,
+ }
+
+ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+ pub struct door_arg_t {
+ pub data_ptr: *const ::c_char,
+ pub data_size: ::size_t,
+ pub desc_ptr: *const door_desc_t,
+ pub dec_num: ::c_uint,
+ pub rbuf: *const ::c_char,
+ pub rsize: ::size_t,
+ }
+}
+
pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
@@ -33,8 +57,13 @@ pub const AF_LOCAL: ::c_int = 0;
pub const AF_FILE: ::c_int = 0;
pub const TCP_KEEPIDLE: ::c_int = 0x1d;
-pub const TCP_KEEPCNT: ::c_int = 0x1e;
-pub const TCP_KEEPINTVL: ::c_int = 0x1f;
+pub const TCP_KEEPINTVL: ::c_int = 0x1e;
+pub const TCP_KEEPCNT: ::c_int = 0x1f;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 47;
+pub const F_DUPFD_CLOFORK: ::c_int = 49;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 48;
+pub const F_DUP2FD_CLOFORK: ::c_int = 50;
extern "C" {
pub fn fexecve(
@@ -43,11 +72,7 @@ extern "C" {
envp: *const *const ::c_char,
) -> ::c_int;
- pub fn mincore(
- addr: *const ::c_void,
- len: ::size_t,
- vec: *mut ::c_char,
- ) -> ::c_int;
+ pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int;
pub fn door_return(
@@ -70,32 +95,7 @@ extern "C" {
pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
- pub fn pthread_getattr_np(
- thread: ::pthread_t,
- attr: *mut ::pthread_attr_t,
- ) -> ::c_int;
-}
+ pub fn pthread_getattr_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
-s_no_extra_traits! {
- #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
- pub union door_desc_t__d_data {
- pub d_desc: door_desc_t__d_data__d_desc,
- d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
- }
-
- #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
- pub struct door_desc_t {
- pub d_attributes: door_attr_t,
- pub d_data: door_desc_t__d_data,
- }
-
- #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
- pub struct door_arg_t {
- pub data_ptr: *const ::c_char,
- pub data_size: ::size_t,
- pub desc_ptr: *const door_desc_t,
- pub dec_num: ::c_uint,
- pub rbuf: *const ::c_char,
- pub rsize: ::size_t,
- }
+ pub fn euidaccess(path: *const ::c_char, amode: ::c_int) -> ::c_int;
}
diff --git a/src/unix/solarish/x86.rs b/src/unix/solarish/x86.rs
new file mode 100644
index 0000000000000..23f52ad3c894f
--- /dev/null
+++ b/src/unix/solarish/x86.rs
@@ -0,0 +1,29 @@
+pub type Elf32_Addr = ::c_ulong;
+pub type Elf32_Half = ::c_ushort;
+pub type Elf32_Off = ::c_ulong;
+pub type Elf32_Sword = ::c_long;
+pub type Elf32_Word = ::c_ulong;
+pub type Elf32_Lword = ::c_ulonglong;
+pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr;
+
+s! {
+ pub struct __c_anonymous_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 dl_phdr_info {
+ pub dlpi_addr: ::Elf32_Addr,
+ pub dlpi_name: *const ::c_char,
+ pub dlpi_phdr: *const ::Elf32_Phdr,
+ pub dlpi_phnum: ::Elf32_Half,
+ pub dlpi_adds: ::c_ulonglong,
+ pub dlpi_subs: ::c_ulonglong,
+ }
+}
diff --git a/src/unix/solarish/x86_64.rs b/src/unix/solarish/x86_64.rs
new file mode 100644
index 0000000000000..bca552f378202
--- /dev/null
+++ b/src/unix/solarish/x86_64.rs
@@ -0,0 +1,190 @@
+pub type greg_t = ::c_long;
+
+pub type Elf64_Addr = ::c_ulong;
+pub type Elf64_Half = ::c_ushort;
+pub type Elf64_Off = ::c_ulong;
+pub type Elf64_Sword = ::c_int;
+pub type Elf64_Sxword = ::c_long;
+pub type Elf64_Word = ::c_uint;
+pub type Elf64_Xword = ::c_ulong;
+pub type Elf64_Lword = ::c_ulong;
+pub type Elf64_Phdr = __c_anonymous_Elf64_Phdr;
+
+s! {
+ pub struct __c_anonymous_fpchip_state {
+ pub cw: u16,
+ pub sw: u16,
+ pub fctw: u8,
+ pub __fx_rsvd: u8,
+ pub fop: u16,
+ pub rip: u64,
+ pub rdp: u64,
+ pub mxcsr: u32,
+ pub mxcsr_mask: u32,
+ pub st: [::upad128_t; 8],
+ pub xmm: [::upad128_t; 16],
+ pub __fx_ign: [::upad128_t; 6],
+ pub status: u32,
+ pub xstatus: u32,
+ }
+
+ pub struct __c_anonymous_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 dl_phdr_info {
+ pub dlpi_addr: ::Elf64_Addr,
+ pub dlpi_name: *const ::c_char,
+ pub dlpi_phdr: *const ::Elf64_Phdr,
+ pub dlpi_phnum: ::Elf64_Half,
+ pub dlpi_adds: ::c_ulonglong,
+ pub dlpi_subs: ::c_ulonglong,
+ }
+}
+
+s_no_extra_traits! {
+ #[cfg(libc_union)]
+ pub union __c_anonymous_fp_reg_set {
+ pub fpchip_state: __c_anonymous_fpchip_state,
+ pub f_fpregs: [[u32; 13]; 10],
+ }
+
+ pub struct fpregset_t {
+ pub fp_reg_set: __c_anonymous_fp_reg_set,
+ }
+
+ pub struct mcontext_t {
+ pub gregs: [::greg_t; 28],
+ pub fpregs: fpregset_t,
+ }
+
+ pub struct ucontext_t {
+ pub uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_sigmask: ::sigset_t,
+ pub uc_stack: ::stack_t,
+ pub uc_mcontext: mcontext_t,
+ pub uc_filler: [::c_long; 5],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_fp_reg_set {
+ fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool {
+ unsafe {
+ self.fpchip_state == other.fpchip_state ||
+ self.
+ f_fpregs.
+ iter().
+ zip(other.f_fpregs.iter()).
+ all(|(a, b)| a == b)
+ }
+ }
+ }
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_fp_reg_set {}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_fp_reg_set {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_fp_reg_set")
+ .field("fpchip_state", &{self.fpchip_state})
+ .field("f_fpregs", &{self.f_fpregs})
+ .finish()
+ }
+ }
+ }
+ impl PartialEq for fpregset_t {
+ fn eq(&self, other: &fpregset_t) -> bool {
+ self.fp_reg_set == other.fp_reg_set
+ }
+ }
+ impl Eq for fpregset_t {}
+ impl ::fmt::Debug for fpregset_t {
+ fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("fpregset_t")
+ .field("fp_reg_set", &self.fp_reg_set)
+ .finish()
+ }
+ }
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.gregs == other.gregs &&
+ self.fpregs == other.fpregs
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("gregs", &self.gregs)
+ .field("fpregs", &self.fpregs)
+ .finish()
+ }
+ }
+ impl PartialEq for ucontext_t {
+ fn eq(&self, other: &ucontext_t) -> bool {
+ self.uc_flags == other.uc_flags
+ && self.uc_link == other.uc_link
+ && self.uc_sigmask == other.uc_sigmask
+ && self.uc_stack == other.uc_stack
+ && self.uc_mcontext == other.uc_mcontext
+ && self.uc_filler == other.uc_filler
+ }
+ }
+ impl Eq for ucontext_t {}
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_flags", &self.uc_flags)
+ .field("uc_link", &self.uc_link)
+ .field("uc_sigmask", &self.uc_sigmask)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_filler", &self.uc_filler)
+ .finish()
+ }
+ }
+
+ }
+}
+
+// sys/regset.h
+
+pub const REG_GSBASE: ::c_int = 27;
+pub const REG_FSBASE: ::c_int = 26;
+pub const REG_DS: ::c_int = 25;
+pub const REG_ES: ::c_int = 24;
+pub const REG_GS: ::c_int = 23;
+pub const REG_FS: ::c_int = 22;
+pub const REG_SS: ::c_int = 21;
+pub const REG_RSP: ::c_int = 20;
+pub const REG_RFL: ::c_int = 19;
+pub const REG_CS: ::c_int = 18;
+pub const REG_RIP: ::c_int = 17;
+pub const REG_ERR: ::c_int = 16;
+pub const REG_TRAPNO: ::c_int = 15;
+pub const REG_RAX: ::c_int = 14;
+pub const REG_RCX: ::c_int = 13;
+pub const REG_RDX: ::c_int = 12;
+pub const REG_RBX: ::c_int = 11;
+pub const REG_RBP: ::c_int = 10;
+pub const REG_RSI: ::c_int = 9;
+pub const REG_RDI: ::c_int = 8;
+pub const REG_R8: ::c_int = 7;
+pub const REG_R9: ::c_int = 6;
+pub const REG_R10: ::c_int = 5;
+pub const REG_R11: ::c_int = 4;
+pub const REG_R12: ::c_int = 3;
+pub const REG_R13: ::c_int = 2;
+pub const REG_R14: ::c_int = 1;
+pub const REG_R15: ::c_int = 0;
diff --git a/src/unix/solarish/x86_common.rs b/src/unix/solarish/x86_common.rs
new file mode 100644
index 0000000000000..515f23490db55
--- /dev/null
+++ b/src/unix/solarish/x86_common.rs
@@ -0,0 +1,65 @@
+// AT_SUN_HWCAP
+pub const AV_386_FPU: u32 = 0x00001;
+pub const AV_386_TSC: u32 = 0x00002;
+pub const AV_386_CX8: u32 = 0x00004;
+pub const AV_386_SEP: u32 = 0x00008;
+pub const AV_386_AMD_SYSC: u32 = 0x00010;
+pub const AV_386_CMOV: u32 = 0x00020;
+pub const AV_386_MMX: u32 = 0x00040;
+pub const AV_386_AMD_MMX: u32 = 0x00080;
+pub const AV_386_AMD_3DNow: u32 = 0x00100;
+pub const AV_386_AMD_3DNowx: u32 = 0x00200;
+pub const AV_386_FXSR: u32 = 0x00400;
+pub const AV_386_SSE: u32 = 0x00800;
+pub const AV_386_SSE2: u32 = 0x01000;
+pub const AV_386_CX16: u32 = 0x10000;
+pub const AV_386_AHF: u32 = 0x20000;
+pub const AV_386_TSCP: u32 = 0x40000;
+pub const AV_386_AMD_SSE4A: u32 = 0x80000;
+pub const AV_386_POPCNT: u32 = 0x100000;
+pub const AV_386_AMD_LZCNT: u32 = 0x200000;
+pub const AV_386_SSSE3: u32 = 0x400000;
+pub const AV_386_SSE4_1: u32 = 0x800000;
+pub const AV_386_SSE4_2: u32 = 0x1000000;
+pub const AV_386_MOVBE: u32 = 0x2000000;
+pub const AV_386_AES: u32 = 0x4000000;
+pub const AV_386_PCLMULQDQ: u32 = 0x8000000;
+pub const AV_386_XSAVE: u32 = 0x10000000;
+pub const AV_386_AVX: u32 = 0x20000000;
+pub const AV_386_VMX: u32 = 0x40000000;
+pub const AV_386_AMD_SVM: u32 = 0x80000000;
+// AT_SUN_HWCAP2
+pub const AV_386_2_F16C: u32 = 0x00000001;
+pub const AV_386_2_RDRAND: u32 = 0x00000002;
+pub const AV_386_2_BMI1: u32 = 0x00000004;
+pub const AV_386_2_BMI2: u32 = 0x00000008;
+pub const AV_386_2_FMA: u32 = 0x00000010;
+pub const AV_386_2_AVX2: u32 = 0x00000020;
+pub const AV_386_2_ADX: u32 = 0x00000040;
+pub const AV_386_2_RDSEED: u32 = 0x00000080;
+pub const AV_386_2_AVX512F: u32 = 0x00000100;
+pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
+pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
+pub const AV_386_2_AVX512PF: u32 = 0x00000800;
+pub const AV_386_2_AVX512ER: u32 = 0x00001000;
+pub const AV_386_2_AVX512CD: u32 = 0x00002000;
+pub const AV_386_2_AVX512BW: u32 = 0x00004000;
+pub const AV_386_2_AVX512VL: u32 = 0x00008000;
+pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
+pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
+pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
+pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
+pub const AV_386_2_SHA: u32 = 0x00100000;
+pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
+pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
+pub const AV_386_2_CLWB: u32 = 0x00800000;
+pub const AV_386_2_MONITORX: u32 = 0x01000000;
+pub const AV_386_2_CLZERO: u32 = 0x02000000;
+pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
+pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
+pub const AV_386_2_VAES: u32 = 0x10000000;
+// AT_SUN_FPTYPE
+pub const AT_386_FPINFO_NONE: u32 = 0;
+pub const AT_386_FPINFO_FXSAVE: u32 = 1;
+pub const AT_386_FPINFO_XSAVE: u32 = 2;
+pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;
diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs
old mode 100755
new mode 100644
index 704dac7f5cc7e..6b705e8a22c81
--- a/src/vxworks/mod.rs
+++ b/src/vxworks/mod.rs
@@ -631,6 +631,7 @@ pub const EFAULT: ::c_int = 14;
pub const ENOTEMPTY: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
@@ -638,7 +639,9 @@ pub const EINVAL: ::c_int = 22;
pub const ENAMETOOLONG: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDEADLK: ::c_int = 33;
pub const ERANGE: ::c_int = 38;
@@ -664,6 +667,10 @@ pub const ESHUTDOWN: ::c_int = 58;
pub const ETOOMANYREFS: ::c_int = 59;
pub const ETIMEDOUT: ::c_int = 60;
pub const ECONNREFUSED: ::c_int = 61;
+pub const ENETDOWN: ::c_int = 62;
+pub const ETXTBSY: ::c_int = 63;
+pub const ELOOP: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
pub const EINPROGRESS: ::c_int = 68;
pub const EALREADY: ::c_int = 69;
pub const EWOULDBLOCK: ::c_int = 70;
@@ -702,24 +709,16 @@ pub const S_nfsLib_NFSERR_NAMETOOLONG: ::c_int = ENAMETOOLONG;
pub const S_nfsLib_NFSERR_NOTEMPTY: ::c_int = ENOTEMPTY;
pub const S_nfsLib_NFSERR_DQUOT: ::c_int = EDQUOT;
pub const S_nfsLib_NFSERR_STALE: ::c_int = ESTALE;
-pub const S_nfsLib_NFSERR_WFLUSH: ::c_int =
- M_nfsStat | nfsstat::NFSERR_WFLUSH as ::c_int;
-pub const S_nfsLib_NFSERR_REMOTE: ::c_int =
- M_nfsStat | nfsstat::NFSERR_REMOTE as ::c_int;
-pub const S_nfsLib_NFSERR_BADHANDLE: ::c_int =
- M_nfsStat | nfsstat::NFSERR_BADHANDLE as ::c_int;
-pub const S_nfsLib_NFSERR_NOT_SYNC: ::c_int =
- M_nfsStat | nfsstat::NFSERR_NOT_SYNC as ::c_int;
-pub const S_nfsLib_NFSERR_BAD_COOKIE: ::c_int =
- M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as ::c_int;
+pub const S_nfsLib_NFSERR_WFLUSH: ::c_int = M_nfsStat | nfsstat::NFSERR_WFLUSH as ::c_int;
+pub const S_nfsLib_NFSERR_REMOTE: ::c_int = M_nfsStat | nfsstat::NFSERR_REMOTE as ::c_int;
+pub const S_nfsLib_NFSERR_BADHANDLE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADHANDLE as ::c_int;
+pub const S_nfsLib_NFSERR_NOT_SYNC: ::c_int = M_nfsStat | nfsstat::NFSERR_NOT_SYNC as ::c_int;
+pub const S_nfsLib_NFSERR_BAD_COOKIE: ::c_int = M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as ::c_int;
pub const S_nfsLib_NFSERR_NOTSUPP: ::c_int = EOPNOTSUPP;
-pub const S_nfsLib_NFSERR_TOOSMALL: ::c_int =
- M_nfsStat | nfsstat::NFSERR_TOOSMALL as ::c_int;
+pub const S_nfsLib_NFSERR_TOOSMALL: ::c_int = M_nfsStat | nfsstat::NFSERR_TOOSMALL as ::c_int;
pub const S_nfsLib_NFSERR_SERVERFAULT: ::c_int = EIO;
-pub const S_nfsLib_NFSERR_BADTYPE: ::c_int =
- M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int;
-pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int =
- M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int;
+pub const S_nfsLib_NFSERR_BADTYPE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int;
+pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int = M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int;
// in.h
pub const IPPROTO_IP: ::c_int = 0;
@@ -803,8 +802,7 @@ pub const SOCK_PACKET: ::c_int = 10;
pub const _SS_MAXSIZE: usize = 128;
pub const _SS_ALIGNSIZE: usize = size_of::();
-pub const _SS_PAD1SIZE: usize =
- _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>();
+pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>();
pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE
- size_of::<::c_uchar>()
- size_of::<::sa_family_t>()
@@ -951,14 +949,13 @@ pub const _PARM_PATH_MAX: ::c_int = 1024;
pub const WNOHANG: ::c_int = 0x01;
pub const WUNTRACED: ::c_int = 0x02;
-const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t =
- pthread_mutexattr_t {
- mutexAttrStatus: PTHREAD_INITIALIZED_OBJ,
- mutexAttrProtocol: PTHREAD_PRIO_NONE,
- mutexAttrPrioceiling: 0,
- mutexAttrType: PTHREAD_MUTEX_DEFAULT,
- mutexAttrPshared: 1,
- };
+const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t {
+ mutexAttrStatus: PTHREAD_INITIALIZED_OBJ,
+ mutexAttrProtocol: PTHREAD_PRIO_NONE,
+ mutexAttrPrioceiling: 0,
+ mutexAttrType: PTHREAD_MUTEX_DEFAULT,
+ mutexAttrPshared: 1,
+};
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
mutexSemId: null_mut(),
mutexValid: PTHREAD_VALID_OBJ,
@@ -984,13 +981,12 @@ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX],
};
-const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t =
- pthread_rwlockattr_t {
- rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ,
- rwlockAttrPshared: 1,
- rwlockAttrMaxReaders: 0,
- rwlockAttrConformOpt: 1,
- };
+const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_t {
+ rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ,
+ rwlockAttrPshared: 1,
+ rwlockAttrMaxReaders: 0,
+ rwlockAttrConformOpt: 1,
+};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
rwlockSemId: null_mut(),
rwlockReadersRefCount: 0,
@@ -1097,44 +1093,24 @@ extern "C" {
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
- pub fn freopen(
- filename: *const c_char,
- mode: *const c_char,
- file: *mut FILE,
- ) -> *mut FILE;
+ 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 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 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;
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;
- pub fn fwrite(
- ptr: *const c_void,
- size: size_t,
- nobj: size_t,
- stream: *mut FILE,
- ) -> size_t;
+ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+ 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);
@@ -1143,18 +1119,16 @@ extern "C" {
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 atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
+ pub fn atol(s: *const c_char) -> c_long;
+ pub fn atoll(s: *const c_char) -> c_longlong;
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 strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
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;
@@ -1166,17 +1140,9 @@ extern "C" {
pub fn getenv(s: *const c_char) -> *mut c_char;
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 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 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;
@@ -1188,60 +1154,30 @@ extern "C" {
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 strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
- pub fn strncasecmp(
- s1: *const c_char,
- s2: *const c_char,
- n: size_t,
- ) -> c_int;
+ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strlen(cs: *const c_char) -> size_t;
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 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 wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
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 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;
}
extern "C" {
- pub fn fprintf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
- pub fn snprintf(
- s: *mut ::c_char,
- n: ::size_t,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
- pub fn fscanf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
- pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...)
- -> ::c_int;
+ pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
@@ -1259,11 +1195,7 @@ extern "C" {
pub fn geteuid() -> uid_t;
pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
pub fn getlogin() -> *mut c_char;
- pub fn getopt(
- argc: ::c_int,
- argv: *const *mut c_char,
- optstr: *const c_char,
- ) -> ::c_int;
+ pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pause() -> ::c_int;
pub fn seteuid(uid: uid_t) -> ::c_int;
@@ -1289,27 +1221,15 @@ extern "C" {
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn pthread_exit(value: *mut ::c_void) -> !;
- pub fn pthread_attr_setdetachstate(
- attr: *mut ::pthread_attr_t,
- state: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
- pub fn sigaction(
- signum: ::c_int,
- act: *const sigaction,
- oldact: *mut sigaction,
- ) -> ::c_int;
+ pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
- pub fn utimes(
- filename: *const ::c_char,
- times: *const ::timeval,
- ) -> ::c_int;
+ pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
+
+ pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
#[link_name = "_rtld_dlopen"]
pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
@@ -1318,10 +1238,7 @@ extern "C" {
pub fn dlerror() -> *mut ::c_char;
#[link_name = "_rtld_dlsym"]
- pub fn dlsym(
- handle: *mut ::c_void,
- symbol: *const ::c_char,
- ) -> *mut ::c_void;
+ pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
#[link_name = "_rtld_dlclose"]
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
@@ -1341,25 +1258,14 @@ extern "C" {
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn usleep(secs: ::useconds_t) -> ::c_int;
pub fn putenv(string: *mut c_char) -> ::c_int;
- pub fn setlocale(
- category: ::c_int,
- locale: *const ::c_char,
- ) -> *mut ::c_char;
-
- pub fn sigprocmask(
- how: ::c_int,
- set: *const sigset_t,
- oldset: *mut sigset_t,
- ) -> ::c_int;
+ pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
+
+ pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
- pub fn fseeko(
- stream: *mut ::FILE,
- offset: ::off_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
@@ -1369,18 +1275,13 @@ extern "C" {
pub fn closelog();
pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
- pub fn getline(
- lineptr: *mut *mut c_char,
- n: *mut size_t,
- stream: *mut FILE,
- ) -> ssize_t;
+ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
}
extern "C" {
// stdlib.h
- pub fn memalign(block_size: ::size_t, size_arg: ::size_t)
- -> *mut ::c_void;
+ pub fn memalign(block_size: ::size_t, size_arg: ::size_t) -> *mut ::c_void;
// ioLib.h
pub fn getcwd(buf: *mut ::c_char, size: ::size_t) -> *mut ::c_char;
@@ -1392,15 +1293,10 @@ extern "C" {
pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
// pthread.h
- pub fn pthread_mutexattr_destroy(
- attr: *mut pthread_mutexattr_t,
- ) -> ::c_int;
+ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
// pthread.h
- pub fn pthread_mutexattr_settype(
- pAttr: *mut ::pthread_mutexattr_t,
- pType: ::c_int,
- ) -> ::c_int;
+ pub fn pthread_mutexattr_settype(pAttr: *mut ::pthread_mutexattr_t, pType: ::c_int) -> ::c_int;
// pthread.h
pub fn pthread_mutex_init(
@@ -1418,31 +1314,20 @@ extern "C" {
pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> ::c_int;
// pthread.h
- pub fn pthread_mutex_timedlock(
- attr: *mut pthread_mutex_t,
- spec: *const timespec,
- ) -> ::c_int;
+ pub fn pthread_mutex_timedlock(attr: *mut pthread_mutex_t, spec: *const timespec) -> ::c_int;
// pthread.h
pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> ::c_int;
// pthread.h
- pub fn pthread_attr_setname(
- pAttr: *mut ::pthread_attr_t,
- name: *mut ::c_char,
- ) -> ::c_int;
+ pub fn pthread_attr_setname(pAttr: *mut ::pthread_attr_t, name: *mut ::c_char) -> ::c_int;
// pthread.h
- pub fn pthread_attr_setstacksize(
- attr: *mut ::pthread_attr_t,
- stacksize: ::size_t,
- ) -> ::c_int;
+ pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stacksize: ::size_t) -> ::c_int;
// pthread.h
- pub fn pthread_attr_getstacksize(
- attr: *const ::pthread_attr_t,
- size: *mut ::size_t,
- ) -> ::c_int;
+ pub fn pthread_attr_getstacksize(attr: *const ::pthread_attr_t, size: *mut ::size_t)
+ -> ::c_int;
// pthread.h
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
@@ -1477,11 +1362,8 @@ extern "C" {
pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
// dirent.h
- pub fn readdir_r(
- pDir: *mut ::DIR,
- entry: *mut ::dirent,
- result: *mut *mut ::dirent,
- ) -> ::c_int;
+ pub fn readdir_r(pDir: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+ -> ::c_int;
// dirent.h
pub fn readdir(pDir: *mut ::DIR) -> *mut ::dirent;
@@ -1497,9 +1379,7 @@ extern "C" {
pub fn pthread_condattr_init(attr: *mut ::pthread_condattr_t) -> ::c_int;
// pthread.h
- pub fn pthread_condattr_destroy(
- attr: *mut ::pthread_condattr_t,
- ) -> ::c_int;
+ pub fn pthread_condattr_destroy(attr: *mut ::pthread_condattr_t) -> ::c_int;
// pthread.h
pub fn pthread_condattr_getclock(
@@ -1529,20 +1409,14 @@ extern "C" {
pub fn pthread_cond_broadcast(cond: *mut ::pthread_cond_t) -> ::c_int;
// pthread.h
- pub fn pthread_cond_wait(
- cond: *mut ::pthread_cond_t,
- mutex: *mut ::pthread_mutex_t,
- ) -> ::c_int;
+ pub fn pthread_cond_wait(cond: *mut ::pthread_cond_t, mutex: *mut ::pthread_mutex_t)
+ -> ::c_int;
// pthread.h
- pub fn pthread_rwlockattr_init(
- attr: *mut ::pthread_rwlockattr_t,
- ) -> ::c_int;
+ pub fn pthread_rwlockattr_init(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
// pthread.h
- pub fn pthread_rwlockattr_destroy(
- attr: *mut ::pthread_rwlockattr_t,
- ) -> ::c_int;
+ pub fn pthread_rwlockattr_destroy(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
// pthread.h
pub fn pthread_rwlockattr_setmaxreaders(
@@ -1596,10 +1470,7 @@ extern "C" {
pub fn pthread_key_delete(key: ::pthread_key_t) -> ::c_int;
// pthread.h
- pub fn pthread_setspecific(
- key: ::pthread_key_t,
- value: *const ::c_void,
- ) -> ::c_int;
+ pub fn pthread_setspecific(key: ::pthread_key_t, value: *const ::c_void) -> ::c_int;
// pthread.h
pub fn pthread_getspecific(key: ::pthread_key_t) -> *mut ::c_void;
@@ -1612,37 +1483,22 @@ extern "C" {
) -> ::c_int;
// pthread.h
- pub fn pthread_attr_getname(
- attr: *mut ::pthread_attr_t,
- name: *mut *mut ::c_char,
- ) -> ::c_int;
+ pub fn pthread_attr_getname(attr: *mut ::pthread_attr_t, name: *mut *mut ::c_char) -> ::c_int;
// pthread.h
- pub fn pthread_join(
- thread: ::pthread_t,
- status: *mut *mut ::c_void,
- ) -> ::c_int;
+ pub fn pthread_join(thread: ::pthread_t, status: *mut *mut ::c_void) -> ::c_int;
// pthread.h
pub fn pthread_self() -> ::pthread_t;
// clockLib.h
- pub fn clock_gettime(
- clock_id: ::clockid_t,
- tp: *mut ::timespec,
- ) -> ::c_int;
+ pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
// clockLib.h
- pub fn clock_settime(
- clock_id: ::clockid_t,
- tp: *const ::timespec,
- ) -> ::c_int;
+ pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
// clockLib.h
- pub fn clock_getres(
- clock_id: ::clockid_t,
- res: *mut ::timespec,
- ) -> ::c_int;
+ pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
// clockLib.h
pub fn clock_nanosleep(
@@ -1653,35 +1509,19 @@ extern "C" {
) -> ::c_int;
// timerLib.h
- pub fn nanosleep(
- rqtp: *const ::timespec,
- rmtp: *mut ::timespec,
- ) -> ::c_int;
+ pub fn nanosleep(rqtp: *const ::timespec, rmtp: *mut ::timespec) -> ::c_int;
// socket.h
- pub fn accept(
- s: ::c_int,
- addr: *mut ::sockaddr,
- addrlen: *mut ::socklen_t,
- ) -> ::c_int;
+ pub fn accept(s: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t) -> ::c_int;
// socket.h
- pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t)
- -> ::c_int;
+ pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
// socket.h
- pub fn connect(
- s: ::c_int,
- name: *const ::sockaddr,
- namelen: ::socklen_t,
- ) -> ::c_int;
+ pub fn connect(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) -> ::c_int;
// socket.h
- pub fn getpeername(
- s: ::c_int,
- name: *mut ::sockaddr,
- namelen: *mut ::socklen_t,
- ) -> ::c_int;
+ pub fn getpeername(s: ::c_int, name: *mut ::sockaddr, namelen: *mut ::socklen_t) -> ::c_int;
// socket.h
pub fn getsockname(
@@ -1703,12 +1543,7 @@ extern "C" {
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
// socket.h
- pub fn recv(
- s: ::c_int,
- buf: *mut ::c_void,
- bufLen: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn recv(s: ::c_int, buf: *mut ::c_void, bufLen: ::size_t, flags: ::c_int) -> ::ssize_t;
// socket.h
pub fn recvfrom(
@@ -1720,25 +1555,12 @@ extern "C" {
pFromLen: *mut ::socklen_t,
) -> ::ssize_t;
- pub fn recvmsg(
- socket: ::c_int,
- mp: *mut ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn recvmsg(socket: ::c_int, mp: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
// socket.h
- pub fn send(
- socket: ::c_int,
- buf: *const ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
- pub fn sendmsg(
- socket: ::c_int,
- mp: *const ::msghdr,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn sendmsg(socket: ::c_int, mp: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
// socket.h
pub fn sendto(
@@ -1763,11 +1585,7 @@ extern "C" {
pub fn shutdown(s: ::c_int, how: ::c_int) -> ::c_int;
// socket.h
- pub fn socket(
- domain: ::c_int,
- _type: ::c_int,
- protocol: ::c_int,
- ) -> ::c_int;
+ pub fn socket(domain: ::c_int, _type: ::c_int, protocol: ::c_int) -> ::c_int;
// icotl.h
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
@@ -1785,16 +1603,11 @@ extern "C" {
// ioLib.h or
// unistd.h
- pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
- -> ::ssize_t;
+ pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
// ioLib.h or
// unistd.h
- pub fn write(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- ) -> ::ssize_t;
+ pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
// ioLib.h or
// unistd.h
@@ -1841,8 +1654,7 @@ extern "C" {
pub fn getppid() -> pid_t;
// wait.h
- pub fn waitpid(pid: pid_t, status: *mut ::c_int, optons: ::c_int)
- -> pid_t;
+ pub fn waitpid(pid: pid_t, status: *mut ::c_int, optons: ::c_int) -> pid_t;
// unistd.h
pub fn sysconf(attr: ::c_int) -> ::c_long;
@@ -1862,20 +1674,13 @@ extern "C" {
) -> ::c_int;
// stdlib.h
- pub fn realpath(
- fileName: *const ::c_char,
- resolvedName: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char;
// unistd.h
pub fn link(src: *const ::c_char, dst: *const ::c_char) -> ::c_int;
// unistd.h
- pub fn readlink(
- path: *const ::c_char,
- buf: *mut ::c_char,
- bufsize: ::size_t,
- ) -> ::ssize_t;
+ pub fn readlink(path: *const ::c_char, buf: *mut ::c_char, bufsize: ::size_t) -> ::ssize_t;
// unistd.h
pub fn symlink(path1: *const ::c_char, path2: *const ::c_char) -> ::c_int;
@@ -1940,11 +1745,7 @@ extern "C" {
pub fn kill(__pid: pid_t, __signo: ::c_int) -> ::c_int;
// signal.h for user
- pub fn sigqueue(
- __pid: pid_t,
- __signo: ::c_int,
- __value: ::sigval,
- ) -> ::c_int;
+ pub fn sigqueue(__pid: pid_t, __signo: ::c_int, __value: ::sigval) -> ::c_int;
// signal.h for user
pub fn _sigqueue(
@@ -1977,27 +1778,13 @@ extern "C" {
) -> RTP_ID;
// ioLib.h
- pub fn _realpath(
- fileName: *const ::c_char,
- resolvedName: *mut ::c_char,
- ) -> *mut ::c_char;
+ pub fn _realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char;
// pathLib.h
- pub fn _pathIsAbsolute(
- filepath: *const ::c_char,
- pNameTail: *mut *const ::c_char,
- ) -> BOOL;
+ pub fn _pathIsAbsolute(filepath: *const ::c_char, pNameTail: *mut *const ::c_char) -> BOOL;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// randomNumGen.h
pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int;
@@ -2036,11 +1823,7 @@ extern "C" {
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
- pub fn mq_setattr(
- mqd: ::mqd_t,
- newattr: *const ::mq_attr,
- oldattr: *mut ::mq_attr,
- ) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
}
//Dummy functions, these don't really exist in VxWorks.
@@ -2067,12 +1850,7 @@ safe_f! {
}
}
-pub fn pread(
- _fd: ::c_int,
- _buf: *mut ::c_void,
- _count: ::size_t,
- _offset: off64_t,
-) -> ::ssize_t {
+pub fn pread(_fd: ::c_int, _buf: *mut ::c_void, _count: ::size_t, _offset: off64_t) -> ::ssize_t {
-1
}
@@ -2084,16 +1862,10 @@ pub fn pwrite(
) -> ::ssize_t {
-1
}
-pub fn posix_memalign(
- memptr: *mut *mut ::c_void,
- align: ::size_t,
- size: ::size_t,
-) -> ::c_int {
+pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int {
// check to see if align is a power of 2 and if align is a multiple
// of sizeof(void *)
- if (align & align - 1 != 0)
- || (align as usize % size_of::<::size_t>() != 0)
- {
+ if (align & align - 1 != 0) || (align as usize % size_of::<::size_t>() != 0) {
return ::EINVAL;
}
diff --git a/src/wasi.rs b/src/wasi.rs
index 9aef01a5f455d..abfebd6439326 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -1,3 +1,5 @@
+use super::{Send, Sync};
+
pub use ffi::c_void;
pub type c_char = i8;
@@ -36,9 +38,17 @@ pub type blksize_t = c_long;
pub type blkcnt_t = i64;
pub type nfds_t = c_ulong;
pub type wchar_t = i32;
-
+pub type nl_item = c_int;
pub type __wasi_rights_t = u64;
+s_no_extra_traits! {
+ #[repr(align(16))]
+ #[allow(missing_debug_implementations)]
+ pub struct max_align_t {
+ priv_: [f64; 4]
+ }
+}
+
#[allow(missing_copy_implementations)]
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
@@ -51,6 +61,16 @@ pub enum __locale_struct {}
pub type locale_t = *mut __locale_struct;
+s_paren! {
+ // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct),
+ // but that's an implementation detail that we don't want to have to deal with
+ #[repr(transparent)]
+ pub struct clockid_t(*const u8);
+}
+
+unsafe impl Send for clockid_t {}
+unsafe impl Sync for clockid_t {}
+
s! {
#[repr(align(8))]
pub struct fpos_t {
@@ -201,6 +221,7 @@ pub const O_EXEC: c_int = 0x02000000;
pub const O_RDONLY: c_int = 0x04000000;
pub const O_SEARCH: c_int = 0x08000000;
pub const O_WRONLY: c_int = 0x10000000;
+pub const O_CLOEXEC: c_int = 0x0;
pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
pub const O_NOCTTY: c_int = 0x0;
@@ -225,6 +246,18 @@ pub const S_IFREG: mode_t = 32768;
pub const S_IFLNK: mode_t = 40960;
pub const S_IFSOCK: mode_t = 49152;
pub const S_IFMT: mode_t = 57344;
+pub const S_IXOTH: mode_t = 0x1;
+pub const S_IWOTH: mode_t = 0x2;
+pub const S_IROTH: mode_t = 0x4;
+pub const S_IXGRP: mode_t = 0x8;
+pub const S_IWGRP: mode_t = 0x10;
+pub const S_IRGRP: mode_t = 0x20;
+pub const S_IXUSR: mode_t = 0x40;
+pub const S_IWUSR: mode_t = 0x80;
+pub const S_IRUSR: mode_t = 0x100;
+pub const S_ISVTX: mode_t = 0x200;
+pub const S_ISGID: mode_t = 0x400;
+pub const S_ISUID: mode_t = 0x800;
pub const DT_UNKNOWN: u8 = 0;
pub const DT_BLK: u8 = 1;
pub const DT_CHR: u8 = 2;
@@ -329,9 +362,86 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_IOV_MAX: c_int = 60;
pub const _SC_SYMLOOP_MAX: c_int = 173;
+pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
+pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
+ unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
+pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
+pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
+ unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
#[cfg_attr(
feature = "rustc-dep-of-std",
- link(name = "c", kind = "static", cfg(target_feature = "crt-static"))
+ link(
+ name = "c",
+ kind = "static",
+ modifiers = "-bundle",
+ cfg(target_feature = "crt-static")
+ )
)]
#[cfg_attr(
feature = "rustc-dep-of-std",
@@ -358,11 +468,7 @@ extern "C" {
pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t;
pub static mut environ: *mut *mut c_char;
pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE;
- pub fn freopen(
- a: *const c_char,
- b: *const c_char,
- f: *mut FILE,
- ) -> *mut FILE;
+ pub fn freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE;
pub fn fclose(f: *mut FILE) -> c_int;
pub fn remove(a: *const c_char) -> c_int;
pub fn rename(a: *const c_char, b: *const c_char) -> c_int;
@@ -375,18 +481,8 @@ extern "C" {
pub fn rewind(f: *mut FILE);
pub fn fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int;
pub fn fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int;
- pub fn fread(
- buf: *mut c_void,
- a: size_t,
- b: size_t,
- f: *mut FILE,
- ) -> size_t;
- pub fn fwrite(
- buf: *const c_void,
- a: size_t,
- b: size_t,
- f: *mut FILE,
- ) -> size_t;
+ pub fn fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
+ pub fn fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
pub fn fgetc(f: *mut FILE) -> c_int;
pub fn getc(f: *mut FILE) -> c_int;
pub fn getchar() -> c_int;
@@ -410,12 +506,7 @@ extern "C" {
pub fn time(a: *mut time_t) -> time_t;
pub fn difftime(a: time_t, b: time_t) -> c_double;
pub fn mktime(a: *mut tm) -> time_t;
- pub fn strftime(
- a: *mut c_char,
- b: size_t,
- c: *const c_char,
- d: *const tm,
- ) -> size_t;
+ pub fn strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t;
pub fn gmtime(a: *const time_t) -> *mut tm;
pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm;
pub fn localtime(a: *const time_t) -> *mut tm;
@@ -423,15 +514,14 @@ extern "C" {
pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char;
pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char;
+ static _CLOCK_MONOTONIC: u8;
+ static _CLOCK_PROCESS_CPUTIME_ID: u8;
+ static _CLOCK_REALTIME: u8;
+ static _CLOCK_THREAD_CPUTIME_ID: u8;
pub fn nanosleep(a: *const timespec, b: *mut timespec) -> c_int;
- // pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int;
- // pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int;
- // pub fn clock_nanosleep(
- // a: clockid_t,
- // a2: c_int,
- // b: *const timespec,
- // c: *mut timespec,
- // ) -> c_int;
+ pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int;
+ pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int;
+ pub fn clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int;
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
@@ -447,41 +537,24 @@ extern "C" {
pub fn isblank(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
- pub fn setvbuf(
- stream: *mut FILE,
- buffer: *mut c_char,
- mode: c_int,
- size: size_t,
- ) -> c_int;
+ 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 fgets(buf: *mut c_char, n: c_int, stream: *mut FILE)
- -> *mut c_char;
- pub fn atoi(s: *const c_char) -> c_int;
+ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
pub fn atof(s: *const c_char) -> c_double;
+ pub fn atoi(s: *const c_char) -> c_int;
+ pub fn atol(s: *const c_char) -> c_long;
+ pub fn atoll(s: *const c_char) -> c_longlong;
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 strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
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 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 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;
@@ -494,11 +567,7 @@ extern "C" {
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 strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
- pub fn strncasecmp(
- s1: *const c_char,
- s2: *const c_char,
- n: size_t,
- ) -> c_int;
+ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
pub fn strerror(n: c_int) -> *mut c_char;
@@ -507,39 +576,17 @@ extern "C" {
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 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;
- pub fn fprintf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
- pub fn snprintf(
- s: *mut ::c_char,
- n: ::size_t,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
- pub fn fscanf(
- stream: *mut ::FILE,
- format: *const ::c_char,
- ...
- ) -> ::c_int;
+ pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
- pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...)
- -> ::c_int;
+ pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
@@ -561,12 +608,7 @@ extern "C" {
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn openat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- flags: ::c_int,
- ...
- ) -> ::c_int;
+ pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
pub fn fstatat(
dirfd: ::c_int,
pathname: *const ::c_char,
@@ -580,11 +622,7 @@ extern "C" {
newpath: *const ::c_char,
flags: ::c_int,
) -> ::c_int;
- pub fn mkdirat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- mode: ::mode_t,
- ) -> ::c_int;
+ pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn readlinkat(
dirfd: ::c_int,
pathname: *const ::c_char,
@@ -602,20 +640,12 @@ extern "C" {
newdirfd: ::c_int,
linkpath: *const ::c_char,
) -> ::c_int;
- pub fn unlinkat(
- dirfd: ::c_int,
- pathname: *const ::c_char,
- flags: ::c_int,
- ) -> ::c_int;
+ pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
pub fn close(fd: ::c_int) -> ::c_int;
pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
- pub fn getopt(
- argc: ::c_int,
- argv: *const *mut c_char,
- optstr: *const c_char,
- ) -> ::c_int;
+ pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
pub fn isatty(fd: ::c_int) -> ::c_int;
pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
@@ -623,18 +653,8 @@ extern "C" {
pub fn rmdir(path: *const c_char) -> ::c_int;
pub fn sleep(secs: ::c_uint) -> ::c_uint;
pub fn unlink(c: *const c_char) -> ::c_int;
- pub fn pread(
- fd: ::c_int,
- buf: *mut ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
- pub fn pwrite(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::size_t,
- offset: off_t,
- ) -> ::ssize_t;
+ pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+ pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
@@ -651,37 +671,16 @@ extern "C" {
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn times(buf: *mut ::tms) -> ::clock_t;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn usleep(secs: ::c_uint) -> ::c_int;
- pub fn send(
- socket: ::c_int,
- buf: *const ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
- pub fn recv(
- socket: ::c_int,
- buf: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::ssize_t;
+ pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+ pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
- pub fn setlocale(
- category: ::c_int,
- locale: *const ::c_char,
- ) -> *mut ::c_char;
+ pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
pub fn localeconv() -> *mut lconv;
- pub fn readlink(
- path: *const c_char,
- buf: *mut c_char,
- bufsz: ::size_t,
- ) -> ::ssize_t;
+ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
pub fn timegm(tm: *mut ::tm) -> time_t;
@@ -689,24 +688,12 @@ extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
- pub fn fseeko(
- stream: *mut ::FILE,
- offset: ::off_t,
- whence: ::c_int,
- ) -> ::c_int;
+ pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
- pub fn posix_fallocate(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- ) -> ::c_int;
+ pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
- pub fn getline(
- lineptr: *mut *mut c_char,
- n: *mut size_t,
- stream: *mut FILE,
- ) -> ssize_t;
+ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
pub fn faccessat(
dirfd: ::c_int,
@@ -714,34 +701,12 @@ extern "C" {
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn pwritev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn preadv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- offset: ::off_t,
- ) -> ::ssize_t;
- pub fn posix_fadvise(
- fd: ::c_int,
- offset: ::off_t,
- len: ::off_t,
- advise: ::c_int,
- ) -> ::c_int;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+ -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
@@ -750,27 +715,21 @@ extern "C" {
flag: ::c_int,
) -> ::c_int;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
- pub fn memrchr(
- cx: *const ::c_void,
- c: ::c_int,
- n: ::size_t,
- ) -> *mut ::c_void;
+ pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn abs(i: c_int) -> c_int;
pub fn labs(i: c_long) -> c_long;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
- pub fn newlocale(
- mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t,
- ) -> ::locale_t;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn sched_yield() -> ::c_int;
+ pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
+ pub fn chdir(dir: *const c_char) -> ::c_int;
- pub fn __wasilibc_register_preopened_fd(
- fd: c_int,
- path: *const c_char,
- ) -> c_int;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+
+ pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;
pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
@@ -781,14 +740,8 @@ extern "C" {
relative_path_len: usize,
) -> c_int;
pub fn __wasilibc_tell(fd: c_int) -> ::off_t;
- pub fn __wasilibc_nocwd___wasilibc_unlinkat(
- dirfd: c_int,
- path: *const c_char,
- ) -> c_int;
- pub fn __wasilibc_nocwd___wasilibc_rmdirat(
- dirfd: c_int,
- path: *const c_char,
- ) -> c_int;
+ pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int;
+ pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_nocwd_linkat(
olddirfd: c_int,
oldpath: *const c_char,
@@ -819,51 +772,30 @@ extern "C" {
newdirfd: c_int,
newpath: *const c_char,
) -> c_int;
- pub fn __wasilibc_nocwd_openat_nomode(
- dirfd: c_int,
- path: *const c_char,
- flags: c_int,
- ) -> c_int;
+ pub fn __wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int)
+ -> c_int;
pub fn __wasilibc_nocwd_fstatat(
dirfd: c_int,
path: *const c_char,
buf: *mut stat,
flags: c_int,
) -> c_int;
- pub fn __wasilibc_nocwd_mkdirat_nomode(
- dirfd: c_int,
- path: *const c_char,
- ) -> c_int;
+ pub fn __wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_nocwd_utimensat(
dirfd: c_int,
path: *const c_char,
times: *const ::timespec,
flags: c_int,
) -> c_int;
- pub fn __wasilibc_nocwd_opendirat(
- dirfd: c_int,
- path: *const c_char,
- ) -> *mut ::DIR;
- pub fn __wasilibc_access(
- pathname: *const c_char,
- mode: c_int,
- flags: c_int,
- ) -> c_int;
- pub fn __wasilibc_stat(
- pathname: *const c_char,
- buf: *mut stat,
- flags: c_int,
- ) -> c_int;
+ pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::DIR;
+ pub fn __wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
+ pub fn __wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int;
pub fn __wasilibc_utimens(
pathname: *const c_char,
times: *const ::timespec,
flags: c_int,
) -> c_int;
- pub fn __wasilibc_link(
- oldpath: *const c_char,
- newpath: *const c_char,
- flags: c_int,
- ) -> c_int;
+ pub fn __wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int;
pub fn __wasilibc_link_oldat(
olddirfd: c_int,
oldpath: *const c_char,
diff --git a/src/windows/gnu/mod.rs b/src/windows/gnu/mod.rs
index 3e906967f60dc..3e7d38b8e83c6 100644
--- a/src/windows/gnu/mod.rs
+++ b/src/windows/gnu/mod.rs
@@ -8,19 +8,11 @@ pub const STDERR_FILENO: ::c_int = 2;
extern "C" {
pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
- pub fn strncasecmp(
- s1: *const ::c_char,
- s2: *const ::c_char,
- n: ::size_t,
- ) -> ::c_int;
+ pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int;
// NOTE: For MSVC target, `wmemchr` is only a inline function in ``
// header file. We cannot find a way to link to that symbol from Rust.
- pub fn wmemchr(
- cx: *const ::wchar_t,
- c: ::wchar_t,
- n: ::size_t,
- ) -> *mut ::wchar_t;
+ pub fn wmemchr(cx: *const ::wchar_t, c: ::wchar_t, n: ::size_t) -> *mut ::wchar_t;
}
cfg_if! {
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index a2cd8574ab28d..7f2f1ded19ec7 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -27,6 +27,8 @@ pub type wchar_t = u16;
pub type clock_t = i32;
+pub type errno_t = ::c_int;
+
cfg_if! {
if #[cfg(all(target_arch = "x86", target_env = "gnu"))] {
pub type time_t = i32;
@@ -117,16 +119,27 @@ pub const BUFSIZ: ::c_uint = 512;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 260;
-pub const O_RDONLY: ::c_int = 0;
-pub const O_WRONLY: ::c_int = 1;
-pub const O_RDWR: ::c_int = 2;
-pub const O_APPEND: ::c_int = 8;
-pub const O_CREAT: ::c_int = 256;
-pub const O_EXCL: ::c_int = 1024;
-pub const O_TEXT: ::c_int = 16384;
-pub const O_BINARY: ::c_int = 32768;
-pub const O_NOINHERIT: ::c_int = 128;
-pub const O_TRUNC: ::c_int = 512;
+// fcntl.h
+pub const O_RDONLY: ::c_int = 0x0000;
+pub const O_WRONLY: ::c_int = 0x0001;
+pub const O_RDWR: ::c_int = 0x0002;
+pub const O_APPEND: ::c_int = 0x0008;
+pub const O_CREAT: ::c_int = 0x0100;
+pub const O_TRUNC: ::c_int = 0x0200;
+pub const O_EXCL: ::c_int = 0x0400;
+pub const O_TEXT: ::c_int = 0x4000;
+pub const O_BINARY: ::c_int = 0x8000;
+pub const _O_WTEXT: ::c_int = 0x10000;
+pub const _O_U16TEXT: ::c_int = 0x20000;
+pub const _O_U8TEXT: ::c_int = 0x40000;
+pub const O_RAW: ::c_int = O_BINARY;
+pub const O_NOINHERIT: ::c_int = 0x0080;
+pub const O_TEMPORARY: ::c_int = 0x0040;
+pub const _O_SHORT_LIVED: ::c_int = 0x1000;
+pub const _O_OBTAIN_DIR: ::c_int = 0x2000;
+pub const O_SEQUENTIAL: ::c_int = 0x0020;
+pub const O_RANDOM: ::c_int = 0x0010;
+
pub const S_IFCHR: ::c_int = 8192;
pub const S_IFDIR: ::c_int = 16384;
pub const S_IFREG: ::c_int = 32768;
@@ -233,7 +246,13 @@ pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIGABRT: ::c_int = 22;
pub const NSIG: ::c_int = 23;
+
pub const SIG_ERR: ::c_int = -1;
+pub const SIG_DFL: ::sighandler_t = 0;
+pub const SIG_IGN: ::sighandler_t = 1;
+pub const SIG_GET: ::sighandler_t = 2;
+pub const SIG_SGE: ::sighandler_t = 3;
+pub const SIG_ACK: ::sighandler_t = 4;
// inline comment below appeases style checker
#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "
@@ -258,6 +277,16 @@ impl ::Clone for fpos_t {
}
}
+// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860
+#[cfg_attr(
+ all(windows, target_env = "msvc"),
+ link(name = "legacy_stdio_definitions")
+)]
+extern "C" {
+ pub fn printf(format: *const c_char, ...) -> ::c_int;
+ pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int;
+}
+
extern "C" {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
@@ -274,44 +303,24 @@ extern "C" {
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
- pub fn freopen(
- filename: *const c_char,
- mode: *const c_char,
- file: *mut FILE,
- ) -> *mut FILE;
+ 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 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 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;
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;
- pub fn fwrite(
- ptr: *const c_void,
- size: size_t,
- nobj: size_t,
- stream: *mut FILE,
- ) -> size_t;
+ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+ 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);
@@ -320,18 +329,16 @@ extern "C" {
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 atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
+ pub fn atol(s: *const c_char) -> c_long;
+ pub fn atoll(s: *const c_char) -> c_longlong;
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 strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
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;
@@ -344,17 +351,9 @@ extern "C" {
pub fn getenv(s: *const c_char) -> *mut c_char;
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 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 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;
@@ -371,28 +370,15 @@ extern "C" {
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 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 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;
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);
@@ -402,6 +388,8 @@ extern "C" {
#[link_name = "_gmtime64_s"]
pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> ::c_int;
+ #[link_name = "_localtime64_s"]
+ pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> ::errno_t;
#[link_name = "_time64"]
pub fn time(destTime: *mut time_t) -> time_t;
#[link_name = "_chmod"]
@@ -447,37 +435,21 @@ extern "C" {
#[link_name = "_execl"]
pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
#[link_name = "_wexecl"]
- pub fn wexecl(path: *const wchar_t, arg0: *const wchar_t, ...)
- -> intptr_t;
+ pub fn wexecl(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
#[link_name = "_execle"]
pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
#[link_name = "_wexecle"]
- pub fn wexecle(
- path: *const wchar_t,
- arg0: *const wchar_t,
- ...
- ) -> intptr_t;
+ pub fn wexecle(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
#[link_name = "_execlp"]
pub fn execlp(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
#[link_name = "_wexeclp"]
- pub fn wexeclp(
- path: *const wchar_t,
- arg0: *const wchar_t,
- ...
- ) -> intptr_t;
+ pub fn wexeclp(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
#[link_name = "_execlpe"]
pub fn execlpe(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
#[link_name = "_wexeclpe"]
- pub fn wexeclpe(
- path: *const wchar_t,
- arg0: *const wchar_t,
- ...
- ) -> intptr_t;
+ pub fn wexeclpe(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
#[link_name = "_execv"]
- pub fn execv(
- prog: *const c_char,
- argv: *const *const c_char,
- ) -> ::intptr_t;
+ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::intptr_t;
#[link_name = "_execve"]
pub fn execve(
prog: *const c_char,
@@ -493,10 +465,7 @@ extern "C" {
envp: *const *const c_char,
) -> ::c_int;
#[link_name = "_wexecv"]
- pub fn wexecv(
- prog: *const wchar_t,
- argv: *const *const wchar_t,
- ) -> ::intptr_t;
+ pub fn wexecv(prog: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t;
#[link_name = "_wexecve"]
pub fn wexecve(
prog: *const wchar_t,
@@ -504,10 +473,7 @@ extern "C" {
envp: *const *const wchar_t,
) -> ::intptr_t;
#[link_name = "_wexecvp"]
- pub fn wexecvp(
- c: *const wchar_t,
- argv: *const *const wchar_t,
- ) -> ::intptr_t;
+ pub fn wexecvp(c: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t;
#[link_name = "_wexecvpe"]
pub fn wexecvpe(
c: *const wchar_t,
@@ -523,17 +489,9 @@ extern "C" {
#[link_name = "_lseek"]
pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long;
#[link_name = "_lseeki64"]
- pub fn lseek64(
- fd: ::c_int,
- offset: c_longlong,
- origin: ::c_int,
- ) -> c_longlong;
+ pub fn lseek64(fd: ::c_int, offset: c_longlong, origin: ::c_int) -> c_longlong;
#[link_name = "_pipe"]
- pub fn pipe(
- fds: *mut ::c_int,
- psize: ::c_uint,
- textmode: ::c_int,
- ) -> ::c_int;
+ pub fn pipe(fds: *mut ::c_int, psize: ::c_uint, textmode: ::c_int) -> ::c_int;
#[link_name = "_read"]
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::c_uint) -> ::c_int;
#[link_name = "_rmdir"]
@@ -541,11 +499,7 @@ extern "C" {
#[link_name = "_unlink"]
pub fn unlink(c: *const c_char) -> ::c_int;
#[link_name = "_write"]
- pub fn write(
- fd: ::c_int,
- buf: *const ::c_void,
- count: ::c_uint,
- ) -> ::c_int;
+ pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::c_uint) -> ::c_int;
#[link_name = "_commit"]
pub fn commit(fd: ::c_int) -> ::c_int;
#[link_name = "_get_osfhandle"]
@@ -554,41 +508,28 @@ extern "C" {
pub fn open_osfhandle(osfhandle: ::intptr_t, flags: ::c_int) -> ::c_int;
pub fn setlocale(category: ::c_int, locale: *const c_char) -> *mut c_char;
#[link_name = "_wsetlocale"]
- pub fn wsetlocale(
- category: ::c_int,
- locale: *const wchar_t,
- ) -> *mut wchar_t;
+ pub fn wsetlocale(category: ::c_int, locale: *const wchar_t) -> *mut wchar_t;
#[link_name = "_aligned_malloc"]
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
+ #[link_name = "_aligned_free"]
+ pub fn aligned_free(ptr: *mut ::c_void);
+ #[link_name = "_putenv"]
+ pub fn putenv(envstring: *const ::c_char) -> ::c_int;
+ #[link_name = "_wputenv"]
+ pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
+ #[link_name = "_putenv_s"]
+ pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
+ #[link_name = "_wputenv_s"]
+ pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
}
extern "system" {
pub fn listen(s: SOCKET, backlog: ::c_int) -> ::c_int;
- pub fn accept(
- s: SOCKET,
- addr: *mut ::sockaddr,
- addrlen: *mut ::c_int,
- ) -> SOCKET;
- pub fn bind(
- s: SOCKET,
- name: *const ::sockaddr,
- namelen: ::c_int,
- ) -> ::c_int;
- pub fn connect(
- s: SOCKET,
- name: *const ::sockaddr,
- namelen: ::c_int,
- ) -> ::c_int;
- pub fn getpeername(
- s: SOCKET,
- name: *mut ::sockaddr,
- nameln: *mut ::c_int,
- ) -> ::c_int;
- pub fn getsockname(
- s: SOCKET,
- name: *mut ::sockaddr,
- nameln: *mut ::c_int,
- ) -> ::c_int;
+ pub fn accept(s: SOCKET, addr: *mut ::sockaddr, addrlen: *mut ::c_int) -> SOCKET;
+ pub fn bind(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+ pub fn connect(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+ pub fn getpeername(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int;
+ pub fn getsockname(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int;
pub fn getsockopt(
s: SOCKET,
level: ::c_int,
@@ -619,11 +560,7 @@ extern "system" {
optval: *const ::c_char,
optlen: ::c_int,
) -> ::c_int;
- pub fn socket(
- af: ::c_int,
- socket_type: ::c_int,
- protocol: ::c_int,
- ) -> SOCKET;
+ pub fn socket(af: ::c_int, socket_type: ::c_int, protocol: ::c_int) -> SOCKET;
}
cfg_if! {
diff --git a/src/windows/msvc.rs b/src/windows/msvc/mod.rs
similarity index 58%
rename from src/windows/msvc.rs
rename to src/windows/msvc/mod.rs
index 8f20deb5dfb55..f5a1d95f395b3 100644
--- a/src/windows/msvc.rs
+++ b/src/windows/msvc/mod.rs
@@ -9,9 +9,12 @@ extern "C" {
#[link_name = "_stricmp"]
pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
#[link_name = "_strnicmp"]
- pub fn strnicmp(
- s1: *const ::c_char,
- s2: *const ::c_char,
- n: ::size_t,
- ) -> ::c_int;
+ pub fn strnicmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int;
+ #[link_name = "_memccpy"]
+ pub fn memccpy(
+ dest: *mut ::c_void,
+ src: *const ::c_void,
+ c: ::c_int,
+ count: ::size_t,
+ ) -> *mut ::c_void;
}
diff --git a/triagebot.toml b/triagebot.toml
index 702ee90f89846..27e3e61288fac 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -3,4 +3,23 @@ allow-unauthenticated = [
"C-*", "O-*", "S-*"
]
+[autolabel."S-waiting-on-review"]
+new_pr = true
+
[assign]
+contributing_url = "https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md"
+
+[assign.owners]
+"*" = ["@JohnTitor"]
+
+[mentions."src/unix/bsd/netbsdlike/openbsd"]
+message = "Some changes occurred in OpenBSD module"
+cc = ["@semarie"]
+
+[mentions."src/unix/bsd/netbsdlike/mod.rs"]
+message = "Some changes occurred in OpenBSD module"
+cc = ["@semarie"]
+
+[mentions."src/unix/solarish"]
+message = "Some changes occurred in solarish module"
+cc = ["@jclulow", "@pfmooney"]