Skip to content

linux: Add devmem constants and structs #4299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

tammela
Copy link
Contributor

@tammela tammela commented Mar 5, 2025

Description

Adds devmem constants and structs. Devmem was merged recently (6.12).
I had also add all the other missing SO_ constants for completion.
As usual, musl is way behind (even on 1.2) so all of these will be skipped there.

Sources

https://github.com/torvalds/linux/blob/c0d35086a21b8d5536da5029fd76b9aeecf3217d/include/uapi/asm-generic/socket.h#L125
https://github.com/torvalds/linux/blob/c0d35086a21b8d5536da5029fd76b9aeecf3217d/include/uapi/linux/uio.h#L23

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Implementation LGTM. Could you add permalinks to the headers in the PR description and fix the style failure?

@tgross35
Copy link
Contributor

tgross35 commented Mar 7, 2025

Thanks!

@rustbot label +stable-nominated

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Mar 7, 2025
@tgross35 tgross35 enabled auto-merge March 7, 2025 20:05
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Are SO_RESERVE_MEM and similar available on sparc? CI seems to think they aren't. If they are more recent, the test crate's build script will need to be updated.

@tammela
Copy link
Contributor Author

tammela commented Mar 10, 2025

My guess is that there will one more architecture that this PR will be break.
Anyways I posted this: #4317
Should fix for sparc and reactivate testing on s390x.

tammela added 2 commits March 11, 2025 03:21
The devmem constants requires headers >= 6.12 on gnu libc.
Musl hardcodes these constants into "sys/socket.h", which are not yet present.

For reference:
   https://elixir.bootlin.com/linux/v6.13.5/source/include/uapi/asm-generic/socket.h#L142

Signed-off-by: Pedro Tammela <[email protected]>
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Looks like things are passing now, thanks for the CI fix!

@tgross35 tgross35 added this pull request to the merge queue Mar 11, 2025
Merged via the queue into rust-lang:main with commit 0ad0aa6 Mar 11, 2025
43 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 11, 2025
The devmem constants requires headers >= 6.12 on gnu libc.
Musl hardcodes these constants into "sys/socket.h", which are not yet present.

For reference:
   https://elixir.bootlin.com/linux/v6.13.5/source/include/uapi/asm-generic/socket.h#L142

Signed-off-by: Pedro Tammela <[email protected]>

(backport <rust-lang#4299>)
(cherry picked from commit ae98edd)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 11, 2025
@tgross35 tgross35 mentioned this pull request Mar 11, 2025
@tgross35 tgross35 removed the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Mar 11, 2025
@tgross35 tgross35 added the stable-applied This PR has been cherry-picked to libc's stable release branch label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-linux O-mips O-sparc O-unix S-waiting-on-author 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