-
Notifications
You must be signed in to change notification settings - Fork 666
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
feat(sys): High-level personality(2) wrappers #1331
Conversation
src/sys/personality.rs
Outdated
|
||
libc_bitflags! { | ||
pub struct Persona: c_ulong { | ||
ADDR_COMPAT_LAYOUT as c_ulong; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N.B.: These casts won't be necessary if/when rust-lang/libc#1974 lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be worthwhile. It just needs a few things:
- To be rebased once the libc PR lands
- tests (doc tests are ok)
- CHANGELOG entry
Sounds good; I can do all of those. |
Okay, I've added some doctests and a CHANGELOG entry. I'll also rebase once that PR goes through. |
This looks good. You'll also need to rebase to pick up a Nix fix for those libc deprecations. |
Looks like musl libc doesn't support some of these persona values, so I went ahead and Upsteam musl change: https://www.openwall.com/lists/musl/2020/11/18/1 Edit: This was merged. At some point in this distant future, musl users will be able to use these with |
Last CI failure looks unrelated:
|
Please rebase to fix the CHANGELOG. |
I've updated this PR to not be blocked on libc: the signature of |
lol. The C API doesn't make much sense, then. |
This looks good now. It just needs a squash. And you'll probably want to rebase at the same time, or you may get blocked waiting for Travis. |
Yep. My educated guess is that it's
👍 I'll squash and rebase tomorrow. |
Okay, squashed and rebased. Let me know if there's anything else (&c &c) |
Unrelated failure?
|
Try rebasing again. |
Rebased! |
Adds a high level `Persona` bitflags enum, as well as `personality::get()` and `personality::set()` for interacting with `libc::personality()`.
(Same unrelated failure as before). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Adds a high level
Persona
bitflags enum, as well aspersonality::get()
andpersonality::set()
for interacting withlibc::personality()
.Closes #1330.
See also rust-lang/libc#1974.