Skip to content

Commit

Permalink
Added getpgrp
Browse files Browse the repository at this point in the history
  • Loading branch information
tinywombat765 committed Dec 12, 2016
1 parent 5d0b170 commit 1ba7fe0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ pub fn tcsetpgrp(fd: c_int, pgrp: pid_t) -> Result<()> {
Errno::result(res).map(drop)
}


/// Get the group id of the calling process (see
///[getpgrp(3)](http://man7.org/linux/man-pages/man3/getpgrp.3p.html)).
///
/// Get the process group id (PGID) of the calling process.
/// According to the man page it is always successful.
#[inline]
pub fn getpgrp() -> pid_t {
unsafe { libc::getpgrp() }
}

/// Get the caller's thread ID (see
/// [gettid(2)](http://man7.org/linux/man-pages/man2/gettid.2.html).
///
Expand Down

0 comments on commit 1ba7fe0

Please sign in to comment.