Skip to content

Conversation

eduardorittner
Copy link

Since uutils/coreutils#7676 was merged in uucore, there are now safe wrappers for getpgrp and getsid so we use them. Pgrep is the only place they are used in procps.

@eduardorittner
Copy link
Author

Note that I also found this implementation of getsid which can probably be removed since it's pretty much identical to uucore's getsid, they only change in that this returns an Option<i32> and uucore's returns Result<pid_t, Errno>

fn getsid(pid: i32) -> Option<i32> {
unsafe {
let result = libc::getsid(pid);
if Errno::last() == Errno::UnknownErrno {
Some(result)
} else {
None
}
}
}

@cakebaker
Copy link
Contributor

To make this work there has to be a new coreutils release first :|

@eduardorittner
Copy link
Author

To make this work there has to be a new coreutils release first :|

Oh ok! Sorry I saw that coreutil's latest commit is at version "0.30.0" and that procps is also using the "0.30.0" version so I thought that wasn't needed. When that happens I'll come back to this then, in the meantime do you prefer if I leave this PR open or closed?

@cakebaker
Copy link
Contributor

You can leave it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants