Add SECBIT_ constants from securebits.h#4480
Merged
Merged
Conversation
Contributor
Author
|
I don't believe that the FreeBSD failures are due to the changes in this pull request. |
tgross35
requested changes
Jun 16, 2025
tgross35
left a comment
Contributor
There was a problem hiding this comment.
The values look good to me, but in the interest of matching the source code would you mind adding a const fn issecure_mask to do the shifts? Something like
const SECURE_NOROOT: c_int = 0;
pub const SECBIT_NOROOT: c_int = issecure_mask(SECURE_NOROOT);
// ...
const fn issecure_mask(x: c_int) -> c_int {
1 << x
}
Contributor
Author
Sure thing. Consistency with source is always great for debugging and verification. |
tgross35
approved these changes
Jul 7, 2025
tgross35
left a comment
Contributor
There was a problem hiding this comment.
Sorry, didn't see the change. Thanks!
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Jul 29, 2025
See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/securebits.h (backport <rust-lang#4480>) (cherry picked from commit f811577)
Merged
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jul 29, 2025
See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/securebits.h (backport <#4480>) (cherry picked from commit f811577)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the
SECBIT_constants for use with thePR_GET_SECUREBITSandPR_SET_SECUREBITSprctloperations.Sources
linux/securebits.h
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated