Closed sjchoure closed 3 years ago
@saviourcode i would highly suggest you add a os check (using GOOS ) and then slice of PID 0 if its windows
@saviourcode i would highly suggest you add a os check (using GOOS ) and then slice of PID 0 if its windows
Yeah, that way is more acceptable and maintainable in long run, rather than slicing random PID: 0, 😃 Okay I will make the changes.
Describe the bug Since the PID of system processes in Windows and Unix differ, for example,
PID 0
andPID 1
in *nix are given to the Scheduler and the Init Process respectively. Note: Unix PID starts from 1PID 0
andPID 4
in Windows are given to the System Idle Process and the Init Process respectively. Note: Windows PID starts from 4So, the System Idle Process in Windows is generally not accessible by the userland programs not even by the administrative privileges.
To Reproduce Steps to reproduce the behavior:
Expected behavior
Additional context (Optional) The solution is to slice off the PID = 0 if present in the
Processes
Slice inside thememory.go
file. This result in the desired output without the error as follows:Note: We still require to "Run as an Admin" to get the desired result