Skip to content

Commit 81116e4

Browse files
committed
(temp) using syscall to get pgid and sid
1 parent 4b0890f commit 81116e4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

process.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Process interface {
1616
// PPid is the parent process ID for this process.
1717
PPid() int
1818

19-
// Pgid is the process group ID of the process
19+
// Pgrp is the process group ID of the process
2020
Pgrp() int
2121

2222
// Sid is the session ID of the process

process_darwin.go

+4
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ func processes() ([]Process, error) {
7373

7474
darwinProcs := make([]Process, len(procs))
7575
for i, p := range procs {
76+
pgid, _ := syscall.Getpgid(int(p.Pid))
77+
sid, _ := syscall.Getsid(int(p.Pid))
7678
darwinProcs[i] = &DarwinProcess{
7779
pid: int(p.Pid),
7880
ppid: int(p.PPid),
81+
pgrp: pgid,
82+
sid: sid,
7983
binary: darwinCstring(p.Comm),
8084
}
8185
}

0 commit comments

Comments
 (0)