Add utility for getting processes and process group leaders
This commit is contained in:
@@ -3,5 +3,18 @@
|
||||
|
||||
package process
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// SystemProcessID is the PID of the System/Kernel itself.
|
||||
const SystemProcessID = 0
|
||||
|
||||
func GetProcessGroupLeader(ctx context.Context, pid int) (*Process, error) {
|
||||
// On systems other than linux we just return the process with PID == pid
|
||||
return GetOrFindProcess(ctx, pid)
|
||||
}
|
||||
|
||||
func GetProcessGroupID(ctx context.Context, pid int) (int, error) {
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user