diff options
Diffstat (limited to 'src/unistd.rs')
-rw-r--r-- | src/unistd.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unistd.rs b/src/unistd.rs index 4a7903a3..04031e37 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -200,7 +200,7 @@ impl ForkResult { /// ```no_run /// use nix::unistd::{fork, ForkResult}; /// -/// match fork() { +/// match unsafe{fork()} { /// Ok(ForkResult::Parent { child, .. }) => { /// println!("Continuing execution in parent process, new child has pid: {}", child); /// } @@ -230,9 +230,9 @@ impl ForkResult { /// /// [async-signal-safe]: http://man7.org/linux/man-pages/man7/signal-safety.7.html #[inline] -pub fn fork() -> Result<ForkResult> { +pub unsafe fn fork() -> Result<ForkResult> { use self::ForkResult::*; - let res = unsafe { libc::fork() }; + let res = libc::fork(); Errno::result(res).map(|res| match res { 0 => Child, |