#include <libproc2/misc.h> Platform Particulars
procps_hertz_get() returns the number of clock ticks per second as sysconf(_SC_CLK_TCK) or an assumed 100. Dividing tics by this value yields seconds.
procps_pid_length() returns the maximum string length for a PID on the system. For example, if the largest possible PID value on was 123, then the length would be 3. If the file /proc/sys/kernel/pid_max is unreadable, the value is assumed to be 5.
procps_linux_version() returns the current Linux version as an encoded integer. On non-Linux systems that have an emulated proc filesystem this function returns the version of the Linux emulation instead. The version consists of three positive integers representing the major, minor and patch levels. The following macros are provided for encoding a given Linux version or separating out the components of the current version.
LINUX_VERSION( major , minor , patch )
LINUX_VERSION_MAJOR( ver )
LINUX_VERSION_MINOR( ver )
LINUX_VERSION_PATCH( ver )
procps_loadavg() fetches the system load average and puts the 1, 5 and 15 minute averages into location(s) specified by any pointer which is not NULL.
procps_uptime() returns uptime and/or idle seconds into location(s) specified by any pointer which is not NULL. The sprint varieties return a human-readable string in one of two forms.
HH:MM:SS up HH:MM, # users, load average: 1, 5, 15 MM averages
up HH, MM
procps_ns_get_id() returns the integer id (enum namespace_type) of the namespace for the given namespace name.
procps_ns_get_name() returns the name of the namespace for the given id (enum namespace_type).
procps_ns_read_pid() returns the inodes for the namespaces of the given process in the procps_ns structure pointed to by nsp. Those inodes will appear in the order proscribed by enum namespace_type.
enum namespace_type { PROCPS_NS_CGROUP, PROCPS_NS_IPC, PROCPS_NS_MNT, PROCPS_NS_NET, PROCPS_NS_PID, PROCPS_NS_TIME, PROCPS_NS_USER, PROCPS_NS_UTS };