diff --git a/.cirrus.yml b/.cirrus.yml
index dcfff67206296..3a42cc356c255 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -29,9 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
- # FIXME: FreeBSD 14 CI fails due to pkg installation.
- # Use 14 again once a new image is available on Cirrus CI.
- image_family: freebsd-13-2
+ image: freebsd-14-0-rc1-amd64
setup_script:
- pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000000..5ace4600a1f26
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml
index cc0bb667bdf20..12069700cccb1 100644
--- a/.github/workflows/bors.yml
+++ b/.github/workflows/bors.yml
@@ -26,7 +26,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -49,7 +49,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
@@ -84,7 +84,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
@@ -106,7 +106,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
@@ -167,7 +167,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -195,7 +195,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -214,7 +214,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -250,7 +250,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
@@ -285,7 +285,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
@@ -310,7 +310,7 @@ jobs:
stable,
]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
@@ -329,29 +329,11 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
- name: Build with check-cfg
- run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg=features,names,values,output
-
- 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-22.04
- needs: docker_linux_tier2
- steps:
- - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
- with:
- github_token: "${{ secrets.GITHUB_TOKEN }}"
- - uses: actions/checkout@v3
- - name: Setup Rust toolchain
- run: sh ./ci/install-rust.sh
- - name: Generate documentation
- run: LIBC_CI=1 sh ci/dox.sh
+ run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
# These jobs doesn't actually test anything, but they're only used to tell
# bors the build completed, as there is no practical way to detect when a
@@ -374,7 +356,6 @@ jobs:
build_channels_linux,
build_channels_macos,
build_channels_windows,
- docs,
]
steps:
@@ -396,7 +377,6 @@ jobs:
build_channels_linux,
build_channels_macos,
build_channels_windows,
- docs,
]
steps:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
deleted file mode 100644
index ff722bc96e748..0000000000000
--- a/.github/workflows/docs.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Upload documentation to GitHub Pages
-
-on:
- push:
- branches:
- - main
-
-# 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:
- - 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: Setup Pages
- uses: actions/configure-pages@v3
- - name: Fix permissions
- run: rm -f ./target/doc/.lock
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v2
- with:
- path: 'target/doc'
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v2
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 91c07cad417c1..7a0e646bddd70 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -22,7 +22,7 @@ jobs:
x86_64-unknown-linux-gnu,
]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
@@ -38,7 +38,7 @@ jobs:
x86_64-apple-darwin,
]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
@@ -66,7 +66,7 @@ jobs:
# ARCH: i686
- target: i686-pc-windows-msvc
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
@@ -81,7 +81,7 @@ jobs:
name: Style check
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
diff --git a/Cargo.toml b/Cargo.toml
index 319c896f3a629..b70de560209fe 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.149"
+version = "0.2.150"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
diff --git a/README.md b/README.md
index 43d706d0f2a64..29d2a4b6160f7 100644
--- a/README.md
+++ b/README.md
@@ -60,7 +60,7 @@ newer Rust features are only available on newer Rust toolchains:
## Platform support
-[Platform-specific documentation (HEAD)][docs.head].
+You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see.
See
[`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh)
@@ -107,4 +107,3 @@ dual licensed as above, without any additional terms or conditions.
[Documentation]: https://docs.rs/libc/badge.svg
[docs.rs]: https://docs.rs/libc
[License]: https://img.shields.io/crates/l/libc.svg
-[docs.head]: https://rust-lang.github.io/libc/#platform-specific-documentation
diff --git a/build.rs b/build.rs
index 1bd9a8db514ab..d7a9b7f7811d2 100644
--- a/build.rs
+++ b/build.rs
@@ -167,11 +167,19 @@ fn main() {
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
if libc_check_cfg {
for cfg in ALLOWED_CFGS {
- println!("cargo:rustc-check-cfg=values({})", cfg);
+ if rustc_minor_ver >= 75 {
+ println!("cargo:rustc-check-cfg=cfg({})", cfg);
+ } else {
+ println!("cargo:rustc-check-cfg=values({})", cfg);
+ }
}
for &(name, values) in CHECK_CFG_EXTRA {
let values = values.join("\",\"");
- println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
+ if rustc_minor_ver >= 75 {
+ println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
+ } else {
+ println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
+ }
}
}
}
diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile
index b009e95b0e71e..5dc0c0e7fed3f 100644
--- a/ci/docker/aarch64-linux-android/Dockerfile
+++ b/ci/docker/aarch64-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 a609d8a3b7a28..c94a7c63c0ea4 100644
--- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 2002879e8c9e0..c27a451792a47 100644
--- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile
index 93d850b38eb1f..e51c50e0f53c6 100644
--- a/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/ci/docker/arm-linux-androideabi/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 57efe887b6292..977acabf4b6ba 100644
--- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 53228f46e6cef..1709699997e7f 100644
--- a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
index e6be22c93c637..585fdc35ff542 100644
--- a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
+++ b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \
diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile
index 65d1a949ec577..d344cb1368f28 100644
--- a/ci/docker/asmjs-unknown-emscripten/Dockerfile
+++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
# This is a workaround to avoid the interaction with tzdata.
ENV DEBIAN_FRONTEND=noninteractive
diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile
index ed1b2e9fbef0e..05846ea9bf077 100644
--- a/ci/docker/i686-linux-android/Dockerfile
+++ b/ci/docker/i686-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 bbe76a4c5c16c..6cdc1942c50c7 100644
--- a/ci/docker/i686-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 fd2ba4c63b166..a54456fd9942b 100644
--- a/ci/docker/i686-unknown-linux-musl/Dockerfile
+++ b/ci/docker/i686-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN dpkg --add-architecture i386
RUN apt-get update
diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile
index 333a5bae32a9d..4c2bb1667b832 100644
--- a/ci/docker/mips-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
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 6fbd284fb9ba3..2df2e6a34725a 100644
--- a/ci/docker/mips-unknown-linux-musl/Dockerfile
+++ b/ci/docker/mips-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
index 263a2a77d5501..b5bb6e72c38bd 100644
--- a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
+++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile b/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile
index 9e36b3b7f7f25..e2c11fe504268 100644
--- a/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile
+++ b/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
index 49fd75cb04f38..942646b6e2707 100644
--- a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
+++ b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile
index c8b6f122a5f23..1e9a8a6bdc9da 100644
--- a/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile
+++ b/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/ci/docker/mipsel-unknown-linux-musl/Dockerfile
index dad215abf5601..e698729109257 100644
--- a/ci/docker/mipsel-unknown-linux-musl/Dockerfile
+++ b/ci/docker/mipsel-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \
diff --git a/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile b/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile
index fe9806d0535b8..c5e6794301dc8 100644
--- a/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile
+++ b/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \
diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
index 50edc7d97dda9..930f0375db219 100644
--- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
index d04283615507a..b5bf6e90dfbbd 100644
--- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
index 52e1874ff3b89..f078a13e7c484 100644
--- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
index 7102e605668e4..9ada79ac7273d 100644
--- a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile
index 73d158dbcf9e6..70856d78bb879 100644
--- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
diff --git a/ci/docker/s390x-unknown-linux-musl/Dockerfile b/ci/docker/s390x-unknown-linux-musl/Dockerfile
index ba6331e761001..868f7b67bc9e1 100644
--- a/ci/docker/s390x-unknown-linux-musl/Dockerfile
+++ b/ci/docker/s390x-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
index ff6810a7fac58..99ba40276a568 100644
--- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile
index 5a10efe16eb12..0e429c055b200 100644
--- a/ci/docker/wasm32-unknown-emscripten/Dockerfile
+++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
# This is a workaround to avoid the interaction with tzdata.
ENV DEBIAN_FRONTEND=noninteractive
diff --git a/ci/docker/wasm32-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile
index ffc4b4bdea079..80ae09f75038b 100644
--- a/ci/docker/wasm32-wasi/Dockerfile
+++ b/ci/docker/wasm32-wasi/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && \
apt-get install -y --no-install-recommends \
diff --git a/ci/docker/x86_64-linux-android/Dockerfile b/ci/docker/x86_64-linux-android/Dockerfile
index bbce3b9a6bc8f..96d9721eebd0a 100644
--- a/ci/docker/x86_64-linux-android/Dockerfile
+++ b/ci/docker/x86_64-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update && \
apt-get install -y --no-install-recommends \
diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
index f8e6be479470b..aa5d5e043f9b1 100644
--- a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates linux-headers-generic
diff --git a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
index bbe76a4c5c16c..6cdc1942c50c7 100644
--- a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
diff --git a/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/ci/docker/x86_64-unknown-linux-musl/Dockerfile
index 0495007640004..7b65f5fa2a8c1 100644
--- a/ci/docker/x86_64-unknown-linux-musl/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.04
+FROM ubuntu:23.10
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
diff --git a/ci/dox.sh b/ci/dox.sh
deleted file mode 100644
index 6dd1e4a2282c7..0000000000000
--- a/ci/dox.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env sh
-
-# Builds documentation for all target triples that we have a registered URL for
-# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
-# which has a bunch of `html_root_url` directives we pick up.
-
-set -ex
-
-TARGET_DOC_DIR="target/doc"
-README="README.md"
-PLATFORM_SUPPORT="platform-support.md"
-
-rm -rf "$TARGET_DOC_DIR"
-mkdir -p "$TARGET_DOC_DIR"
-
-if ! rustc --version | grep -E "nightly" ; then
- echo "Building the documentation requires a nightly Rust toolchain"
- exit 1
-fi
-
-rustup component add rust-src
-
-# List all targets that do currently build successfully:
-# shellcheck disable=SC1003
-grep '[\d|\w|-]* \\' ci/build.sh > targets
-sed -i.bak 's/ \\//g' targets
-grep '^[_a-zA-Z0-9-]*$' targets | sort > tmp && mv tmp targets
-
-# Create a markdown list of supported platforms in $PLATFORM_SUPPORT
-rm $PLATFORM_SUPPORT || true
-
-printf '### Platform-specific documentation\n' >> $PLATFORM_SUPPORT
-
-while read -r target; do
- echo "documenting ${target}"
-
- case "${target}" in
- *apple*)
- # FIXME:
- # We can't build docs of apple targets from Linux yet.
- continue
- ;;
- *)
- ;;
- esac
-
- rustup target add "${target}" || true
-
- # Enable extra configuration flags:
- export RUSTDOCFLAGS="--cfg freebsd11"
-
- # If cargo doc fails, then try with unstable feature:
- if ! cargo doc --target "${target}" \
- --no-default-features --features const-extern-fn,extra_traits ; then
- cargo doc --target "${target}" \
- -Z build-std=core,alloc \
- --no-default-features --features const-extern-fn,extra_traits
- fi
-
- mkdir -p "${TARGET_DOC_DIR}/${target}"
- cp -r "target/${target}/doc" "${TARGET_DOC_DIR}/${target}"
-
- echo "* [${target}](${target}/doc/libc/index.html)" >> $PLATFORM_SUPPORT
-done < targets
-
-# Replace
with the contents of $PLATFORM_SUPPORT
-cp $README $TARGET_DOC_DIR
-line=$(grep -n '' $README | cut -d ":" -f 1)
-
-{ head -n "$((line-1))" $README; cat $PLATFORM_SUPPORT; tail -n "+$((line+1))" $README; } > $TARGET_DOC_DIR/$README
-
-cp $TARGET_DOC_DIR/$README $TARGET_DOC_DIR/index.md
-
-RUSTDOCFLAGS="--enable-index-page --index-page=${TARGET_DOC_DIR}/index.md -Zunstable-options" cargo doc
-
-# Tweak style
-cp ci/rust.css $TARGET_DOC_DIR
-sed -ie "8i " $TARGET_DOC_DIR/index.html
-sed -ie "9i " $TARGET_DOC_DIR/index.html
-
-# Copy the licenses
-cp LICENSE-* $TARGET_DOC_DIR/
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 6abf99adf9a52..6594300a9d2bf 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.149"
+version = "0.2.150"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.149"
+version = "0.2.150"
default-features = false
[build-dependencies]
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 48fb4df08e8e9..f7b030e8b54bd 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -299,6 +299,9 @@ fn test_apple(target: &str) {
}
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
// FIXME: actually a union
"sigval" => true,
@@ -310,8 +313,13 @@ fn test_apple(target: &str) {
}
});
- cfg.skip_type(move |ty| match ty {
- _ => false,
+ cfg.skip_type(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
+ match ty {
+ _ => false,
+ }
});
cfg.skip_const(move |name| {
@@ -364,6 +372,9 @@ fn test_apple(target: &str) {
("__darwin_arm_neon_state64", "__v") => true,
// MAXPATHLEN is too big for auto-derive traits on arrays.
("vnode_info_path", "vip_path") => true,
+ ("ifreq", "ifr_ifru") => true,
+ ("ifkpi", "ifk_data") => true,
+ ("ifconf", "ifc_ifcu") => true,
_ => false,
}
});
@@ -512,7 +523,19 @@ fn test_openbsd(target: &str) {
"sys/param.h",
}
+ cfg.skip_type(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
+ match ty {
+ _ => false,
+ }
+ });
+
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
// FIXME: actually a union
"sigval" => true,
@@ -586,6 +609,8 @@ fn test_openbsd(target: &str) {
// conflicting with `p_type` macro from .
("Elf32_Phdr", "p_type") => true,
("Elf64_Phdr", "p_type") => true,
+ // ifr_ifru is defined is an union
+ ("ifreq", "ifr_ifru") => true,
_ => false,
}
});
@@ -1838,7 +1863,8 @@ fn test_android(target: &str) {
| "NDA_NDM_FLAGS_MASK"
| "NDTPA_INTERVAL_PROBE_TIME_MS"
| "NFQA_UNSPEC"
- | "NTF_EXT_LOCKED" => true,
+ | "NTF_EXT_LOCKED"
+ | "ALG_SET_DRBG_ENTROPY" => true,
_ => false,
}
@@ -1883,6 +1909,8 @@ fn test_android(target: &str) {
// Added in API level 28, but some tests use level 24.
"pthread_attr_getinheritsched" | "pthread_attr_setinheritsched" => true,
+ // Added in API level 28, but some tests use level 24.
+ "fread_unlocked" | "fwrite_unlocked" | "fgets_unlocked" | "fflush_unlocked" => true,
_ => false,
}
@@ -1960,6 +1988,10 @@ fn test_freebsd(target: &str) {
Some(n) if n >= 13 => true,
_ => false,
};
+ let freebsd14 = match freebsd_ver {
+ Some(n) if n >= 14 => true,
+ _ => false,
+ };
headers! { cfg:
"aio.h",
@@ -2047,6 +2079,7 @@ fn test_freebsd(target: &str) {
"sys/sysctl.h",
"sys/thr.h",
"sys/time.h",
+ [freebsd14]:"sys/timerfd.h",
"sys/times.h",
"sys/timex.h",
"sys/types.h",
@@ -2169,6 +2202,12 @@ fn test_freebsd(target: &str) {
// should've been used anywhere anyway.
"TDF_UNUSED23" => true,
+ // Removed in FreeBSD 14 (git a6b55ee6be1)
+ "IFF_KNOWSEPOCH" => true,
+
+ // Removed in FreeBSD 14 (git 7ff9ae90f0b)
+ "IFF_NOGROUP" => 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
@@ -2250,8 +2289,8 @@ fn test_freebsd(target: &str) {
// 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"
+ "IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM" | "IFCAP_VXLAN_HWTSO"
+ | "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
if Some(13) > freebsd_ver =>
{
true
@@ -3550,6 +3589,10 @@ fn test_linux(target: &str) {
// FIXME: requires >= 6.1 kernel headers
"canxl_frame" => true,
+
+ // FIXME: The size of `iv` has been changed since Linux v6.0
+ // https://github.com/torvalds/linux/commit/94dfc73e7cf4a31da66b8843f0b9283ddd6b8381
+ "af_alg_iv" => true,
_ => false,
}
});
@@ -3700,8 +3743,6 @@ fn test_linux(target: &str) {
// kernel constants not available in uclibc 1.0.34
| "EXTPROC"
- | "FAN_MARK_FILESYSTEM"
- | "FAN_MARK_INODE"
| "IPPROTO_BEETPH"
| "IPPROTO_MPLS"
| "IPV6_HDRINCL"
@@ -3816,6 +3857,7 @@ fn test_linux(target: &str) {
| "MADV_POPULATE_READ"
| "MADV_POPULATE_WRITE"
if musl => true,
+ "CLONE_CLEAR_SIGHAND" | "CLONE_INTO_CGROUP" => true,
// kernel 6.1 minimum
"MADV_COLLAPSE" => true,
@@ -3834,6 +3876,44 @@ fn test_linux(target: &str) {
// FIXME: Requires more recent kernel headers
"HWTSTAMP_TX_ONESTEP_P2P" if musl => true, // linux v5.6+
+ // kernel 6.5 minimum
+ "MOVE_MOUNT_BENEATH" => true,
+ // FIXME: Requires linux 6.1
+ "ALG_SET_KEY_BY_KEY_SERIAL" | "ALG_SET_DRBG_ENTROPY" => true,
+
+ // FIXME: Requires more recent kernel headers
+ | "FAN_FS_ERROR" // linux v5.16+
+ | "FAN_RENAME" // linux v5.17+
+ | "FAN_REPORT_TARGET_FID" // linux v5.17+
+ | "FAN_REPORT_DFID_NAME_TARGET" // linux v5.17+
+ | "FAN_MARK_EVICTABLE" // linux v5.19+
+ | "FAN_MARK_IGNORE" // linux v6.0+
+ | "FAN_MARK_IGNORE_SURV" // linux v6.0+
+ | "FAN_EVENT_INFO_TYPE_ERROR" // linux v5.16+
+ | "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME" // linux v5.17+
+ | "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME" // linux v5.17+
+ | "FAN_RESPONSE_INFO_NONE" // linux v5.16+
+ | "FAN_RESPONSE_INFO_AUDIT_RULE" // linux v5.16+
+ | "FAN_INFO" // linux v5.16+
+ => true,
+
+ // FIXME: Requires linux 5.15+
+ "FAN_REPORT_PIDFD" if musl => true,
+
+ // FIXME: Requires linux 5.9+
+ | "FAN_REPORT_DIR_FID"
+ | "FAN_REPORT_NAME"
+ | "FAN_REPORT_DFID_NAME"
+ | "FAN_EVENT_INFO_TYPE_DFID_NAME"
+ | "FAN_EVENT_INFO_TYPE_DFID"
+ | "FAN_EVENT_INFO_TYPE_PIDFD"
+ | "FAN_NOPIDFD"
+ | "FAN_EPIDFD"
+ if musl => true,
+
+ // FIXME: Requires linux 6.5
+ "NFT_MSG_MAX" => true,
+
_ => false,
}
});
@@ -3940,6 +4020,9 @@ fn test_linux(target: &str) {
"posix_basename" if gnu => true,
"gnu_basename" if gnu => true,
+ // FIXME: function pointers changed since Ubuntu 23.10
+ "strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
+
_ => false,
}
});
@@ -4013,6 +4096,8 @@ fn test_linux(target: &str) {
(struct_ == "sockaddr_vm" && field == "svm_zero") ||
// the `ifr_ifru` field is an anonymous union
(struct_ == "ifreq" && field == "ifr_ifru") ||
+ // the `ifc_ifcu` field is an anonymous union
+ (struct_ == "ifconf" && field == "ifc_ifcu") ||
// glibc uses a single array `uregs` instead of individual fields.
(struct_ == "user_regs" && arm)
});
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 5153069559f68..09551d329c435 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -61,6 +61,7 @@ ALG_OP_DECRYPT
ALG_OP_ENCRYPT
ALG_SET_AEAD_ASSOCLEN
ALG_SET_AEAD_AUTHSIZE
+ALG_SET_DRBG_ENTROPY
ALG_SET_IV
ALG_SET_KEY
ALG_SET_OP
@@ -3101,6 +3102,7 @@ ff_trigger
fgetc
fgetpos
fgets
+fgets_unlocked
fgetxattr
fileno
flistxattr
@@ -3116,6 +3118,7 @@ fprintf
fputc
fputs
fread
+fread_unlocked
free
freeaddrinfo
freeifaddrs
@@ -3144,6 +3147,7 @@ ftruncate
ftruncate64
futimens
fwrite
+fwrite_unlocked
gai_strerror
genlmsghdr
getaddrinfo
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index d70ce6fc24749..ef911271ff425 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1883,6 +1883,7 @@ endpwent
endservent
endutxent
exchangedata
+execvP
faccessat
fchdir
fchflags
@@ -1957,6 +1958,9 @@ if_freenameindex
if_msghdr
if_nameindex
ifaddrs
+ifconf
+ifkpi
+ifreq
image_offset
in6_pktinfo
in_pktinfo
@@ -2080,6 +2084,8 @@ posix_spawnattr_setflags
posix_spawnattr_setpgroup
posix_spawnattr_setsigdefault
posix_spawnattr_setsigmask
+posix_spawnattr_getbinpref_np
+posix_spawnattr_setbinpref_np
posix_spawnattr_t
posix_spawnp
preadv
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index 1e1261cad8803..b9c8e7ee6180c 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -1287,6 +1287,8 @@ eui64_aton
eui64_hostton
eui64_ntoa
eui64_ntohost
+exect
+execvP
exit_status
explicit_bzero
faccessat
@@ -1318,6 +1320,8 @@ getitimer
getlastlogx
getline
getloadavg
+getmntinfo
+getmntvinfo
getnameinfo
getopt_long
getpeereid
@@ -1451,6 +1455,7 @@ pthread_condattr_getpshared
pthread_condattr_setclock
pthread_condattr_setpshared
pthread_get_name_np
+pthread_getname_np
pthread_getcpuclockid
pthread_kill
pthread_main_np
@@ -1460,6 +1465,7 @@ pthread_mutexattr_setpshared
pthread_rwlockattr_getpshared
pthread_rwlockattr_setpshared
pthread_set_name_np
+pthread_setname_np
pthread_spin_destroy
pthread_spin_init
pthread_spin_lock
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 0adb0dcf736e3..43de5c8ccdb8c 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -972,6 +972,8 @@ PROC_WX_MAPPINGS_PERMIT
PROC_WXMAP_CTL
PROC_WXMAP_STATUS
PROC_WXORX_ENFORCE
+PROT_MAX
+PROT_MAX_EXTRACT
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
PTHREAD_MUTEX_ADAPTIVE_NP
@@ -1770,6 +1772,8 @@ eui64_aton
eui64_hostton
eui64_ntoa
eui64_ntohost
+exect
+execvP
explicit_bzero
extattr_delete_fd
extattr_delete_file
@@ -2025,6 +2029,7 @@ pthread_condattr_getpshared
pthread_condattr_setclock
pthread_condattr_setpshared
pthread_get_name_np
+pthread_getname_np
pthread_getaffinity_np
pthread_getcpuclockid
pthread_getthreadid_np
@@ -2040,6 +2045,7 @@ pthread_rwlockattr_getpshared
pthread_rwlockattr_setpshared
pthread_setaffinity_np
pthread_set_name_np
+pthread_setname_np
pthread_getschedparam
pthread_setschedparam
pthread_spin_destroy
@@ -2237,3 +2243,5 @@ xucred
eaccess
dirname
basename
+closefrom
+close_range
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 263a2b2bb7a98..ad971de731bad 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -31,6 +31,9 @@ BPF_FS_MAGIC
BTRFS_SUPER_MAGIC
CGROUP2_SUPER_MAGIC
CGROUP_SUPER_MAGIC
+CLONE_NEWTIME
+CLONE_CLEAR_SIGHAND
+CLONE_INTO_CGROUP
CODA_SUPER_MAGIC
CRAMFS_MAGIC
DEAD_PROCESS
@@ -137,6 +140,14 @@ MOD_OFFSET
MOD_STATUS
MOD_TAI
MOD_TIMECONST
+MOVE_MOUNT_BENEATH
+MOVE_MOUNT_F_AUTOMOUNTS
+MOVE_MOUNT_F_EMPTY_PATH
+MOVE_MOUNT_F_SYMLINKS
+MOVE_MOUNT_SET_GROUP
+MOVE_MOUNT_T_AUTOMOUNTS
+MOVE_MOUNT_T_EMPTY_PATH
+MOVE_MOUNT_T_SYMLINKS
MPOL_BIND
MPOL_DEFAULT
MPOL_F_NUMA_BALANCING
@@ -665,4 +676,4 @@ getmntent_r
putpwent
putgrent
execveat
-close_range
\ No newline at end of file
+close_range
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index b4091a707047d..007692c9d4dbc 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -71,8 +71,10 @@ ALG_OP_DECRYPT
ALG_OP_ENCRYPT
ALG_SET_AEAD_ASSOCLEN
ALG_SET_AEAD_AUTHSIZE
+ALG_SET_DRBG_ENTROPY
ALG_SET_IV
ALG_SET_KEY
+ALG_SET_KEY_BY_KEY_SERIAL
ALG_SET_OP
ALT_DIGITS
AM_STR
@@ -717,6 +719,8 @@ FANOTIFY_METADATA_VERSION
FAN_ACCESS
FAN_ACCESS_PERM
FAN_ALLOW
+FAN_ATTRIB
+FAN_AUDIT
FAN_CLASS_CONTENT
FAN_CLASS_NOTIF
FAN_CLASS_PRE_CONTENT
@@ -724,25 +728,60 @@ FAN_CLOEXEC
FAN_CLOSE
FAN_CLOSE_NOWRITE
FAN_CLOSE_WRITE
+FAN_CREATE
+FAN_DELETE
+FAN_DELETE_SELF
FAN_DENY
+FAN_ENABLE_AUDIT
+FAN_EPIDFD
+FAN_EVENT_INFO_TYPE_DFID
+FAN_EVENT_INFO_TYPE_DFID_NAME
+FAN_EVENT_INFO_TYPE_ERROR
+FAN_EVENT_INFO_TYPE_FID
+FAN_EVENT_INFO_TYPE_NEW_DFID_NAME
+FAN_EVENT_INFO_TYPE_OLD_DFID_NAME
+FAN_EVENT_INFO_TYPE_PIDFD
FAN_EVENT_ON_CHILD
+FAN_FS_ERROR
+FAN_INFO
FAN_MARK_ADD
FAN_MARK_DONT_FOLLOW
+FAN_MARK_EVICTABLE
FAN_MARK_FILESYSTEM
FAN_MARK_FLUSH
+FAN_MARK_IGNORE
FAN_MARK_IGNORED_MASK
FAN_MARK_IGNORED_SURV_MODIFY
+FAN_MARK_IGNORE_SURV
FAN_MARK_INODE
FAN_MARK_MOUNT
FAN_MARK_ONLYDIR
FAN_MARK_REMOVE
FAN_MODIFY
+FAN_MOVE
+FAN_MOVED_FROM
+FAN_MOVED_TO
+FAN_MOVE_SELF
FAN_NOFD
FAN_NONBLOCK
+FAN_NOPIDFD
FAN_ONDIR
FAN_OPEN
+FAN_OPEN_EXEC
+FAN_OPEN_EXEC_PERM
FAN_OPEN_PERM
FAN_Q_OVERFLOW
+FAN_RENAME
+FAN_REPORT_DFID_NAME
+FAN_REPORT_DFID_NAME_TARGET
+FAN_REPORT_DIR_FID
+FAN_REPORT_FID
+FAN_REPORT_NAME
+FAN_REPORT_PIDFD
+FAN_REPORT_TARGET_FID
+FAN_REPORT_TID
+FAN_RESPONSE_INFO_AUDIT_RULE
+FAN_RESPONSE_INFO_NONE
FAN_UNLIMITED_MARKS
FAN_UNLIMITED_QUEUE
FF0
@@ -895,6 +934,14 @@ IFF_MULTICAST
IFF_MULTI_QUEUE
IFF_NOARP
IFF_NOFILTER
+TUN_TX_TIMESTAMP
+TUN_F_CSUM
+TUN_F_TSO4
+TUN_F_TSO6
+TUN_F_TSO_ECN
+TUN_F_UFO
+TUN_PKT_STRIP
+TUN_FLT_ALLMULTI
IFF_NOTRAILERS
IFF_NO_PI
IFF_ONE_QUEUE
@@ -906,6 +953,8 @@ IFF_RUNNING
IFF_SLAVE
IFF_TAP
IFF_TUN
+IFF_NAPI
+IFF_NAPI_FRAGS
IFF_TUN_EXCL
IFF_UP
IFF_VNET_HDR
@@ -1375,6 +1424,7 @@ MCAST_MSFILTER
MCAST_UNBLOCK_SOURCE
MCL_CURRENT
MCL_FUTURE
+MCL_ONFAULT
MEMBARRIER_CMD_GLOBAL
MEMBARRIER_CMD_GLOBAL_EXPEDITED
MEMBARRIER_CMD_QUERY
@@ -1926,6 +1976,7 @@ PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_STACK_MIN
+PTHREAD_ONCE_INIT
PTRACE_ATTACH
PTRACE_CONT
PTRACE_DETACH
@@ -1940,6 +1991,7 @@ PTRACE_EVENT_VFORK_DONE
PTRACE_GETEVENTMSG
PTRACE_GETREGSET
PTRACE_GETSIGINFO
+PTRACE_GETSIGMASK
PTRACE_INTERRUPT
PTRACE_KILL
PTRACE_LISTEN
@@ -1965,6 +2017,7 @@ PTRACE_SEIZE
PTRACE_SETOPTIONS
PTRACE_SETREGSET
PTRACE_SETSIGINFO
+PTRACE_SETSIGMASK
PTRACE_SINGLESTEP
PTRACE_SYSCALL
PTRACE_TRACEME
@@ -3197,6 +3250,7 @@ if_freenameindex
if_nameindex
ifaddrs
ifreq
+ifconf
in6_ifreq
in6_pktinfo
in6_rtmsg
@@ -3373,6 +3427,8 @@ pthread_barrier_wait
pthread_barrier_destroy
pthread_barrierattr_t
pthread_barrier_t
+pthread_once
+pthread_once_t
ptrace
ptsname_r
pwrite64
diff --git a/libc-test/semver/netbsd-mips.txt b/libc-test/semver/netbsd-mips.txt
new file mode 100644
index 0000000000000..26d05a44b1163
--- /dev/null
+++ b/libc-test/semver/netbsd-mips.txt
@@ -0,0 +1,4 @@
+PT_GETREGS
+PT_SETREGS
+PT_GETFPREGS
+PT_SETFPREGS
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 5fa24d0e8cf4f..a548a2d77d057 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -957,6 +957,7 @@ SOCK_RDM
SOMAXCONN
SO_ACCEPTFILTER
SO_NOHEADER
+SO_NOSIGPIPE
SO_OVERFLOWED
SO_REUSEPORT
SO_TIMESTAMP
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index e56760a9e8118..0b11c5fdbbc7e 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -1083,6 +1083,7 @@ if_freenameindex
if_msghdr
if_nameindex
ifaddrs
+ifreq
in6_pktinfo
initgroups
ip_mreqn
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
index 6e73d0ac25f7d..5f85e1aa7f3d4 100644
--- a/libc-test/semver/redox.txt
+++ b/libc-test/semver/redox.txt
@@ -180,6 +180,7 @@ bsearch
chroot
clearerr
difftime
+endgrent
endpwent
endservent
epoll_create
@@ -191,7 +192,10 @@ explicit_bzero
fchdir
fmemopen
getdtablesize
+getgrent
+getgrgid
getgrgid_r
+getgrnam
getgrnam_r
getgrouplist
getline
@@ -212,6 +216,7 @@ pipe2
pthread_condattr_setclock
qsort
reallocarray
+setgrent
setpwent
setrlimit
setservent
diff --git a/src/lib.rs b/src/lib.rs
index dc8f8312072e5..1b6f0c077ab24 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,8 +1,4 @@
//! libc - Raw FFI bindings to platforms' system libraries
-//!
-//! [Documentation for other platforms][pd].
-//!
-//! [pd]: https://rust-lang.github.io/libc/#platform-specific-documentation
#![crate_name = "libc"]
#![crate_type = "rlib"]
#![allow(
diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs
index 13d8ce1b8ffd2..cffe041976573 100644
--- a/src/teeos/mod.rs
+++ b/src/teeos/mod.rs
@@ -8,6 +8,8 @@
// only supported on Rust > 1.59, so we can directly reexport c_void from core.
pub use core::ffi::c_void;
+use Option;
+
pub type c_schar = i8;
pub type c_uchar = u8;
diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs
index 66e4b7cf67204..0d7c2ed1d1b65 100644
--- a/src/unix/aix/mod.rs
+++ b/src/unix/aix/mod.rs
@@ -1,7 +1,6 @@
pub type c_char = i8;
pub type caddr_t = *mut ::c_char;
-// FIXME: clockid_t must be c_long, but time.rs accepts only i32
-pub type clockid_t = ::c_int;
+pub type clockid_t = ::c_longlong;
pub type blkcnt_t = ::c_long;
pub type clock_t = ::c_int;
pub type daddr_t = ::c_long;
@@ -3275,7 +3274,13 @@ extern "C" {
pub fn splice(socket1: ::c_int, socket2: ::c_int, flags: ::c_int) -> ::c_int;
pub fn srand(seed: ::c_uint);
pub fn srand48(seed: ::c_long);
- pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
+ pub fn stat64(path: *const ::c_char, buf: *mut stat64) -> ::c_int;
+ pub fn stat64at(
+ dirfd: ::c_int,
+ path: *const ::c_char,
+ buf: *mut stat64,
+ flags: ::c_int,
+ ) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index b22b40ef9b374..21efb23eb2e32 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -797,7 +797,7 @@ s! {
pub struct sockaddr_ndrv {
pub snd_len: ::c_uchar,
pub snd_family: ::c_uchar,
- pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h
+ pub snd_name: [::c_uchar; ::IFNAMSIZ],
}
// sys/socket.h
@@ -1129,6 +1129,15 @@ s! {
pub validattr: attribute_set_t,
pub nativeattr: attribute_set_t,
}
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct ifconf {
+ pub ifc_len: ::c_int,
+ #[cfg(libc_union)]
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ #[cfg(not(libc_union))]
+ pub ifc_ifcu: *mut ifreq,
+ }
}
s_no_extra_traits! {
@@ -1419,6 +1428,60 @@ s_no_extra_traits! {
pub svm_port: ::c_uint,
pub svm_cid: ::c_uint,
}
+
+ pub struct ifdevmtu {
+ pub ifdm_current: ::c_int,
+ pub ifdm_min: ::c_int,
+ pub ifdm_max: ::c_int,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifk_data {
+ pub ifk_ptr: *mut ::c_void,
+ pub ifk_value: ::c_int,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct ifkpi {
+ pub ifk_module_id: ::c_uint,
+ pub ifk_type: ::c_uint,
+ #[cfg(libc_union)]
+ pub ifk_data: __c_anonymous_ifk_data,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifr_ifru {
+ pub ifru_addr: ::sockaddr,
+ pub ifru_dstaddr: ::sockaddr,
+ pub ifru_broadaddr: ::sockaddr,
+ pub ifru_flags: ::c_short,
+ pub ifru_metrics: ::c_int,
+ pub ifru_mtu: ::c_int,
+ pub ifru_phys: ::c_int,
+ pub ifru_media: ::c_int,
+ pub ifru_intval: ::c_int,
+ pub ifru_data: *mut ::c_char,
+ pub ifru_devmtu: ifdevmtu,
+ pub ifru_kpi: ifkpi,
+ pub ifru_wake_flags: u32,
+ pub ifru_route_refcnt: u32,
+ pub ifru_cap: [::c_int; 2],
+ pub ifru_functional_type: u32,
+ }
+
+ pub struct ifreq {
+ 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: *mut ::c_char,
+ pub ifcu_req: *mut ifreq,
+ }
}
impl siginfo_t {
@@ -2767,6 +2830,222 @@ cfg_if! {
svm_cid.hash(state);
}
}
+
+ impl PartialEq for ifdevmtu {
+ fn eq(&self, other: &ifdevmtu) -> bool {
+ self.ifdm_current == other.ifdm_current
+ && self.ifdm_min == other.ifdm_min
+ && self.ifdm_max == other.ifdm_max
+ }
+ }
+
+ impl Eq for ifdevmtu {}
+
+ impl ::fmt::Debug for ifdevmtu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifdevmtu")
+ .field("ifdm_current", &self.ifdm_current)
+ .field("ifdm_min", &self.ifdm_min)
+ .field("ifdm_max", &self.ifdm_max)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ifdevmtu {
+ fn hash(&self, state: &mut H) {
+ self.ifdm_current.hash(state);
+ self.ifdm_min.hash(state);
+ self.ifdm_max.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifk_data {
+ fn eq(&self, other: &__c_anonymous_ifk_data) -> bool {
+ unsafe {
+ self.ifk_ptr == other.ifk_ptr
+ && self.ifk_value == other.ifk_value
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifk_data {}
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifk_data {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifk_data")
+ .field("ifk_ptr", unsafe { &self.ifk_ptr })
+ .field("ifk_value", unsafe { &self.ifk_value })
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifk_data {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.ifk_ptr.hash(state);
+ self.ifk_value.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for ifkpi {
+ fn eq(&self, other: &ifkpi) -> bool {
+ self.ifk_module_id == other.ifk_module_id
+ && self.ifk_type == other.ifk_type
+ }
+ }
+
+ impl Eq for ifkpi {}
+
+ impl ::fmt::Debug for ifkpi {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifkpi")
+ .field("ifk_module_id", &self.ifk_module_id)
+ .field("ifk_type", &self.ifk_type)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ifkpi {
+ fn hash(&self, state: &mut H) {
+ self.ifk_module_id.hash(state);
+ self.ifk_type.hash(state);
+ }
+ }
+
+ #[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_flags == other.ifru_flags
+ && self.ifru_metrics == other.ifru_metrics
+ && self.ifru_mtu == other.ifru_mtu
+ && self.ifru_phys == other.ifru_phys
+ && self.ifru_media == other.ifru_media
+ && self.ifru_intval == other.ifru_intval
+ && self.ifru_data == other.ifru_data
+ && self.ifru_devmtu == other.ifru_devmtu
+ && self.ifru_kpi == other.ifru_kpi
+ && self.ifru_wake_flags == other.ifru_wake_flags
+ && self.ifru_route_refcnt == other.ifru_route_refcnt
+ && self.ifru_cap.iter().zip(other.ifru_cap.iter()).all(|(a,b)| a == b)
+ && self.ifru_functional_type == other.ifru_functional_type
+ }
+ }
+ }
+
+ #[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("__c_anonymous_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_flags", unsafe { &self.ifru_flags })
+ .field("ifru_metrics", unsafe { &self.ifru_metrics })
+ .field("ifru_mtu", unsafe { &self.ifru_mtu })
+ .field("ifru_phys", unsafe { &self.ifru_phys })
+ .field("ifru_media", unsafe { &self.ifru_media })
+ .field("ifru_intval", unsafe { &self.ifru_intval })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_devmtu", unsafe { &self.ifru_devmtu })
+ .field("ifru_kpi", unsafe { &self.ifru_kpi })
+ .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags })
+ .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt })
+ .field("ifru_cap", unsafe { &self.ifru_cap })
+ .field("ifru_functional_type", unsafe { &self.ifru_functional_type })
+ .finish()
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifr_ifru {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.ifru_addr.hash(state);
+ self.ifru_dstaddr.hash(state);
+ self.ifru_broadaddr.hash(state);
+ self.ifru_flags.hash(state);
+ self.ifru_metrics.hash(state);
+ self.ifru_mtu.hash(state);
+ self.ifru_phys.hash(state);
+ self.ifru_media.hash(state);
+ self.ifru_intval.hash(state);
+ self.ifru_data.hash(state);
+ self.ifru_devmtu.hash(state);
+ self.ifru_kpi.hash(state);
+ self.ifru_wake_flags.hash(state);
+ self.ifru_route_refcnt.hash(state);
+ self.ifru_cap.hash(state);
+ self.ifru_functional_type.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) };
+ }
+ }
}
}
@@ -4719,12 +4998,12 @@ pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
pub const MNT_NOBLOCK: ::c_int = 0x00020000;
// sys/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 = 0x04;
-pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
-pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40;
-pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80;
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x0001;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x0002;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x0004;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x0008;
+pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x0040;
+pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x0080;
pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000;
// sys/ipc.h:
@@ -5779,6 +6058,18 @@ extern "C" {
subpref: *mut ::cpu_subtype_t,
ocount: *mut ::size_t,
) -> ::c_int;
+ pub fn posix_spawnattr_getbinpref_np(
+ attr: *const posix_spawnattr_t,
+ count: ::size_t,
+ pref: *mut ::cpu_type_t,
+ ocount: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setbinpref_np(
+ attr: *mut posix_spawnattr_t,
+ count: ::size_t,
+ pref: *mut ::cpu_type_t,
+ ocount: *mut ::size_t,
+ ) -> ::c_int;
pub fn posix_spawnattr_set_qos_class_np(
attr: *mut posix_spawnattr_t,
qos_class: ::qos_class_t,
@@ -6117,6 +6408,11 @@ extern "C" {
dev: dev_t,
) -> ::c_int;
pub fn freadlink(fd: ::c_int, buf: *mut ::c_char, size: ::size_t) -> ::c_int;
+ pub fn execvP(
+ file: *const ::c_char,
+ search_path: *const ::c_char,
+ argv: *const *mut ::c_char,
+ ) -> ::c_int;
}
pub unsafe fn mach_task_self() -> ::mach_port_t {
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index b3a5be4494543..6ade7949afb0f 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1678,6 +1678,12 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+ pub fn getmntvinfo(
+ mntbufp: *mut *mut ::statfs,
+ mntvbufp: *mut *mut ::statvfs,
+ flags: ::c_int,
+ ) -> ::c_int;
}
#[link(name = "rt")]
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index c8403d1cf369d..c654ae42ef44a 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -365,9 +365,13 @@ s! {
}
pub struct cpuset_t {
- #[cfg(target_pointer_width = "64")]
+ #[cfg(all(freebsd14, target_pointer_width = "64"))]
+ __bits: [::c_long; 16],
+ #[cfg(all(freebsd14, target_pointer_width = "32"))]
+ __bits: [::c_long; 32],
+ #[cfg(all(not(freebsd14), target_pointer_width = "64"))]
__bits: [::c_long; 4],
- #[cfg(target_pointer_width = "32")]
+ #[cfg(all(not(freebsd14), target_pointer_width = "32"))]
__bits: [::c_long; 8],
}
@@ -967,6 +971,8 @@ s! {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ #[cfg(not(libc_union))]
+ pub ifc_ifcu: *mut ifreq,
}
pub struct au_mask_t {
@@ -996,6 +1002,8 @@ s! {
pub pcbcnt: u32,
}
+ // Note: this structure will change in a backwards-incompatible way in
+ // FreeBSD 15.
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
@@ -1053,7 +1061,21 @@ s! {
#[cfg(freebsd14)]
pub __tcpi_received_ce_bytes: u32,
#[cfg(freebsd14)]
- pub __tcpi_pad: [u32; 19],
+ pub tcpi_total_tlp: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_total_tlp_bytes: u64,
+ #[cfg(freebsd14)]
+ pub tcpi_snd_una: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_snd_max: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_rcv_numsacks: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_rcv_adv: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_dupacks: u32,
+ #[cfg(freebsd14)]
+ pub __tcpi_pad: [u32; 10],
#[cfg(not(freebsd14))]
pub __tcpi_pad: [u32; 26],
}
@@ -2597,7 +2619,13 @@ 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;
+cfg_if! {
+ if #[cfg(freebsd14)] {
+ pub const CPU_SETSIZE: ::c_int = 1024;
+ } else {
+ pub const CPU_SETSIZE: ::c_int = 256;
+ }
+}
pub const SIGEV_THREAD_ID: ::c_int = 4;
@@ -3170,6 +3198,7 @@ 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
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
/// (d) resources allocated
pub const IFF_RUNNING: ::c_int = 0x40;
@@ -3217,6 +3246,7 @@ 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
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_NOGROUP: ::c_int = 0x800000;
/// link invalid/unknown
@@ -4827,6 +4857,14 @@ f! {
};
::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
}
+
+ pub fn PROT_MAX(x: ::c_int) -> ::c_int {
+ x << 16
+ }
+
+ pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
+ (x >> 16) & (::PROT_READ | ::PROT_WRITE | ::PROT_EXEC)
+ }
}
safe_f! {
@@ -5422,6 +5460,8 @@ extern "C" {
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> ::c_int;
+ pub fn closefrom(lowfd: ::c_int);
+ pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
}
#[link(name = "memstat")]
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 8eb4a8e7bf480..d2cd7794b107e 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1646,6 +1646,12 @@ extern "C" {
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 pthread_getname_np(
+ thread: ::pthread_t,
+ buffer: *mut ::c_char,
+ length: ::size_t,
+ ) -> ::c_int;
+ pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
pub fn pthread_setschedparam(
native: ::pthread_t,
policy: ::c_int,
@@ -1772,6 +1778,17 @@ extern "C" {
len: ::c_int,
) -> ::c_int;
pub fn reboot(howto: ::c_int) -> ::c_int;
+
+ pub fn exect(
+ path: *const ::c_char,
+ argv: *const *mut ::c_char,
+ envp: *const *mut ::c_char,
+ ) -> ::c_int;
+ pub fn execvP(
+ file: *const ::c_char,
+ search_path: *const ::c_char,
+ argv: *const *mut ::c_char,
+ ) -> ::c_int;
}
#[link(name = "rt")]
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index c43a4b9e8e4e3..a787ac6db8553 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -736,6 +736,11 @@ extern "C" {
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 execvpe(
+ file: *const ::c_char,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
}
extern "C" {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mips.rs b/src/unix/bsd/netbsdlike/netbsd/mips.rs
new file mode 100644
index 0000000000000..a536254ceb4b3
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/netbsd/mips.rs
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+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;
+ }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index bd5161893a864..c612689a53f06 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_lock_nv_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 cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
@@ -60,6 +60,39 @@ impl siginfo_t {
self.si_addr
}
+ pub unsafe fn si_code(&self) -> ::c_int {
+ self.si_code
+ }
+
+ pub unsafe fn si_errno(&self) -> ::c_int {
+ self.si_errno
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ __pad1: ::c_int,
+ _pid: ::pid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
+ #[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,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._uid
+ }
+
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
@@ -1527,6 +1560,7 @@ pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000;
pub const SO_SNDTIMEO: ::c_int = 0x100b;
pub const SO_RCVTIMEO: ::c_int = 0x100c;
+pub const SO_NOSIGPIPE: ::c_int = 0x0800;
pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
pub const SO_TIMESTAMP: ::c_int = 0x2000;
pub const SO_OVERFLOWED: ::c_int = 0x1009;
@@ -2532,12 +2566,6 @@ 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,
@@ -3208,6 +3236,12 @@ cfg_if! {
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
+ } else if #[cfg(target_arch = "mips")] {
+ mod mips;
+ pub use self::mips::*;
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else {
// Unknown target_arch
}
diff --git a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
new file mode 100644
index 0000000000000..bc09149efeabd
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+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 PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 38fa29c97e02b..ea90ba780f3c5 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -533,6 +533,14 @@ s! {
pub key: *mut ::c_char,
pub data: *mut ::c_void,
}
+
+ pub struct ifreq {
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ #[cfg(libc_union)]
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
+ #[cfg(not(libc_union))]
+ pub ifr_ifru: ::sockaddr,
+ }
}
impl siginfo_t {
@@ -540,12 +548,46 @@ impl siginfo_t {
self.si_addr
}
- pub unsafe fn si_value(&self) -> ::sigval {
+ pub unsafe fn si_code(&self) -> ::c_int {
+ self.si_code
+ }
+
+ pub unsafe fn si_errno(&self) -> ::c_int {
+ self.si_errno
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_code: ::c_int,
+ _si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
+ _pid: ::pid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
+ _si_code: ::c_int,
_si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
+ _pid: ::pid_t,
+ _uid: ::uid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._uid
+ }
+
+ pub unsafe fn si_value(&self) -> ::sigval {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
_si_code: ::c_int,
+ _si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
value: ::sigval,
@@ -608,6 +650,18 @@ s_no_extra_traits! {
align: [::c_char; 160],
}
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifr_ifru {
+ pub ifru_addr: ::sockaddr,
+ pub ifru_dstaddr: ::sockaddr,
+ pub ifru_broadaddr: ::sockaddr,
+ pub ifru_flags: ::c_short,
+ pub ifru_metric: ::c_int,
+ pub ifru_vnetid: i64,
+ pub ifru_media: u64,
+ pub ifru_data: *mut ::c_char,
+ pub ifru_index: ::c_uint,
+ }
}
cfg_if! {
@@ -814,6 +868,60 @@ cfg_if! {
unsafe { self.align.hash(state) };
}
}
+
+ #[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_flags == other.ifru_flags
+ && self.ifru_metric == other.ifru_metric
+ && self.ifru_vnetid == other.ifru_vnetid
+ && self.ifru_media == other.ifru_media
+ && self.ifru_data == other.ifru_data
+ && self.ifru_index == other.ifru_index
+ }
+ }
+ }
+
+ #[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("__c_anonymous_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_flags", unsafe { &self.ifru_flags })
+ .field("ifru_metric", unsafe { &self.ifru_metric })
+ .field("ifru_vnetid", unsafe { &self.ifru_vnetid })
+ .field("ifru_media", unsafe { &self.ifru_media })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_index", unsafe { &self.ifru_index })
+ .finish()
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifr_ifru {
+ fn hash(&self, state: &mut H) {
+ unsafe {
+ self.ifru_addr.hash(state);
+ self.ifru_dstaddr.hash(state);
+ self.ifru_broadaddr.hash(state);
+ self.ifru_flags.hash(state);
+ self.ifru_metric.hash(state);
+ self.ifru_vnetid.hash(state);
+ self.ifru_media.hash(state);
+ self.ifru_data.hash(state);
+ self.ifru_index.hash(state);
+ }
+ }
+ }
}
}
@@ -1578,6 +1686,9 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;
pub const TMPFS_ARGS_VERSION: ::c_int = 1;
+const SI_MAXSZ: ::size_t = 128;
+const SI_PAD: ::size_t = (SI_MAXSZ / ::mem::size_of::<::c_int>()) - 3;
+
pub const MAP_STACK: ::c_int = 0x4000;
pub const MAP_CONCEAL: ::c_int = 0x8000;
@@ -1657,6 +1768,30 @@ pub const SF_ARCHIVED: ::c_uint = 0x00010000;
pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
pub const SF_APPEND: ::c_uint = 0x00040000;
+// sys/exec_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_LOOS: u32 = 0x60000000;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+
+// sys/exec_elf.h - Legal values for p_flags (segment flags).
+pub const PF_X: u32 = 0x1;
+pub const PF_W: u32 = 0x2;
+pub const PF_R: u32 = 0x4;
+pub const PF_MASKOS: u32 = 0x0ff00000;
+pub const PF_MASKPROC: u32 = 0xf0000000;
+
// sys/mount.h
pub const MNT_NOPERM: ::c_int = 0x00000020;
pub const MNT_WXALLOWED: ::c_int = 0x00000800;
@@ -1779,11 +1914,6 @@ safe_f! {
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 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 unveil(path: *const ::c_char, permissions: *const ::c_char) -> ::c_int;
pub fn strtonum(
diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs
index ba84edb8c6ffc..05d75851d9e8f 100644
--- a/src/unix/hurd/mod.rs
+++ b/src/unix/hurd/mod.rs
@@ -315,7 +315,7 @@ s! {
pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: socklen_t,
- pub msg_iov: *mut iovec,
+ pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: socklen_t,
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index b2ef7973806dd..98a9d9b2b8448 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -1707,6 +1707,7 @@ pub const REG_BACKR: ::c_int = 1024;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
@@ -2744,6 +2745,7 @@ pub const ALG_SET_IV: ::c_int = 2;
pub const ALG_SET_OP: ::c_int = 3;
pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
@@ -3707,6 +3709,20 @@ extern "C" {
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
+ pub fn fread_unlocked(
+ buf: *mut ::c_void,
+ size: ::size_t,
+ nobj: ::size_t,
+ stream: *mut ::FILE,
+ ) -> ::size_t;
+ pub fn fwrite_unlocked(
+ buf: *const ::c_void,
+ size: ::size_t,
+ nobj: ::size_t,
+ stream: *mut ::FILE,
+ ) -> ::size_t;
+ pub fn fflush_unlocked(stream: *mut ::FILE) -> ::c_int;
+ pub fn fgets_unlocked(buf: *mut ::c_char, size: ::c_int, stream: *mut ::FILE) -> *mut ::c_char;
}
cfg_if! {
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 fd690a17e158d..9b3a2ff861731 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -341,6 +341,7 @@ pub const SOCK_DGRAM: ::c_int = 2;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
index c1234845e9a1f..9807cea831021 100644
--- a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
@@ -290,6 +290,7 @@ pub const SOCK_DGRAM: ::c_int = 2;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
index 69725ee7cf6a2..8ca7d3d214094 100644
--- a/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
@@ -293,6 +293,7 @@ pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
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 6a03f0ba83bac..fa2707500dbe4 100644
--- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
@@ -719,6 +719,7 @@ pub const RTLD_NOLOAD: ::c_int = 0x8;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs
index e70b216bf9c50..dd5732e0dcc14 100644
--- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs
+++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs
@@ -293,6 +293,7 @@ pub const SOCK_DGRAM: ::c_int = 2;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
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 f3b130cbc6205..65b7aaa783559 100644
--- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
@@ -393,6 +393,7 @@ pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
pub const MCL_CURRENT: ::c_int = 1;
pub const MCL_FUTURE: ::c_int = 2;
+pub const MCL_ONFAULT: ::c_int = 4;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 4111;
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 57ad9fe8ee21b..da9cf29c48668 100644
--- a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
@@ -363,6 +363,7 @@ pub const EREMOTEIO: ::c_int = 121;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 4096;
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 93622387e81a9..a3531c141fdb6 100644
--- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
@@ -507,6 +507,7 @@ pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
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 f9aed99b2e788..206283e22f6b2 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -423,6 +423,7 @@ pub const EDEADLOCK: ::c_int = 35;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 5120;
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 66b29a8aaf168..f7b52be805cab 100644
--- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
@@ -823,6 +823,7 @@ pub const RTLD_NOLOAD: ::c_int = 0x8;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
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 2b225e4809f30..3088c25a2646f 100644
--- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
@@ -473,6 +473,7 @@ pub const EREMOTEIO: ::c_int = 121;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const SIGSTKSZ: ::size_t = 0x4000;
pub const MINSIGSTKSZ: ::size_t = 4096;
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 c65a562ac2e18..8e06a135baa42 100644
--- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -432,6 +432,7 @@ 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 MCL_ONFAULT: ::c_int = 4;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 4111;
diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs
index c2c4f31cf8117..61ee2dcc9b50a 100644
--- a/src/unix/linux_like/linux/gnu/b64/s390x.rs
+++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs
@@ -481,6 +481,7 @@ pub const PTRACE_DETACH: ::c_uint = 17;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const EFD_NONBLOCK: ::c_int = 0x800;
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 2427c7a0ad219..de2f0d6e470f6 100644
--- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
@@ -444,6 +444,7 @@ pub const EREMOTEIO: ::c_int = 121;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 4096;
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 e6307e282a116..9b2aac5c2ba34 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
@@ -651,6 +651,7 @@ pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index c2daa6903ba30..377b9f122f150 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -718,11 +718,6 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOCK_DCCP: ::c_int = 6;
pub const SOCK_PACKET: ::c_int = 10;
-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
-pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100;
-
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
@@ -857,6 +852,8 @@ 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_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e;
pub const PTRACE_SYSCALL_INFO_NONE: ::__u8 = 0;
pub const PTRACE_SYSCALL_INFO_ENTRY: ::__u8 = 1;
@@ -944,6 +941,11 @@ pub const NT_PRFPXREG: ::c_int = 20;
pub const ELFOSABI_ARM_AEABI: u8 = 64;
+// linux/sched.h
+pub const CLONE_NEWTIME: ::c_int = 0x80;
+pub const CLONE_CLEAR_SIGHAND: ::c_int = 0x100000000;
+pub const CLONE_INTO_CGROUP: ::c_int = 0x200000000;
+
// linux/keyctl.h
pub const KEYCTL_DH_COMPUTE: u32 = 23;
pub const KEYCTL_PKEY_QUERY: u32 = 24;
@@ -1024,7 +1026,17 @@ pub const STATX_ATTR_DAX: ::c_int = 0x00200000;
pub const SOMAXCONN: ::c_int = 4096;
-//sys/timex.h
+// linux/mount.h
+pub const MOVE_MOUNT_F_SYMLINKS: ::c_uint = 0x00000001;
+pub const MOVE_MOUNT_F_AUTOMOUNTS: ::c_uint = 0x00000002;
+pub const MOVE_MOUNT_F_EMPTY_PATH: ::c_uint = 0x00000004;
+pub const MOVE_MOUNT_T_SYMLINKS: ::c_uint = 0x00000010;
+pub const MOVE_MOUNT_T_AUTOMOUNTS: ::c_uint = 0x00000020;
+pub const MOVE_MOUNT_T_EMPTY_PATH: ::c_uint = 0x00000040;
+pub const MOVE_MOUNT_SET_GROUP: ::c_uint = 0x00000100;
+pub const MOVE_MOUNT_BENEATH: ::c_uint = 0x00000200;
+
+// sys/timex.h
pub const ADJ_OFFSET: ::c_uint = 0x0001;
pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
pub const ADJ_MAXERROR: ::c_uint = 0x0004;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 067fe07c71f2f..224300a64609e 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_once_t = ::c_int;
pub type pthread_spinlock_t = ::c_int;
pub type __u8 = ::c_uchar;
@@ -791,6 +792,23 @@ s_no_extra_traits! {
pub ifr_ifru: ::sockaddr,
}
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifc_ifcu {
+ pub ifcu_buf: *mut ::c_char,
+ pub ifcu_req: *mut ::ifreq,
+ }
+
+ /* Structure used in SIOCGIFCONF request. Used to retrieve interface
+ configuration for machine (useful for programs which must know all
+ networks accessible). */
+ pub struct ifconf {
+ pub ifc_len: ::c_int, /* Size of buffer. */
+ #[cfg(libc_union)]
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ #[cfg(not(libc_union))]
+ pub ifc_ifcu: *mut ::ifreq,
+ }
+
pub struct hwtstamp_config {
pub flags: ::c_int,
pub tx_type: ::c_int,
@@ -1228,6 +1246,23 @@ cfg_if! {
}
}
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifr_ifru")
+ .field("ifcu_buf", unsafe { &self.ifcu_buf })
+ .field("ifcu_req", unsafe { &self.ifcu_req })
+ .finish()
+ }
+ }
+ impl ::fmt::Debug for ifconf {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifconf")
+ .field("ifc_len", &self.ifc_len)
+ .field("ifc_ifcu", &self.ifc_ifcu)
+ .finish()
+ }
+ }
impl ::fmt::Debug for hwtstamp_config {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("hwtstamp_config")
@@ -1829,6 +1864,8 @@ pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
// 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;
// Read queue size
pub const TUN_READQ_SIZE: ::c_short = 500;
@@ -1846,6 +1883,18 @@ pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
// read-only flag
pub const IFF_PERSIST: ::c_int = 0x0800;
pub const IFF_NOFILTER: ::c_int = 0x1000;
+// Socket options
+pub const TUN_TX_TIMESTAMP: ::c_int = 1;
+// Features for GSO (TUNSETOFFLOAD)
+pub const TUN_F_CSUM: ::c_ushort = 0x01; /* You can hand me unchecksummed packets. */
+pub const TUN_F_TSO4: ::c_ushort = 0x02; /* I can handle TSO for IPv4 packets */
+pub const TUN_F_TSO6: ::c_ushort = 0x04; /* I can handle TSO for IPv6 packets */
+pub const TUN_F_TSO_ECN: ::c_ushort = 0x08; /* I can handle TSO with ECN bits. */
+pub const TUN_F_UFO: ::c_ushort = 0x10; /* I can handle UFO packets */
+// Protocol info prepended to the packets (when IFF_NO_PI is not set)
+pub const TUN_PKT_STRIP: ::c_int = 0x0001;
+// Accept all multicast packets
+pub const TUN_FLT_ALLMULTI: ::c_int = 0x0001;
// Since Linux 3.1
pub const SEEK_DATA: ::c_int = 3;
@@ -1903,6 +1952,7 @@ align_const! {
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
};
}
+pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
@@ -3194,6 +3244,8 @@ pub const ALG_SET_IV: ::c_int = 2;
pub const ALG_SET_OP: ::c_int = 3;
pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
+pub const ALG_SET_KEY_BY_KEY_SERIAL: ::c_int = 7;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
@@ -3550,20 +3602,33 @@ pub const UINPUT_MAX_NAME_SIZE: usize = 80;
// uapi/linux/fanotify.h
pub const FAN_ACCESS: u64 = 0x0000_0001;
pub const FAN_MODIFY: u64 = 0x0000_0002;
+pub const FAN_ATTRIB: u64 = 0x0000_0004;
pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008;
pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010;
pub const FAN_OPEN: u64 = 0x0000_0020;
+pub const FAN_MOVED_FROM: u64 = 0x0000_0040;
+pub const FAN_MOVED_TO: u64 = 0x0000_0080;
+pub const FAN_CREATE: u64 = 0x0000_0100;
+pub const FAN_DELETE: u64 = 0x0000_0200;
+pub const FAN_DELETE_SELF: u64 = 0x0000_0400;
+pub const FAN_MOVE_SELF: u64 = 0x0000_0800;
+pub const FAN_OPEN_EXEC: u64 = 0x0000_1000;
pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000;
+pub const FAN_FS_ERROR: u64 = 0x0000_8000;
pub const FAN_OPEN_PERM: u64 = 0x0001_0000;
pub const FAN_ACCESS_PERM: u64 = 0x0002_0000;
-
-pub const FAN_ONDIR: u64 = 0x4000_0000;
+pub const FAN_OPEN_EXEC_PERM: u64 = 0x0004_0000;
pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000;
+pub const FAN_RENAME: u64 = 0x1000_0000;
+
+pub const FAN_ONDIR: u64 = 0x4000_0000;
+
pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE;
+pub const FAN_MOVE: u64 = FAN_MOVED_FROM | FAN_MOVED_TO;
pub const FAN_CLOEXEC: ::c_uint = 0x0000_0001;
pub const FAN_NONBLOCK: ::c_uint = 0x0000_0002;
@@ -3574,6 +3639,18 @@ pub const FAN_CLASS_PRE_CONTENT: ::c_uint = 0x0000_0008;
pub const FAN_UNLIMITED_QUEUE: ::c_uint = 0x0000_0010;
pub const FAN_UNLIMITED_MARKS: ::c_uint = 0x0000_0020;
+pub const FAN_ENABLE_AUDIT: ::c_uint = 0x0000_0040;
+
+pub const FAN_REPORT_PIDFD: ::c_uint = 0x0000_0080;
+pub const FAN_REPORT_TID: ::c_uint = 0x0000_0100;
+pub const FAN_REPORT_FID: ::c_uint = 0x0000_0200;
+pub const FAN_REPORT_DIR_FID: ::c_uint = 0x0000_0400;
+pub const FAN_REPORT_NAME: ::c_uint = 0x0000_0800;
+pub const FAN_REPORT_TARGET_FID: ::c_uint = 0x0000_1000;
+
+pub const FAN_REPORT_DFID_NAME: ::c_uint = FAN_REPORT_DIR_FID | FAN_REPORT_NAME;
+pub const FAN_REPORT_DFID_NAME_TARGET: ::c_uint =
+ FAN_REPORT_DFID_NAME | FAN_REPORT_FID | FAN_REPORT_TARGET_FID;
pub const FAN_MARK_ADD: ::c_uint = 0x0000_0001;
pub const FAN_MARK_REMOVE: ::c_uint = 0x0000_0002;
@@ -3582,13 +3659,37 @@ pub const FAN_MARK_ONLYDIR: ::c_uint = 0x0000_0008;
pub const FAN_MARK_IGNORED_MASK: ::c_uint = 0x0000_0020;
pub const FAN_MARK_IGNORED_SURV_MODIFY: ::c_uint = 0x0000_0040;
pub const FAN_MARK_FLUSH: ::c_uint = 0x0000_0080;
+pub const FAN_MARK_EVICTABLE: ::c_uint = 0x0000_0200;
+pub const FAN_MARK_IGNORE: ::c_uint = 0x0000_0100;
+
+pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000;
+pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010;
+pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100;
+
+pub const FAN_MARK_IGNORE_SURV: ::c_uint = FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY;
pub const FANOTIFY_METADATA_VERSION: u8 = 3;
+pub const FAN_EVENT_INFO_TYPE_FID: u8 = 1;
+pub const FAN_EVENT_INFO_TYPE_DFID_NAME: u8 = 2;
+pub const FAN_EVENT_INFO_TYPE_DFID: u8 = 3;
+pub const FAN_EVENT_INFO_TYPE_PIDFD: u8 = 4;
+pub const FAN_EVENT_INFO_TYPE_ERROR: u8 = 5;
+
+pub const FAN_EVENT_INFO_TYPE_OLD_DFID_NAME: u8 = 10;
+pub const FAN_EVENT_INFO_TYPE_NEW_DFID_NAME: u8 = 12;
+
+pub const FAN_RESPONSE_INFO_NONE: u8 = 0;
+pub const FAN_RESPONSE_INFO_AUDIT_RULE: u8 = 1;
+
pub const FAN_ALLOW: u32 = 0x01;
pub const FAN_DENY: u32 = 0x02;
+pub const FAN_AUDIT: u32 = 0x10;
+pub const FAN_INFO: u32 = 0x20;
pub const FAN_NOFD: ::c_int = -1;
+pub const FAN_NOPIDFD: ::c_int = FAN_NOFD;
+pub const FAN_EPIDFD: ::c_int = -2;
pub const FUTEX_WAIT: ::c_int = 0;
pub const FUTEX_WAKE: ::c_int = 1;
@@ -4771,7 +4872,7 @@ extern "C" {
newfd: ::c_int,
) -> ::c_int;
pub fn fread_unlocked(
- ptr: *mut ::c_void,
+ buf: *mut ::c_void,
size: ::size_t,
nobj: ::size_t,
stream: *mut ::FILE,
@@ -4849,6 +4950,8 @@ extern "C" {
longindex: *mut ::c_int,
) -> ::c_int;
+ pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;
+
pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
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 c47fa2c4cfda9..8225f26adb474 100644
--- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs
@@ -235,6 +235,7 @@ pub const O_LARGEFILE: ::c_int = 0o400000;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
@@ -311,8 +312,6 @@ pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
-pub const SOCK_NONBLOCK: ::c_int = 2048;
-
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
@@ -326,7 +325,6 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOCK_SEQPACKET: ::c_int = 5;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -451,9 +449,6 @@ pub const F_GETOWN: ::c_int = 9;
pub const F_SETLK: ::c_int = 13;
pub const F_SETLKW: ::c_int = 14;
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 VEOL: usize = 11;
diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs
index 49e000ce97f1e..089c06f859e6b 100644
--- a/src/unix/linux_like/linux/musl/b32/hexagon.rs
+++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs
@@ -225,9 +225,6 @@ pub const F_GETOWN_EX: ::c_int = 16;
pub const F_GETSIG: ::c_int = 11;
pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024;
pub const FLUSHO: ::c_int = 4096;
-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_OWNER_PGRP: ::c_int = 2;
pub const F_OWNER_PID: ::c_int = 1;
pub const F_OWNER_TID: ::c_int = 0;
@@ -294,8 +291,6 @@ 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 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 SOL_CAIF: ::c_int = 278;
pub const SOL_IUCV: ::c_int = 277;
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 d09b8278e5f1c..2fb405bbc6ceb 100644
--- a/src/unix/linux_like/linux/musl/b32/mips/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/mips/mod.rs
@@ -174,6 +174,7 @@ pub const O_LARGEFILE: ::c_int = 0x2000;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
@@ -250,8 +251,6 @@ pub const O_SYNC: ::c_int = 0o40020;
pub const O_RSYNC: ::c_int = 0o40020;
pub const O_DSYNC: ::c_int = 0o020;
-pub const SOCK_NONBLOCK: ::c_int = 0o200;
-
pub const MAP_ANON: ::c_int = 0x800;
pub const MAP_GROWSDOWN: ::c_int = 0x1000;
pub const MAP_DENYWRITE: ::c_int = 0x2000;
@@ -351,7 +350,6 @@ pub const ERFKILL: ::c_int = 167;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
-pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 8;
@@ -388,9 +386,6 @@ pub const F_GETOWN: ::c_int = 23;
pub const F_SETLK: ::c_int = 34;
pub const F_SETLKW: ::c_int = 35;
pub const F_SETOWN: ::c_int = 24;
-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 = 16;
pub const VEOL: usize = 17;
diff --git a/src/unix/linux_like/linux/musl/b32/powerpc.rs b/src/unix/linux_like/linux/musl/b32/powerpc.rs
index ec4f2047e46b2..bdf25455fd8cc 100644
--- a/src/unix/linux_like/linux/musl/b32/powerpc.rs
+++ b/src/unix/linux_like/linux/musl/b32/powerpc.rs
@@ -167,6 +167,7 @@ pub const O_LARGEFILE: ::c_int = 0x10000;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const CBAUD: ::tcflag_t = 0o0000377;
pub const TAB1: ::c_int = 0x00000400;
pub const TAB2: ::c_int = 0x00000800;
@@ -243,8 +244,6 @@ pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
-pub const SOCK_NONBLOCK: ::c_int = 2048;
-
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
@@ -262,7 +261,6 @@ pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOCK_SEQPACKET: ::c_int = 5;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -385,9 +383,6 @@ pub const F_GETOWN: ::c_int = 9;
pub const F_SETLK: ::c_int = 13;
pub const F_SETLKW: ::c_int = 14;
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 VEOL: usize = 6;
diff --git a/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
index bf7a4f59c7945..f963f645a9f10 100644
--- a/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
@@ -323,9 +323,11 @@ 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 F_GETOWN: ::c_int = 9;
+pub const F_GETLK: ::c_int = 12;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
pub const SFD_NONBLOCK: ::c_int = 2048;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
@@ -353,6 +355,7 @@ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 16384;
pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
pub const O_NOFOLLOW: ::c_int = 131072;
pub const MAP_HUGETLB: ::c_int = 262144;
pub const MAP_LOCKED: ::c_int = 8192;
@@ -376,6 +379,7 @@ 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 MCL_ONFAULT: ::c_int = 4;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 4111;
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 aaca917fa03cd..944d6e7877d48 100644
--- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs
@@ -224,6 +224,7 @@ pub const O_LARGEFILE: ::c_int = 0o0100000;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
@@ -300,8 +301,6 @@ pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
-pub const SOCK_NONBLOCK: ::c_int = 2048;
-
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
@@ -315,7 +314,6 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
-pub const SOCK_SEQPACKET: ::c_int = 5;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -441,9 +439,6 @@ pub const F_GETOWN: ::c_int = 9;
pub const F_SETLK: ::c_int = 13;
pub const F_SETLKW: ::c_int = 14;
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 VEOL: usize = 11;
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 14b4bc6d68b87..54e072b314a84 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -250,9 +250,6 @@ 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;
@@ -567,6 +564,7 @@ pub const SYS_set_mempolicy_home_node: ::c_long = 450;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs
index 22ac916909346..18fa6c664c81d 100644
--- a/src/unix/linux_like/linux/musl/b64/mips64.rs
+++ b/src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -612,12 +612,10 @@ 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 F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
diff --git a/src/unix/linux_like/linux/musl/b64/mod.rs b/src/unix/linux_like/linux/musl/b64/mod.rs
index f437355d900cb..05586cdb44b68 100644
--- a/src/unix/linux_like/linux/musl/b64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/mod.rs
@@ -134,10 +134,6 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
-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;
}
diff --git a/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/src/unix/linux_like/linux/musl/b64/powerpc64.rs
index c9bd94135c9a4..202abe8796b13 100644
--- a/src/unix/linux_like/linux/musl/b64/powerpc64.rs
+++ b/src/unix/linux_like/linux/musl/b64/powerpc64.rs
@@ -212,9 +212,6 @@ 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;
@@ -626,6 +623,7 @@ pub const FLUSHO: ::tcflag_t = 0x00800000;
pub const MCL_CURRENT: ::c_int = 0x2000;
pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
pub const CBAUD: ::tcflag_t = 0xff;
pub const TAB1: ::c_int = 0x400;
pub const TAB2: ::c_int = 0x800;
diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
index 9e9dbf6c83097..393f54d3ff773 100644
--- a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
@@ -469,6 +469,9 @@ 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_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 O_APPEND: ::c_int = 1024;
pub const O_DIRECT: ::c_int = 0x4000;
@@ -604,9 +607,6 @@ 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;
@@ -630,6 +630,7 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
diff --git a/src/unix/linux_like/linux/musl/b64/s390x.rs b/src/unix/linux_like/linux/musl/b64/s390x.rs
index f338dcc54a7ec..aa4cbf87f8a22 100644
--- a/src/unix/linux_like/linux/musl/b64/s390x.rs
+++ b/src/unix/linux_like/linux/musl/b64/s390x.rs
@@ -290,15 +290,13 @@ pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
-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 VTIME: usize = 5;
pub const VSWTC: usize = 7;
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 9decf91bcc63a..4d17868000ebd 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
@@ -805,9 +805,6 @@ 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;
@@ -831,6 +828,7 @@ pub const MAP_SYNC: ::c_int = 0x080000;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 4c605338972e3..b67d55e99bb53 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -512,6 +512,10 @@ pub const ECOMM: ::c_int = 70;
pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
+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_WRLCK: ::c_int = 1;
pub const F_UNLCK: ::c_int = 2;
@@ -541,7 +545,9 @@ pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
pub const SOCK_PACKET: ::c_int = 10;
pub const SOMAXCONN: ::c_int = 128;
@@ -585,11 +591,8 @@ pub const PTRACE_SEIZE: ::c_int = 0x4206;
pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
pub const PTRACE_LISTEN: ::c_int = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
-
-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
-pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100;
+pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs
index 4a01e0cd81c85..4afb98e957c9d 100644
--- a/src/unix/linux_like/linux/uclibc/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/mod.rs
@@ -109,6 +109,7 @@ impl siginfo_t {
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGEV_THREAD_ID: ::c_int = 4;
@@ -245,9 +246,6 @@ 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;
@@ -282,7 +280,9 @@ 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_GETSIGMASK: ::c_uint = 0x420a;
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
pub const RTLD_NOLOAD: ::c_int = 0x00004;
pub const RUSAGE_THREAD: ::c_int = 1;
pub const SHM_EXEC: ::c_int = 0100000;
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 900337b4f7e21..cd219a777288f 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -1080,6 +1080,10 @@ extern "C" {
pub fn getdtablesize() -> ::c_int;
// grp.h
+ pub fn getgrent() -> *mut ::group;
+ pub fn setgrent();
+ pub fn endgrent();
+ pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
@@ -1087,6 +1091,7 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
+ pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs
index c337a82793e6a..21d33a4e5eddf 100644
--- a/src/vxworks/mod.rs
+++ b/src/vxworks/mod.rs
@@ -1018,6 +1018,21 @@ pub const O_WRONLY: ::c_int = 0x0001;
pub const O_RDONLY: ::c_int = 0;
pub const O_NONBLOCK: ::c_int = 0x4000;
+// mman.h
+pub const PROT_NONE: ::c_int = 0x0000;
+pub const PROT_READ: ::c_int = 0x0001;
+pub const PROT_WRITE: ::c_int = 0x0002;
+pub const PROT_EXEC: ::c_int = 0x0004;
+
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_ANON: ::c_int = 0x0004;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_CONTIG: ::c_int = 0x0020;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
impl ::Copy for FILE {}
@@ -1218,6 +1233,8 @@ extern "C" {
) -> *mut ::c_void;
pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pub fn truncate(path: *const c_char, length: off_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 gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn pthread_exit(value: *mut ::c_void) -> !;
@@ -1909,19 +1926,19 @@ cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
- } else if #[cfg(any(target_arch = "arm"))] {
+ } else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
- } else if #[cfg(any(target_arch = "x86"))] {
+ } else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
- } else if #[cfg(any(target_arch = "x86_64"))] {
+ } else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
- } else if #[cfg(any(target_arch = "powerpc"))] {
+ } else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
- } else if #[cfg(any(target_arch = "powerpc64"))] {
+ } else if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
} else {