mirror of https://github.com/shirou/gopsutil
Remove CGO bits from process_openbsd.go (also v3)
Prior to this commit CGO was used in OpenBSD implementation of Process.CmdlineSliceWithContext() for parsing the "kern.proc.args" sysctl output. It requires some pointer arithmetics and raw pointer dereferencing. Having CGO in the "process" module prevents it from being go vet'ted on any platform other than OpenBSD. In order to overcome this limitation, the sysctl output parsing was reimplemented without raw pointer deferencing. The resulting code might be slightly slower than the original one, but it is cleaner and safer. Since this fix allows go vet with GOOS=openbsd to run without any issues on all platforms, openbsd entries were also added to the "vet" Makefile target. Co-authored-by: Sergey Vinogradov <cbrpnk@gmail.com>pull/1087/head
parent
b49f37e9f3
commit
d6e0932b96
Loading…
Reference in New Issue