summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index aeda2a82..4a7359cc 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -20,6 +20,7 @@ pub enum ForkResult {
}
impl ForkResult {
+ #[inline]
pub fn is_child(&self) -> bool {
match *self {
ForkResult::Child => true,
@@ -27,11 +28,13 @@ impl ForkResult {
}
}
+ #[inline]
pub fn is_parent(&self) -> bool {
!self.is_child()
}
}
+#[inline]
pub fn fork() -> Result<ForkResult> {
use self::ForkResult::*;
let res = unsafe { libc::fork() };