.\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 .\" .\" 2007-12-08, mtk, Converted from mdoc to man macros .\" .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. .\" Translated Sun 6 Jan 2002 by NAKANO Takeo .\" .\"WORD: load average 負荷平均 .\" .TH GETLOADAVG 3 2007-12-08 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O getloadavg \- システムの負荷平均を取得する getloadavg \- get system load averages .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _BSD_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _BSD_SOURCE" " /* feature_test_macros(7) 参照 */" .B #include .sp .BI "int getloadavg(double " loadavg[] ", int " nelem ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR getloadavg () .\"O function returns the number of processes in the system run queue .\"O averaged over various periods of time. .\"O Up to .\"O .I nelem .\"O samples are retrieved and assigned to successive elements of .\"O .IR loadavg []. .\"O The system imposes a maximum of 3 samples, representing averages .\"O over the last 1, 5, and 15 minutes, respectively. .BR getloadavg () 関数はシステムの実行キューに入っているプロセスの数を、 様々な期間について平均した値を返す。 .I nelem 個までのサンプル値を取得し、 .IR loadavg [] の連続する要素に代入する。 システムが提供するサンプル数は 3 個までで、 それぞれ最近 1, 5, 15 分の平均を表している。 .\"O .SH RETURN VALUE .SH 返り値 .\"O If the load average was unobtainable, \-1 is returned; otherwise, .\"O the number of samples actually retrieved is returned. 負荷平均が取得できないと \-1 を返す。 取得できた場合は、実際に取得したサンプル値の数を返す。 .\"O .\" .SH HISTORY .\" .SH 履歴 .\"O .\" The .\"O .\" .BR getloadavg () .\"O .\" function appeared in .\"O .\" 4.3BSD Reno. .\" .BR getloadavg () .\" 関数は .\" 4.3BSD Reno .\" で登場した。 .\"O .SH VERSIONS .SH バージョン .\"O This function is available in glibc since version 2.2. この関数は glibc のバージョン 2.2 以降で利用可能である。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O Not in POSIX.1-2001. .\"O Present on the BSDs and Solaris. POSIX.1-2001 にはない。 BSD 系と Solaris に存在する。 .\" mdoc seems to have a bug - there must be no newline here .\"O .SH SEE ALSO .SH 関連項目 .BR uptime (1), .BR proc (5)