.\" Copyright (C) 2001 Bert Hubert .\" and Copyright (C) 2007 Michael Kerrisk .\" .\" %%%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 .\" .\" Created Sun Jun 3 17:23:32 2001 by bert hubert .\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04. .\" Modified, 20 May 2003, Michael Kerrisk .\" Modified, 30 Apr 2004, Michael Kerrisk .\" 2005-04-05 mtk, Fixed error descriptions .\" after message from .\" 2007-01-08 mtk, rewrote various parts .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2001-2005 Yuichi SATO .\" all rights reserved. .\" Translated Sun Jul 8 21:09:35 JST 2001 .\" by Yuichi SATO .\" Updated & Modified Sat Jul 26 13:54:03 JST 2003 .\" by Yuichi SATO .\" Updated & Modified Fri Dec 31 05:59:40 JST 2004 by Yuichi SATO .\" Updated & Modified Fri Apr 22 02:35:03 JST 2005 by Yuichi SATO .\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 .\" .TH MINCORE 2 2017\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 mincore \- ページがメモリー内にあるかどうかを判定する .SH 書式 \fB#include \fP .br \fB#include \fP .PP \fBint mincore(void *\fP\fIaddr\fP\fB, size_t \fP\fIlength\fP\fB, unsigned char *\fP\fIvec\fP\fB);\fP .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBmincore\fP(): glibc 2.19 以降: _DEFAULT_SOURCE Glibc 2.19 以前: _BSD_SOURCE || _SVID_SOURCE .SH 説明 \fBmincore\fP() は、呼び出し元プロセスの仮想メモリーのページがコア (RAM) 内に存在し、 ページ参照時にディスクアクセス (ページフォールト) を起こさないか どうかを示すベクトルを返す。カーネルは、アドレス \fIaddr\fP から始まる \fIlength\fP バイトの範囲のページに関する存在情報を返す。 .PP \fIaddr\fP 引数はシステムのページサイズの倍数でなければならない。 \fIlength\fP 引数はページサイズの倍数である必要はないが、 ページ全体に関する存在情報が返されるので、事実上 \fIlength\fP はページサイズの倍数に切り上げられることになる。 ページサイズ (\fBPAGE_SIZE\fP) は \fIsysconf(_SC_PAGESIZE)\fP を使って入手できる。 .PP \fIvec\fP 引数は、少なくとも \fI(length+PAGE_SIZE\-1) / PAGE_SIZE\fP バイトが格納できる配列を指していなければならない。 この呼び出しが返るとき、 各バイトの最下位ビットは、対応するページがメモリー内にそのとき存在すれば セットされ、そうでない場合はクリアされる (各バイトのその他のビットは未定義であり、これらのビットは将来の使用に そなえて予約されている)。 もちろん、 \fIvec\fP で返された情報はスナップショットでしかない。 メモリー内にロックされていないページは、任意の時点でメモリー内に 入ったり出たりでき、この呼び出しが返るときには \fIvec\fP の内容はすでに古くなっているかもしれない。 .SH 返り値 成功した場合、 \fBmincore\fP() は 0 を返す。 エラーの場合は \-1 を返して、 \fIerrno\fP を適切な値に設定する。 .SH エラー \fBEAGAIN\fP カーネルが一時的にリソースを使い果たしている。 .TP \fBEFAULT\fP \fIvec\fP が無効なアドレスを指している。 .TP \fBEINVAL\fP \fIaddr\fP がページサイズの倍数でない。 .TP \fBENOMEM\fP \fIlength\fP が (\fITASK_SIZE\fP \- \fIaddr\fP) より大きい。 (\fIlength\fP に負の値が指定された場合、 その値が大きな符号なし整数として解釈されるために起こることがある。) Linux 2.6.11 以前では、この条件の場合はエラー \fBEINVAL\fP が返されていた。 .TP \fBENOMEM\fP \fIaddr\fP から \fIaddr\fP + \fIlength\fP の間にマップされていないメモリーがあった。 .SH バージョン Linux 2.3.99pre1 と glibc 2.2 から利用可能である。 .SH 準拠 .\" It is on at least NetBSD, FreeBSD, OpenBSD, Solaris 8, .\" AIX 5.1, SunOS 4.1 .\" .SH HISTORY .\" The .\" .BR mincore () .\" function first appeared in 4.4BSD. \fBmincore\fP() は POSIX.1 に記述されておらず、 全ての UNIX 実装で利用可能であるわけではない。 .SH バグ .\" Linux (up to now, 2.6.5), .\" .B mincore .\" does not return correct information for MAP_PRIVATE mappings: .\" for a MAP_PRIVATE file mapping, .\" .B mincore .\" returns the residency of the file pages, rather than any .\" modified process-private pages that have been copied on write; .\" for a MAP_PRIVATE mapping of .\" .IR /dev/zero , .\" .B mincore .\" always reports pages as nonresident; .\" and for a MAP_PRIVATE, MAP_ANONYMOUS mapping, .\" .B mincore .\" always fails with the error .\" .BR ENOMEM . カーネル 2.6.21 より前は、 \fBmincore\fP() は、 \fBMAP_PRIVATE\fP マッピングや非線形マッピング (\fBremap_file_pages\fP(2) を使って作成される) について正しい情報を返さなかった。 .SH 関連項目 \fBfincore\fP(1), \fBmadvise\fP(2), \fBmlock\fP(2), \fBmmap\fP(2), \fBposix_fadvise\fP(2), \fBposix_madvise\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。