diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/unistd.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unistd.rs b/src/unistd.rs index be1836ad..771a50fb 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -116,6 +116,11 @@ pub fn setpgid(pid: pid_t, pgid: pid_t) -> Result<()> { let res = unsafe { libc::setpgid(pid, pgid) }; Errno::result(res).map(drop) } +#[inline] +pub fn getpgid(pid: Option<pid_t>) -> Result<pid_t> { + let res = unsafe { libc::getpgid(pid.unwrap_or(0 as pid_t)) }; + Errno::result(res) +} /// Create new session and set process group id (see /// [setsid(2)](http://man7.org/linux/man-pages/man2/setsid.2.html)). |