1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

uucore: add safe wrapper for getpgrp() (#7676)

* uucore: add safe wrapper for getpgrp()

* add getpgrp to the spell ignore

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
This commit is contained in:
Eduardo Rittner Coelho 2025-05-04 11:13:13 -07:00 committed by GitHub
parent 6d29b7b3c1
commit 99ca58a7ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (vars) cvar exitstatus cmdline kworker getsid getpid
// spell-checker:ignore (sys/unix) WIFSIGNALED ESRCH
// spell-checker:ignore pgrep pwait snice
// spell-checker:ignore pgrep pwait snice getpgrp
use libc::{gid_t, pid_t, uid_t};
#[cfg(not(target_os = "redox"))]
@ -23,6 +23,12 @@ pub fn geteuid() -> uid_t {
unsafe { libc::geteuid() }
}
/// `getpgrp()` returns the process group ID of the calling process.
/// It is a trivial wrapper over libc::getpgrp to "hide" the unsafe
pub fn getpgrp() -> pid_t {
unsafe { libc::getpgrp() }
}
/// `getegid()` returns the effective group ID of the calling process.
pub fn getegid() -> gid_t {
unsafe { libc::getegid() }