OSDN Git Service

276c346547c0b2d1462a7173af4431e920dd550e
[linuxjm/LDP_man-pages.git] / release / man2 / sysinfo.2
1 .\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu)
2 .\"
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
8 .\" %%%LICENSE_END
9 .\"
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>
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" This file was generated with po4a. Translate the source file.
17 .\"
18 .\"*******************************************************************
19 .\"
20 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
21 .\"         all rights reserved.
22 .\" Translated Tue Mar  4 00:04:15 JST 1997
23 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
24 .\" Modified Mon Sep 23 21:56:40 JST 2000
25 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
26 .\"
27 .TH SYSINFO 2 2012\-05\-05 Linux "Linux Programmer's Manual"
28 .SH 名前
29 sysinfo \- システム全体の統計情報を返す。
30 .SH 書式
31 \fB#include <sys/sysinfo.h>\fP
32 .sp
33 \fBint sysinfo(struct sysinfo *\fP\fIinfo\fP\fB);\fP
34 .SH 説明
35 Linux 2.3.16 までは \fBsysinfo\fP()  は以下の構造体に情報を入れて返す。
36
37 .nf
38 .in +4n
39 struct sysinfo {
40     long uptime;             /* Seconds since boot */
41     unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
42     unsigned long totalram;  /* Total usable main memory size */
43     unsigned long freeram;   /* Available memory size */
44     unsigned long sharedram; /* Amount of shared memory */
45     unsigned long bufferram; /* Memory used by buffers */
46     unsigned long totalswap; /* Total swap space size */
47     unsigned long freeswap;  /* swap space still available */
48     unsigned short procs;    /* Number of current processes */
49     char _f[22];             /* Pads structure to 64 bytes */
50 };
51 .in
52 .fi
53 .PP
54 ここでバイト単位で与えられる。
55
56 Linux 2.3.23 (i386)、2.3.48 (全てのアーキテクチャ) からは構造体は
57
58 .nf
59 .in +4n
60 struct sysinfo {
61     long uptime;             /* Seconds since boot */
62     unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
63     unsigned long totalram;  /* Total usable main memory size */
64     unsigned long freeram;   /* Available memory size */
65     unsigned long sharedram; /* Amount of shared memory */
66     unsigned long bufferram; /* Memory used by buffers */
67     unsigned long totalswap; /* Total swap space size */
68     unsigned long freeswap;  /* swap space still available */
69     unsigned short procs;    /* Number of current processes */
70     unsigned long totalhigh; /* Total high memory size */
71     unsigned long freehigh;  /* Available high memory size */
72     unsigned int mem_unit;   /* Memory unit size in bytes */
73     char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding to 64 bytes */
74 };
75 .in
76 .fi
77 .PP
78 となり、大きさは \fImem_unit\fP バイトの倍数で与えられる。
79
80 \fBsysinfo\fP()  はシステム全体の統計を取得する簡単な方法を提供する。 これは \fI/dev/kmem\fP を読むよりも移植性の高い方法である。
81 .SH 返り値
82 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
83 .SH エラー
84 .TP 
85 \fBEFAULT\fP
86 \fIsysinfo 構造体\fP へのポインターが不正である。
87 .SH 準拠
88 この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。
89 .sp
90 Linux カーネルは 0.98.pl6 から \fBsysinfo\fP()  システムコールを持っている。 Linux の libc は 5.3.5
91 より、glibc では 1.90 より \fBsysinfo\fP()  ルーチンを含んでいる。
92 .SH 関連項目
93 \fBproc\fP(5)
94 .SH この文書について
95 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
96 である。プロジェクトの説明とバグ報告に関する情報は
97 http://www.kernel.org/doc/man\-pages/ に書かれている。