OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / sysinfo.2
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu)
4 .\"
5 .\"  Permission is granted to freely distribute or modify this file
6 .\"  for the purpose of improving Linux or its documentation efforts.
7 .\"  If you modify this file, please put a date stamp and HOW you
8 .\"  changed this file.  Thanks.   -DM
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 .TH SYSINFO 2 2007\-11\-15 Linux "Linux Programmer's Manual"
20 .SH 名前
21 sysinfo \- システム全体の統計情報を返す。
22 .SH 書式
23 \fB#include <sys/sysinfo.h>\fP
24 .sp
25 \fBint sysinfo(struct sysinfo *\fP\fIinfo\fP\fB);\fP
26 .SH 説明
27 Linux 2.3.16 までは \fBsysinfo\fP()  は以下の構造体に情報を入れて返す。
28
29 .nf
30 .in +4n
31 struct sysinfo {
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 */
42 };
43 .in
44 .fi
45 .PP
46 ここでバイト単位で与えられる。
47
48 Linux 2.3.23 (i386)、2.3.48 (全てのアーキテクチャ) からは構造体は
49
50 .nf
51 .in +4n
52 struct sysinfo {
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 for libc5 */
66 };
67 .in
68 .fi
69 .PP
70 となり、大きさは \fImem_unit\fP バイトの倍数で与えられる。
71
72 \fBsysinfo\fP()  はシステム全体の統計を取得する簡単な方法を提供する。 これは \fI/dev/kmem\fP を読むよりも移植性の高い方法である。
73 .SH 返り値
74 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
75 .SH エラー
76 .TP 
77 \fBEFAULT\fP
78 \fIsysinfo 構造体\fP へのポインターが不正である。
79 .SH 準拠
80 この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。
81 .sp
82 Linux カーネルは 0.98.pl6 から \fBsysinfo\fP()  システムコールを持っている。 Linux の libc は 5.3.5
83 より、glibc では 1.90 より \fBsysinfo\fP()  ルーチンを含んでいる。
84 .SH 関連項目
85 \fBproc\fP(5)