PROCPS_MISC(3) Library Functions Manual PROCPS_MISC(3) procps_misc -- /proc #include long procps_cpu_count (void); long procps_hertz_get (void); unsigned int procps_pid_length (void); int procps_linux_version (void); int procps_loadavg (double *av1, double *av5, double *av15); int procps_uptime (double *uptime_secs, double *idle_secs); char *procps_uptime_sprint (void); char *procps_uptime_sprint_short (void); int procps_ns_get_id (const char *name); const char *procps_ns_get_name (int id); int procps_ns_read_pid (int pid, struct procps_ns *nsp); -lproc2. procps_cpu_count() sysconf(_SC_NPROCESSORS_ONLY) 1. procps_hertz_get() sysconf(_SC_CLK_TCK) 100. , . procps_pid_length() PID . , PID -- 123, 3. /proc/sys/kernel/pid_max , 5. procps_linux_version() Linux . , Linux, proc Linux. , , . Linux . LINUX_VERSION( major , minor , patch ) LINUX_VERSION_MAJOR( ver ) LINUX_VERSION_MINOR( ver ) LINUX_VERSION_PATCH( ver ) procps_loadavg() 1, 5 15 , - , (NULL). procps_uptime() / , - , (NULL). sprint . :: up :, # users, load average: 1, 5, 15 MM averages up , procps_ns_get_id() (enum namespace_type) name. procps_ns_get_name() id (enum namespace_type). procps_ns_read_pid() inode- procps_ns nsp. inode- , 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 }; , <> <> ' , errno.h. , <
> NUL- errno. /proc/loadavg . /proc/sys/kernel/osrelease Linux proc. /proc/sys/kernel/pid_max , PID, PID. /proc/uptime . /proc//ns PID. procps(3), procps_pids(3), proc(5). libproc2 2022 PROCPS_MISC(3)