-
Notifications
You must be signed in to change notification settings - Fork 676
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
FreeBSD's rfork wrapper proposal #2121
Conversation
src/unistd.rs
Outdated
feature! { | ||
#![feature = "process"] | ||
#[cfg(target_os = "freebsd")] | ||
pub mod rfork_freebsd { |
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.
We don't need to put it in a dedicated module, the existing 2 pub mod
within unistd.rs
are for better naming
rfork(2)
, IMHO, is good enough so we don't need this
src/unistd.rs
Outdated
/// Flags for [`rfork`] | ||
/// subset of flags supported by FreeBSD 12.x and onwards |
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.
/// Flags for [`rfork`] | |
/// subset of flags supported by FreeBSD 12.x and onwards | |
/// Flags for [`rfork`] | |
/// | |
/// subset of flags supported by FreeBSD 12.x and onwards |
We should add a newline here or the they will be rendered into a single paragraph
src/unistd.rs
Outdated
/// subset of flags supported by FreeBSD 12.x and onwards | ||
/// with a safe outcome, thus as `RFMEM` can possibly lead to undefined behavior, | ||
/// it is not in the list. And `rfork_thread` is deprecated. | ||
pub struct RforkFlags: libc::c_int { |
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.
Seems like there is a RFSIGSHARE
flag that is currently missing, though it is also not available in libc
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.
Noticed this PR rust-lang/libc#3457, thanks for doing it!
Please revert the format changes. Is it possible to add a test in |
193749b
to
1355dd0
Compare
} | ||
} | ||
|
||
feature! { |
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.
If we use a feature!
block here, why not put them all in the block?
feature! {
#![feature = "process"]
#[cfg(target_os = "freebsd")]
libc_bitflags! {
}
#[cfg(target_os = "freebsd")]
pub unsafe fn rfork(flags: RforkFlags) -> Result<ForkResult> {
}
}
No description provided.