Skip to content

[#88] Draft of foundations for clone3() syscall & friends#115

Draft
michalfita wants to merge 1 commit into
nuta:mainfrom
michalfita:issue/88/work-on-clone-call
Draft

[#88] Draft of foundations for clone3() syscall & friends#115
michalfita wants to merge 1 commit into
nuta:mainfrom
michalfita:issue/88/work-on-clone-call

Conversation

@michalfita

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

nuta commented Dec 10, 2021

Copy link
Copy Markdown
Owner

Fantastic! I'll check this tomorrow 😃

@nuta nuta left a comment

Copy link
Copy Markdown
Owner

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.

Comment thread kernel/syscalls/clone3.rs

bitflags! {
/// Flags used by [`clone()`] system call
/// Source: `/usr/include/linux/sched.h`

Copy link
Copy Markdown
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.

Comment thread kernel/syscalls/clone3.rs
///
/// [`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
Copy Markdown
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;

Comment thread kernel/syscalls/clone3.rs

#[repr(C, align(8))]
pub struct CloneArgs {
flags: u64,

Copy link
Copy Markdown
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.

Comment thread kernel/syscalls/clone3.rs
}
}

#[repr(C, align(8))]

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