Add utility for getting processes and process group leaders

This commit is contained in:
Patrick Pacher
2023-12-19 10:26:10 +01:00
committed by Daniel
parent ceaf1546d2
commit 30fee07a89
13 changed files with 796 additions and 0 deletions

View File

@@ -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
}