The value for `ClockTicks` is defined as `100` by the Linux kernel for
all currently supported architectures in Go. Therefore, there is no need
to define this constant for each architecture separately.
This fixes #260.
Signed-off-by: Thomas Hipp <thomashipp@gmail.com>
Instead of hard-coding the page size for linux systems, use Go's
`Getpagesize` function.
This resolves #258.
Signed-off-by: Thomas Hipp <thipp@suse.de>
- Creating a slice of length numFDs and later appending elements to it
results in a slice whose first numFDs elements are all nil. It is
sufficient to create a slice of zero length since we are appending
elements to it.
- The current allocation will make ret a slice of length 0. What's
needed is a slice of length len(ofs).
Before it was doing a fillFromStatus() call which was much slower
and none of the information was needed, except by the Name() func
which now will call fillFromStatus() if p.name is not set.
This allows for getting more exact information about each argument
especially if there are arguments that have spaces in them.
This was not implemented for darwin or for windows because they
both currently have not way of properly parsing the cmdline string.
Darwin parses the output of 'ps' which is already whitespace
segmented, and windows just has the cmdline string.
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