Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
d6efc56
meta: Explicitly include rather than exclude package members
bushrat011899 Jul 22, 2026
fe69d9d
ci: Select Cuttlefish by target instead of a matrix env
10ne1 Jul 22, 2026
1967e14
Fill out some more WASI pthread APIs
alexcrichton Jul 22, 2026
1b279a9
Review comments
alexcrichton Jul 22, 2026
557eda1
build(deps): bump vmactions/netbsd-vm from 1.4.2 to 1.4.4
dependabot[bot] Jul 27, 2026
ebf9b03
build(deps): bump taiki-e/install-action from 2.84.0 to 2.85.2
dependabot[bot] Jul 27, 2026
6c076ee
build(deps): bump actions/checkout from 7.0.0 to 7.0.1
dependabot[bot] Jul 27, 2026
7d616f1
Add binding of getrandom for Redox OS
bjorn3 Jul 27, 2026
7da9d7f
build(deps): bump zizmorcore/zizmor-action from 0.5.7 to 0.6.1
dependabot[bot] Jul 27, 2026
544efc5
clippy: fix unused_unit lint
xtqqczze Jul 24, 2026
0a4261a
freebsd: move `net/if_mib.h` to `src/new` module
ydirson Sep 27, 2023
6442763
Add `RTLD_NEXT` for Android targets
tyilo Jul 24, 2026
d27d756
hurd(b32): simplify item paths
dybucc Jul 8, 2026
421d490
hurd: fill in definition for `fpos_t`
dybucc Jul 8, 2026
73a46f3
hurd: add proper handling of lfs
dybucc Jul 8, 2026
7fbfa01
hurd: adjust `cpu_set_t` definition
dybucc Jul 8, 2026
f6a8f64
hurd: remove duplicate definitions
dybucc Jul 8, 2026
15cad6c
hurd: deprecate glob64 types and routines
dybucc Jul 10, 2026
f1c04f9
hurd: deprecate non-existing `fallocate64`
dybucc Jul 10, 2026
d4e5fc5
hurd: annotate file off tys/fns for deprecation
dybucc Jul 2, 2026
b35e034
linux(uclibc): remove explicit linking to libutil
dybucc Jun 25, 2026
798237b
linux(uclibc): remove conflicting records
dybucc Jun 25, 2026
c9efede
add __errno for newlib targets
LusterSourav Jul 31, 2026
0830bbb
add __errno to espidf semver list
LusterSourav Jul 31, 2026
88dac1f
fix(vxworks): sync semver test with some symbol removal
JohnTitor Jul 27, 2026
3fa3c27
docs: wrap bare URLs in doc comments so `cargo doc` builds off Linux
samuraixwandering Aug 2, 2026
5b97602
style: run rustfmt with nightly toolchain in ci/style.py
senthilnathaa3 Jul 30, 2026
fd5ff8a
clippy: fix explicit_iter_loop lint
xtqqczze Jul 27, 2026
e56e4b9
libc-test: Detect the targeted Android API level from the toolchain
10ne1 Jul 11, 2026
54af614
libc-test: Version-gate the Android API level skips
10ne1 Jul 11, 2026
2c127a4
libc-test: Skip termios function pointer checks below Android API 28
10ne1 Jul 11, 2026
fdb0561
ci: Point each Android toolchain at the API level we target
10ne1 Jul 13, 2026
fce5c6a
bsd: add `BPF_WORDALIGN`
sbogomolov Jul 23, 2026
01f2e8c
macros: Test for safety/unsafety of `f` and `safe_f`
tgross35 Aug 2, 2026
3b76b7d
macros: Merge `f!` and `safe_f!`
tgross35 Aug 2, 2026
ef605de
ci: Pin docs toolchain to nightly-2026-08-02
tgross35 Aug 3, 2026
56ff5ee
build(deps): bump taiki-e/install-action from 2.85.2 to 2.85.5
dependabot[bot] Aug 3, 2026
b8ccc2b
build(deps): bump vmactions/netbsd-vm from 1.4.4 to 1.4.5
dependabot[bot] Aug 3, 2026
4f30c57
wasi: move version-independent socket constants to the shared module,…
ChihweiLHBird Jul 28, 2026
db81760
use trusted publishing
marcoieni Jul 22, 2026
b0fa222
Add pthread_gettid_np for Android and glibc
valentynkit Aug 3, 2026
fca5bd6
fuchsia: mirror `fd_set` definition
dybucc Aug 3, 2026
2e3346d
fuchsia: mirror type aliases
dybucc Aug 3, 2026
3588840
fuchsia: tweak constant definitions
dybucc Aug 3, 2026
d5d4bbc
fuchsia: fill in definition of `fpos_t`
dybucc Aug 3, 2026
198735f
fuchsia: deprecate nonexistent types
dybucc Aug 3, 2026
69e41fd
macros: allow deprecated in `s_no_extra_traits`
dybucc Aug 3, 2026
6917de8
fuchsia: fix record definitions
dybucc Aug 3, 2026
b1fe31b
fuchsia: fix `bits/signal.h` types
dybucc Aug 3, 2026
2141723
fuchsia: fix `pthread.h` definitions
dybucc Aug 3, 2026
d4d79d2
newlib: change definition of `time_t`
dybucc Jul 25, 2026
279c58a
newlib: change definition of file offset types
dybucc Jul 25, 2026
e406d3a
newlib: remove `aarch64` bindings
dybucc Jul 25, 2026
769cd96
newlib: enforce file off tys in supported targets
dybucc Jul 25, 2026
6aa311b
newlib: move `generic` module definitions
dybucc Jul 25, 2026
5d1701a
newlib: remove `powerpc` bindings
dybucc Jul 25, 2026
114bbc4
linux: add `NLMSG_*` helpers
sbogomolov Jul 23, 2026
3dc9c53
haiku: remove redundant `union` skips
dybucc Aug 1, 2026
b6b6697
haiku: fill in full definition for `sem_t`
dybucc Aug 1, 2026
c7b1407
hexagon: remove redundant `union` skip
dybucc Aug 1, 2026
554945e
hexagon: remove possibly redundant skip on `sem_t`
dybucc Aug 1, 2026
a582a7f
add macros for generating Default impls
telcharr Aug 4, 2026
ed83624
use default macros in linux/can.rs
telcharr Aug 4, 2026
0604fe4
linux: select powerpc64 speed symbols by ELF ABI
amaanq Jul 30, 2026
cfd3b5e
docs: update mirror repo for glibc
xtqqczze Aug 4, 2026
1cfed55
docs: add mirror repo for relibc
xtqqczze Aug 4, 2026
3d418ee
docs: add official repo for musl
xtqqczze Aug 4, 2026
b2ae559
docs: update source links section in CONTRIBUTING
xtqqczze Aug 4, 2026
9ebf4c2
Add RFC 3678 multicast `group_req`/`group_source_req` and `MCAST_*`
sbogomolov Jun 30, 2026
9941107
apple: change `BPF_ALIGNMENT` to `size_t`
sbogomolov Jul 31, 2026
e607803
android: add reuseport BPF socket options
apersomany Aug 4, 2026
fc8f142
apple: add TCP header flags, options and SACK limits
samuraixwandering Aug 2, 2026
8daa59e
freebsd: add `rt_msghdr` and `rt_metrics`
sbogomolov Aug 4, 2026
10336e8
docs: update source links for xnu
xtqqczze Aug 4, 2026
09d0aee
Add `environ` for linux-gnu
LusterSourav Aug 4, 2026
47a8f13
test: Move the build script for `libc-test` to a subdirectory
tgross35 Aug 4, 2026
7cad49f
test: Move semver check build portion to a separate file
tgross35 Aug 4, 2026
e087fef
haiku: Use `i32::MIN` rather than `core::i32::MIN`
tgross35 Aug 6, 2026
e982dd0
build: Add a warning if using `RUST_LIBC_UNSTABLE_MUSL_V1_2_3`
tgross35 Aug 6, 2026
6695840
test: Simplify musl_v1_2_3 config
tgross35 Aug 6, 2026
ddd81ab
libc-test: re-enable some skipped tests on powerpc64
Gelbpunkt Aug 7, 2026
3f671b8
clippy: fix manual_bits lint
xtqqczze Aug 2, 2026
6e4a0b8
freebsd: use size_of_val for bitset calculations
xtqqczze Aug 2, 2026
4a7bda6
remove stale sparc64 roundtrip skips
LusterSourav Aug 7, 2026
64bcac1
android: stop skipping `ioctl` in tests
dybucc Aug 7, 2026
0cbfc73
Define max_align_t for s390x-linux
glaubitz Aug 8, 2026
e2d326d
linux(musl): annotate lfs bindings for deprecation
dybucc Jun 9, 2026
169e1d5
deps: Bump `cc` to 1.4.2
tgross35 Aug 9, 2026
83073e1
deps: Run `cargo update`
tgross35 Aug 9, 2026
e1eec0f
Remove most items that have been deprecated since before 0.2.100
tgross35 Aug 11, 2026
bf2e2d8
fix: move `i686-pc-windows-gnu` to without host tools target
JohnTitor Aug 30, 2026
a7bf83b
fix: remove repeated reprs
JohnTitor Aug 30, 2026
9662db1
fix: use Debian to sync with Cuttlefish
JohnTitor Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust toolchain
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup update stable --no-self-update
Expand Down Expand Up @@ -75,14 +75,14 @@ jobs:
env:
TOOLCHAIN: ${{ matrix.toolchain }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust toolchain
run: ./ci/install-rust.sh

- name: Install semver-checks
uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9 # v2.84.0
uses: taiki-e/install-action@6a1bd70eaac3c8bdf093356838d7ee09fda951cf # v2.85.5
if: matrix.toolchain == 'stable'
with:
tool: cargo-semver-checks
Expand Down Expand Up @@ -133,8 +133,6 @@ jobs:
os: windows-11-arm
- target: aarch64-unknown-linux-gnu
os: ubuntu-26.04-arm
- target: i686-pc-windows-gnu
os: windows-2025
- target: i686-pc-windows-msvc
os: windows-2025
- target: i686-unknown-linux-gnu
Expand All @@ -148,7 +146,7 @@ jobs:
env:
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust toolchain
Expand Down Expand Up @@ -231,7 +229,6 @@ jobs:
- target: x86_64-apple-darwin
os: macos-26-intel
- target: x86_64-linux-android
env: { TEST_CUTTLEFISH: 1 }
# Keep in sync with the Android build pinned in ci/cuttlefish-setup.sh
artifact-tag: android17
# FIXME: Exec format error (os error 8)
Expand All @@ -251,7 +248,7 @@ jobs:
env:
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust toolchain
Expand Down Expand Up @@ -303,7 +300,7 @@ jobs:
- target: x86_64-unknown-illumos
timeout-minutes: 25
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Test on FreeBSD
Expand Down Expand Up @@ -334,7 +331,7 @@ jobs:
run: ./ci/bsd-run.sh ${{ matrix.target }}

- name: Test on NetBSD
uses: vmactions/netbsd-vm@0c26a4c4a5e234038862a4a53a00c905b8a107c9 # v1.4.2
uses: vmactions/netbsd-vm@e7ac71b97abbe8437cec8859a5acf72dfa6a8be0 # v1.4.5
if: contains(matrix.target, 'netbsd')
with:
release: "10.1"
Expand Down Expand Up @@ -363,11 +360,12 @@ jobs:
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
# FIXME(rust-lang/rust#160439): unpin once the issue is fixed
run: rustup update nightly-2026-08-02 --no-self-update && rustup default nightly-2026-08-02
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo doc --workspace --no-deps

Expand All @@ -379,12 +377,12 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_0.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
release-plz:
name: Release-plz v0.2
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
Expand All @@ -27,7 +28,6 @@ jobs:
uses: release-plz/action@2eb1d8bcb770b4c48ccfaad919734b38b51958c9 # v0.5.131
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
# FIXME(release): release-pr is broken since we have two release tracks for
# `libc` :(
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Please include permalinks to headers in commit messages for all API changes.
Common sources include:

* Linux uapi: https://github.com/torvalds/linux/tree/master/include/uapi
* Glibc: https://sourceware.org/git/?p=glibc.git;a=tree
* Glibc: https://github.com/sailfishos-mirror/glibc (original is https://sourceware.org/git/?p=glibc.git;a=tree)
* Musl: https://github.com/kraj/musl (original is https://git.musl-libc.org/cgit/musl/tree/)
* Apple XNU: https://github.com/apple-oss-distributions/xnu, libc https://github.com/apple-oss-distributions/Libc/tree/main/include
* Android: https://cs.android.com/android/platform/superproject/main
Expand Down
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ name = "libc"
version = "0.2.189"
keywords = ["libc", "ffi", "bindings", "operating", "system"]
categories = ["external-ffi-bindings", "no-std", "os"]
exclude = ["/ci/*", "/.github/*", "/triagebot.toml", "cherry-pick-stable.sh"]
include = [
"/src",
"/tests",
"/examples",
"/build.rs",
"/CHANGELOG*",
"/LICENSE*",
"/README*",
]
description = "Raw FFI bindings to platform libraries like libc."
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -34,7 +42,6 @@ targets = [
"arm-unknown-linux-gnueabihf",
"armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-ohos",
"i686-pc-windows-gnu",
"loongarch64-unknown-linux-gnu",
"loongarch64-unknown-linux-musl",
"powerpc-unknown-linux-gnu",
Expand Down Expand Up @@ -72,6 +79,7 @@ targets = [
"i586-unknown-linux-gnu",
"i586-unknown-linux-musl",
"i686-linux-android",
"i686-pc-windows-gnu",
"i686-unknown-freebsd",
"i686-unknown-linux-musl",
"nvptx64-nvidia-cuda",
Expand Down Expand Up @@ -128,6 +136,7 @@ targets = [
"powerpc64-ibm-aix",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-gnuelfv2",
"powerpc64-wrs-vxworks",
"riscv32-wrs-vxworks",
"riscv32gc-unknown-linux-musl",
Expand Down
19 changes: 15 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const ALLOWED_CFGS: &[&str] = &[
// GNU to expose a 64-bit `time_t`.
"gnu_time_bits64",
"libc_deny_warnings",
"libc_elfv2",
// Corresponds to `__USE_TIME_BITS64` in UAPI
"linux_time_bits64",
"musl_v1_2_3",
Expand Down Expand Up @@ -92,9 +93,12 @@ fn main() {
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
let target_abi = env::var("CARGO_CFG_TARGET_ABI").unwrap_or_default();

// FIXME(msrv): Once the MSRV is 1.78, use `cfg(target_abi = "pauthtest")`
// directly instead of translating it to `libc_pauthtest`. `target_abi`
// cannot be used directly in cfg expressions on the current MSRV.
// FIXME(msrv): Once the MSRV is 1.78, use `cfg(target_abi)` directly instead
// of translating its values. `target_abi` cannot be used directly in cfg
// expressions on the current MSRV.
if target_abi == "elfv2" {
set_cfg("libc_elfv2");
}
if target_abi == "pauthtest" {
set_cfg("libc_pauthtest");
}
Expand Down Expand Up @@ -147,6 +151,13 @@ fn main() {
}

let mut musl_v1_2_3 = env_flag("CARGO_CFG_LIBC_UNSTABLE_MUSL_V1_2_3");
if let Ok(old_musl_v1_2_3) = env::var("RUST_LIBC_UNSTABLE_MUSL_V1_2_3") {
println!(
"cargo:warning=RUST_LIBC_UNSTABLE_MUSL_V1_2_3 will be removed; \
set `--cfg=libc_unstable_musl_v1_2_3` via RUSTFLAGS instead"
);
musl_v1_2_3 |= old_musl_v1_2_3 != "0";
}

// OpenHarmony uses a fork of the musl libc
let musl = target_env == "musl" || target_env == "ohos";
Expand Down Expand Up @@ -177,7 +188,7 @@ fn main() {
}

if target_env == "gnu"
&& matches!(target_os.as_str(), "linux" | "windows")
&& matches!(target_os.as_str(), "linux" | "windows" | "hurd")
&& target_ptr_width == "32"
&& target_arch != "riscv32"
&& target_arch != "x86_64"
Expand Down
20 changes: 13 additions & 7 deletions ci/android-install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,31 @@ mkdir -p sdk/cmdline-tools
wget -q --tries=20 "https://dl.google.com/android/repository/commandlinetools-linux-${sdk}_latest.zip"
unzip -q -d sdk/cmdline-tools "commandlinetools-linux-${sdk}_latest.zip"

case "$1" in
# The API level is passed in (arg 2) so it stays a single source of truth
# shared with the CC wrapper name in the Dockerfile; only the image variant
# is arch-specific here.
arch="$1"
api="$2"
if [ -z "${api}" ]; then
echo "usage: $0 <arch> <api-level>"
exit 1
fi

case "${arch}" in
arm | armv7)
api=24
image="system-images;android-${api};default;armeabi-v7a"
;;
aarch64)
api=24
image="system-images;android-${api};google_apis;arm64-v8a"
;;
i686)
api=28
image="system-images;android-${api};default;x86"
;;
x86_64)
api=28
image="system-images;android-${api};default;x86_64"
;;
*)
echo "invalid arch: $1"
echo "invalid arch: ${arch}"
exit 1
;;
esac
Expand Down Expand Up @@ -66,7 +72,7 @@ cp /android/android-emulator-package.xml /android/sdk/emulator/package.xml

echo "no" |
./sdk/cmdline-tools/tools/bin/avdmanager create avd \
--name "${1}" \
--name "${arch}" \
--package "${image}" | grep -v = || true

rm -rf "commandlinetools-linux-${sdk}_latest.zip" emulator-linux_x64-9058569.zip
Loading