Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getloadavg(3) [debian man page]

GETLOADAVG(3)						     Linux Programmer's Manual						     GETLOADAVG(3)

NAME
getloadavg - get system load averages SYNOPSIS
#define _BSD_SOURCE /* See feature_test_macros(7) */ #include <stdlib.h> int getloadavg(double loadavg[], int nelem); DESCRIPTION
The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time. Up to nelem sam- ples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. RETURN VALUE
If the load average was unobtainable, -1 is returned; otherwise, the number of samples actually retrieved is returned. VERSIONS
This function is available in glibc since version 2.2. CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs and Solaris. SEE ALSO
uptime(1), proc(5) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-12-08 GETLOADAVG(3)

Check Out this Related Man Page

getloadavg(3C)						   Standard C Library Functions 					    getloadavg(3C)

NAME
getloadavg - get system load averages SYNOPSIS
#include <sys/loadavg.h> int getloadavg(double loadavg[], int nelem); DESCRIPTION
The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time. Up to nelem sam- ples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. The LOADAVG_1MIN, LOADAVG_5MIN, and LOADAVG_15MIN indices, defined in <sys/loadavg.h>, can be used to extract the data from the appropriate element of the loadavg[] array. RETURN VALUES
Upon successful completion, the number of samples actually retrieved is returned. If the load average was unobtainable, -1 is returned and errno is set to indicate the error. ERRORS
The getloadavg() function will fail if: EINVAL The number of elements specified is less than 0. USAGE
If the caller is in a non-global zone and the pools facility is active, the behavior of getloadavg() is equivalent to that of pset_getload- avg(3C) called with psetid set to PS_MYID. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
uptime(1), w(1), pooladm(1M), Kstat(3PERL), pset_getloadavg(3C), standards(5) SunOS 5.11 28 Jun 2004 getloadavg(3C)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Load Average

Hello all, I have a question about load averages. I've read the man pages for the uptime and w command for two or three different flavors of Unix (Red Hat, Tru64, Solaris). All of them agree that in the output of the 2 aforementioned commands, you are given the load average for the box, but... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

2. Advertise with Us

Present openings for Solaris Admins(L2)

Hi all, I am looking for a job change as solaris admin(L2) with experience of 3.8 years experience in the present recession period in IND. Even I uploaded my CV in some of the job portals ie, naukri,monster and timesjobs, but I can't find any interviews scheduling from past two months.Even I... (0 Replies)
Discussion started by: chant_soladm
0 Replies

3. Shell Programming and Scripting

awk -F works on Linux, but not on Solaris

Hello, I found this command works on Linux: $ echo `uptime` | awk -F "load average: " '{ print $2 }' 1.60, 1.53, 1.46 but got error on Solaris: $ echo `uptime` | awk -F "load average: " '{ print $2 }' awk: syntax error near line 1 awk: bailing out near line 1 $ which awk... (2 Replies)
Discussion started by: seafan
2 Replies

4. Shell Programming and Scripting

Create a list of load averages

`/proc/loadavg` give me three indicators of how much work the system has done during the last 1, 5 & 15 minutes. How can i get a list of load averages that each averaged over the last minute for 10 minutes? (2 Replies)
Discussion started by: navidlog
2 Replies

5. Shell Programming and Scripting

Awk- Pivot Table Averages

Hi everyone, Has anyone figured out yet how to do pivot table averages using AWK. I didn't see anything with regards to doing averages. For example, suppose you have the following table with various individuals and their scores in round1 and round2: SAMPLE SCORE1 SCORE2 British ... (6 Replies)
Discussion started by: Geneanalyst
6 Replies