Skip to content

Commit c3d3344

Browse files
uucore: add safe wrapper for getpgrp()
1 parent 181885b commit c3d3344

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/uucore/src/lib/features/process.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ pub fn geteuid() -> uid_t {
2323
unsafe { libc::geteuid() }
2424
}
2525

26+
/// `getpgrp()` returns the process group ID of the calling process.
27+
/// It is a trivial wrapper over libc::getpgrp to "hide" the unsafe
28+
pub fn getpgrp() -> pid_t {
29+
unsafe { libc::getpgrp() }
30+
}
31+
2632
/// `getegid()` returns the effective group ID of the calling process.
2733
pub fn getegid() -> gid_t {
2834
unsafe { libc::getegid() }

0 commit comments

Comments
 (0)