Skip to content

Commit 254ded9

Browse files
authored
Add a Safety section to rfork's docs. (#2299)
1 parent dcd30a5 commit 254ded9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/unistd.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,9 +3032,17 @@ libc_bitflags! {
30323032
feature! {
30333033
#![feature = "process"]
30343034
#[cfg(target_os = "freebsd")]
3035-
/// rfork can be used to have a tigher control about which resources child
3036-
/// and parent process will be sharing, file descriptors, address spaces
3037-
/// and child exit's behavior.
3035+
/// Like [`fork`], `rfork` can be used to have a tigher control about which
3036+
/// resources child and parent process will be sharing, file descriptors,
3037+
/// address spaces and child exit's behavior.
3038+
///
3039+
/// # Safety
3040+
///
3041+
/// The same restrictions apply as for [`fork`].
3042+
///
3043+
/// # See Also
3044+
///
3045+
/// * [rfork(2)](https://man.freebsd.org/cgi/man.cgi?query=rfork)
30383046
pub unsafe fn rfork(flags: RforkFlags) -> Result<ForkResult> {
30393047
use ForkResult::*;
30403048
let res = unsafe { libc::rfork(flags.bits()) };

0 commit comments

Comments
 (0)