Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michalfita
Copy link
Contributor

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.

@nuta
Copy link
Owner

nuta commented Dec 10, 2021

Fantastic! I'll check this tomorrow 😃

Copy link
Owner

@nuta nuta left a 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`
Copy link
Owner

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
Copy link
Owner

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.

Suggested change
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,
Copy link
Owner

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))]
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants