PROCPS_UPTIME(3)

NAME
procps_uptime - provide the uptime and idle time in seconds

SYNOPSIS
#include <proc/procps.h>

int procps_uptime(double * uptime_secs, double * idle_secs);

Link with -lprocps.

DESCRIPTION
The function procps_uptime() fills the location of the two double points with the current sytem uptime and idle time.

RETURN VALUE
procps_uptime() returns 0 on success. On failure, it returns a negative integer to one of the values defined below.

-ERANGE
    Unable to parse the uptime file.

procps_uptime() may also return any (negated) value that fopen() may set errno to.

FILES

/proc/uptime
    The raw values for uptime and idle time.

VERSIONS
procps_uptime() first appeared in libproc-2 version 0.0.

SEE ALSO
fopen(3), proc(5).