-
Notifications
You must be signed in to change notification settings - Fork 689
Added sys::user. #606
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
Added sys::user. #606
Conversation
Added structs defined in sys/user.h adapted to follow rust naming conventions (so user_regs_struct becomes user::Regs).
EFlags (Extended Flags) represents different flags that can be raised during execution. Implemented constants representing the possible flags as a bitflag and placed into original register structs.
Updated the changelog to reflect addition of sys/user and updated the conditional compilation to only include x86 and x86_64 and not limit based on OS.
|
||
|
||
#[repr(C)] | ||
#[cfg(any(target_arch = "x86_64"))] |
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.
This should just be #[cfg(target_arch = "x86_64")]
. You should make the same change for the rest of these in this file.
Thanks for your PR! I don't think I quite understand what this work is for. There's no functions here that produce or consume any of these values. Additionally, since all of the things you declared are safe, shouldn't they all be upstreaming into |
That makes sense. I'll fork and submit a PR for libc. Although the Eflag constants aren't defined in any system headers, I did have to check the x86 documentation for them. So are they still a good fit for libc? |
Cool, thanks @xd009642. As for the Eflag constants, you'll have to ask them. Sounds like those should go in a separate crate that defines some of those extra constants, as I imagine one exists, but I don't know which one. |
This is being upstreamed in rust-lang/libc#599. |
This has now been merged into libc. Closing the pull request. |
Thanks, @xd009642 for getting that pushed. |
Follow up question @Susurrus, does rust-nix have a gitter or is there a means to message without opening a PR or issue? |
Yeah, there's a gitter. We need to add it to our README (see #597). |
This PR adds the various register structures for the x86 and x64 architectures. the Regs struct in particular is what accessed and modified by PTRACE_GETREGS and PTRACE_SETREGS so is of particular use to people using ptrace with rust-nix.
Following review comments I'll fix them and fill in the PR number in the changelog if the changes are accepted