mitchellh / go-ps

Find, list, and inspect processes from Go (golang).
MIT License
1.46k stars 250 forks source link

Add netbsd support via mount_procfs(8) #59

Open iamleot opened 2 years ago

iamleot commented 2 years ago

This PR adds NetBSD support via mount_procfs(8).

Completely based on Linux one.

(It would be probably better to avoid mount_procfs(8) because on some setup it can be not present (i.e. procfs is optional) but that's a possible starting point in order to make go-ps working on NetBSD too!)

iamleot commented 2 years ago

Here a complete transcript of corresponding go test -v:

$ go test -v
=== RUN   TestFindProcess
--- PASS: TestFindProcess (0.00s)
=== RUN   TestProcesses
--- PASS: TestProcesses (0.01s)
=== RUN   TestUnixProcess_impl
--- PASS: TestUnixProcess_impl (0.00s)
PASS
ok      github.com/mitchellh/go-ps      0.013s