| 51340584 | 15-Jun-2025 |
Trevor Gross <[email protected]> |
Allow new `unpredictable_function_pointer_comparisons` lints
These appeared in a recent nightly from our `PartialEq` derives. Add `allow`s where needed to suppress them, since removing the derive wo
Allow new `unpredictable_function_pointer_comparisons` lints
These appeared in a recent nightly from our `PartialEq` derives. Add `allow`s where needed to suppress them, since removing the derive would be breaking.
(backport <https://github.com/rust-lang/libc/pull/4489>) [ applied to PSP as well - Trevor ] (cherry picked from commit e6378105c41a6bf525bd6a746db11e0c52ce172e)
show more ...
|
| c04c92ed | 02-Jun-2025 |
Trevor Gross <[email protected]> |
Replace handwritten `Debug` impls with derives
`s_no_extra_traits!` doesn't derive `Debug` so there are a lot of handwritten implementations. However, since we have a derive-like solution for unions
Replace handwritten `Debug` impls with derives
`s_no_extra_traits!` doesn't derive `Debug` so there are a lot of handwritten implementations. However, since we have a derive-like solution for unions now (printing them like an opaque struct), there really isn't any reason these can't all be derived.
Add `derive(Debug)` to `s_no_extra_traits`, still gated behind `feature = "extra_traits"`, which allows getting rid of manual implementations.
(backport <https://github.com/rust-lang/libc/pull/4471>) (cherry picked from commit 65c39bf1b0c7b904cf512280860120307d17703b)
show more ...
|
| b6971335 | 15-Apr-2025 |
Jakub Janowski <[email protected]> |
Cleanup IOCTL definitions in linux_like tree
(backport <https://github.com/rust-lang/libc/pull/4418>) (cherry picked from commit 49a6e233a085866dff1a4c410dc21d1cd96e861e) |
| a598506f | 15-Apr-2025 |
Yuri Astrakhan <[email protected]> |
chore: apply some clippy lints
(backport <https://github.com/rust-lang/libc/pull/4415>) [ drop changes around the FreeBSD version in build.rs since the logic isn't the same - Trevor ] (cherry pick
chore: apply some clippy lints
(backport <https://github.com/rust-lang/libc/pull/4415>) [ drop changes around the FreeBSD version in build.rs since the logic isn't the same - Trevor ] (cherry picked from commit a283b9e66d4a8e9371b0aa69d8534010a1c7d9e7)
show more ...
|
| 66b58759 | 14-Apr-2025 |
Yuri Astrakhan <[email protected]> |
chore: minor cleanup `mode_t` usage
`crate::mode_t` is almost never needed because it is part of prelude. Moreover, in many cases `mode_t` was already used without the prefix - thus confusing if th
chore: minor cleanup `mode_t` usage
`crate::mode_t` is almost never needed because it is part of prelude. Moreover, in many cases `mode_t` was already used without the prefix - thus confusing if they are different or not. Keeping it the same helps readability.
(backport <https://github.com/rust-lang/libc/pull/4405>) [ Resolve conflict around vxworks S_* constants - Trevor ] (cherry picked from commit 1984cc22406f45cae7d6c6e2a1d1bc3faa6dc3e8)
show more ...
|
| f9a47ac8 | 11-Apr-2025 |
Ningyuan Wang <[email protected]> |
Define SO_BINDTOIFINDEX on Android
Android supports SO_BINDTOIFINDEX since SDK level 31: https://cs.android.com/android/platform/superproject/main/+/main:prebuilts/vndk/v31/arm/include/bionic/libc/k
Define SO_BINDTOIFINDEX on Android
Android supports SO_BINDTOIFINDEX since SDK level 31: https://cs.android.com/android/platform/superproject/main/+/main:prebuilts/vndk/v31/arm/include/bionic/libc/kernel/uapi/asm-generic/socket.h;l=88;drc=684b16d3ce1e891ebe15d5678e12fa05ee6dd6e4
(backport <https://github.com/rust-lang/libc/pull/4391>) (cherry picked from commit efc694994f918f4970c6bca265b69fe42dc0cb1c)
show more ...
|
| 8b54b5cc | 03-Apr-2025 |
Jakub Janowski <[email protected]> |
if_tun.h ioctls for android
Add missing constants from linux/if_tun.h header on android platform. Mainly ioctl operation codes
(backport <https://github.com/rust-lang/libc/pull/4379>) (cherry picke
if_tun.h ioctls for android
Add missing constants from linux/if_tun.h header on android platform. Mainly ioctl operation codes
(backport <https://github.com/rust-lang/libc/pull/4379>) (cherry picked from commit 610eb02a95cd4620ef12fd54b35553c265e8c09b)
show more ...
|
| de18637f | 18-Mar-2025 |
Taiki Endo <[email protected]> |
android: Add getauxval for 32-bit targets
(backport <https://github.com/rust-lang/libc/pull/4338>) (cherry picked from commit a42eea3540fa30dbb7f672aa0bdfe6ea346b379f) |
| bbb331a9 | 14-Mar-2025 |
Michael Buesch <[email protected]> |
seccomp: Add more constants from seccomp.h
and align Android + Linux
(backport <https://github.com/rust-lang/libc/pull/4330>) (cherry picked from commit 97432d1e07ede4132410134fa02ea371729b9d6c) |
| 56330cd4 | 27-Feb-2025 |
John Baublitz <[email protected]> |
linux: Add new netlink flags
(backport <https://github.com/rust-lang/libc/pull/4288>) (cherry picked from commit 70527d14f3049fa672ca09ca0d197742b683cc1e) |
| ff174764 | 10-Mar-2025 |
Luca BRUNO <[email protected]> |
linux_like: add F_SEAL_EXEC
This flag has been introduced in Linux kernel 6.3: https://github.com/torvalds/linux/commit/6fd7353829cafc4067aad9eea0dc95da67e7df16
(backport <https://github.com/rust-l
linux_like: add F_SEAL_EXEC
This flag has been introduced in Linux kernel 6.3: https://github.com/torvalds/linux/commit/6fd7353829cafc4067aad9eea0dc95da67e7df16
(backport <https://github.com/rust-lang/libc/pull/4316>) (cherry picked from commit 61c4a0a6597174e1f6f475806e9f2467794c7f98)
show more ...
|
| 44f1f920 | 19-Jan-2025 |
David Carlier <[email protected]> |
adding if_nameindex/if_freenameindex support for Android.
[ref](https://android.googlesource.com/platform/bionic/+/master/libc/include/net/if.h#52)
close GH-4246
(backport <https://github.com/rust
adding if_nameindex/if_freenameindex support for Android.
[ref](https://android.googlesource.com/platform/bionic/+/master/libc/include/net/if.h#52)
close GH-4246
(backport <https://github.com/rust-lang/libc/pull/4247>) (cherry picked from commit 32821d48836036550dad8f0660b7527ffdc2ac08)
show more ...
|
| 24430c76 | 18-Dec-2024 |
Ivan Gankevich <[email protected]> |
Make all `major`, `minor`, `makedev` into `const fn`.
(backport <https://github.com/rust-lang/libc/pull/4208>) (cherry picked from commit 37c3333c07105cf29245941ecbbd5733ad0ddd22) |
| 01499643 | 14-Feb-2025 |
David Carlier <[email protected]> |
linux: deprecate obsolete packet filter interfaces.
sockaddr_ll/AF_PACKET are in place since Linux 2.2
(backport <https://github.com/rust-lang/libc/pull/4267>) (cherry picked from commit eb78ad0090
linux: deprecate obsolete packet filter interfaces.
sockaddr_ll/AF_PACKET are in place since Linux 2.2
(backport <https://github.com/rust-lang/libc/pull/4267>) (cherry picked from commit eb78ad0090fb2d2195bd4564368468334d399dea)
show more ...
|
| a0021d2c | 18-Feb-2025 |
Nicolas Iooss <[email protected]> |
Add recent socket timestamping flags for Linux and Android
Linux defines 3 more flags for socket option SO_TIMESTAMPING:
- SOF_TIMESTAMPING_BIND_PHC introduced in Linux 5.14 https://git.kernel.or
Add recent socket timestamping flags for Linux and Android
Linux defines 3 more flags for socket option SO_TIMESTAMPING:
- SOF_TIMESTAMPING_BIND_PHC introduced in Linux 5.14 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d463126e23f112629edb01594141ca437a92a108 - SOF_TIMESTAMPING_OPT_ID_TCP introduced in Linux 6.2 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b534dc46c8ae0165b1b2509be24dbea4fa9c4011 - SOF_TIMESTAMPING_OPT_RX_FILTER introduced in Linux 6.12 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=be8e9eb3750639aa5cffb3f764ca080caed41bd0
These flags are defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/net_tstamp.h?h=v6.13
Android C library (bionic) picked this flags up: https://android.googlesource.com/platform//bionic/+/9cdc362a2f7463670a766400defcd332a9edfe19/libc/kernel/uapi/linux/net_tstamp.h
Update Linux and Android files accordingly.
(backport <https://github.com/rust-lang/libc/pull/4273>) (cherry picked from commit d1d92db586e16f8ed1cc5e9ece79783b8b19b4ac)
show more ...
|
| e2f92909 | 04-Feb-2025 |
Aphek <[email protected]> |
Copy definitions from core::ffi and centralize them
(backport <https://github.com/rust-lang/libc/pull/4256>) (cherry picked from commit 95446f458e472511d65e560224c1b85570e50944)
[ include the neces
Copy definitions from core::ffi and centralize them
(backport <https://github.com/rust-lang/libc/pull/4256>) (cherry picked from commit 95446f458e472511d65e560224c1b85570e50944)
[ include the necessary changes for psp, which isn't part of the original commit since the target is not present on main - Trevor ]
show more ...
|
| 608f947b | 06-Feb-2025 |
xd009642 <[email protected]> |
Adds in SI and TRAP signal codes
Impacts linux and android adding in (when applicable):
* SI_ASYNCIO * SI_ASYNCNL * SI_DETHREAD * SI_KERNEL * SI_MESGQ * SI_QUEUE * SI_SIGIO * SI_TIMER * SI_TKILL *
Adds in SI and TRAP signal codes
Impacts linux and android adding in (when applicable):
* SI_ASYNCIO * SI_ASYNCNL * SI_DETHREAD * SI_KERNEL * SI_MESGQ * SI_QUEUE * SI_SIGIO * SI_TIMER * SI_TKILL * SI_USER
And also:
* TRAP_BRANCH * TRAP_BRKPT * TRAP_HWBKPT * TRAP_PERF * TRAP_TRACE * TRAP_UNK
(backport <https://github.com/rust-lang/libc/pull/4225>) (cherry picked from commit a34697a1fde98a4898d88217144d2e68cecce57c)
show more ...
|
| ab5bbaef | 05-Jan-2025 |
David Carlier <[email protected]> |
linux/android proposal to deprecate kernel modules syscalls.
they were functional up 2.6.
[create_module](https://man7.org/linux/man-pages/man2/create_module.2.html) [query_module](https://man7.org
linux/android proposal to deprecate kernel modules syscalls.
they were functional up 2.6.
[create_module](https://man7.org/linux/man-pages/man2/create_module.2.html) [query_module](https://man7.org/linux/man-pages/man2/query_module.2.html) [get_kernel_syms](https://man7.org/linux/man-pages/man2/get_kernel_syms.2.html)
(backport <https://github.com/rust-lang/libc/pull/4228>) (cherry picked from commit e84fc948d7f1f7f1a5f6c9631379f5febc2e37e3)
show more ...
|
| 49178977 | 05-Jan-2025 |
lvllvl <[email protected]> |
chore: add labels to FIXMEs
(backport <https://github.com/rust-lang/libc/pull/4230>) (cherry picked from commit 174a37cf6aecc87b8fab65152f10396b8101b878) |
| 91d0a1d9 | 03-Jan-2025 |
Dan Gohman <[email protected]> |
Move `setdomainname` and `getdomainname` into linux_like.
(backport <https://github.com/rust-lang/libc/pull/4212>) (cherry picked from commit b0d8e18801b0b8ed77cdf39fa0b58f8c0c9cef94) |
| 09e24d3a | 18-Dec-2024 |
Dan Gohman <[email protected]> |
Declare `setdomainname` and `getdomainname` on Android.
Android [supports] `setdomainname` and `getdomainname` in API level 26.
[supports] https://github.com/aosp-google/bionic/blob/28f9101d76b709f
Declare `setdomainname` and `getdomainname` on Android.
Android [supports] `setdomainname` and `getdomainname` in API level 26.
[supports] https://github.com/aosp-google/bionic/blob/28f9101d76b709febe25977f98530d77580387d1/libc/include/unistd.h#L236
(backport <https://github.com/rust-lang/libc/pull/4212>) (cherry picked from commit 7e1b5b840bac1df400aa85e2f51daad3aacfd052)
show more ...
|
| 8448147a | 18-Dec-2024 |
Taiki Endo <[email protected]> |
Define c_char at top-level and remove per-target c_char definitions
(backport <https://github.com/rust-lang/libc/pull/4202>) (cherry picked from commit 0a02b941cf105dc4d4c5b5bd1ddc7bb546ad89c9) |
| 7e761a52 | 17-Dec-2024 |
Taiki Endo <[email protected]> |
Fix c_char on various targets
- aarch64-kmc-solid_asp3 - armv7a-kmc-solid_asp3-eabi - armv7a-kmc-solid_asp3-eabihf - riscv64-linux-android - x86_64-unknown-l4re-uclibc - armv7-sony-vita-newlibeabihf
Fix c_char on various targets
- aarch64-kmc-solid_asp3 - armv7a-kmc-solid_asp3-eabi - armv7a-kmc-solid_asp3-eabihf - riscv64-linux-android - x86_64-unknown-l4re-uclibc - armv7-sony-vita-newlibeabihf - riscv32imac-unknown-nuttx-elf - riscv32imafc-unknown-nuttx-elf - riscv32imc-unknown-nuttx-elf - riscv64gc-unknown-nuttx-elf - riscv64imac-unknown-nuttx-elf - thumbv6m-nuttx-eabi - thumbv7em-nuttx-eabi - thumbv7em-nuttx-eabihf - thumbv7m-nuttx-eabi - thumbv8m.base-nuttx-eabi - thumbv8m.main-nuttx-eabi - thumbv8m.main-nuttx-eabihf - aarch64-unknown-redox - aarch64-unknown-illumos - riscv32-wrs-vxworks - riscv64-wrs-vxworks
(backport <https://github.com/rust-lang/libc/pull/4199>) (cherry picked from commit 0344a78d8ebfc3bf9c924df994541df6ac72280d)
show more ...
|
| 7457aa18 | 07-Dec-2024 |
Juan Aguilar Santillana <[email protected]> |
fix: make Debug impl for unions opaque
(backport <https://github.com/rust-lang/libc/pull/4176>) (cherry picked from commit 6faa521f32fc11db9fc43a248a64463ce288b48d)
[ resolve conflicts and update b
fix: make Debug impl for unions opaque
(backport <https://github.com/rust-lang/libc/pull/4176>) (cherry picked from commit 6faa521f32fc11db9fc43a248a64463ce288b48d)
[ resolve conflicts and update based on some main vs. 0.2 differences - Trevor ]
show more ...
|
| 108310db | 27-Nov-2024 |
Trevor Gross <[email protected]> |
Make use of the crate's prelude to replace individual imports
Automatically apply changes with the following:
#!/bin/bash
set -eux
files=()
# Types either defined in this crate o
Make use of the crate's prelude to replace individual imports
Automatically apply changes with the following:
#!/bin/bash
set -eux
files=()
# Types either defined in this crate or in `core` prelude_types=( c_char c_double c_float c_int c_longlong c_long c_short c_uchar c_uint c_ulonglong c_ulong c_ushort c_void intptr_t size_t ssize_t Clone Copy Option Send Sync )
# Reexports from core prelude_modules=( fmt hash iter mem )
# Everything in the prelude prelude=( "${prelude_types[@]}" "${prelude_modules[@]}" )
# Generate a list of all files excluding `lib.rs` (since the prelude being # defined there makes string matching weird). while IFS= read -r -d '' file; do files+=("$file") done < <(find src -name '*.rs' -not -name '*lib.rs' -not -name '*macros.rs' -not -name 'fixed_width_ints.rs' -print0)
for file in "${files[@]}"; do needs_prelude=0
# If the file already has some sort of glob import, skip it if rg --pcre2 -q 'use (crate|super)::(?!prelude).*\*' "$file"; then continue fi
# Core types always require the prelude to handle rustc-dep-of-std if rg --pcre2 -q '\b(?<!\.)(Option|Clone|Copy|Send|Sync|fmt|hash|iter|mem)\b' "$file"; then needs_prelude=1 fi
# If we use any types that are specified in the prelude then we will import it for ty in "${prelude[@]}"; do # If the type is defined in the current module, we don't need it from the prelude if rg -q "type $ty =" "$file"; then continue fi
if rg -qU '((crate|super)::'"$ty"'|use (crate|super)::(\{\n){0,2}.*'"$ty)" "$file"; then needs_prelude=1 fi done
# Check if the prelude is needed and does not already exist; if so, add it if [ "$needs_prelude" = "1" ] && ! rg -q 'use crate::prelude::\*' "$file"; then # Split the file into two parts: module-level attributes and rest # Imports will be added after module-level attributes
attrs=$(awk '/^#!|^\/\/!/ {found=NR} {lines[NR]=$0} END {for (i=1; i<=found; i++) print lines[i]}' "$file") rest=$(awk '/^#!|^\/\/!/ {found=NR} END {if (found) {for (i=found+1; i<=NR; i++) print lines[i]} else {for (i=1; i<=NR; i++) print lines[i]}} {lines[NR]=$0}' "$file")
printf "%s\n" "$attrs" > "$file" printf "\n%s\n\n" "use crate::prelude::*;" >> "$file" printf "%s" "$rest" >> "$file" fi
for ty in "${prelude[@]}"; do export TY="$ty" # env for perl to use
# Remove simple imports `use crate::ty;` perl -pi -0777 -e 's/use ((crate|super)::)?($ENV{TY});//g' "$file"
# Remove the type if it is part of a group import perl -pi -0777 -e 's/(use (crate|super)::\{?(.*|(\n.*){0,2}))\b$ENV{TY}\b,? ?/$1/g' "$file"
# Replace pathed `crate::ty` perl -pi -0777 -e 's/(crate|super)::($ENV{TY})\b/$2/g' "$file" done
# For some reason, rustfmt doesn't trim leading newlines. Do so manually here. perl -pi -0777 -e 's/\A\n+//' "$file"
rustfmt "$file" done
./ci/style.sh
(backport <https://github.com/rust-lang/libc/pull/4161>) (cherry picked from commit f8a018a8e3efaf8cc4fbad84974255b0fa899fc2)
Applied by rerunning the script rather than resolving conflicts manually.
show more ...
|