Skip to content

Remove nonexistent clocks on WASI - #4880

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
alexcrichton:remove-some-wasi-things
Dec 17, 2025
Merged

tgross35 merged 1 commit into
rust-lang:mainfrom
alexcrichton:remove-some-wasi-things

Conversation

@alexcrichton

@alexcrichton alexcrichton commented Dec 10, 2025 •

Copy link
Copy Markdown
Member

These were added way back when in #2499 and while they may have existed in a historical version of wasi-libc they most certainly do not exist in the current wasi-libc. Any usage of them is already-breaking, so this deletes these items.

These were added way back when in rust-lang#2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.
@alexcrichton

Copy link
Copy Markdown
Member Author

This is something I'd ideally like to backport to the 0.2 version as well, although naturally it's a strictly-speaking breaking change. Technically historical changes like ca20d7d were also breaking in a minor fashion too, but this in theory could have higher impact because it's a more C-like constant rather than something libc-specific.

Basically I don't know what the fallout of this would be. Extrapolating the highest risk is a crate that uses these constants in platform-specific code, including WASI, but the code is dead at runtime so no one noticed that it wouldn't work if it were executed. I'm not sure how prevalent such a situation is, however.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is fine to backport if you're okay with it: my philosophy has basically been that for anything in boat of "technically breaking but anybody using this is already broken without knowing it", it's more useful to poke users to fix the broken code than it is to spend effort keeping things half-working. At least on T<=2 platforms and more niche API. From your description, I think that applies here.

@tgross35
tgross35 added this pull request to the merge queue Dec 17, 2025
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Dec 17, 2025
Merged via the queue into rust-lang:main with commit e883afc Dec 17, 2025
50 of 51 checks passed
@alexcrichton
alexcrichton deleted the remove-some-wasi-things branch December 18, 2025 16:47
@alexcrichton

Copy link
Copy Markdown
Member Author

Sounds good to me! And yeah I'm comfortable backporting this myself, and feel free to redirect any confusion to me if you happen to see it

tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 28, 2025
These were added way back when in rust-lang#2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.

(backport <rust-lang#4880>)
(cherry picked from commit e883afc)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jan 3, 2026
These were added way back when in rust-lang#2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.

(backport <rust-lang#4880>)
(cherry picked from commit e883afc)
@tgross35 tgross35 mentioned this pull request Jan 3, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Jan 3, 2026
These were added way back when in #2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.

(backport <#4880>)
(cherry picked from commit e883afc)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jan 3, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 4, 2026
…ed, r=Mark-Simulacrum

rustc: Stop passing `--allow-undefined` on wasm targets

This commit updates how the linker is invoked on WebAssembly targets (all of them) to avoid passing the `--allow-undefined` flag to the linker. Historically, if I remember this correctly, when `wasm-ld` was first integrated this was practically required because at the time it was otherwise impossible to import a function from the host into a wasm binary. Or, at least, I'm pretty sure that was why this was added.

At the time, as the documentation around this option indicates, it was known that this was going to be a hazard. This doesn't match behavior on native, for example, and can easily paper over what should be a linker error with some sort of other obscure runtime error. An example is that this program currently compiles and links, it just prints null:

    unsafe extern "C" {
        static nonexistent: u8;
    }

    fn main() {
        println!("{:?}", &raw const nonexistent);
    }

This can easily lead to mistakes like rust-lang/libc#4880 and defer what should be a compile-time link error to weird or unusual behavior at link time. Additionally, in the intervening time since `wasm-ld` was first introduced here, lots has changed and notably this program works as expected:

    #[link(wasm_import_module = "host")]
    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

This continues to compile without error and the final wasm binary indeed has an imported function from the host. This program:

    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

this currently compiles successfully and emits an import from the `env` module. After this change, however, this will fail to compile with a link error stating that the `foo` symbol is not defined.
rust-timer added a commit to rust-lang/rust that referenced this pull request Apr 4, 2026
Rollup merge of #149868 - alexcrichton:wasm-no-allow-undefined, r=Mark-Simulacrum

rustc: Stop passing `--allow-undefined` on wasm targets

This commit updates how the linker is invoked on WebAssembly targets (all of them) to avoid passing the `--allow-undefined` flag to the linker. Historically, if I remember this correctly, when `wasm-ld` was first integrated this was practically required because at the time it was otherwise impossible to import a function from the host into a wasm binary. Or, at least, I'm pretty sure that was why this was added.

At the time, as the documentation around this option indicates, it was known that this was going to be a hazard. This doesn't match behavior on native, for example, and can easily paper over what should be a linker error with some sort of other obscure runtime error. An example is that this program currently compiles and links, it just prints null:

    unsafe extern "C" {
        static nonexistent: u8;
    }

    fn main() {
        println!("{:?}", &raw const nonexistent);
    }

This can easily lead to mistakes like rust-lang/libc#4880 and defer what should be a compile-time link error to weird or unusual behavior at link time. Additionally, in the intervening time since `wasm-ld` was first introduced here, lots has changed and notably this program works as expected:

    #[link(wasm_import_module = "host")]
    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

This continues to compile without error and the final wasm binary indeed has an imported function from the host. This program:

    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

this currently compiles successfully and emits an import from the `env` module. After this change, however, this will fail to compile with a link error stating that the `foo` symbol is not defined.
github-actions Bot pushed a commit to rust-lang/miri that referenced this pull request Apr 5, 2026
…k-Simulacrum

rustc: Stop passing `--allow-undefined` on wasm targets

This commit updates how the linker is invoked on WebAssembly targets (all of them) to avoid passing the `--allow-undefined` flag to the linker. Historically, if I remember this correctly, when `wasm-ld` was first integrated this was practically required because at the time it was otherwise impossible to import a function from the host into a wasm binary. Or, at least, I'm pretty sure that was why this was added.

At the time, as the documentation around this option indicates, it was known that this was going to be a hazard. This doesn't match behavior on native, for example, and can easily paper over what should be a linker error with some sort of other obscure runtime error. An example is that this program currently compiles and links, it just prints null:

    unsafe extern "C" {
        static nonexistent: u8;
    }

    fn main() {
        println!("{:?}", &raw const nonexistent);
    }

This can easily lead to mistakes like rust-lang/libc#4880 and defer what should be a compile-time link error to weird or unusual behavior at link time. Additionally, in the intervening time since `wasm-ld` was first introduced here, lots has changed and notably this program works as expected:

    #[link(wasm_import_module = "host")]
    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

This continues to compile without error and the final wasm binary indeed has an imported function from the host. This program:

    unsafe extern "C" {
        fn foo();
    }

    fn main() {
        unsafe {
            foo();
        }
    }

this currently compiles successfully and emits an import from the `env` module. After this change, however, this will fail to compile with a link error stating that the `foo` symbol is not defined.
zhaowenbo-vivo pushed a commit to vivoblueos/libc that referenced this pull request Oct 14, 2026
* ci: Switch `verify-build` to a python script

It would be nice to do a few more things with this script that are
starting to get cumbersome in bash. Switch to python so we gain some
flexibility.

There are some target inaccuracies in the lists here, but fixing these
is left for a future change.

(backport <https://github.com/rust-lang/libc/pull/4778>)
(cherry picked from commit f82e7fae815f20e1274c455fad8325b3e8541636)

* ci: Update targets in verify-build

Do a few things:

* Update the list to reflect current target tiers.
* Add some missing T2 targets (includes ohos and gnullvm).
* Remove unneeded `dist = False` and minimum toolchain config.
* Delete some `-none-` targets, which don't make use of libc.
* Add a check for duplicates.
* Re-group and sort the lists.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 24d00496c7a8ef2087a8065ca739952eb6857ba1)

* ci: Always run verify-build on Linux

Most of the targets are cross compiled anyway, and there isn't any
advantage to running on native platforms. Start running everything on
Linux which is the fastest and cheapest runner.

As part of this, introduce a way to run only half of the target list
from a single invocation. This is used to split the nightly job in two,
each now only taking about as long as the stable job.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 56b916db7e237d9259b697741550abcab9a0db29)

* ci: Print elapsed time as part of verify-build

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 5e95452b38e4051d458fe3639d64a8ca64fe5cc3)

* ci: Launch create-artifacts.py with python

We have occasional CI failures on Windows where the environment
variables don't get set so the artifact upload fails. Looking at the
logs, it doesn't even appear the create-artifact job ran (but there are
no errors). The Windows runners sometimes have trouble launching python
scripts via `./`, so switch to using the python3 executable in hopes
that this helps.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 962b985cfd3101715742c24f36f4c0cef4613dee)

* aix: Resolve function comparison and `unnecessary_transmutes` warnings

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit c81917388181e50c58c285b24488e7cef70fc897)

* ci: For no-dist targets, do a check rather than a full build

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit a53f4bc2964bbb1b594c628627cb9396ee48ba69)

* macros: Allow `s!` and `s_no_extra_traits!` to take private items

Occasionally we need to define structs that keep the expected set of
traits but aren't crate-public. Add support to the macros to do this.

(backport <https://github.com/rust-lang/libc/pull/4783>)
(cherry picked from commit cdcc46679ade1254d310b9db46224befefb9fe46)

* ci: Pass the `MUSL_V1_2_3` env in docker

This was being set as part of CI but not forwarded to the jobs. Start
passing it now.

(backport <https://github.com/rust-lang/libc/pull/4775>)
(cherry picked from commit ab130bf6df0cd664d474c6ee93a98ae3d7cad66c)

* musl: Fix skips with recent versions

It appeared that tests with the constants here were passing in CI with
new versions of musl before, but that was only because the correct
config wasn't being set. Go back to our original configuration (with
some cleanup) to resolve this.

Fixes: dd44cb603e77 ("test: linux: Unskip types and constants that are now available")

(backport <https://github.com/rust-lang/libc/pull/4775>)
(cherry picked from commit 075c1184bc803fdfc9ced147eefc318dccb53a90)

* ci: Also check builds with `musl_v1_2_3`

(backport <https://github.com/rust-lang/libc/pull/4784>)
(cherry picked from commit 7b9f8fd059a9cc4d64be801aced0019a4b62a119)

* ci: Run gnu env tests as part of the main job

Since glibc supports both 32- and 64-bit time_t and off_t without
different setup (just a header define in libc-test), these don't have
any need to be standalone jobs. Switch glibc config variants to be
checked as part of `run.sh`, which means we are now covering all 32-bit
platforms by default.

(backport <https://github.com/rust-lang/libc/pull/4785>)
(cherry picked from commit cbf2b8a94129b1ae857a0588de8465e46fd53572)

* ci: Only test against one of two musl versions

Commonize to always build 1.2.5 for tests that require a newer musl,
rather than either 1.2.3 or 1.2.5 based on the version.

(backport <https://github.com/rust-lang/libc/pull/4788>)
(cherry picked from commit 03e32e84eb6a006f8d90a5b7d8ca883d252cd735)

* Change errno EWOULDBLOCK to make it an alias of EAGAIN.

(backport <https://github.com/rust-lang/libc/pull/4790>)
(cherry picked from commit 095aae8e6f0878b3dfb8f010cd8b699c5dd2d31f)

* build(deps): bump actions/upload-artifact from 4 to 5

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4791>)
(cherry picked from commit bf2bd19d07f1fb35fa0ee2fd956962b17ad15dba)

* Add an `offset_of` macro

We can't yet use the standard library's macro since it isn't in our
MSRV, but there are a couple of applicatons for having `offset_of`
available. Add a polyfill for now.

(backport <https://github.com/rust-lang/libc/pull/4792>)
(cherry picked from commit 18083938f28c39908f487624bd96ed9a6c0c24e0)

* ci: Commonize dockerfile style

Split all dependencies to new lines and sort them, and use consistent
indentation across all files.

(backport <https://github.com/rust-lang/libc/pull/4795>)
(cherry picked from commit 2e208d03fe34ef7fe4e68e46ea7e6de227d83b4f)

* ci: Remove unused dependency installs

`linux-headers-generic` isn't needed, sparc no longer needs the
dependencies to prepare for using qemu-system, and g++ isn't needed for
platforms that have a C-only libc.

(backport <https://github.com/rust-lang/libc/pull/4795>)
(cherry picked from commit 584c1d348ca24982601568f8f46c550c0d44abbd)

* Adding defines and functions required for vxworks

Co-authored-by: Immad Mir <mirimmad17@gmail.com>

(backport <https://github.com/rust-lang/libc/pull/4781>)
(cherry picked from commit 2bee2f363b53935c9f1432ad62a582e9cb7fcb10)

* VxWorks: Mention that the release ID represents minor+patch

Link: https://github.com/rust-lang/libc/pull/4781#discussion_r2471685324

(backport <https://github.com/rust-lang/libc/pull/4781>)
(cherry picked from commit 5a1ced6e3b45e3012ef983dd8baeea40433cf135)

* doc: Fix rustdoc `bare_urls` warnings

(backport <https://github.com/rust-lang/libc/pull/4774>)
(cherry picked from commit 91fc98caa6ac1120db4bd82469398995a7775c33)

* reorg: Introduce a posix/unistd module

Create a module for common Posix-specified definitions in `unistd.h`,
which are then reexported by relevant targets. Populate this with the
`STD{IN,OUT,ERR}_FILENO` constants to start, which have posix-specified
values.

Link: https://pubs.opengroup.org/onlinepubs/007904975/basedefs/unistd.h.html

(backport <https://github.com/rust-lang/libc/pull/4774>)
(cherry picked from commit 9cf1a1c1ce89669860e3e45a28f6e8dea6573cb1)

* glibc: Initial setup of source reorganization

Establish the basic source reorganization for glibc, and seed it with a
`net/route.h` definition.

Glibc has the same headers in various locations, then copies or (I
believe) combines them in the install location based on the target
platform. To mirror this, our source primarily mirrors the glibc source
tree, then reexports things in `src/new/glibc.rs` in the same way that
glibc does when it creates an install.

(backport <https://github.com/rust-lang/libc/pull/4540>)
(cherry picked from commit 0399c4ed2ae4d3f7c3c6728b894881cd338e9520)

* ci: Skip hexagon-unknown-linux-musl

This hits an error about a duplicate fma symbol while building std.

(backport <https://github.com/rust-lang/libc/pull/4540>)
(cherry picked from commit 5a9e1db32bb09a0b23e257b65e5b5ccdf754d00e)

* ci: Re-enable ohos check builds

(backport <https://github.com/rust-lang/libc/pull/4804>)
(cherry picked from commit 4bc2673628b515e75f660b6d6d101d066b92a972)

* ohos: Don't emit duplicate lfs64 definitions

The musl module is enabled on ohos, so these are duplicates.

(backport <https://github.com/rust-lang/libc/pull/4804>)
(cherry picked from commit b30e7144278263f9fe12ad6d22c9713eeeb5dd5c)

* musl: Switch to the new structure for `socket.h`

Move `struct msghdr`, `struct cmsghdr`, `sendmmsg`, and `recvmmsg` over
at this time, as well as two `SOCK_*` constants that were in the musl
module.

Link: https://github.com/kraj/musl/blob/9f204467e88c75e36105d1359951c5857c20fe0b/include/sys/socket.h

(backport <https://github.com/rust-lang/libc/pull/4539>)
(cherry picked from commit 564e0efe817e8d2e147c21fe2227c2d78eff44ff)

* Flip `Copy` and `PartialEq, Hash` derives for packed struct support

1.63 doesn't support deriving `PartialEq` on non-`Copy` packed structs
and will error out here because it doesn't realize `Copy` is added
later. Swapping the order of the derives resolves this issue and enables
us to derive `extra_traits` even on packed structs.

(backport <https://github.com/rust-lang/libc/pull/4807>)
(cherry picked from commit 79d1bdbb07b0b782cdb7b482c6a26a81dc044fc3)

* cleanup: Use derived traits as much as possible

Historically Rust hasn't supported derives on packed structs well, and
until recently our automatic derives via `s!` still did not support
these (fixed by 79d1bdbb07b0 ("Flip `Copy` and `PartialEq, Hash`
derives")). This meant that any packed struct implementing
`extra_traits` had handwritten implementations that are no longer
needed.

There are also a handful of cases that use a handwritten implementation
in order to selectively exclude padding fields. Others don't seem to be
handwritten for any specific reason.

Clean up all of the above by switching from `s_no_extra_traits!` to `s!`
and deleting the handwritten implementations wherever possible. The only
remaining handwritten implementations are those that compare unions with
`unsafe` (which will have to be addressed) or floats.

Note that in some cases, this means we are no longer excluding padding
fields from comparisons. These traits are only usable via references,
not raw pointers; thus, the user has asserted that they are initialized,
and there is no UB in `libc` by reading them. Practically the only way
to know they are initialized is by starting with a zeroed struct, so in
most cases they will have no effect on the results. Whether or not
padding fields are included in handwritten traits is also completely
inconsistent (most include them), so there isn't much predictability
lost here.

The new `Padding` type will also improve the situation here in the
future.

(backport <https://github.com/rust-lang/libc/pull/4806>)
(cherry picked from commit 141aea1c5c1d13c6193056862a04000d860ece51)
[ note that this was very conflict-heavy so the cherry pick differs
  quite a bit from the original commit - Trevor ]

* ci: Check process output in create-artifacts

Add `check=True` to catch nonzero exit codes, and address one other lint
for unneeded collection to `list`. Additionally, add some print
statements in an attempt to help debug the CI failure on Windows.

(backport <https://github.com/rust-lang/libc/pull/4813>)
(cherry picked from commit 83bd32f8ac10bf20bba9509b06de5f242ca7c6ad)

* ci: Use a mirror for musl downloads

The musl server has been a bit flaky, so the files we needed have been
added to rust-lang mirrors. Update CI setup here to make use of them.

Link: https://github.com/rust-lang/ci-mirrors/blob/15a6d341341e858c2b7be872a47a39f546cc6759/files/libc.toml

(backport <https://github.com/rust-lang/libc/pull/4819>)
(cherry picked from commit 7c9757722c623dc87ce0f1f3bce34f1c8d93fe41)

* ci: Run semver checks even on non-host targets

Add a version of semver checks that run on non-host targets by building
rustdoc JSON output and passing that to `cargo-semver-checks`.
Unfortunately this doesn't have a way to suppress false positives, so we
need to leave the checks as optional rather than enforced for now (i.e.
the exit code isn't checked).

* ci: Add a job to ensure documentation succeeds

This is a cherry pick of 1b08efd83ae0 ("Increase the recursion limit to
fix docs.rs `ctest`") but we don't need the ctest bit, only the docs
build.

So, in essence:
(backport <https://github.com/rust-lang/libc/pull/4371>)
(cherry picked from commit 1b08efd83ae0493ff140ed89de3bc483494141e8)

* cleanup: Also use `s_no_extra_traits!` for private structs

(backport <https://github.com/rust-lang/libc/pull/4808>)
(cherry picked from commit b4cb730fde5b8eb4b3f6d094753716f0a97c1aa1)

* ci: Make clippy a required job

This was part of e09683ea3523 ("run clippy on 3 major platforms"), most
of which made it to libc-0.2. However, this line was missed.

* ci: Add testing for NetBSD

The x86-64 NetBSD target is tier 2, so we can start testing it.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit d77b8e7ff828c5de46f94c9a6997ac2e3529fe89)

* Add `core::cfg` to the prelude

This is not always present when we are building as `rustc-dep-of-std`.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 919d0d4653d7d5aa73e00d2cdfe6e29a8ff1ee59)

* test: Factor out a fallible command runner

This pattern is currently used by the `freebsd-version` check but will
be used by more in the future.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 91f208c61eb684c9ec5a5666f0dcd9168c7b5f2e)

* NetBSD: Delete items from the semver file that don't exist

Some of these may have been removed. `NI_MAXHOST` is already specified
in the unix semver file.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 60d7cccb442a3c59d2d76f6305ba1784181d30ba)

* NetBSD: riscv64: Fix the mcontext types

Currently this target fails to build.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 368df02c8d8b04f688e8de3a2a5c4338f72d8f10)

* NetBSD: Update test headers and skips

Add headers required for the new constants we have, add skips for things
we can't easily fix, and remove skips for things that now work.

Additionally, check the NetBSD version via `uname` for configuring skips
based on the tested version.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 5634c88449febdd2d722bf2008bfc29503751053)

* NetBSD: Skip tests on 9.x for network structs with alignment mismatches

These were previously packed, but this was changed in NetBSD10.

Link: https://github.com/NetBSD/src/commit/1ca39e872702d4539e8844aff15593cf4c18a1cb

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 277c0c55786e85cd966d94ffa65ce172f97c54f1)

* NetBSD: Remove IFF_NOTRAILERS

Upstream commit: https://github.com/NetBSD/src/commit/091e15265dbe2bb314cd3f15830a81f296d03f40

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 35d5592a1f9e712220203ddff65a5dc63e95c1ba)

* NetBSD: Remove `*_MAXID` constants and `AT_SUN_LDPGSIZE`

These assorted constants may have existed at some point but I can't find
any reference to them in the source repo. Remove them now.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 17727db4414aa32f7ff2bf7465a5d154682cad16)

* NetBSD: Remove `vm_size_t`

As noted, this has been deprecated a long time and is no longer present
on x86_64. Remove the typedef.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 11d36ae0efd967e52c9346778ae6ab70b505beae)

* NetBSD: Remove BPF constants

These are currently incorrect, so remove them for now. If desired, they
can be added back in the future using the `_IO*` functions.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 7de84bf0842561b85752acc29fa49803c190c745)

* NetBSD: Replace REG_ENOSYS with REG_ILLSEQ

Upstream commit: https://github.com/NetBSD/src/commit/cc8bab3745d49df3be13e903212f10c5fbee6c75

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit b038f178e2aad9ed4cbf2f2dda6b4b4ae926916a)

* NetBSD: Fix `uucred.cr_ngroups` from `int` to `short`

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/ucred.h#L52

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 3bb84ebc5566637ddb2c03b90f13d5af91066ab8)

* NetBSD: Fix the type of `kevent.udata`

This changed in 10.0. The change is ABI-compatible so we can make it
now.

This is a minor break, but should allow users to remove some special
casing on NetBSD since this brings it in line with other BSDs.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/event.h#L72

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 14f2bc5a1cfff354871167468d802f6fe2ca53a8)

* NetBSD: Fix the value of `PT_SUSPEND`

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ptrace.h#L62

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 5e47663bc529af1c1aac82f5362ce284310d696b)

* NetBSD: Fix the values of FNM_* constants

Link: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/fnmatch.h#L43-L48

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit cfb674c59dec21a10533c267b63859a45ef2eb92)

* NetBSD: Fix the type of `mcontext_t.__fpregs`

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/arch/amd64/include/mcontext.h#L59-L65

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit a47db5328b888658adc97b263d4572863b5df7f0)

* NetBSD: Increase the size of `sockaddr_dl.sdl_data` from 12 to 24

Upstream commit: https://github.com/NetBSD/src/commit/a3d9e0f54ed964e4da9d6ef05c15f769c7bc2bc9

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 8ff5e7e896f7608e60c1d71867d11017c09aeea6)

* NetBSD: Make `_cpuset` an extern type

Our definition was correct for how it is defined internally, but in the
header where it is included it is an incomplete definition.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/sched.h#L99

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 95e5cdbb0771dac53c0fe384180fa68a7339d4cd)

* NetBSD: Account for upstream changes to ptrace with LWP

Deprecate the PT_LWPINFO and PL_EVENT* constants, as well as
`ptrace_lwpinfo`.

Upstream commit: https://github.com/NetBSD/src/commit/4f79a484704c25ba5c21ab92911b2c71cf56a9dd

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit c4a86e0c19a48b0df2eba4fc186e6bd919c813b8)

* NetBSD: Introduce `statvfs.rs`

Move statvfs types to the `new` module.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/statvfs.h#L66-L101

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit c4731a0c308288626d83c6403a778c4c9328a59b)

* NetBSD: Make `statvfs.f_spare` non-public

With NetBSD10 the type changes and fields get adjusted. Make the field
nonpublic now to prepare for this change in the future.

This is a minor breaking change but means that the NetBSD10 updates will
not be breaking.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/statvfs.h#L94

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit d5f4354cf28a965d46876a1cf50e2896fbe1352d)

* NetBSD: Skip tests for structvfs on NetBSD10

This went through an ABI change with a symbol version in NetBSD10. Our
version still works but tests don't pass.

Link: https://github.com/NetBSD/src/commit/02cdd248ec8b17634bab40aa4f2e161a756d7fce

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit bf0f52cccfbc716cff00931062cf8b6059486b2e)

* NetBSD: Correct `ipc_perm`, split from OpenBSD as `ipc.rs`

The field ordering is incorrect on NetBSD. Move it to the `new` module
for NetBSD and OpenBSD and fix the mismatch on NetBSD.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ipc.h#L54-L68
Link: https://github.com/openbsd/src/blob/9abc5df53d8ad6b65dbd35b89ed94f73e2fc58da/sys/sys/ipc.h#L53-L61

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 066e702ac0a9e87f1cd46399122f4c64b6359faa)

* NetBSD: Introduce `utmp_.rs`, correct the definition of `lastlog`

The field order was incorrect. Update this and move it to `new`, along
with the rest of `utmp`.

As part of this, correct an incorrectly spelled `utpname` to `utmpname`.

Fixes: 42289eb64f63 "Implement utmp for NetBSD"

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 6a01e2f2c2ef65fc41b1e9db27213eefa2dbe54b)

* NetBSD: Introduce `utmpx_.rs`, correct utmpx definitions

Create a new module for `utmpx` and move definitions there, then correct
`_UTX_PADSIZE`. We can also just use `s!`, there is no need to manually
implement the traits.

NetBSD defines `_UTX_PADSIZE` manually but includes this comment in
their source:

    /*
     * This should be:
     * 40 - (sizeof(struct timeval) - sizeof(struct { long s; long u; })))
     * but g++ does not like it, to retain size compatibility with v1.00,
     * so we do it manually.
     */
    #ifdef _LP64
    #define _UTX_PADSIZE 36
    #else
    #define _UTX_PADSIZE 40
    #endif

I tried using the expression here:

    40 - (size_of::<crate::timeval>() - size_of::<(c_long, c_long)>());

But this returns a value of 8 which doesn't match the expected 36. So,
keep with their source and hardcode the values.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/include/utmpx.h#L91-L101

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 4055637d36dc795c71cea037066a42224eead2be)

* NetBSD: Introduce `types.rs`, correct the definition of `lwpid_t`

This is currently defined as an `unsigned int` but should be `int32_t`.
Also move some related definitions `new`.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/types.h#L200

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 29464834a1aecefcd1aa14b0a89f4c23d7ee4922)

* NetBSD: Introduce `timex.rs`

Move `timex.h` types to the `new/` module.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit fb74b6f9cafdc60afebcbf7016e34daf839d99c4)

* NetBSD: Introduce `time.rs`, fix the values of `CLOCK_*_CPUTIME_ID`

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/time.h#L305-L306

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 57213d424db1eefa76750a99a99fef57e1667caf)

* NetBSD: Introduce `if_.rs`, fix the definition of `ifreq`

The definition of `struct ifreq` didn't match up. Make a new module for
`net/if.h` and fix it there. Note that this drops some trait
implementations since the correct API involves unions.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 8cb1db91b85ac9cd041d471a388d0a5cb90c4e1e)

* NetBSD: Correct a number of symbol link names

Relevant source:

* `devname`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/stdlib.h#L296
* `getutent`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmp.h#L70
* `ntp_gettime`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/timex.h#L257
* `sched_rr_get_interval`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/sched.h#L50-L51
* `shmctl`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/shm.h#L2011
* `sig{action,suspend}`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/signal.h#L85-L95
* `{get,set}itimer`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/time.h#L331-L335
* `timer_{get,set}time`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/time.h#L158-L160
* `utmpx` symbols: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmpx.h#L135-L150
* `wait4`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/wait.h#L209

Excluded are `__statvfs90`, `__fstatvfs90`, `__sigaction_siginfo`,
`__getmntinfo90`, `__getvfsstat90`which are only present in 10.0+ (the
symbol version seems to be N-1). Source:

* https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/statvfs.h#L160-L168

There is also a deprecated aliases that used to be needed and is removed
here.

* `__getmntinfo13`:  https://github.com/NetBSD/src/blob/62c785e59d064070166dab5d2a4492055effba89/lib/libc/compat/gen/compat___getmntinfo13.c#L49-L50

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 1816f606144e0263fc2b1ed05b2f6f0e214536f2)

* NetBSD: Correct the type of `kinfo_vmentry.kve_path`

* Add missing constants from `unistd.h`

(backport <https://github.com/rust-lang/libc/pull/4811>)
(cherry picked from commit e654f3a8f08ea01ca7bb69c4ad8c962252b1807c)

* test: Upgrade ctest

* Gate `__wasilibc_register_preopened_fd` on WASI

This API is only available in WASIp1 and as the libc build for WASIp2 is
changing the symbol was recently deleted. This functionality makes sense
for WASIp1, but for WASIp2 it's a fundamentally different set of
syscalls so this is no longer provided by libc.

(backport <https://github.com/rust-lang/libc/pull/4837>)
(cherry picked from commit ca20d7d9c30f201ea7501b6fbffe00da1c9daae2)

* Fix pid_t type on redox

(backport <https://github.com/rust-lang/libc/pull/4825>)
(cherry picked from commit 33c96c930e3bd457bc06fd62241ed4f7cb0fbe16)

* build(deps): bump vmactions/solaris-vm from 1.1.5 to 1.1.6

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.5 to 1.1.6.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.5...v1.1.6)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.1.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4826>)
(cherry picked from commit 7b336ae69d21022f21a1e2a71d3e312b7d572c5b)

* Update wasi-sdk in CI, plus some script updates

* Update to wasi-sdk-29 which is the latest
* Pass `-Clink-self-contained=n` instead of
  `-Ctarget-feature=-crt-static` (which didn't work) to force using the
  external libc.

(backport <https://github.com/rust-lang/libc/pull/4837>)
(cherry picked from commit 6259f3a35fb6cde8494f12502c0428184411e731)

* DragonflyBSD: Fix the type of `mcontext_t.mc_fpregs`

* libc: add PartialEq, Eq, and Hash trait implementations for Padding.

(backport <https://github.com/rust-lang/libc/pull/4609>)
(cherry picked from commit cbc178b298c0afe83f23b90c43f6355c1fc5d9ab)

* libc: wrap padding fields with Padding newtype.

(backport <https://github.com/rust-lang/libc/pull/4609>)
(cherry picked from commit c4dcfd23f00ec3fe6b7a2a67416084c174222754)

* linux: Move Linux-specific pthread bits to the `new` module

Move `pthread_*` API in `linux_like/linux.rs` to a module in `new` and
reexport via `glibc` and `musl`. Eventually other platforms will be
ported as well.

(backport <https://github.com/rust-lang/libc/pull/4833>)
(cherry picked from commit 04c5805de39c16582afe8212fd5b0b3795280a26)

* ci: Disable tests on FreeBSD 13

These jobs almost always fail with a segfault so unfortunately aren't
very useful. There isn't anything we can do to fix them on the libc
side, given the issue comes from a kernel bug. The failing jobs have
been a source of contributor confusion, so remove them here.

Link: https://github.com/rust-lang/libc/issues/4740
Link: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285873

(backport <https://github.com/rust-lang/libc/pull/4838>)
(cherry picked from commit 7b1449ab13ec24234793ed1c1fa75b7cf08742e8)

* android: Move android-specific pthread bits to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4834>)
(cherry picked from commit af044aae8d9a5bb7f3bc50920f74769537bf3384)

* emscripten: Move emscripten-specific pthread bits to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4834>)
(cherry picked from commit 6029abbeeca7458d5ad0b463148f5ff30210188f)

* linux-like: Move pthread API in to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4836>)
(cherry picked from commit bed5b8da278b105c1bf91c19786f2606048256b7)

* l4re: Update available pthread API

This is imperfect but should get things closer to what is available on
l4re's uclibc fork. Based on work by Marius Melzer [#4479].

[#4479]: https://github.com/rust-lang/libc/pull/4479

(backport <https://github.com/rust-lang/libc/pull/4836>)
(cherry picked from commit 34d8ce72d307b2432efd49038d20f059ac5f0e61)

* apple: Nest all new Apple sources in an `apple/` module

We will eventually add `libpthread`, so accommodate for that.

(backport <https://github.com/rust-lang/libc/pull/4840>)
(cherry picked from commit 4e698ae93d4de049cccde64925c11a036c1bd3f4)

* apple: Add missing pthread API to the semver lists

(backport <https://github.com/rust-lang/libc/pull/4839>)
(cherry picked from commit dc66e547de225335f5dcf91b100fa099b852c304)

* apple: Move pthread API to the `new` module

This sets up the basic structure but does not yet move all `pthread_*`
API.

(backport <https://github.com/rust-lang/libc/pull/4839>)
(cherry picked from commit ce5dc81cd72539fa1195fc2a4ea9ef1a3027f544)

* fmt: Use the same rustfmt.toml everywhere

It isn't worth keeping a separate rustfmt.toml only for ctest, so switch
to using the vertical formatting everywhere.

(backport <https://github.com/rust-lang/libc/pull/4842>)
(cherry picked from commit 04ab55dbcfaaea7e5cfbe3687c7204f86c17eac0)

* fmt: Replace style.sh with style.py

We need a bit more flexibility in the formatting, which would be
difficult to achieve with bash. Rewrite the style check to a python
script that will be easier to extend. This is also faster than using
inplace perl, an now prints a diff when semver files aren't sorted.

(backport <https://github.com/rust-lang/libc/pull/4842>)
(cherry picked from commit 9713fd10555633f22ed4eab4b46597a1ca990fec)

* macros: Take a visibility for `c_enum` variants

Accept a visibility so we are able to make some variants nonpublic. This
means that `pub` needs to be added on all variants we want to be
visible: it is more verbose, but matches how everything else works.

(backport <https://github.com/rust-lang/libc/pull/4841>)
(cherry picked from commit ba6357ef7892f3eed598822c21e8ef692caf6575)

[ Needed to drop changes to a lot of types that still use Rust `enum`s -
  Trevor ]

* ci: Update `style.py` to work with visibility on enums

E.g. the following can now be formatted correctly:

    c_enum! {
        #[repr(c_uint)]
        pub enum #anon {
            pub PTHREAD_INTROSPECTION_THREAD_CREATE = 1,
            pub PTHREAD_INTROSPECTION_THREAD_START,
            pub PTHREAD_INTROSPECTION_THREAD_TERMINATE,
            pub PTHREAD_INTROSPECTION_THREAD_DESTROY,
        }
    }

(backport <https://github.com/rust-lang/libc/pull/4841>)
(cherry picked from commit d58c1f4f9ae01648b342d7dead291d08655677c4)

* Fix test for cygwin

(backport <https://github.com/rust-lang/libc/pull/4827>)
(cherry picked from commit eb871eb941ee3c44b00beac2df20a913894437ab)

* cygwin: Add missing utmp/x.h, grp.h, and stdio.h interfaces

These constants and functions are required for building uutils-coreutils for Cygwin.

Sources:

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/cygwin/config.h#L50
https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/stdio.h#L138-L139

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/cygwin/utmp.h#L20-L33

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L21-L32

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/stdio.h#L120-L122

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/grp.h#L64-L65

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L21-L32

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L42-L49

(backport <https://github.com/rust-lang/libc/pull/4827>)
(cherry picked from commit a3bb40e18a207d53b7eb02fdd21cf97c360aaa37)

* Make eventfd argument names match OS docs/headers

(backport <https://github.com/rust-lang/libc/pull/4830>)
(cherry picked from commit 3ff2a88d1186126e4984446f3517f29c7a9c6305)

* Define eventfd on NetBSD

Like FreeBSD but unlike OpenBSD, NetBSD supports eventfd since version
10 (September 2021, see http://netbsd.org/changes/changes-10.0.html).

I don't know enough about NetBSD to know whether all systems running
10 can be expected to have eventfd, but it's probably fine. Our GitHub
actions CI only tests NetBSD 10.1.

Ref: https://man.netbsd.org/eventfd.2
Ref: https://github.com/NetBSD/src/blob/d04b0c735abc997743bb3faa74464524cbe7becd/sys/sys/eventfd.h

(backport <https://github.com/rust-lang/libc/pull/4830>)
(cherry picked from commit 3e82c57a9b5ed872b4effdf00e8f16cbe13831d1)

* linux, android: Add definition for IUCLC

This is defined in termios-c_iflag.h (or termbits.h) and it's shared
across all the linux archs, even though it's not POSIX

(backport <https://github.com/rust-lang/libc/pull/4846>)
(cherry picked from commit fb8c00e283cf48a2a133537914bad180275d3b27)

* build(deps): bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4848>)
(cherry picked from commit 71e04e1ed98df356d49639f293384b4eff2a34e4)

* add syscalls 451-469 for m68k linux

(backport <https://github.com/rust-lang/libc/pull/4850>)
(cherry picked from commit b841a7822732dc10f05d1f9c022a7326dc7b1bc6)

* NetBSD: Only skip `sockaddr_dl` on NetBSD9

Fixes: 8ff5e7e896f7 ("NetBSD: Increase the size of sockaddr_dl.sdl_data from 12 to 24")

(backport <https://github.com/rust-lang/libc/pull/4855>)
(cherry picked from commit 46845987076649c0458810e323162d5c8b40b61e)

* chore: release libc 0.2.178

* Update CI images to FreeBSD 15.0-release

Released yesterday.  Also, restore testing on FreeBSD i686, but on a
15.0 image instead of 13.4.

(backport <https://github.com/rust-lang/libc/pull/4857>)
(cherry picked from commit 9e5926604133219c52bd018007e018752a1146cf)

* linux, fuchsia: Mark mq_attr padding area as such

As per commit c100954964 the hard-coded partial equality implementations
have been dropped in favor for auto-generated ones, but they did not
work for mq_attr, since the padding area was not typed correctly.

Fix this, using the Padding type.

(backport <https://github.com/rust-lang/libc/pull/4858>)
(cherry picked from commit d5b0f290a1c464fecc9710bb7fb1c8e011c1314a)

* linux, android: Add a generic definition for XCASE

XCASE it's defined for all the architectures, although this is not
happening currently.

The only arch definition that has a different value is powerpc

(backport <https://github.com/rust-lang/libc/pull/4847>)
(cherry picked from commit ec63a9d1c2e98b02d32225bfc2260dcd77864a81)

* build(deps): bump vmactions/solaris-vm from 1.1.6 to 1.1.8

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.6 to 1.1.8.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.6...v1.1.8)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.1.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4851>)
(cherry picked from commit 1f0579d230da9fa7d2ef7a5c5b665594db5e6747)

* ci: Use mirrors for kernel.org in install-musl.sh

We have had a high number of CI failures in the past few days due to
errors like:

    #9 857.0 curl: (28) Failed to connect to kernel.org port 443 after 135536 ms: Couldn't connect to server
    #9 ERROR: process "/bin/sh -c /install-musl.sh arm" did not complete successfully: exit code: 28

Replace the Alpine kernel.org URLs with a rust-lang mirror to mitigate
this.

(backport <https://github.com/rust-lang/libc/pull/4860>)
(cherry picked from commit ba9759db75d9f406cad0b422443807bb93b3271c)

* ci: Relaunch `create-artifacts.py` via subprocess

There have been a number of CI issues related to creating artifacts,
where no output is produced from the script even though it seemingly
starts successfully. In case this comes from `execvpe` somehow, switch
to relaunching via subprocess.

(backport <https://github.com/rust-lang/libc/pull/4861>)
(cherry picked from commit d5a75f33f25ccf2f37b3c3eaad0466523409a8dd)

* types: Add Padding<T>::uninit()

It allows to uninitialize padding areas in const contextes.

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit e40f470032675f82bdc574bc66feb309b106f54a)

* cleanup: Declare more private padding fields Padding's

We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 69783f63079f743339f76e8358cd368d5ab714b6)

* cleanup: Also padding is padding!

As previous commit, but tackle the *padding* fields

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 0745ad49a247e40f64207c9d8d7e846b8b017784)

* cleanup: Also mark reserved fields as Padding

Some were already done, more were missing

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit e52c686941d149f50764df3a668ab7294f0df74c)

* cleanup: Also unused fields are Padding ones

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 6383ad82758910224dc6937c66a25cf9a6bafe85)

* test: Switch remaining chained `||` to `match` in build.rs

These are much easier to read and update.

(backport <https://github.com/rust-lang/libc/pull/4866>)
(cherry picked from commit 5c4255f8259298ac6ad159d1dd3a27484844d454)

* macros: Update `offset_of!`

- assert! access from core.
- nested unsafe raises an error on older rust compilers on CI.

[ re-split commits as authorized by the author, and update the commit
  summary - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4269>)
(cherry picked from commit c20475c60e3a7f5223db15c8fb3c76f67be9291f)

* adding SUN_LEN macro to linux glibc/musl

[glibc ref](https://github.com/bminor/glibc/blob/1b6f868625403d6b7683af840e87d2b18d5d7731/socket/sys/un.h#L41)
[musl ref](https://github.com/bminor/musl/blob/c47ad25ea3b484e10326f933e927c0bc8cded3da/include/sys/un.h#L24)

[ re-split commits as authorized by the author - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4269>)
(cherry picked from commit 34d6637bd07755b02b14ce1249ebe0d6a3fa48cd)

* build: Introduce `env_flag` to allow setting flags false

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 598155629d4f0b42bec72cbd2af30d0abd5e54b7)

* ci: Require specifying version in `install-musl.sh`

Getting this information from an env has been problematic since `docker
build` doesn't pass the environment. Switch to expecting an explicit arg
and fail if unset, so we don't accidentally regress.

With this change, new musl tests are correctly getting run in CI.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 29c5b94554c3c007c2a13c7d43ed15c539cf91fc)

* musl: Fix the value of `CPU_SETSIZE` on musl 1.2+

Link: https://github.com/kraj/musl/blob/ff441c9ddfefbb94e5881ddd5112b24a944dc36c/include/sched.h#L126

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 5e125a1007026a2ad86086105143409f8cf72611)

* test: Skip `input_event.time` on recent musl

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 34e758376862382e0da205c918160f398e9e72b5)

* test: musl: Skip time64-dependent API on new musl

This is all intended to be removed once the PR adding our version of
`_REDIR_TIME64` lands.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 72fe537010f9600bfedbb43af89bdb8ff967317e)

* build: Remove `RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64`

Currently this isn't used for any testing, and there isn't really a time
when it would be useful to set this: it is always set by the libc in
practice. Thus, remove it.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit a97bea577c4e5d0452805765722311b55f2735ef)

* test: Remove unneeded `unsafe` blocks

(backport <https://github.com/rust-lang/libc/pull/4868>)
(cherry picked from commit dfd6ab9a24d2a84749517d14d92a7fcf7d530c00)

* ci: Forward more RUST and CARGO env to docker

(backport <https://github.com/rust-lang/libc/pull/4868>)
(cherry picked from commit fb1901d11011ff327e1e25cc1f2a1b553f1379c6)

* ci: Forward `RUSTFLAGS` to docker via `EXTRA_RUSTFLAGS`

This needs to be a separate environment variable since otherwise it
overwrites `RUSTFLAGS` as set in CI. This is currently happening, which
is why warnings were not getting denied.

(backport <https://github.com/rust-lang/libc/pull/4871>)
(cherry picked from commit cd1d68be25bde7d992357b1257561e92dc3f0c2b)

* test: Update the `ctest` dependency

* ci: fix docker mount volumes SE-Linux enabled systems

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 789b9357bafbfa063107cffd583d2dd5dfe0f6d0)

* Separate L4Re from Linux code and enable tests

The L4Re code was previously attached to the Linux code which was not
correct in many ways. This commit separates the L4Re code and enables
the libc-tests and includes the fixes for the failing tests.

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 2fe1d91f1822bfa27e83a25ad5f817b526319f15)

* Add uclibc aarch64 support for L4Re

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 980c9230631ce75f90812a0432609c3d2d0974db)

* l4re: pthread fixes in new

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit c827adff74ff30842eb39338986f14b49d0f911f)

* linux_like: communize some structs

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 1034d7076bdc5ca3f6586ef9f1896eb40f68f505)

* Make l4re pthread struct fields private

(backport <https://github.com/rust-lang/libc/pull/4876>)
(cherry picked from commit c24866a08188df1121766142e3d587f8e3f9e378)

* Add interface LINK_STATE_* definitions from sys/net/if.h

(backport <https://github.com/rust-lang/libc/pull/4751>)
(cherry picked from commit d06928fa2091e21698049e370433419170a211ba)

* Remove nonexistent clocks on WASI

These were added way back when in #2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.

(backport <https://github.com/rust-lang/libc/pull/4880>)
(cherry picked from commit e883afcede949948e513be5ffac0a75375002a1b)

* Revert the workaround for Rust bug 132185

It's been fixed since probably sometime in February.

https://github.com/rust-lang/rust/issues/132185

(backport <https://github.com/rust-lang/libc/pull/4881>)
(cherry picked from commit a3efefee3e3a6ed1e000fa0dd1fb4077e5c867ef)

* libc-test: semver: Move Linux s390x ucontext symbols to GNU symbol list

Musl does not provide these.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>

(backport <https://github.com/rust-lang/libc/pull/4884>)
(cherry picked from commit 3d372c69e2dfff2ad70c4cdd1bd2b0ff55d5193b)

* musl: s390x: Fix definition of SIGSTKSZ/MINSIGSTKSZ

These have had the values 10240 and 4096 respectively since the introduction
of the s390x port in musl back in 2016.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>

(backport <https://github.com/rust-lang/libc/pull/4884>)
(cherry picked from commit cde9e8af47b2498f3f9d880469802ff6a370cdb3)

* Add AT_EXECVE_CHECK

(backport <https://github.com/rust-lang/libc/pull/4422>)
(cherry picked from commit ec1e1e5da4578c88ef57e35ab234eb1c55cfe83c)

* aix: Fix swapped struct/union test skips and missing `c_enum`

Closes: https://github.com/rust-lang/libc/issues/4870

[ replace the commit summary - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4874>)
(cherry picked from commit 0bd3900d54027ee439f6e7417c781671dda0ad07)

* musl: riscv: fix public padding fields in `stat/stat64`

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit de1bd4e5aae856b74a1653a8ef5a55cae55fd102)

* musl: Merge stat64 and stat with `stat`

The structures are the same - and this follows the upstream definition
On musl at least, blkcnt64_t == blkcnt_t == i64 and
ino_t == ino64_t == u64

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 9ca4ae9afacf0a66849b0a723f55c1e739d99961)

* musl: add musl_time64 feature

This feature is enabled with independently from musl_v1_2_3 to support
time64.

Defining this feature makes this roughly equivalent to upstream
commit bminor/musl@f12bd8e.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 47960b4b00cd114074faa1fff098c9dde6c32908)

* musl: time64: adjust struct timespec definition

This is equivalent to upstream commit bminor/musl@9b2921b.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit fa7e710e77f3c9025759580ccf1dbf56db343789)

* musl: time64: set link names for symbols

This corresponds to upstream commit bminor/musl@1febd21 (most symbols)
and bminor/musl@22daaea (only dlsym)

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 6fcc954468d7a2f595935f46c8f356c768b4e229)

* musl: time64: update struct sched_param

A bunch of properties were removed upstream and set to reserved.

This matches upstream commit bminor/musl@827aa8f and bminor/musl@2d69fcf

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 72a590fa1fd5faf3f947e02cda45e2b1ec165c8e)

* musl: convert inline timespecs to timespec

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 80b82d8330ac736023ce166e29c4d6160f09b0e5)

* musl: time64: change time_t type and structs

Change time_t type to i64
Change struct stat, msqid_ds and shmid_ds to reflect

This commit follows upstream bminor/musl@3814333 and bminor/musl@d6dcfe4
It also implements a fix from bminor/musl@0fbd7d6

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 793fa971aabfbadb1ef9564cdc9fcdc31f3ef636)

* musl: time64: update {IPC,MSG,SEM}_STAT definitions

This is primarily based on a small part of bminor/musl@3814333.

This also integrates bminor/musl@3c02bac, which update MSG_STAT,
SEM_STAT, SEM_STAT_ANY. These are based on the value of IPC_STAT,
however we can just use `cfg` as it is effectively the same.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 3d9801debc89299c7b4afb1cb12a647810430f94)

* semver: linux powerpc: split GNU-specific symbols into own file.

This fixes test failures on musl.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 8195473b4407f59a5e89b358485b4f55d39d5cf1)

* libc-test: add allowlist for positive s! marco configs

Namely, this allows `target_endian` as well as adds a constant array
where certain configs are explicitly allowed (e.g. musl32_time64).

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 75fb1f0658fc95b7614a6c6f0b0026389e8eefd9)

* libc-test: delete handle_s_macro_no_attrs

Unfortunately does not seem to handle cfg_if well

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 587fd843559374b9083d66fd6ecff9f831cfc671)

* Revert "test: Skip `input_event.time` on recent musl"

This reverts commit 34e758376862382e0da205c918160f398e9e72b5.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 092ccf22c974f18202a869f50e15a8f03524c3a8)

* Revert "test: musl: Skip time64-dependent API on new musl"

This reverts commit 72fe537010f9600bfedbb43af89bdb8ff967317e.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 7726e8fb57c1cdbb1a66dbb5366d19567a5f5f8c)

* newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS

(backport <https://github.com/rust-lang/libc/pull/4875>)
(cherry picked from commit fb18f2667c4adb45f46913282d5c0c48f158692d)

* getitimer and setitimer for linux

(backport <https://github.com/rust-lang/libc/pull/4890>)
(cherry picked from commit edd1b6167fd16691d371e6c5d3c4bd84b45c1f6a)

* Add NAME_MAX for Linux (like)

(backport <https://github.com/rust-lang/libc/pull/4888>)
(cherry picked from commit 9cbb6ff34cda2124fe51d388e41b34a1ca0e39ae)

* Remove `[no-mentions]` handler in our triagebot config

https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/

(backport <https://github.com/rust-lang/libc/pull/4877>)
(cherry picked from commit 6450c78a91f2632f8498c9e068de635dda978f7b)

* build(deps): bump actions/upload-artifact from 5 to 6

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4883>)
(cherry picked from commit e59cb691cc8a720f63a59769cb154bc32e5b3c41)

* Fix QNX build error

(backport <https://github.com/rust-lang/libc/pull/4879>)
(cherry picked from commit b7ee7452756c184378e3acacba7103daf3bb3b94)

* qurt: Add support for Qualcomm QuRT

The QuRT RTOS -- used primarily on the Hexagon architecture --
has support for large parts of POSIX.

(backport <https://github.com/rust-lang/libc/pull/4845>)
(cherry picked from commit 8ecae6cae62df6bf8123b87f60b964a554af1863)

* build(deps): bump vmactions/solaris-vm from 1.1.8 to 1.2.3

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.8 to 1.2.3.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.8...v1.2.3)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.2.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4900>)
(cherry picked from commit 0a5a8b65f98441cb71e7aaefd81672080d819443)

* src/new/netbsd/net/if_.rs: make if_msghdr self-tests succeed on ilp32 hosts:

This fixes the following errors from `cd libc-test; cargo test`:

    bad `if_msghdr` size: rust: 148 != c 152
    bad `if_msghdr` align: rust: 4 != c 8
and
    size of `struct if_msghdr` is 152 in C and 148 in Rust

as verified natively on NetBSD/i386 10.0 with rust 1.92.0.

Ref. https://nxr.netbsd.org/xref/src/sys/net/if.h#790 for the
original C definition of `struct if_msghdr`.

(backport <https://github.com/rust-lang/libc/pull/4902>)
(cherry picked from commit 86dbfd4cf4247c936035fd1edd8545be1f77c838)

* netbsd/mod.rs: fix so that self-tests pass on both ilp32 and lp64.

This is mostly related to siginfo_t.
An error in si_status() implementation was also fixed.

Ref. padding dependent on _LP64 in
   https://nxr.netbsd.org/xref/src/sys/sys/siginfo.h#50

and si_status() in
   https://nxr.netbsd.org/xref/src/sys/sys/siginfo.h#161

(backport <https://github.com/rust-lang/libc/pull/4904>)
(cherry picked from commit 1fab928a9996bf8189847b225140d720796a9d76)

* links old version of cf{g,s}et{i,o}speed for glibc

(backport <https://github.com/rust-lang/libc/pull/4882>)
(cherry picked from commit b5c3653c862acb20ce5686a85f400c3dba00a893)

* netbsd/mod.rs: change definition of pthread_spin_t to allow arch redefinition.

(backport <https://github.com/rust-lang/libc/pull/4899>)
(cherry picked from commit d4dd6d8d9696c42afde356413d52ad87962bf95a)

* netbsd/arm.rs: make typo corrections which make the libc-test pass.

(backport <https://github.com/rust-lang/libc/pull/4899>)
(cherry picked from commit d37e61547c3d88dd1dbfd6a753d7522712bda092)

* adding pthread_tryjoin_n/pthread_timedjoin_np to Linux.

close #4878

ref linux: https://man7.org/linux/man-pages/man3/pthread_tryjoin_np.3.html
ref freebsd: https://man.freebsd.org/cgi/man.cgi?query=pthread_np&apropos=0&sektion=3&manpath=FreeBSD+13.3-RELEASE&arch=default&format=html

(backport <https://github.com/rust-lang/libc/pull/4887>)
(cherry picked from commit ba215ffa77c864bb06d36716c36bc7a62f306c60)

* chore: release libc 0.2.179

* chore: Fix the changelog version and date for 0.2.179

* linux, l4re: address soundness issues of `CMSG_NXTHDR`

This change makes sure that the header of `next` is within max,
returning null if not. This is similar to how `glibc` does it.

No checks were previously being done to assert that `next as usize +
size_of::<cmsghdr>() < max`. Wrapping offset calculations could then
lead to buffer over-reads in the following `(*next).cmsg_len`.

[glibc ref](https://github.com/bminor/glibc/blob/b71d59074b98ad4abd23c136ec9ad4c26e29ee6d/sysdeps/unix/sysv/linux/cmsg_nxthdr.c#L49-L51)

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit cdc2077f76b91a89b47aea132209e2ad20fe94a7)

* Remove redundant CMSG_NXTHDR test assertions.

Likely written to make assertions in the unsound CMSG_NXTHDR implementations
introduced in #1235. CMSG_NXTHDR(mhdr, current_cmsghdr) should not be concerned
with the value next_cmsghdr.cmsg_len, which the previous implementation did.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 1e43edbf5599a90540e90b3333f562f1e976aaa8)

* Properly set `cmsg_len` in `CMSG_NXTHDR` tests.

Setting `(*pcmsghdr).cmsg_len = cmsg_len as _;` when cmsg_len ranges
from 0 to 64 is invalid as it must always be `>= size_of::<cmsghdr>()`,
rounded up to the nearest alignment boundary.

Some implementations (notably glbic) do check that `cmsg_len >=
size_of::<cmsghdr>()` in `CMSG_NXTHDR`, returning null if so. But
this is more so an extra precaution that is not mentioned in the POSIX
1003.1-2024. It can therefore not be relied on for tests executed on
multiple platforms.

The change also removes the ignoring of some testvalues when targeting AIX.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit f391df35f33a15ec71efc81d200d77fb30ef3bbe)

* sparc64: remove ignore for `CMSG_NXTHDR` tests

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 99280f2d94010bcd82fda687e9608fcfae9b898d)

* Test msghdr.controllen boundary behaviour for `CMSG_NXTHDR`

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 2782869da59df7386b4618614035de815c62f9e9)

* Add some context to `CMSG_NXTHDR` test assertions.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit befc34b4e4587db45bd84205a0f9ec701dcd35fc)

* linux, emscripten, android, l4re: handle zero-sized payload differences in CMSG_NXTHDR

musl and its descendants check `next_addr >= max_addr` whilst the rest
do `next_addr > max_addr`. This was previously not reflected in the
implementations, coming to light only after testing was extended to
execute at the controllen boundary.

[musl_ref]: https://www.openwall.com/lists/musl/2025/12/27/1

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 17adf2d8003fd5021358905abdfeed68d504070f)

* musl: Fix incorrect definitions of struct stat on some architectures

Fixes: #4913

(backport <https://github.com/rust-lang/libc/pull/4914>)
(cherry picked from commit ab195ebff42d2e7ed890795869882c0626fbdc4e)

* netbsd/riscv64.rs: make changes so that this builds again.

 * Use the same type names as used by the native libc, to allow
   more self-tests to succeed
 * Remove un-needed imports, uncovered by libc's "cargo test"
 * Compute _ALIGNBYTES the same way gcc does.

Verified by

 * Running (and passing) the libc self-tests "natively"
   on an emulated NetBSD/riscv64 system.
 * Cross-built rust 1.92.0 with this file in place for riscv64
   in the vendored libc-0.2.17{5,6,7} versions, targeting
   NetBSD/riscv64.

[ extracted this commit from the two in the PR - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4886>)
(cherry picked from commit e9b8fa5c93c6766cc28f4630bb69ea12ac90a77d)

* uclibc: Re-enable `__SIZEOF_PTHREAD_COND_T` on non-L4Re uclibc

Resolves a uclibc build error introduced in the "Fixes" commit.

Fixes: 2fe1d91f1822 ("Separate L4Re from Linux code and enable tests")

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit 3dad48911eb83ba149f4759191b2c4fa7d54a2d7)

* linux: Restructure `netlink` to `src/new`

Move netlink types defined in UAPI to the `new` module. This resolves
the following build error on uclibc platforms:

    error[E0425]: cannot find value `NLMSG_MIN_TYPE` in the crate root
        --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.179/src/unix/linux_like/linux/mod.rs:1999:48
         |
    1999 | pub const NFNL_MSG_BATCH_BEGIN: c_int = crate::NLMSG_MIN_TYPE;
         |                                                ^^^^^^^^^^^^^^ not found in the crate root
         |
    note: found an item that was configured out
        --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.179/src/unix/linux_like/linux_l4re_shared.rs:1222:19
         |
    1200 |     if #[cfg(not(target_env = "uclibc"))] {
         |                 ----------------------- the item is gated here
    ...
    1222 |         pub const NLMSG_MIN_TYPE: c_int = 0x10;
         |                   ^^^^^^^^^^^^^^

Fixes: 2fe1d91f1822 ("Separate L4Re from Linux code and enable tests")

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit e0ed72dc03f1d71d0ad6a014f2ef35dee4fd584d)

* linux: Move `membarrier.h` constants to `src/new`

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit 68d3a77a7db4786791c25690360edfc0e01ab574)

* Only test addresses of cmsghdrs that are multiples of the size of cmsghdr.

(backport <https://github.com/rust-lang/libc/pull/4916>)
(cherry picked from commit 85a3691237a2386116ad36b703bd0062b839043a)

* ci: Add rtems to basic tier 3 checks

(backport <https://github.com/rust-lang/libc/pull/4917>)
(cherry picked from commit b4995f36c84cb058bfba601bdd221270ffc63c29)

* qnx: add missing BPF and ifreq structures

(backport <https://github.com/rust-lang/libc/pull/4769>)
(cherry picked from commit 76344929beae4754cd762f3147b53b2525fecd56)

* chore: release libc 0.2.180

* build(deps): bump vmactions/solaris-vm from 1.2.3 to 1.2.6

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.2.3 to 1.2.6.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.2.3...v1.2.6)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.2.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4923>)
(cherry picked from commit df9237d730156a4e04b344fd9987c5935b6fb6e0)

* Add MADV_ZERO for macOS

(backport <https://github.com/rust-lang/libc/pull/4924>)
(cherry picked from commit 297f6ac59902c8ab0e0058f7f320b1c8e540e49e)

* redox: add makedev, major, minor, and fix dev_t

(backport <https://github.com/rust-lang/libc/pull/4928>)
(cherry picked from commit 76e737e6770fb97b9432600b9432beaf45763cba)

* cleanup: Also mark reserved fields as private Padding

Some were already done, more were missing

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit 2f657a93c52d361a6d463f500e3b894faabacb7e)

* cleanup: Also padding is padding!

As previous commit, but tackle the *padding* fields

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit a6e9b51424c467d98a00c4f65fb58c588152c0de)

* cleanup: Set unused fields as private Padding

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit 0cfa0b29632c8b9e5623c1641007bf87c17970da)

* cleanup: Mark the alignment fields to private

We have some leftovers of alignment data that is exposed

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit ec2139e3dae1fd53dc01234c3634b592ff382fd7)

* Make 'tv_nsec' of 'struct timespec' as type 'c_long' and use 'struct st_timespec' in 'struct stat' and 'struct stat64' to be consistent with AIX headers.

(backport <https://github.com/rust-lang/libc/pull/4931>)
(cherry picked from commit a44a76ef02388324b38884167020428aa5c29f68)

* Update SO_* constants for Fuchsia

Added SO_COOKIE, SO_TIMESTAMPNS and SO_FUCHSIA_MARK.

(backport <https://github.com/rust-lang/libc/pull/4937>)
(cherry picked from commit a940a7d6f4c2b9df9ac7012e8388ee8fee782b6d)

* qurt: Fix type visibility and defs

- Removed duplicate type definitions from legacy qurt module that conflicted
  with new module (socklen_t, in_addr_t, timespec, timeval, stat, tm, etc.)
- Add crate:: prefix to type references in submodules
- Add public re-exports for submodule contents (errno, fcntl, pthread, etc.)

Type/define fixes: ssize_t, time_t, dev_t, ino_t, stat struct, dirent, DIR
Added items from QuRT SDK: clock(), strptime(), _SC_NPROCESSORS_ONLN

(backport <https://github.com/rust-lang/libc/pull/4932>)
(cherry picked from commit 9934c04c2396ac29ca509e67346b3133f51402d2)

* Add PTRACE_SET_SYSCALL_INFO constant

(backport <https://github.com/rust-lang/libc/pull/4933>)
(cherry picked from commit 0403150379d66216e90a0f8a804ae1ca33691067)

* types: Fix wording of Padding::uninit() comment

I guess I may wanted to say two different things and then I mixed the
words in the resulting comment.

Fix the text to make it actually have a meaning

(backport <https://github.com/rust-lang/libc/pull/4941>)
(cherry picked from commit 92c51f3b37db83cf40cbe04cdaacb46ac39c6334)

* fix(redox): incorrect values for `PTHREAD_MUTEX_{NORMAL, RECURSIVE}`

See https://gitlab.redox-os.org/redox-os/relibc/-/blob/5cadc9ebbd36f5294e08f67233928e5ad6f05670/src/header/pthread/mod.rs#L60

Signed-off-by: Anhad Singh <andypython@protonmail.com>

(backport <https://github.com/rust-lang/libc/pull/4943>)
(cherry picked from commit 3482c8046a10c57391cbf0813916378dc130b293)

* linux: add CAN error types

Port libc "error.h" file for SocketCAN subsystem and expose through
can.rs.

(backport <https://github.com/rust-lang/libc/pull/4944>)
(cherry picked from commit c6ba84bd05e671c4680d464e9e7a6e3430f7c2d9)

* Add more kqueue related constants for OpenBSD

(backport <https://github.com/rust-lang/libc/pull/4945>)
(cherry picked from commit 506d591dd2a45a2dc4b08a37129217b3181831eb)

* fix(ci): update aports Git repo URL

(backport <https://github.com/rust-lang/libc/pull/4949>)
(cherry picked from commit 6ec397f84f3f8ab26139b538fbaf796bf0bc9ae9)

* Add siginfo_t::si_status

(backport <https://github.com/rust-lang/libc/pull/4946>)
(cherry picked from commit 150f1a95603523c05e32ee5045c7ce04e00c0fae)

* Fix fields

(backport <https://github.com/rust-lang/libc/pull/4946>)
(cherry picked from commit 3749159f5b5728b53d82a2ed7b…
blueos-josh-sync Bot pushed a commit to vivoblueos/bluekernel that referenced this pull request Oct 14, 2026
* ci: Switch `verify-build` to a python script

It would be nice to do a few more things with this script that are
starting to get cumbersome in bash. Switch to python so we gain some
flexibility.

There are some target inaccuracies in the lists here, but fixing these
is left for a future change.

(backport <https://github.com/rust-lang/libc/pull/4778>)
(cherry picked from commit f82e7fae815f20e1274c455fad8325b3e8541636)

* ci: Update targets in verify-build

Do a few things:

* Update the list to reflect current target tiers.
* Add some missing T2 targets (includes ohos and gnullvm).
* Remove unneeded `dist = False` and minimum toolchain config.
* Delete some `-none-` targets, which don't make use of libc.
* Add a check for duplicates.
* Re-group and sort the lists.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 24d00496c7a8ef2087a8065ca739952eb6857ba1)

* ci: Always run verify-build on Linux

Most of the targets are cross compiled anyway, and there isn't any
advantage to running on native platforms. Start running everything on
Linux which is the fastest and cheapest runner.

As part of this, introduce a way to run only half of the target list
from a single invocation. This is used to split the nightly job in two,
each now only taking about as long as the stable job.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 56b916db7e237d9259b697741550abcab9a0db29)

* ci: Print elapsed time as part of verify-build

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 5e95452b38e4051d458fe3639d64a8ca64fe5cc3)

* ci: Launch create-artifacts.py with python

We have occasional CI failures on Windows where the environment
variables don't get set so the artifact upload fails. Looking at the
logs, it doesn't even appear the create-artifact job ran (but there are
no errors). The Windows runners sometimes have trouble launching python
scripts via `./`, so switch to using the python3 executable in hopes
that this helps.

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit 962b985cfd3101715742c24f36f4c0cef4613dee)

* aix: Resolve function comparison and `unnecessary_transmutes` warnings

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit c81917388181e50c58c285b24488e7cef70fc897)

* ci: For no-dist targets, do a check rather than a full build

(backport <https://github.com/rust-lang/libc/pull/4780>)
(cherry picked from commit a53f4bc2964bbb1b594c628627cb9396ee48ba69)

* macros: Allow `s!` and `s_no_extra_traits!` to take private items

Occasionally we need to define structs that keep the expected set of
traits but aren't crate-public. Add support to the macros to do this.

(backport <https://github.com/rust-lang/libc/pull/4783>)
(cherry picked from commit cdcc46679ade1254d310b9db46224befefb9fe46)

* ci: Pass the `MUSL_V1_2_3` env in docker

This was being set as part of CI but not forwarded to the jobs. Start
passing it now.

(backport <https://github.com/rust-lang/libc/pull/4775>)
(cherry picked from commit ab130bf6df0cd664d474c6ee93a98ae3d7cad66c)

* musl: Fix skips with recent versions

It appeared that tests with the constants here were passing in CI with
new versions of musl before, but that was only because the correct
config wasn't being set. Go back to our original configuration (with
some cleanup) to resolve this.

Fixes: dd44cb603e77 ("test: linux: Unskip types and constants that are now available")

(backport <https://github.com/rust-lang/libc/pull/4775>)
(cherry picked from commit 075c1184bc803fdfc9ced147eefc318dccb53a90)

* ci: Also check builds with `musl_v1_2_3`

(backport <https://github.com/rust-lang/libc/pull/4784>)
(cherry picked from commit 7b9f8fd059a9cc4d64be801aced0019a4b62a119)

* ci: Run gnu env tests as part of the main job

Since glibc supports both 32- and 64-bit time_t and off_t without
different setup (just a header define in libc-test), these don't have
any need to be standalone jobs. Switch glibc config variants to be
checked as part of `run.sh`, which means we are now covering all 32-bit
platforms by default.

(backport <https://github.com/rust-lang/libc/pull/4785>)
(cherry picked from commit cbf2b8a94129b1ae857a0588de8465e46fd53572)

* ci: Only test against one of two musl versions

Commonize to always build 1.2.5 for tests that require a newer musl,
rather than either 1.2.3 or 1.2.5 based on the version.

(backport <https://github.com/rust-lang/libc/pull/4788>)
(cherry picked from commit 03e32e84eb6a006f8d90a5b7d8ca883d252cd735)

* Change errno EWOULDBLOCK to make it an alias of EAGAIN.

(backport <https://github.com/rust-lang/libc/pull/4790>)
(cherry picked from commit 095aae8e6f0878b3dfb8f010cd8b699c5dd2d31f)

* build(deps): bump actions/upload-artifact from 4 to 5

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4791>)
(cherry picked from commit bf2bd19d07f1fb35fa0ee2fd956962b17ad15dba)

* Add an `offset_of` macro

We can't yet use the standard library's macro since it isn't in our
MSRV, but there are a couple of applicatons for having `offset_of`
available. Add a polyfill for now.

(backport <https://github.com/rust-lang/libc/pull/4792>)
(cherry picked from commit 18083938f28c39908f487624bd96ed9a6c0c24e0)

* ci: Commonize dockerfile style

Split all dependencies to new lines and sort them, and use consistent
indentation across all files.

(backport <https://github.com/rust-lang/libc/pull/4795>)
(cherry picked from commit 2e208d03fe34ef7fe4e68e46ea7e6de227d83b4f)

* ci: Remove unused dependency installs

`linux-headers-generic` isn't needed, sparc no longer needs the
dependencies to prepare for using qemu-system, and g++ isn't needed for
platforms that have a C-only libc.

(backport <https://github.com/rust-lang/libc/pull/4795>)
(cherry picked from commit 584c1d348ca24982601568f8f46c550c0d44abbd)

* Adding defines and functions required for vxworks

Co-authored-by: Immad Mir <mirimmad17@gmail.com>

(backport <https://github.com/rust-lang/libc/pull/4781>)
(cherry picked from commit 2bee2f363b53935c9f1432ad62a582e9cb7fcb10)

* VxWorks: Mention that the release ID represents minor+patch

Link: https://github.com/rust-lang/libc/pull/4781#discussion_r2471685324

(backport <https://github.com/rust-lang/libc/pull/4781>)
(cherry picked from commit 5a1ced6e3b45e3012ef983dd8baeea40433cf135)

* doc: Fix rustdoc `bare_urls` warnings

(backport <https://github.com/rust-lang/libc/pull/4774>)
(cherry picked from commit 91fc98caa6ac1120db4bd82469398995a7775c33)

* reorg: Introduce a posix/unistd module

Create a module for common Posix-specified definitions in `unistd.h`,
which are then reexported by relevant targets. Populate this with the
`STD{IN,OUT,ERR}_FILENO` constants to start, which have posix-specified
values.

Link: https://pubs.opengroup.org/onlinepubs/007904975/basedefs/unistd.h.html

(backport <https://github.com/rust-lang/libc/pull/4774>)
(cherry picked from commit 9cf1a1c1ce89669860e3e45a28f6e8dea6573cb1)

* glibc: Initial setup of source reorganization

Establish the basic source reorganization for glibc, and seed it with a
`net/route.h` definition.

Glibc has the same headers in various locations, then copies or (I
believe) combines them in the install location based on the target
platform. To mirror this, our source primarily mirrors the glibc source
tree, then reexports things in `src/new/glibc.rs` in the same way that
glibc does when it creates an install.

(backport <https://github.com/rust-lang/libc/pull/4540>)
(cherry picked from commit 0399c4ed2ae4d3f7c3c6728b894881cd338e9520)

* ci: Skip hexagon-unknown-linux-musl

This hits an error about a duplicate fma symbol while building std.

(backport <https://github.com/rust-lang/libc/pull/4540>)
(cherry picked from commit 5a9e1db32bb09a0b23e257b65e5b5ccdf754d00e)

* ci: Re-enable ohos check builds

(backport <https://github.com/rust-lang/libc/pull/4804>)
(cherry picked from commit 4bc2673628b515e75f660b6d6d101d066b92a972)

* ohos: Don't emit duplicate lfs64 definitions

The musl module is enabled on ohos, so these are duplicates.

(backport <https://github.com/rust-lang/libc/pull/4804>)
(cherry picked from commit b30e7144278263f9fe12ad6d22c9713eeeb5dd5c)

* musl: Switch to the new structure for `socket.h`

Move `struct msghdr`, `struct cmsghdr`, `sendmmsg`, and `recvmmsg` over
at this time, as well as two `SOCK_*` constants that were in the musl
module.

Link: https://github.com/kraj/musl/blob/9f204467e88c75e36105d1359951c5857c20fe0b/include/sys/socket.h

(backport <https://github.com/rust-lang/libc/pull/4539>)
(cherry picked from commit 564e0efe817e8d2e147c21fe2227c2d78eff44ff)

* Flip `Copy` and `PartialEq, Hash` derives for packed struct support

1.63 doesn't support deriving `PartialEq` on non-`Copy` packed structs
and will error out here because it doesn't realize `Copy` is added
later. Swapping the order of the derives resolves this issue and enables
us to derive `extra_traits` even on packed structs.

(backport <https://github.com/rust-lang/libc/pull/4807>)
(cherry picked from commit 79d1bdbb07b0b782cdb7b482c6a26a81dc044fc3)

* cleanup: Use derived traits as much as possible

Historically Rust hasn't supported derives on packed structs well, and
until recently our automatic derives via `s!` still did not support
these (fixed by 79d1bdbb07b0 ("Flip `Copy` and `PartialEq, Hash`
derives")). This meant that any packed struct implementing
`extra_traits` had handwritten implementations that are no longer
needed.

There are also a handful of cases that use a handwritten implementation
in order to selectively exclude padding fields. Others don't seem to be
handwritten for any specific reason.

Clean up all of the above by switching from `s_no_extra_traits!` to `s!`
and deleting the handwritten implementations wherever possible. The only
remaining handwritten implementations are those that compare unions with
`unsafe` (which will have to be addressed) or floats.

Note that in some cases, this means we are no longer excluding padding
fields from comparisons. These traits are only usable via references,
not raw pointers; thus, the user has asserted that they are initialized,
and there is no UB in `libc` by reading them. Practically the only way
to know they are initialized is by starting with a zeroed struct, so in
most cases they will have no effect on the results. Whether or not
padding fields are included in handwritten traits is also completely
inconsistent (most include them), so there isn't much predictability
lost here.

The new `Padding` type will also improve the situation here in the
future.

(backport <https://github.com/rust-lang/libc/pull/4806>)
(cherry picked from commit 141aea1c5c1d13c6193056862a04000d860ece51)
[ note that this was very conflict-heavy so the cherry pick differs
  quite a bit from the original commit - Trevor ]

* ci: Check process output in create-artifacts

Add `check=True` to catch nonzero exit codes, and address one other lint
for unneeded collection to `list`. Additionally, add some print
statements in an attempt to help debug the CI failure on Windows.

(backport <https://github.com/rust-lang/libc/pull/4813>)
(cherry picked from commit 83bd32f8ac10bf20bba9509b06de5f242ca7c6ad)

* ci: Use a mirror for musl downloads

The musl server has been a bit flaky, so the files we needed have been
added to rust-lang mirrors. Update CI setup here to make use of them.

Link: https://github.com/rust-lang/ci-mirrors/blob/15a6d341341e858c2b7be872a47a39f546cc6759/files/libc.toml

(backport <https://github.com/rust-lang/libc/pull/4819>)
(cherry picked from commit 7c9757722c623dc87ce0f1f3bce34f1c8d93fe41)

* ci: Run semver checks even on non-host targets

Add a version of semver checks that run on non-host targets by building
rustdoc JSON output and passing that to `cargo-semver-checks`.
Unfortunately this doesn't have a way to suppress false positives, so we
need to leave the checks as optional rather than enforced for now (i.e.
the exit code isn't checked).

* ci: Add a job to ensure documentation succeeds

This is a cherry pick of 1b08efd83ae0 ("Increase the recursion limit to
fix docs.rs `ctest`") but we don't need the ctest bit, only the docs
build.

So, in essence:
(backport <https://github.com/rust-lang/libc/pull/4371>)
(cherry picked from commit 1b08efd83ae0493ff140ed89de3bc483494141e8)

* cleanup: Also use `s_no_extra_traits!` for private structs

(backport <https://github.com/rust-lang/libc/pull/4808>)
(cherry picked from commit b4cb730fde5b8eb4b3f6d094753716f0a97c1aa1)

* ci: Make clippy a required job

This was part of e09683ea3523 ("run clippy on 3 major platforms"), most
of which made it to libc-0.2. However, this line was missed.

* ci: Add testing for NetBSD

The x86-64 NetBSD target is tier 2, so we can start testing it.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit d77b8e7ff828c5de46f94c9a6997ac2e3529fe89)

* Add `core::cfg` to the prelude

This is not always present when we are building as `rustc-dep-of-std`.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 919d0d4653d7d5aa73e00d2cdfe6e29a8ff1ee59)

* test: Factor out a fallible command runner

This pattern is currently used by the `freebsd-version` check but will
be used by more in the future.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 91f208c61eb684c9ec5a5666f0dcd9168c7b5f2e)

* NetBSD: Delete items from the semver file that don't exist

Some of these may have been removed. `NI_MAXHOST` is already specified
in the unix semver file.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 60d7cccb442a3c59d2d76f6305ba1784181d30ba)

* NetBSD: riscv64: Fix the mcontext types

Currently this target fails to build.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 368df02c8d8b04f688e8de3a2a5c4338f72d8f10)

* NetBSD: Update test headers and skips

Add headers required for the new constants we have, add skips for things
we can't easily fix, and remove skips for things that now work.

Additionally, check the NetBSD version via `uname` for configuring skips
based on the tested version.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 5634c88449febdd2d722bf2008bfc29503751053)

* NetBSD: Skip tests on 9.x for network structs with alignment mismatches

These were previously packed, but this was changed in NetBSD10.

Link: https://github.com/NetBSD/src/commit/1ca39e872702d4539e8844aff15593cf4c18a1cb

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 277c0c55786e85cd966d94ffa65ce172f97c54f1)

* NetBSD: Remove IFF_NOTRAILERS

Upstream commit: https://github.com/NetBSD/src/commit/091e15265dbe2bb314cd3f15830a81f296d03f40

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 35d5592a1f9e712220203ddff65a5dc63e95c1ba)

* NetBSD: Remove `*_MAXID` constants and `AT_SUN_LDPGSIZE`

These assorted constants may have existed at some point but I can't find
any reference to them in the source repo. Remove them now.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 17727db4414aa32f7ff2bf7465a5d154682cad16)

* NetBSD: Remove `vm_size_t`

As noted, this has been deprecated a long time and is no longer present
on x86_64. Remove the typedef.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 11d36ae0efd967e52c9346778ae6ab70b505beae)

* NetBSD: Remove BPF constants

These are currently incorrect, so remove them for now. If desired, they
can be added back in the future using the `_IO*` functions.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 7de84bf0842561b85752acc29fa49803c190c745)

* NetBSD: Replace REG_ENOSYS with REG_ILLSEQ

Upstream commit: https://github.com/NetBSD/src/commit/cc8bab3745d49df3be13e903212f10c5fbee6c75

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit b038f178e2aad9ed4cbf2f2dda6b4b4ae926916a)

* NetBSD: Fix `uucred.cr_ngroups` from `int` to `short`

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/ucred.h#L52

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 3bb84ebc5566637ddb2c03b90f13d5af91066ab8)

* NetBSD: Fix the type of `kevent.udata`

This changed in 10.0. The change is ABI-compatible so we can make it
now.

This is a minor break, but should allow users to remove some special
casing on NetBSD since this brings it in line with other BSDs.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/event.h#L72

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 14f2bc5a1cfff354871167468d802f6fe2ca53a8)

* NetBSD: Fix the value of `PT_SUSPEND`

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ptrace.h#L62

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 5e47663bc529af1c1aac82f5362ce284310d696b)

* NetBSD: Fix the values of FNM_* constants

Link: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/fnmatch.h#L43-L48

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit cfb674c59dec21a10533c267b63859a45ef2eb92)

* NetBSD: Fix the type of `mcontext_t.__fpregs`

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/arch/amd64/include/mcontext.h#L59-L65

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit a47db5328b888658adc97b263d4572863b5df7f0)

* NetBSD: Increase the size of `sockaddr_dl.sdl_data` from 12 to 24

Upstream commit: https://github.com/NetBSD/src/commit/a3d9e0f54ed964e4da9d6ef05c15f769c7bc2bc9

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 8ff5e7e896f7608e60c1d71867d11017c09aeea6)

* NetBSD: Make `_cpuset` an extern type

Our definition was correct for how it is defined internally, but in the
header where it is included it is an incomplete definition.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/sched.h#L99

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 95e5cdbb0771dac53c0fe384180fa68a7339d4cd)

* NetBSD: Account for upstream changes to ptrace with LWP

Deprecate the PT_LWPINFO and PL_EVENT* constants, as well as
`ptrace_lwpinfo`.

Upstream commit: https://github.com/NetBSD/src/commit/4f79a484704c25ba5c21ab92911b2c71cf56a9dd

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit c4a86e0c19a48b0df2eba4fc186e6bd919c813b8)

* NetBSD: Introduce `statvfs.rs`

Move statvfs types to the `new` module.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/statvfs.h#L66-L101

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit c4731a0c308288626d83c6403a778c4c9328a59b)

* NetBSD: Make `statvfs.f_spare` non-public

With NetBSD10 the type changes and fields get adjusted. Make the field
nonpublic now to prepare for this change in the future.

This is a minor breaking change but means that the NetBSD10 updates will
not be breaking.

Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/statvfs.h#L94

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit d5f4354cf28a965d46876a1cf50e2896fbe1352d)

* NetBSD: Skip tests for structvfs on NetBSD10

This went through an ABI change with a symbol version in NetBSD10. Our
version still works but tests don't pass.

Link: https://github.com/NetBSD/src/commit/02cdd248ec8b17634bab40aa4f2e161a756d7fce

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit bf0f52cccfbc716cff00931062cf8b6059486b2e)

* NetBSD: Correct `ipc_perm`, split from OpenBSD as `ipc.rs`

The field ordering is incorrect on NetBSD. Move it to the `new` module
for NetBSD and OpenBSD and fix the mismatch on NetBSD.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ipc.h#L54-L68
Link: https://github.com/openbsd/src/blob/9abc5df53d8ad6b65dbd35b89ed94f73e2fc58da/sys/sys/ipc.h#L53-L61

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 066e702ac0a9e87f1cd46399122f4c64b6359faa)

* NetBSD: Introduce `utmp_.rs`, correct the definition of `lastlog`

The field order was incorrect. Update this and move it to `new`, along
with the rest of `utmp`.

As part of this, correct an incorrectly spelled `utpname` to `utmpname`.

Fixes: 42289eb64f63 "Implement utmp for NetBSD"

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 6a01e2f2c2ef65fc41b1e9db27213eefa2dbe54b)

* NetBSD: Introduce `utmpx_.rs`, correct utmpx definitions

Create a new module for `utmpx` and move definitions there, then correct
`_UTX_PADSIZE`. We can also just use `s!`, there is no need to manually
implement the traits.

NetBSD defines `_UTX_PADSIZE` manually but includes this comment in
their source:

    /*
     * This should be:
     * 40 - (sizeof(struct timeval) - sizeof(struct { long s; long u; })))
     * but g++ does not like it, to retain size compatibility with v1.00,
     * so we do it manually.
     */
    #ifdef _LP64
    #define _UTX_PADSIZE 36
    #else
    #define _UTX_PADSIZE 40
    #endif

I tried using the expression here:

    40 - (size_of::<crate::timeval>() - size_of::<(c_long, c_long)>());

But this returns a value of 8 which doesn't match the expected 36. So,
keep with their source and hardcode the values.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/include/utmpx.h#L91-L101

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 4055637d36dc795c71cea037066a42224eead2be)

* NetBSD: Introduce `types.rs`, correct the definition of `lwpid_t`

This is currently defined as an `unsigned int` but should be `int32_t`.
Also move some related definitions `new`.

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/types.h#L200

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 29464834a1aecefcd1aa14b0a89f4c23d7ee4922)

* NetBSD: Introduce `timex.rs`

Move `timex.h` types to the `new/` module.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit fb74b6f9cafdc60afebcbf7016e34daf839d99c4)

* NetBSD: Introduce `time.rs`, fix the values of `CLOCK_*_CPUTIME_ID`

Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/time.h#L305-L306

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 57213d424db1eefa76750a99a99fef57e1667caf)

* NetBSD: Introduce `if_.rs`, fix the definition of `ifreq`

The definition of `struct ifreq` didn't match up. Make a new module for
`net/if.h` and fix it there. Note that this drops some trait
implementations since the correct API involves unions.

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 8cb1db91b85ac9cd041d471a388d0a5cb90c4e1e)

* NetBSD: Correct a number of symbol link names

Relevant source:

* `devname`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/stdlib.h#L296
* `getutent`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmp.h#L70
* `ntp_gettime`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/timex.h#L257
* `sched_rr_get_interval`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/sched.h#L50-L51
* `shmctl`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/shm.h#L2011
* `sig{action,suspend}`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/signal.h#L85-L95
* `{get,set}itimer`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/time.h#L331-L335
* `timer_{get,set}time`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/time.h#L158-L160
* `utmpx` symbols: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmpx.h#L135-L150
* `wait4`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/wait.h#L209

Excluded are `__statvfs90`, `__fstatvfs90`, `__sigaction_siginfo`,
`__getmntinfo90`, `__getvfsstat90`which are only present in 10.0+ (the
symbol version seems to be N-1). Source:

* https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/statvfs.h#L160-L168

There is also a deprecated aliases that used to be needed and is removed
here.

* `__getmntinfo13`:  https://github.com/NetBSD/src/blob/62c785e59d064070166dab5d2a4492055effba89/lib/libc/compat/gen/compat___getmntinfo13.c#L49-L50

(backport <https://github.com/rust-lang/libc/pull/4782>)
(cherry picked from commit 1816f606144e0263fc2b1ed05b2f6f0e214536f2)

* NetBSD: Correct the type of `kinfo_vmentry.kve_path`

* Add missing constants from `unistd.h`

(backport <https://github.com/rust-lang/libc/pull/4811>)
(cherry picked from commit e654f3a8f08ea01ca7bb69c4ad8c962252b1807c)

* test: Upgrade ctest

* Gate `__wasilibc_register_preopened_fd` on WASI

This API is only available in WASIp1 and as the libc build for WASIp2 is
changing the symbol was recently deleted. This functionality makes sense
for WASIp1, but for WASIp2 it's a fundamentally different set of
syscalls so this is no longer provided by libc.

(backport <https://github.com/rust-lang/libc/pull/4837>)
(cherry picked from commit ca20d7d9c30f201ea7501b6fbffe00da1c9daae2)

* Fix pid_t type on redox

(backport <https://github.com/rust-lang/libc/pull/4825>)
(cherry picked from commit 33c96c930e3bd457bc06fd62241ed4f7cb0fbe16)

* build(deps): bump vmactions/solaris-vm from 1.1.5 to 1.1.6

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.5 to 1.1.6.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.5...v1.1.6)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.1.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4826>)
(cherry picked from commit 7b336ae69d21022f21a1e2a71d3e312b7d572c5b)

* Update wasi-sdk in CI, plus some script updates

* Update to wasi-sdk-29 which is the latest
* Pass `-Clink-self-contained=n` instead of
  `-Ctarget-feature=-crt-static` (which didn't work) to force using the
  external libc.

(backport <https://github.com/rust-lang/libc/pull/4837>)
(cherry picked from commit 6259f3a35fb6cde8494f12502c0428184411e731)

* DragonflyBSD: Fix the type of `mcontext_t.mc_fpregs`

* libc: add PartialEq, Eq, and Hash trait implementations for Padding.

(backport <https://github.com/rust-lang/libc/pull/4609>)
(cherry picked from commit cbc178b298c0afe83f23b90c43f6355c1fc5d9ab)

* libc: wrap padding fields with Padding newtype.

(backport <https://github.com/rust-lang/libc/pull/4609>)
(cherry picked from commit c4dcfd23f00ec3fe6b7a2a67416084c174222754)

* linux: Move Linux-specific pthread bits to the `new` module

Move `pthread_*` API in `linux_like/linux.rs` to a module in `new` and
reexport via `glibc` and `musl`. Eventually other platforms will be
ported as well.

(backport <https://github.com/rust-lang/libc/pull/4833>)
(cherry picked from commit 04c5805de39c16582afe8212fd5b0b3795280a26)

* ci: Disable tests on FreeBSD 13

These jobs almost always fail with a segfault so unfortunately aren't
very useful. There isn't anything we can do to fix them on the libc
side, given the issue comes from a kernel bug. The failing jobs have
been a source of contributor confusion, so remove them here.

Link: https://github.com/rust-lang/libc/issues/4740
Link: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285873

(backport <https://github.com/rust-lang/libc/pull/4838>)
(cherry picked from commit 7b1449ab13ec24234793ed1c1fa75b7cf08742e8)

* android: Move android-specific pthread bits to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4834>)
(cherry picked from commit af044aae8d9a5bb7f3bc50920f74769537bf3384)

* emscripten: Move emscripten-specific pthread bits to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4834>)
(cherry picked from commit 6029abbeeca7458d5ad0b463148f5ff30210188f)

* linux-like: Move pthread API in to the `new` module

(backport <https://github.com/rust-lang/libc/pull/4836>)
(cherry picked from commit bed5b8da278b105c1bf91c19786f2606048256b7)

* l4re: Update available pthread API

This is imperfect but should get things closer to what is available on
l4re's uclibc fork. Based on work by Marius Melzer [#4479].

[#4479]: https://github.com/rust-lang/libc/pull/4479

(backport <https://github.com/rust-lang/libc/pull/4836>)
(cherry picked from commit 34d8ce72d307b2432efd49038d20f059ac5f0e61)

* apple: Nest all new Apple sources in an `apple/` module

We will eventually add `libpthread`, so accommodate for that.

(backport <https://github.com/rust-lang/libc/pull/4840>)
(cherry picked from commit 4e698ae93d4de049cccde64925c11a036c1bd3f4)

* apple: Add missing pthread API to the semver lists

(backport <https://github.com/rust-lang/libc/pull/4839>)
(cherry picked from commit dc66e547de225335f5dcf91b100fa099b852c304)

* apple: Move pthread API to the `new` module

This sets up the basic structure but does not yet move all `pthread_*`
API.

(backport <https://github.com/rust-lang/libc/pull/4839>)
(cherry picked from commit ce5dc81cd72539fa1195fc2a4ea9ef1a3027f544)

* fmt: Use the same rustfmt.toml everywhere

It isn't worth keeping a separate rustfmt.toml only for ctest, so switch
to using the vertical formatting everywhere.

(backport <https://github.com/rust-lang/libc/pull/4842>)
(cherry picked from commit 04ab55dbcfaaea7e5cfbe3687c7204f86c17eac0)

* fmt: Replace style.sh with style.py

We need a bit more flexibility in the formatting, which would be
difficult to achieve with bash. Rewrite the style check to a python
script that will be easier to extend. This is also faster than using
inplace perl, an now prints a diff when semver files aren't sorted.

(backport <https://github.com/rust-lang/libc/pull/4842>)
(cherry picked from commit 9713fd10555633f22ed4eab4b46597a1ca990fec)

* macros: Take a visibility for `c_enum` variants

Accept a visibility so we are able to make some variants nonpublic. This
means that `pub` needs to be added on all variants we want to be
visible: it is more verbose, but matches how everything else works.

(backport <https://github.com/rust-lang/libc/pull/4841>)
(cherry picked from commit ba6357ef7892f3eed598822c21e8ef692caf6575)

[ Needed to drop changes to a lot of types that still use Rust `enum`s -
  Trevor ]

* ci: Update `style.py` to work with visibility on enums

E.g. the following can now be formatted correctly:

    c_enum! {
        #[repr(c_uint)]
        pub enum #anon {
            pub PTHREAD_INTROSPECTION_THREAD_CREATE = 1,
            pub PTHREAD_INTROSPECTION_THREAD_START,
            pub PTHREAD_INTROSPECTION_THREAD_TERMINATE,
            pub PTHREAD_INTROSPECTION_THREAD_DESTROY,
        }
    }

(backport <https://github.com/rust-lang/libc/pull/4841>)
(cherry picked from commit d58c1f4f9ae01648b342d7dead291d08655677c4)

* Fix test for cygwin

(backport <https://github.com/rust-lang/libc/pull/4827>)
(cherry picked from commit eb871eb941ee3c44b00beac2df20a913894437ab)

* cygwin: Add missing utmp/x.h, grp.h, and stdio.h interfaces

These constants and functions are required for building uutils-coreutils for Cygwin.

Sources:

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/cygwin/config.h#L50
https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/stdio.h#L138-L139

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/cygwin/utmp.h#L20-L33

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L21-L32

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/stdio.h#L120-L122

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/newlib/libc/include/grp.h#L64-L65

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L21-L32

https://github.com/msys2/msys2-runtime/blob/msys2-3.6.5/winsup/cygwin/include/utmpx.h#L42-L49

(backport <https://github.com/rust-lang/libc/pull/4827>)
(cherry picked from commit a3bb40e18a207d53b7eb02fdd21cf97c360aaa37)

* Make eventfd argument names match OS docs/headers

(backport <https://github.com/rust-lang/libc/pull/4830>)
(cherry picked from commit 3ff2a88d1186126e4984446f3517f29c7a9c6305)

* Define eventfd on NetBSD

Like FreeBSD but unlike OpenBSD, NetBSD supports eventfd since version
10 (September 2021, see http://netbsd.org/changes/changes-10.0.html).

I don't know enough about NetBSD to know whether all systems running
10 can be expected to have eventfd, but it's probably fine. Our GitHub
actions CI only tests NetBSD 10.1.

Ref: https://man.netbsd.org/eventfd.2
Ref: https://github.com/NetBSD/src/blob/d04b0c735abc997743bb3faa74464524cbe7becd/sys/sys/eventfd.h

(backport <https://github.com/rust-lang/libc/pull/4830>)
(cherry picked from commit 3e82c57a9b5ed872b4effdf00e8f16cbe13831d1)

* linux, android: Add definition for IUCLC

This is defined in termios-c_iflag.h (or termbits.h) and it's shared
across all the linux archs, even though it's not POSIX

(backport <https://github.com/rust-lang/libc/pull/4846>)
(cherry picked from commit fb8c00e283cf48a2a133537914bad180275d3b27)

* build(deps): bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4848>)
(cherry picked from commit 71e04e1ed98df356d49639f293384b4eff2a34e4)

* add syscalls 451-469 for m68k linux

(backport <https://github.com/rust-lang/libc/pull/4850>)
(cherry picked from commit b841a7822732dc10f05d1f9c022a7326dc7b1bc6)

* NetBSD: Only skip `sockaddr_dl` on NetBSD9

Fixes: 8ff5e7e896f7 ("NetBSD: Increase the size of sockaddr_dl.sdl_data from 12 to 24")

(backport <https://github.com/rust-lang/libc/pull/4855>)
(cherry picked from commit 46845987076649c0458810e323162d5c8b40b61e)

* chore: release libc 0.2.178

* Update CI images to FreeBSD 15.0-release

Released yesterday.  Also, restore testing on FreeBSD i686, but on a
15.0 image instead of 13.4.

(backport <https://github.com/rust-lang/libc/pull/4857>)
(cherry picked from commit 9e5926604133219c52bd018007e018752a1146cf)

* linux, fuchsia: Mark mq_attr padding area as such

As per commit c100954964 the hard-coded partial equality implementations
have been dropped in favor for auto-generated ones, but they did not
work for mq_attr, since the padding area was not typed correctly.

Fix this, using the Padding type.

(backport <https://github.com/rust-lang/libc/pull/4858>)
(cherry picked from commit d5b0f290a1c464fecc9710bb7fb1c8e011c1314a)

* linux, android: Add a generic definition for XCASE

XCASE it's defined for all the architectures, although this is not
happening currently.

The only arch definition that has a different value is powerpc

(backport <https://github.com/rust-lang/libc/pull/4847>)
(cherry picked from commit ec63a9d1c2e98b02d32225bfc2260dcd77864a81)

* build(deps): bump vmactions/solaris-vm from 1.1.6 to 1.1.8

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.6 to 1.1.8.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.6...v1.1.8)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.1.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4851>)
(cherry picked from commit 1f0579d230da9fa7d2ef7a5c5b665594db5e6747)

* ci: Use mirrors for kernel.org in install-musl.sh

We have had a high number of CI failures in the past few days due to
errors like:

    #9 857.0 curl: (28) Failed to connect to kernel.org port 443 after 135536 ms: Couldn't connect to server
    #9 ERROR: process "/bin/sh -c /install-musl.sh arm" did not complete successfully: exit code: 28

Replace the Alpine kernel.org URLs with a rust-lang mirror to mitigate
this.

(backport <https://github.com/rust-lang/libc/pull/4860>)
(cherry picked from commit ba9759db75d9f406cad0b422443807bb93b3271c)

* ci: Relaunch `create-artifacts.py` via subprocess

There have been a number of CI issues related to creating artifacts,
where no output is produced from the script even though it seemingly
starts successfully. In case this comes from `execvpe` somehow, switch
to relaunching via subprocess.

(backport <https://github.com/rust-lang/libc/pull/4861>)
(cherry picked from commit d5a75f33f25ccf2f37b3c3eaad0466523409a8dd)

* types: Add Padding<T>::uninit()

It allows to uninitialize padding areas in const contextes.

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit e40f470032675f82bdc574bc66feb309b106f54a)

* cleanup: Declare more private padding fields Padding's

We have more private fields that are padding areas that are currently
not marked as Padding, which is causing the generated Hash
and PartialEq implementations to take care of them wrongly.

Fix them

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 69783f63079f743339f76e8358cd368d5ab714b6)

* cleanup: Also padding is padding!

As previous commit, but tackle the *padding* fields

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 0745ad49a247e40f64207c9d8d7e846b8b017784)

* cleanup: Also mark reserved fields as Padding

Some were already done, more were missing

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit e52c686941d149f50764df3a668ab7294f0df74c)

* cleanup: Also unused fields are Padding ones

(backport <https://github.com/rust-lang/libc/pull/4862>)
(cherry picked from commit 6383ad82758910224dc6937c66a25cf9a6bafe85)

* test: Switch remaining chained `||` to `match` in build.rs

These are much easier to read and update.

(backport <https://github.com/rust-lang/libc/pull/4866>)
(cherry picked from commit 5c4255f8259298ac6ad159d1dd3a27484844d454)

* macros: Update `offset_of!`

- assert! access from core.
- nested unsafe raises an error on older rust compilers on CI.

[ re-split commits as authorized by the author, and update the commit
  summary - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4269>)
(cherry picked from commit c20475c60e3a7f5223db15c8fb3c76f67be9291f)

* adding SUN_LEN macro to linux glibc/musl

[glibc ref](https://github.com/bminor/glibc/blob/1b6f868625403d6b7683af840e87d2b18d5d7731/socket/sys/un.h#L41)
[musl ref](https://github.com/bminor/musl/blob/c47ad25ea3b484e10326f933e927c0bc8cded3da/include/sys/un.h#L24)

[ re-split commits as authorized by the author - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4269>)
(cherry picked from commit 34d6637bd07755b02b14ce1249ebe0d6a3fa48cd)

* build: Introduce `env_flag` to allow setting flags false

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 598155629d4f0b42bec72cbd2af30d0abd5e54b7)

* ci: Require specifying version in `install-musl.sh`

Getting this information from an env has been problematic since `docker
build` doesn't pass the environment. Switch to expecting an explicit arg
and fail if unset, so we don't accidentally regress.

With this change, new musl tests are correctly getting run in CI.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 29c5b94554c3c007c2a13c7d43ed15c539cf91fc)

* musl: Fix the value of `CPU_SETSIZE` on musl 1.2+

Link: https://github.com/kraj/musl/blob/ff441c9ddfefbb94e5881ddd5112b24a944dc36c/include/sched.h#L126

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 5e125a1007026a2ad86086105143409f8cf72611)

* test: Skip `input_event.time` on recent musl

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 34e758376862382e0da205c918160f398e9e72b5)

* test: musl: Skip time64-dependent API on new musl

This is all intended to be removed once the PR adding our version of
`_REDIR_TIME64` lands.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit 72fe537010f9600bfedbb43af89bdb8ff967317e)

* build: Remove `RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64`

Currently this isn't used for any testing, and there isn't really a time
when it would be useful to set this: it is always set by the libc in
practice. Thus, remove it.

(backport <https://github.com/rust-lang/libc/pull/4865>)
(cherry picked from commit a97bea577c4e5d0452805765722311b55f2735ef)

* test: Remove unneeded `unsafe` blocks

(backport <https://github.com/rust-lang/libc/pull/4868>)
(cherry picked from commit dfd6ab9a24d2a84749517d14d92a7fcf7d530c00)

* ci: Forward more RUST and CARGO env to docker

(backport <https://github.com/rust-lang/libc/pull/4868>)
(cherry picked from commit fb1901d11011ff327e1e25cc1f2a1b553f1379c6)

* ci: Forward `RUSTFLAGS` to docker via `EXTRA_RUSTFLAGS`

This needs to be a separate environment variable since otherwise it
overwrites `RUSTFLAGS` as set in CI. This is currently happening, which
is why warnings were not getting denied.

(backport <https://github.com/rust-lang/libc/pull/4871>)
(cherry picked from commit cd1d68be25bde7d992357b1257561e92dc3f0c2b)

* test: Update the `ctest` dependency

* ci: fix docker mount volumes SE-Linux enabled systems

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 789b9357bafbfa063107cffd583d2dd5dfe0f6d0)

* Separate L4Re from Linux code and enable tests

The L4Re code was previously attached to the Linux code which was not
correct in many ways. This commit separates the L4Re code and enables
the libc-tests and includes the fixes for the failing tests.

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 2fe1d91f1822bfa27e83a25ad5f817b526319f15)

* Add uclibc aarch64 support for L4Re

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 980c9230631ce75f90812a0432609c3d2d0974db)

* l4re: pthread fixes in new

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit c827adff74ff30842eb39338986f14b49d0f911f)

* linux_like: communize some structs

(backport <https://github.com/rust-lang/libc/pull/4479>)
(cherry picked from commit 1034d7076bdc5ca3f6586ef9f1896eb40f68f505)

* Make l4re pthread struct fields private

(backport <https://github.com/rust-lang/libc/pull/4876>)
(cherry picked from commit c24866a08188df1121766142e3d587f8e3f9e378)

* Add interface LINK_STATE_* definitions from sys/net/if.h

(backport <https://github.com/rust-lang/libc/pull/4751>)
(cherry picked from commit d06928fa2091e21698049e370433419170a211ba)

* Remove nonexistent clocks on WASI

These were added way back when in #2499 and while they may have existed
in a historical version of wasi-libc they most certainly do not exist in
the current wasi-libc. Any usage of them is already-breaking, so this
deletes these items.

(backport <https://github.com/rust-lang/libc/pull/4880>)
(cherry picked from commit e883afcede949948e513be5ffac0a75375002a1b)

* Revert the workaround for Rust bug 132185

It's been fixed since probably sometime in February.

https://github.com/rust-lang/rust/issues/132185

(backport <https://github.com/rust-lang/libc/pull/4881>)
(cherry picked from commit a3efefee3e3a6ed1e000fa0dd1fb4077e5c867ef)

* libc-test: semver: Move Linux s390x ucontext symbols to GNU symbol list

Musl does not provide these.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>

(backport <https://github.com/rust-lang/libc/pull/4884>)
(cherry picked from commit 3d372c69e2dfff2ad70c4cdd1bd2b0ff55d5193b)

* musl: s390x: Fix definition of SIGSTKSZ/MINSIGSTKSZ

These have had the values 10240 and 4096 respectively since the introduction
of the s390x port in musl back in 2016.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>

(backport <https://github.com/rust-lang/libc/pull/4884>)
(cherry picked from commit cde9e8af47b2498f3f9d880469802ff6a370cdb3)

* Add AT_EXECVE_CHECK

(backport <https://github.com/rust-lang/libc/pull/4422>)
(cherry picked from commit ec1e1e5da4578c88ef57e35ab234eb1c55cfe83c)

* aix: Fix swapped struct/union test skips and missing `c_enum`

Closes: https://github.com/rust-lang/libc/issues/4870

[ replace the commit summary - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4874>)
(cherry picked from commit 0bd3900d54027ee439f6e7417c781671dda0ad07)

* musl: riscv: fix public padding fields in `stat/stat64`

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit de1bd4e5aae856b74a1653a8ef5a55cae55fd102)

* musl: Merge stat64 and stat with `stat`

The structures are the same - and this follows the upstream definition
On musl at least, blkcnt64_t == blkcnt_t == i64 and
ino_t == ino64_t == u64

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 9ca4ae9afacf0a66849b0a723f55c1e739d99961)

* musl: add musl_time64 feature

This feature is enabled with independently from musl_v1_2_3 to support
time64.

Defining this feature makes this roughly equivalent to upstream
commit bminor/musl@f12bd8e.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 47960b4b00cd114074faa1fff098c9dde6c32908)

* musl: time64: adjust struct timespec definition

This is equivalent to upstream commit bminor/musl@9b2921b.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit fa7e710e77f3c9025759580ccf1dbf56db343789)

* musl: time64: set link names for symbols

This corresponds to upstream commit bminor/musl@1febd21 (most symbols)
and bminor/musl@22daaea (only dlsym)

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 6fcc954468d7a2f595935f46c8f356c768b4e229)

* musl: time64: update struct sched_param

A bunch of properties were removed upstream and set to reserved.

This matches upstream commit bminor/musl@827aa8f and bminor/musl@2d69fcf

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 72a590fa1fd5faf3f947e02cda45e2b1ec165c8e)

* musl: convert inline timespecs to timespec

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 80b82d8330ac736023ce166e29c4d6160f09b0e5)

* musl: time64: change time_t type and structs

Change time_t type to i64
Change struct stat, msqid_ds and shmid_ds to reflect

This commit follows upstream bminor/musl@3814333 and bminor/musl@d6dcfe4
It also implements a fix from bminor/musl@0fbd7d6

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 793fa971aabfbadb1ef9564cdc9fcdc31f3ef636)

* musl: time64: update {IPC,MSG,SEM}_STAT definitions

This is primarily based on a small part of bminor/musl@3814333.

This also integrates bminor/musl@3c02bac, which update MSG_STAT,
SEM_STAT, SEM_STAT_ANY. These are based on the value of IPC_STAT,
however we can just use `cfg` as it is effectively the same.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 3d9801debc89299c7b4afb1cb12a647810430f94)

* semver: linux powerpc: split GNU-specific symbols into own file.

This fixes test failures on musl.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 8195473b4407f59a5e89b358485b4f55d39d5cf1)

* libc-test: add allowlist for positive s! marco configs

Namely, this allows `target_endian` as well as adds a constant array
where certain configs are explicitly allowed (e.g. musl32_time64).

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 75fb1f0658fc95b7614a6c6f0b0026389e8eefd9)

* libc-test: delete handle_s_macro_no_attrs

Unfortunately does not seem to handle cfg_if well

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 587fd843559374b9083d66fd6ecff9f831cfc671)

* Revert "test: Skip `input_event.time` on recent musl"

This reverts commit 34e758376862382e0da205c918160f398e9e72b5.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 092ccf22c974f18202a869f50e15a8f03524c3a8)

* Revert "test: musl: Skip time64-dependent API on new musl"

This reverts commit 72fe537010f9600bfedbb43af89bdb8ff967317e.

(backport <https://github.com/rust-lang/libc/pull/4463>)
(cherry picked from commit 7726e8fb57c1cdbb1a66dbb5366d19567a5f5f8c)

* newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS

(backport <https://github.com/rust-lang/libc/pull/4875>)
(cherry picked from commit fb18f2667c4adb45f46913282d5c0c48f158692d)

* getitimer and setitimer for linux

(backport <https://github.com/rust-lang/libc/pull/4890>)
(cherry picked from commit edd1b6167fd16691d371e6c5d3c4bd84b45c1f6a)

* Add NAME_MAX for Linux (like)

(backport <https://github.com/rust-lang/libc/pull/4888>)
(cherry picked from commit 9cbb6ff34cda2124fe51d388e41b34a1ca0e39ae)

* Remove `[no-mentions]` handler in our triagebot config

https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/

(backport <https://github.com/rust-lang/libc/pull/4877>)
(cherry picked from commit 6450c78a91f2632f8498c9e068de635dda978f7b)

* build(deps): bump actions/upload-artifact from 5 to 6

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4883>)
(cherry picked from commit e59cb691cc8a720f63a59769cb154bc32e5b3c41)

* Fix QNX build error

(backport <https://github.com/rust-lang/libc/pull/4879>)
(cherry picked from commit b7ee7452756c184378e3acacba7103daf3bb3b94)

* qurt: Add support for Qualcomm QuRT

The QuRT RTOS -- used primarily on the Hexagon architecture --
has support for large parts of POSIX.

(backport <https://github.com/rust-lang/libc/pull/4845>)
(cherry picked from commit 8ecae6cae62df6bf8123b87f60b964a554af1863)

* build(deps): bump vmactions/solaris-vm from 1.1.8 to 1.2.3

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.1.8 to 1.2.3.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.1.8...v1.2.3)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.2.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4900>)
(cherry picked from commit 0a5a8b65f98441cb71e7aaefd81672080d819443)

* src/new/netbsd/net/if_.rs: make if_msghdr self-tests succeed on ilp32 hosts:

This fixes the following errors from `cd libc-test; cargo test`:

    bad `if_msghdr` size: rust: 148 != c 152
    bad `if_msghdr` align: rust: 4 != c 8
and
    size of `struct if_msghdr` is 152 in C and 148 in Rust

as verified natively on NetBSD/i386 10.0 with rust 1.92.0.

Ref. https://nxr.netbsd.org/xref/src/sys/net/if.h#790 for the
original C definition of `struct if_msghdr`.

(backport <https://github.com/rust-lang/libc/pull/4902>)
(cherry picked from commit 86dbfd4cf4247c936035fd1edd8545be1f77c838)

* netbsd/mod.rs: fix so that self-tests pass on both ilp32 and lp64.

This is mostly related to siginfo_t.
An error in si_status() implementation was also fixed.

Ref. padding dependent on _LP64 in
   https://nxr.netbsd.org/xref/src/sys/sys/siginfo.h#50

and si_status() in
   https://nxr.netbsd.org/xref/src/sys/sys/siginfo.h#161

(backport <https://github.com/rust-lang/libc/pull/4904>)
(cherry picked from commit 1fab928a9996bf8189847b225140d720796a9d76)

* links old version of cf{g,s}et{i,o}speed for glibc

(backport <https://github.com/rust-lang/libc/pull/4882>)
(cherry picked from commit b5c3653c862acb20ce5686a85f400c3dba00a893)

* netbsd/mod.rs: change definition of pthread_spin_t to allow arch redefinition.

(backport <https://github.com/rust-lang/libc/pull/4899>)
(cherry picked from commit d4dd6d8d9696c42afde356413d52ad87962bf95a)

* netbsd/arm.rs: make typo corrections which make the libc-test pass.

(backport <https://github.com/rust-lang/libc/pull/4899>)
(cherry picked from commit d37e61547c3d88dd1dbfd6a753d7522712bda092)

* adding pthread_tryjoin_n/pthread_timedjoin_np to Linux.

close #4878

ref linux: https://man7.org/linux/man-pages/man3/pthread_tryjoin_np.3.html
ref freebsd: https://man.freebsd.org/cgi/man.cgi?query=pthread_np&apropos=0&sektion=3&manpath=FreeBSD+13.3-RELEASE&arch=default&format=html

(backport <https://github.com/rust-lang/libc/pull/4887>)
(cherry picked from commit ba215ffa77c864bb06d36716c36bc7a62f306c60)

* chore: release libc 0.2.179

* chore: Fix the changelog version and date for 0.2.179

* linux, l4re: address soundness issues of `CMSG_NXTHDR`

This change makes sure that the header of `next` is within max,
returning null if not. This is similar to how `glibc` does it.

No checks were previously being done to assert that `next as usize +
size_of::<cmsghdr>() < max`. Wrapping offset calculations could then
lead to buffer over-reads in the following `(*next).cmsg_len`.

[glibc ref](https://github.com/bminor/glibc/blob/b71d59074b98ad4abd23c136ec9ad4c26e29ee6d/sysdeps/unix/sysv/linux/cmsg_nxthdr.c#L49-L51)

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit cdc2077f76b91a89b47aea132209e2ad20fe94a7)

* Remove redundant CMSG_NXTHDR test assertions.

Likely written to make assertions in the unsound CMSG_NXTHDR implementations
introduced in #1235. CMSG_NXTHDR(mhdr, current_cmsghdr) should not be concerned
with the value next_cmsghdr.cmsg_len, which the previous implementation did.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 1e43edbf5599a90540e90b3333f562f1e976aaa8)

* Properly set `cmsg_len` in `CMSG_NXTHDR` tests.

Setting `(*pcmsghdr).cmsg_len = cmsg_len as _;` when cmsg_len ranges
from 0 to 64 is invalid as it must always be `>= size_of::<cmsghdr>()`,
rounded up to the nearest alignment boundary.

Some implementations (notably glbic) do check that `cmsg_len >=
size_of::<cmsghdr>()` in `CMSG_NXTHDR`, returning null if so. But
this is more so an extra precaution that is not mentioned in the POSIX
1003.1-2024. It can therefore not be relied on for tests executed on
multiple platforms.

The change also removes the ignoring of some testvalues when targeting AIX.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit f391df35f33a15ec71efc81d200d77fb30ef3bbe)

* sparc64: remove ignore for `CMSG_NXTHDR` tests

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 99280f2d94010bcd82fda687e9608fcfae9b898d)

* Test msghdr.controllen boundary behaviour for `CMSG_NXTHDR`

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 2782869da59df7386b4618614035de815c62f9e9)

* Add some context to `CMSG_NXTHDR` test assertions.

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit befc34b4e4587db45bd84205a0f9ec701dcd35fc)

* linux, emscripten, android, l4re: handle zero-sized payload differences in CMSG_NXTHDR

musl and its descendants check `next_addr >= max_addr` whilst the rest
do `next_addr > max_addr`. This was previously not reflected in the
implementations, coming to light only after testing was extended to
execute at the controllen boundary.

[musl_ref]: https://www.openwall.com/lists/musl/2025/12/27/1

(backport <https://github.com/rust-lang/libc/pull/4903>)
(cherry picked from commit 17adf2d8003fd5021358905abdfeed68d504070f)

* musl: Fix incorrect definitions of struct stat on some architectures

Fixes: #4913

(backport <https://github.com/rust-lang/libc/pull/4914>)
(cherry picked from commit ab195ebff42d2e7ed890795869882c0626fbdc4e)

* netbsd/riscv64.rs: make changes so that this builds again.

 * Use the same type names as used by the native libc, to allow
   more self-tests to succeed
 * Remove un-needed imports, uncovered by libc's "cargo test"
 * Compute _ALIGNBYTES the same way gcc does.

Verified by

 * Running (and passing) the libc self-tests "natively"
   on an emulated NetBSD/riscv64 system.
 * Cross-built rust 1.92.0 with this file in place for riscv64
   in the vendored libc-0.2.17{5,6,7} versions, targeting
   NetBSD/riscv64.

[ extracted this commit from the two in the PR - Trevor ]

(backport <https://github.com/rust-lang/libc/pull/4886>)
(cherry picked from commit e9b8fa5c93c6766cc28f4630bb69ea12ac90a77d)

* uclibc: Re-enable `__SIZEOF_PTHREAD_COND_T` on non-L4Re uclibc

Resolves a uclibc build error introduced in the "Fixes" commit.

Fixes: 2fe1d91f1822 ("Separate L4Re from Linux code and enable tests")

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit 3dad48911eb83ba149f4759191b2c4fa7d54a2d7)

* linux: Restructure `netlink` to `src/new`

Move netlink types defined in UAPI to the `new` module. This resolves
the following build error on uclibc platforms:

    error[E0425]: cannot find value `NLMSG_MIN_TYPE` in the crate root
        --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.179/src/unix/linux_like/linux/mod.rs:1999:48
         |
    1999 | pub const NFNL_MSG_BATCH_BEGIN: c_int = crate::NLMSG_MIN_TYPE;
         |                                                ^^^^^^^^^^^^^^ not found in the crate root
         |
    note: found an item that was configured out
        --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.179/src/unix/linux_like/linux_l4re_shared.rs:1222:19
         |
    1200 |     if #[cfg(not(target_env = "uclibc"))] {
         |                 ----------------------- the item is gated here
    ...
    1222 |         pub const NLMSG_MIN_TYPE: c_int = 0x10;
         |                   ^^^^^^^^^^^^^^

Fixes: 2fe1d91f1822 ("Separate L4Re from Linux code and enable tests")

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit e0ed72dc03f1d71d0ad6a014f2ef35dee4fd584d)

* linux: Move `membarrier.h` constants to `src/new`

(backport <https://github.com/rust-lang/libc/pull/4915>)
(cherry picked from commit 68d3a77a7db4786791c25690360edfc0e01ab574)

* Only test addresses of cmsghdrs that are multiples of the size of cmsghdr.

(backport <https://github.com/rust-lang/libc/pull/4916>)
(cherry picked from commit 85a3691237a2386116ad36b703bd0062b839043a)

* ci: Add rtems to basic tier 3 checks

(backport <https://github.com/rust-lang/libc/pull/4917>)
(cherry picked from commit b4995f36c84cb058bfba601bdd221270ffc63c29)

* qnx: add missing BPF and ifreq structures

(backport <https://github.com/rust-lang/libc/pull/4769>)
(cherry picked from commit 76344929beae4754cd762f3147b53b2525fecd56)

* chore: release libc 0.2.180

* build(deps): bump vmactions/solaris-vm from 1.2.3 to 1.2.6

Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.2.3 to 1.2.6.
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](https://github.com/vmactions/solaris-vm/compare/v1.2.3...v1.2.6)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.2.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

(backport <https://github.com/rust-lang/libc/pull/4923>)
(cherry picked from commit df9237d730156a4e04b344fd9987c5935b6fb6e0)

* Add MADV_ZERO for macOS

(backport <https://github.com/rust-lang/libc/pull/4924>)
(cherry picked from commit 297f6ac59902c8ab0e0058f7f320b1c8e540e49e)

* redox: add makedev, major, minor, and fix dev_t

(backport <https://github.com/rust-lang/libc/pull/4928>)
(cherry picked from commit 76e737e6770fb97b9432600b9432beaf45763cba)

* cleanup: Also mark reserved fields as private Padding

Some were already done, more were missing

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit 2f657a93c52d361a6d463f500e3b894faabacb7e)

* cleanup: Also padding is padding!

As previous commit, but tackle the *padding* fields

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit a6e9b51424c467d98a00c4f65fb58c588152c0de)

* cleanup: Set unused fields as private Padding

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit 0cfa0b29632c8b9e5623c1641007bf87c17970da)

* cleanup: Mark the alignment fields to private

We have some leftovers of alignment data that is exposed

(backport <https://github.com/rust-lang/libc/pull/4922>)
(cherry picked from commit ec2139e3dae1fd53dc01234c3634b592ff382fd7)

* Make 'tv_nsec' of 'struct timespec' as type 'c_long' and use 'struct st_timespec' in 'struct stat' and 'struct stat64' to be consistent with AIX headers.

(backport <https://github.com/rust-lang/libc/pull/4931>)
(cherry picked from commit a44a76ef02388324b38884167020428aa5c29f68)

* Update SO_* constants for Fuchsia

Added SO_COOKIE, SO_TIMESTAMPNS and SO_FUCHSIA_MARK.

(backport <https://github.com/rust-lang/libc/pull/4937>)
(cherry picked from commit a940a7d6f4c2b9df9ac7012e8388ee8fee782b6d)

* qurt: Fix type visibility and defs

- Removed duplicate type definitions from legacy qurt module that conflicted
  with new module (socklen_t, in_addr_t, timespec, timeval, stat, tm, etc.)
- Add crate:: prefix to type references in submodules
- Add public re-exports for submodule contents (errno, fcntl, pthread, etc.)

Type/define fixes: ssize_t, time_t, dev_t, ino_t, stat struct, dirent, DIR
Added items from QuRT SDK: clock(), strptime(), _SC_NPROCESSORS_ONLN

(backport <https://github.com/rust-lang/libc/pull/4932>)
(cherry picked from commit 9934c04c2396ac29ca509e67346b3133f51402d2)

* Add PTRACE_SET_SYSCALL_INFO constant

(backport <https://github.com/rust-lang/libc/pull/4933>)
(cherry picked from commit 0403150379d66216e90a0f8a804ae1ca33691067)

* types: Fix wording of Padding::uninit() comment

I guess I may wanted to say two different things and then I mixed the
words in the resulting comment.

Fix the text to make it actually have a meaning

(backport <https://github.com/rust-lang/libc/pull/4941>)
(cherry picked from commit 92c51f3b37db83cf40cbe04cdaacb46ac39c6334)

* fix(redox): incorrect values for `PTHREAD_MUTEX_{NORMAL, RECURSIVE}`

See https://gitlab.redox-os.org/redox-os/relibc/-/blob/5cadc9ebbd36f5294e08f67233928e5ad6f05670/src/header/pthread/mod.rs#L60

Signed-off-by: Anhad Singh <andypython@protonmail.com>

(backport <https://github.com/rust-lang/libc/pull/4943>)
(cherry picked from commit 3482c8046a10c57391cbf0813916378dc130b293)

* linux: add CAN error types

Port libc "error.h" file for SocketCAN subsystem and expose through
can.rs.

(backport <https://github.com/rust-lang/libc/pull/4944>)
(cherry picked from commit c6ba84bd05e671c4680d464e9e7a6e3430f7c2d9)

* Add more kqueue related constants for OpenBSD

(backport <https://github.com/rust-lang/libc/pull/4945>)
(cherry picked from commit 506d591dd2a45a2dc4b08a37129217b3181831eb)

* fix(ci): update aports Git repo URL

(backport <https://github.com/rust-lang/libc/pull/4949>)
(cherry picked from commit 6ec397f84f3f8ab26139b538fbaf796bf0bc9ae9)

* Add siginfo_t::si_status

(backport <https://github.com/rust-lang/libc/pull/4946>)
(cherry picked from commit 150f1a95603523c05e32ee5045c7ce04e00c0fae)

* Fix fields

(backport <https://github.com/rust-lang/libc/pull/4946>)
(cherry picked from commit 3749159f5b5728b53d82a2ed7b…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-wasi stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants