1 .\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu)
3 .\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE)
4 .\" Permission is granted to freely distribute or modify this file
5 .\" for the purpose of improving Linux or its documentation efforts.
6 .\" If you modify this file, please put a date stamp and HOW you
7 .\" changed this file. Thanks. -DM
10 .\" Modified Sat Jul 24 12:35:12 1993 by Rik Faith <faith@cs.unc.edu>
11 .\" Modified Tue Oct 22 22:29:51 1996 by Eric S. Raymond <esr@thyrsus.com>
12 .\" Modified Mon Aug 25 16:06:11 1997 by Nicolás Lichtmaier <nick@debian.org>
14 .\"*******************************************************************
16 .\" This file was generated with po4a. Translate the source file.
18 .\"*******************************************************************
19 .TH SYSINFO 2 2012\-05\-05 Linux "Linux Programmer's Manual"
21 sysinfo \- システム全体の統計情報を返す。
23 \fB#include <sys/sysinfo.h>\fP
25 \fBint sysinfo(struct sysinfo *\fP\fIinfo\fP\fB);\fP
27 Linux 2.3.16 までは \fBsysinfo\fP() は以下の構造体に情報を入れて返す。
32 long uptime; /* Seconds since boot */
33 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
34 unsigned long totalram; /* Total usable main memory size */
35 unsigned long freeram; /* Available memory size */
36 unsigned long sharedram; /* Amount of shared memory */
37 unsigned long bufferram; /* Memory used by buffers */
38 unsigned long totalswap; /* Total swap space size */
39 unsigned long freeswap; /* swap space still available */
40 unsigned short procs; /* Number of current processes */
41 char _f[22]; /* Pads structure to 64 bytes */
48 Linux 2.3.23 (i386)、2.3.48 (全てのアーキテクチャ) からは構造体は
53 long uptime; /* Seconds since boot */
54 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
55 unsigned long totalram; /* Total usable main memory size */
56 unsigned long freeram; /* Available memory size */
57 unsigned long sharedram; /* Amount of shared memory */
58 unsigned long bufferram; /* Memory used by buffers */
59 unsigned long totalswap; /* Total swap space size */
60 unsigned long freeswap; /* swap space still available */
61 unsigned short procs; /* Number of current processes */
62 unsigned long totalhigh; /* Total high memory size */
63 unsigned long freehigh; /* Available high memory size */
64 unsigned int mem_unit; /* Memory unit size in bytes */
65 char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding to 64 bytes */
70 となり、大きさは \fImem_unit\fP バイトの倍数で与えられる。
72 \fBsysinfo\fP() はシステム全体の統計を取得する簡単な方法を提供する。 これは \fI/dev/kmem\fP を読むよりも移植性の高い方法である。
74 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
78 \fIsysinfo 構造体\fP へのポインターが不正である。
80 この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。
82 Linux カーネルは 0.98.pl6 から \fBsysinfo\fP() システムコールを持っている。 Linux の libc は 5.3.5
83 より、glibc では 1.90 より \fBsysinfo\fP() ルーチンを含んでいる。
87 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
88 である。プロジェクトの説明とバグ報告に関する情報は
89 http://www.kernel.org/doc/man\-pages/ に書かれている。