From a2185ea0c27d0a9a4ac9a683a5aeb37510632428 Mon Sep 17 00:00:00 2001 From: Brian Shumate Date: Sun, 20 Aug 2017 19:20:35 -0400 Subject: [PATCH 1/7] Add GoDoc link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e8baf9..4e3d0e1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Process List Library for Go +# Process List Library for Go [![GoDoc](https://godoc.org/github.com/mitchellh/go-ps?status.png)](https://godoc.org/github.com/mitchellh/go-ps) go-ps is a library for Go that implements OS-specific APIs to list and manipulate processes in a platform-safe way. The library can find and From 32d76597b274fe874d3e8e89be19315b7b713207 Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Wed, 5 Dec 2018 21:46:19 +0800 Subject: [PATCH 2/7] Remove amd64 directive It also works on i386 architecture. --- process_freebsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_freebsd.go b/process_freebsd.go index 0212b66..130acbe 100644 --- a/process_freebsd.go +++ b/process_freebsd.go @@ -1,4 +1,4 @@ -// +build freebsd,amd64 +// +build freebsd package ps From 79a12729eb74ef3af12c8493176467be77a20204 Mon Sep 17 00:00:00 2001 From: dmitri Date: Thu, 17 Oct 2019 20:29:16 +0200 Subject: [PATCH 3/7] It is not mandatory to verify whether the file in /proc is a directory - simple numeric name check should suffice. Otherwise, it is pretty problematic to query processes on systems with SELinux in enforcing mode as it is complicated to open access to _all_ files inside proc. The reason this catch-all access is required is that with os.Readdir it needs to lstat each entry to return os.FileInfo and this requires additional permissions on each disperate file type inside /proc which is not easy to catch with an attribute (as it is with processes). --- process_unix.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/process_unix.go b/process_unix.go index 3b733ce..cd217a8 100644 --- a/process_unix.go +++ b/process_unix.go @@ -56,7 +56,7 @@ func processes() ([]Process, error) { results := make([]Process, 0, 50) for { - fis, err := d.Readdir(10) + names, err := d.Readdirnames(10) if err == io.EOF { break } @@ -64,14 +64,8 @@ func processes() ([]Process, error) { return nil, err } - for _, fi := range fis { - // We only care about directories, since all pids are dirs - if !fi.IsDir() { - continue - } - + for _, name := range names { // We only care if the name starts with a numeric - name := fi.Name() if name[0] < '0' || name[0] > '9' { continue } From 91629f07a773bde3581a3e817e3a5ff9f4216a5e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 3 Feb 2020 12:01:47 -0800 Subject: [PATCH 4/7] add go.mod --- go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0343279 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/mitchellh/go-ps + +go 1.13 From a5188665a900aa7b000c244634df03cc26be2dfe Mon Sep 17 00:00:00 2001 From: santosh653 <70637961+santosh653@users.noreply.github.com> Date: Thu, 12 Nov 2020 03:25:56 -0500 Subject: [PATCH 5/7] Update .travis.yml Adding Power Support --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8f794f7..e8744e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ +arch: + - amd64 + - ppc64le + language: go go: From 00c9d51b432e7e998ce7c7b2644cf59a5d33adf7 Mon Sep 17 00:00:00 2001 From: santosh653 <70637961+santosh653@users.noreply.github.com> Date: Thu, 12 Nov 2020 03:28:37 -0500 Subject: [PATCH 6/7] Update .travis.yml Updating go version to 1.13 as the lower versions are not supported. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e8744e5..ffdbccb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ arch: language: go go: - - 1.2.1 + - 1.13 From de940c598158ed7ce06e7cc3930307b9261cf96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sun, 23 Apr 2023 09:19:41 -1000 Subject: [PATCH 7/7] Adjust go.mod for the fork --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0343279..ef9cd7e 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/mitchellh/go-ps +module github.com/goss-org/go-ps go 1.13