Unix-system-calls-mincore
提供:Dev Guides
[top]#
|http://www.google.com/[Google] | a|
Web | This Site |
選択した読書 Copyright©2014 by finddevguides |
[cols=",,,,,,,",] |
| | Home | | References | | Discussion Forums | | About TP
[width="100%",cols="100%",] |
a| == mincore()-Unix、Linuxシステムコール
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] image:http://www.finddevguides.com/add- this.gif [AddThisソーシャルブックマークボタン]
広告
NAME
mincore-ページがコアにあるかどうかに関する情報を取得する
概要
- #include <unistd.h> * *#include <sys/mman.h> *
- int mincore(void * start 、size_t length 、unsigned char *vec *);
説明
*mincore* ()関数は、ファイルのどのページがコアにあり、ディスクアクセスなしで読み取れるかを記述するベクトルを要求します。 カーネルは、_start_アドレスに続く_length_バイトのデータを提供します。 戻ったとき、カーネルは_vec_をバイトで埋め、その最下位ビットはページがコアに常駐しているかどうかを示します。 (他のビットは未定義で、後で使用できるように予約されています。)もちろん、これはスナップショットにすぎません。コアでロックされていないページはいつでも行き来できます。
*mincore* ()が正常に戻るには、_start_がページ境界上になければなりません。 最も近いページに切り上げるのは、呼び出し側の責任です。 _length_パラメーターは、ページサイズの倍数である必要はありません。 ベクトル_vec_は、(length + PAGE_SIZE-1)/PAGE_SIZEバイトを含むのに十分な大きさでなければなりません。 *getpagesize* (2)からページサイズを取得できます。
返り値
成功すると、 mincore ()はゼロを返します。 エラーの場合、-1が返され、_errno_が適切に設定されます。
エラー
*EAGAIN* カーネルは一時的にリソース不足です
Tag | Description |
---|---|
EFAULT | vec points to an invalid address |
EINVAL | start is not a multiple of the page size. |
*ENOMEM * | len is greater than (TASK_SIZE - start). (This could occur if a negative value is specified for len, since that value will be interpreted as a large unsigned integer.) In Linux 2.6.11 and earlier, the error* EINVAL* was returned for this condition. |
ENOMEM | address to address + length contained unmapped memory, or memory not part of a file. |
BUGS
これまで(Linux 2.6.5)、 mincore ()はMAP_PRIVATEマッピングの正しい情報を返しません。
準拠
*mincore* ()はPOSIX.1-2001で指定されておらず、すべてのUnix実装で利用できるわけではありません。
歴史
*mincore* ()関数は4.4BSDで初めて登場しました。
可用性
Linux 2.3.99pre1およびglibc 2.2以降。
関連項目
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] [[File:]]
広告
|
[cols="^",] |
|Advertisements