-
Notifications
You must be signed in to change notification settings - Fork 87
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
[#88] Draft of foundations for clone3()
syscall & friends
#115
base: main
Are you sure you want to change the base?
Conversation
Fantastic! I'll check this tomorrow 😃 |
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.
Thank you for the great work! Generally looks good to me so I'll leave just some nitpicks.
|
||
bitflags! { | ||
/// Flags used by [`clone()`] system call | ||
/// Source: `/usr/include/linux/sched.h` |
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.
Please avoid copying from the Linux source code even for a definition like this. Please refer musl instead.
/// | ||
/// [`clone()`]: https://linux.die.net/man/2/clone | ||
pub struct CloneFlags : c_uint { | ||
const CLONE_VM = 0x00000100; // set if VM shared between processes |
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.
Please avoid adding a comment at the end of the line and add a full stop at the end of the comment.
const CLONE_VM = 0x00000100; // set if VM shared between processes | |
/// Set if VM shared between processes. | |
const CLONE_VM = 0x00000100; |
|
||
#[repr(C, align(8))] | ||
pub struct CloneArgs { | ||
flags: u64, |
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.
Nit: Use rustfmt
for formatting.
} | ||
} | ||
|
||
#[repr(C, align(8))] |
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.
Nit: Why do you need align(8)
here?
This is draft for bringing in resolution for #88. The whole work is pretty complex, so probably would need to be split into pieces. I already defined a few things to fix first for get this any further.
I don't have much time to work on it, but I'll tray to add bits into it as time allows. Till then please look and comment.
Any input appreciated.