LIBPROCPS_0 {
global:
closeproc;
- cpuinfo;
dev_to_tty;
escape_command;
escape_str;
kb_swap_free;
kb_swap_total;
kb_swap_used;
- loadavg;
look_up_our_self;
lookup_wchan;
meminfo;
procps_cpu_count;
procps_hertz_get;
procps_linux_version;
+ procps_loadavg;
procps_meminfo_new;
procps_meminfo_read;
procps_meminfo_ref;
page_bytes = sysconf(_SC_PAGESIZE);
}
-
-/***********************************************************************/
-PROCPS_EXPORT int loadavg(double *restrict av1, double *restrict av5, double *restrict av15)
+/*
+ * procps_loadavg:
+ * @av1: location to store 1 minute load average
+ * @av5: location to store 5 minute load average
+ * @av15: location to store 15 minute load average
+ *
+ * Find the 1,5 and 15 minute load average of the system
+ *
+ * Returns: 0 on success <0 on error
+ */
+PROCPS_EXPORT int procps_loadavg(
+ double *restrict av1,
+ double *restrict av5,
+ double *restrict av15)
{
double avg_1=0, avg_5=0, avg_15=0;
char *savelocale;
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "C");
if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) {
- retval = -ERANGE;
+ retval = -ERANGE;
}
setlocale(LC_NUMERIC, savelocale);
free(savelocale);
extern int uptime (double *uptime_secs, double *idle_secs);
extern unsigned long getbtime(void);
-int loadavg(double *av1, double *av5, double *av15);
+int procps_loadavg(double *av1, double *av5, double *av15);
long procps_hertz_get(void);
long procps_cpu_count(void);
pos += sprintf(upbuf + pos, "%d min, ", uphours, upminutes);
users = count_users();
- loadavg(&av1, &av5, &av15);
+ procps_loadavg(&av1, &av5, &av15);
pos += sprintf(upbuf + pos, "%2d user%s, load average: %.2f, %.2f, %.2f",
users, users == 1 ? "" : "s",
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "proc/version.h"
-#include "proc/sysinfo.h"
+#include <proc/sysinfo.h>
#include "c.h"
#include "fileutils.h"
#include "nls.h"
if (scale_fact < max_scale)
scale_fact *= 2.0; /* help it drift back up. */
- loadavg(&av[0], &av[1], &av[2]);
+ procps_loadavg(&av[0], &av[1], &av[2]);
do {
lines = av[0] * scale_fact;