/// Get the process group ID of the calling process.
///
/// # Examples
///
/// ```
/// let pgroup = unsafe { nc::getpgrp() };
/// assert!(pgroup > 0);
/// ```
#[must_use]
pub unsafe fn getpgrp() -> pid_t {
// This function is always successful.
syscall0(SYS_GETPGRP).unwrap_or_default() as pid_t
}