feat(sys): High-level personality(2) wrappers#1331
feat(sys): High-level personality(2) wrappers#1331bors[bot] merged 1 commit intonix-rust:masterfrom trailofbits:ww/personality
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.
N.B.: These casts won't be necessary if/when rust-lang/libc#1974 lands.
asomers
left a comment
There was a problem hiding this comment.
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). |
Adds a high level
Personabitflags enum, as well aspersonality::get()andpersonality::set()for interacting withlibc::personality().Closes #1330.
See also rust-lang/libc#1974.