summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorKamal Marhubi <kamal@marhubi.com>2016-03-30 14:53:38 -0400
committerKamal Marhubi <kamal@marhubi.com>2016-03-30 14:53:38 -0400
commitc2f8bb71110b894cf165967a20ee321a5766e7fb (patch)
tree0b9aa7aad7c38a59c6fde1787d0f913835846f84 /src/unistd.rs
parentc2acb9ec6e1d9fe040b761ed026a9646edbba9ec (diff)
downloadnix-c2f8bb71110b894cf165967a20ee321a5766e7fb.zip
unistd: Mark fork() and related methods as #[inline]
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() };