.\" Copyright (C) 2016, Michael Kerrisk .\" Based on an earlier version of the page where a few pieces were .\" copyright (C) 1993 by Dan Miner (dminer@nyx.cs.du.edu) and subsequently .\" others (see old changelog below). .\" The structure definitions are taken more or less straight from the kernel .\" source files. .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" .\" Modified Sat Jul 24 12:35:12 1993 by Rik Faith .\" Modified Tue Oct 22 22:29:51 1996 by Eric S. Raymond .\" Modified Mon Aug 25 16:06:11 1997 by Nicolás Lichtmaier .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Tue Mar 4 00:04:15 JST 1997 .\" by HANATAKA Shinya .\" Modified Mon Sep 23 21:56:40 JST 2000 .\" by HANATAKA Shinya .\" .TH SYSINFO 2 2017\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 sysinfo \- システム情報を返す .SH 書式 \fB#include \fP .PP \fBint sysinfo(struct sysinfo *\fP\fIinfo\fP\fB);\fP .SH 説明 \fBsysinfo\fP() returns certain statistics on memory and swap usage, as well as the load average. .PP Linux 2.3.16 までは \fBsysinfo\fP() は以下の構造体に情報を入れて返した。 .PP .in +4n .EX struct sysinfo { long uptime; /* Seconds since boot */ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ unsigned long totalram; /* Total usable main memory size */ unsigned long freeram; /* Available memory size */ unsigned long sharedram; /* Amount of shared memory */ unsigned long bufferram; /* Memory used by buffers */ unsigned long totalswap; /* Total swap space size */ unsigned long freeswap; /* Swap space still available */ unsigned short procs; /* Number of current processes */ char _f[22]; /* Pads structure to 64 bytes */ }; .EE .in .PP In the above structure, the sizes of the memory and swap fields are given in bytes. .PP Linux 2.3.23 (i386)、Linux 2.3.48 (全てのアーキテクチャー) 以降では、構造体は .PP .in +4n .EX struct sysinfo { long uptime; /* Seconds since boot */ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ unsigned long totalram; /* Total usable main memory size */ unsigned long freeram; /* Available memory size */ unsigned long sharedram; /* Amount of shared memory */ unsigned long bufferram; /* Memory used by buffers */ unsigned long totalswap; /* Total swap space size */ unsigned long freeswap; /* Swap space still available */ unsigned short procs; /* Number of current processes */ unsigned long totalhigh; /* Total high memory size */ unsigned long freehigh; /* Available high memory size */ unsigned int mem_unit; /* Memory unit size in bytes */ char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding to 64 bytes */ }; .EE .in .PP In the above structure, sizes of the memory and swap fields are given as multiples of \fImem_unit\fP bytes. .SH 返り値 成功すると、 \fBsysinfo\fP() は 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。 .SH エラー .TP \fBEFAULT\fP \fIinfo\fP が有効なアドレスではない。 .SH バージョン \fBsysinfo\fP() は Linux 0.98.pl6 で初めて登場した。 .SH 準拠 この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。 .SH 注意 All of the information provided by this system call is also available via \fI/proc/meminfo\fP and \fI/proc/loadavg\fP. .SH 関連項目 \fBproc\fP(5) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。