Commit Graph

11 Commits (dependabot/go_modules/github.com/tklauser/go-sysconf-0.3.15)

Author SHA1 Message Date
Lomanic 76ccf0d220 [process][darwin][freebsd][linux][openbsd] Make process.Children not reliant on pgrep
pgrep -P $PID exits with status of 1 (and nothing in stdout nor stderr) both if
a process doesn't exist or it doesn't have child processes, so we don't
use it anymore on these OSes. We sort PIDs as pgrep did.

Also deprecate the ErrorNoChildren error when there are no child processes,
this is erroneous (simply check for the length of the returned slice, plus
this is not an error per se), this was only returned on linux anyway.

Fixes #1698
shirou bc060cc227 add SPDX License, remove old build tag, and replace import
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
Matthieu MOREL 851bffc0f1
enable gosec linter
mmorel-35 1e6b445a8a gofumpt
Ville Skyttä ce9d35436e Merge variable declaration with assignment
Lomanic 0e0dd767df [process][darwin] Fix #670 remove call to common.Pipeline (prone to race condition)
Also properly parse lsof to get second txt record instead of hoping the 5th line is the right one (wrong data returned for pid 57)
shirou 145dca90f7 change to use CommandContext.
Marco Pfatschbacher b4846b445b Add support for OpenBSD/amd64
This code is based on the FreeBSD version
and implements roughly the same feature set.
Shirou WAKAYAMA dd13300833 process[linux,freebsd,darwin]: implements Children using pgrep.
Daniel Theophanes 0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100