From 6ba8eb239690903355c16c09062bbdf7f81ade83 Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Tue, 27 Jan 2015 03:44:20 +0900 Subject: [PATCH] Complete several pages in man2 and memory ja.po perfmonctl.2 process_vm_readv.2 malloc_get_state.3 malloc_trim.3 --- draft/man2/perfmonctl.2 | 180 ++++++++++++++++++++++++++++++++++ draft/man2/process_vm_readv.2 | 212 ++++++++++++++++++++++++++++++++++++++++ draft/man3/malloc_get_state.3 | 79 +++++++++++++++ draft/man3/malloc_trim.3 | 67 +++++++++++++ po4a/man2/po/ja.po | 93 +++++++++--------- po4a/memory/po/ja.po | 32 +++--- release/man2/perfmonctl.2 | 180 ++++++++++++++++++++++++++++++++++ release/man2/process_vm_readv.2 | 212 ++++++++++++++++++++++++++++++++++++++++ release/man3/malloc_get_state.3 | 79 +++++++++++++++ release/man3/malloc_trim.3 | 67 +++++++++++++ stats/man2 | 2 - stats/memory | 2 - translation_list | 12 +-- untrans.html | 6 +- 14 files changed, 1144 insertions(+), 79 deletions(-) create mode 100644 draft/man2/perfmonctl.2 create mode 100644 draft/man2/process_vm_readv.2 create mode 100644 draft/man3/malloc_get_state.3 create mode 100644 draft/man3/malloc_trim.3 create mode 100644 release/man2/perfmonctl.2 create mode 100644 release/man2/process_vm_readv.2 create mode 100644 release/man3/malloc_get_state.3 create mode 100644 release/man3/malloc_trim.3 diff --git a/draft/man2/perfmonctl.2 b/draft/man2/perfmonctl.2 new file mode 100644 index 00000000..51130298 --- /dev/null +++ b/draft/man2/perfmonctl.2 @@ -0,0 +1,180 @@ +.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. +.\" and Copyright (C) 2013 Michael Kerrisk +.\" Written by Ivana Varekova +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH PERFMONCTL 2 2013\-02\-13 Linux "Linux Programmer's Manual" +.SH 名前 +perfmonctl \- IA\-64 の PMU (性能監視ユニット) のインターフェース +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBlong perfmonctl(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, void *\fP\fIarg\fP\fB, int \fP\fInarg\fP\fB);\fP +.fi +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +IA\-64 固有の \fBperfmonctl\fP() システムコールは PMU (性能監視ユニット; performance monitoring +unit) へのインターフェースを提供する。 PMU は PMD (performance monitoring data) レジスターと PMC +(performance monitoring control) レジスターで構成され、 ハードウェアの統計を収集する。 + +\fBperfmonctl\fP() は、 操作 \fIcmd\fP を \fIarg\fP で指定された入力引き数で行う。 引き数の数は \fInarg\fP で規定される。 +\fIfd\fP 引き数は操作対象の perfmon コンテキストを指定する。 + +\fIcmd\fP に指定できる値は以下のとおりである。 +.TP +\fBPFM_CREATE_CONTEXT\fP +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_CREATE_CONTEXT, pfarg_context_t *\fP\fIctxt\fP\fB, 1);\fP +.fi +コンテキストを用意する。 + +\fIfd\fP 引き数は無視される。 新しい perfmon コンテキストを \fIctxt\fP で指定した内容で作成し、 そのファイルディスクリプターを +\fIctxt\->ctx_fd\fP で返す。 + +ファイルディスクリプターはそれ以降の \fBperfmonctl\fP() の呼び出しで使用したり、 \fBread\fP(2) を使ってイベント通知 +(\fIpfm_msg_t\fP 型) を読み出したりするのに使用できる。 このファイルディスクリプターは \fBselect\fP(2), \fBpoll\fP(2), +\fBepoll\fP(7) で状態監視 (ポーリング) することができる。 + +コンテキストを破棄するには、 そのファイルディスクリプターに対して \fBclose\fP(2) を呼び出す。 +.TP +\fBPFM_WRITE_PMCS\fP +.\" pfm_write_pmcs() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMCS, pfarg_reg_t *\fP\fIpmcs\fP\fB, n);\fP +.fi +PMC レジスターを設定する。 +.TP +\fBPFM_WRITE_PMDS\fP +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP +.fi +.\" pfm_write_pmds() +PMD レジスターを設定する。 +.TP +\fBPFM_READ_PMDS\fP +.\" pfm_read_pmds() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_READ_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP +.fi +PMD レジスターを読み出す。 +.TP +\fBPFM_START\fP +.\" pfm_start() +.nf +.\" .BI "perfmonctl(int " fd ", PFM_START, arg, 1); +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_START, NULL, 0);\fP +.fi +監視を開始する。 +.TP +\fBPFM_STOP\fP +.\" pfm_stop() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_STOP, NULL, 0);\fP +.fi +監視を停止する。 +.TP +\fBPFM_LOAD_CONTEXT\fP +.\" pfm_context_load() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_LOAD_CONTEXT, pfarg_load_t *\fP\fIlargs\fP\fB, 1);\fP +.fi +指定したコンテキストをスレッドに接続する。 +.TP +\fBPFM_UNLOAD_CONTEXT\fP +.\" pfm_context_unload() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_UNLOAD_CONTEXT, NULL, 0);\fP +.fi +指定したコンテキストをスレッドが切り離す。 +.TP +\fBPFM_RESTART\fP +.\" pfm_restart() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_RESTART, NULL, 0);\fP +.fi +オーバーフロー通知を受信した後、 監視を再開する。 +.TP +\fBPFM_GET_FEATURES\fP +.\" pfm_get_features() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_FEARURES, pfarg_features_t *\fP\fIarg\fP\fB, 1);\fP +.fi +.TP +\fBPFM_DEBUG\fP +.\" pfm_debug() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_DEBUG, \fP\fIval\fP\fB, 0);\fP +.fi +\fIval\fP が 0 以外の場合、デバッグモードを有効にする。 そうでない場合、 無効にする。 +.TP +\fBPFM_GET_PMC_RESET_VAL\fP +.\" pfm_get_pmc_reset() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_PMC_RESET_VAL, pfarg_reg_t * \fP\fIreq\fP\fB, n);\fP +.fi +.\" +.\" +.\" .TP +.\" .B PFM_CREATE_EVTSETS +.\" +.\" create or modify event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_CREATE_EVTSETS, pfarg_setdesc_t *desc , n); +.\" .fi +.\" .TP +.\" .B PFM_DELETE_EVTSETS +.\" delete event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_DELETE_EVTSET, pfarg_setdesc_t *desc , n); +.\" .fi +.\" .TP +.\" .B PFM_GETINFO_EVTSETS +.\" get information about event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_GETINFO_EVTSETS, pfarg_setinfo_t *info, n); +.\" .fi +PMC レジスターをデフォルト値にリセットする。 +.SH 返り値 +\fBperfmonctl\fP() は操作が成功すると 0 を返す。 エラーの場合、 \-1 が返り、 \fIerrno\fP にエラーの原因を示す値が設定される。 +.SH バージョン +\fBperfmonctl\fP() は Linux 2.4 以降で利用可能である。 +.SH 準拠 +\fBperfmonctl\fP() は Linux 固有で、 IA\-64 アーキテクチャーでのみ利用できる。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +.SH 関連項目 +\fBgprof\fP(1) + +perfmon2 インターフェース仕様 +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/draft/man2/process_vm_readv.2 b/draft/man2/process_vm_readv.2 new file mode 100644 index 00000000..509b155a --- /dev/null +++ b/draft/man2/process_vm_readv.2 @@ -0,0 +1,212 @@ +.\" Copyright (C) 2011 Christopher Yeoh +.\" and Copyright (C) 2012 Mike Frysinger +.\" and Copyright (C) 2012 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 +.\" +.\" Commit fcf634098c00dd9cd247447368495f0b79be12d1 +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH PROCESS_VM_READV 2 2014\-08\-19 Linux "Linux Programmer's Manual" +.SH 名前 +process_vm_readv, process_vm_writev \- プロセスのアドレス空間間でデータを転送する +.SH 書式 +.nf +\fB#include \fP + +\fBssize_t process_vm_readv(pid_t \fP\fIpid\fP\fB,\fP +\fB const struct iovec *\fP\fIlocal_iov\fP\fB,\fP +\fB unsigned long \fP\fIliovcnt\fP\fB,\fP +\fB const struct iovec *\fP\fIremote_iov\fP\fB,\fP +\fB unsigned long \fP\fIriovcnt\fP\fB,\fP +\fB unsigned long \fP\fIflags\fP\fB);\fP + +\fBssize_t process_vm_writev(pid_t \fP\fIpid\fP\fB,\fP +\fB const struct iovec *\fP\fIlocal_iov\fP\fB,\fP +\fB unsigned long \fP\fIliovcnt\fP\fB,\fP +\fB const struct iovec *\fP\fIremote_iov\fP\fB,\fP +\fB unsigned long \fP\fIriovcnt\fP\fB,\fP +\fB unsigned long \fP\fIflags\fP\fB);\fP +.fi +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBprocess_vm_readv\fP(), \fBprocess_vm_writev\fP(): +.PD 0 +.ad l +.RS 4 +\fB_GNU_SOURCE\fP +.RE +.ad +.PD +.fi +.SH 説明 +これらのシステムコールは、 呼び出し元プロセス (「ローカルプロセス」) と \fIpid\fP で指定されるプロセス (「リモートプロセス」) +のアドレス空間間でデータを転送する。 データの移動は、 カーネル空間を経由することなく、 2 つのプロセスのアドレス空間間で直接行われる。 + +\fBprocess_vm_readv\fP() システムコールは、 リモートプロセスからローカルプロセスへデータを転送する。 転送対象のデータは +\fIremote_iov\fP と \fIriovcnt\fP で指定される。 \fIremote_iov\fP はプロセス \fIpid\fP +におけるアドレス範囲を指定する配列へのポインターで、 \fIriovcnt\fP は \fIremote_iov\fP の要素数を指定する。 データは +\fIlocal_iov\fP と \fIliovcnt\fP で指定された場所に転送される。 \fIlocal_iov\fP +は呼び出し元プロセスにおけるアドレス範囲を指定する配列で、 \fIliovcnt\fP は \fIlocal_iov\fP の要素数を指定する。 + +\fBprocess_vm_writev\fP() システムコールは \fBprocess_vm_readv\fP() の逆で、 +ローカルプロセスからリモートプロセスにデータを転送する。 転送の方向が違う以外は、 引き数 \fIliovcnt\fP, \fIlocal_iov\fP, +\fIriovcnt\fP, \fIremote_iov\fP は \fBprocess_vm_readv\fP() と同じ意味を持つ。 + +引き数 \fIlocal_iov\fP と \fIremote_iov\fP は \fIiovec\fP 構造体の配列へのポイン +タである。 \fIiovec\fP 構造体は \fI\fP で以下のように定義 +されている: + +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; +.fi +.in + +バッファーは配列の順序で処理される。 つまり、 \fBprocess_vm_readv\fP() は \fIlocal_iov\fP[0] +が一杯になるまでデータを詰めてから、 \fIlocal_iov\fP[1] に進むことを意味する。 同様に、 \fIremote_iov\fP[0] +を全部読み出してから \fIremote_iov\fP[1] に進み、 以降も同様である。 + +同様に、 \fBprocess_vm_writev\fP() は \fIlocal_iov[0]\fP の内容を全部読み出してから \fIlocal_iov[1]\fP +に進み、 書き込み先でも \fIremote_iov[0]\fP が一杯になってから \fIremote_iov[1]\fP に進む。 + +長さ \fIremote_iov[i].iov_len\fP と \fIlocal_iov[i].iov_len\fP は同じである必要はない。 したがって、 +ローカル側で 1 つのバッファーのデータがリモート側で複数のバッファーに分割されることがあるし、 その逆も起こりえる。 + +\fIflags\fP 引き数は現在使用されておらず、 0 を設定しなければならない。 + +.\" In time, glibc might provide a wrapper that works around this limit, +.\" as is done for readv()/writev() +\fIliovcnt\fP と \fIriovcnt\fP で指定される値は \fBIOV_MAX\fP 以下でなければならない (\fBIOV_MAX\fP は +\fI\fP で定義されており、 \fIsysconf(_SC_IOV_MAX)\fP の呼び出しでも入手できる)。 + +要素数引き数と \fIlocal_iov\fP のチェックは、 すべてのデータ転送に先立って行われる。 要素数が大きすぎる場合や \fIlocal_iov\fP +が無効な場合、 アドレスがローカルプロセスがアクセスできない領域を参照している場合は、 配列のどの要素も処理されず、 すぐにエラーが返される。 + +ただし、 これらのシステムコールは、 実際に読み出し/書き込みを行う直前までリモートプロセスのメモリー領域のチェックを行わない点に注意すること。 +結果として、 \fIremote_iov\fP の要素の一つがリモートプロセスで無効なメモリー領域を参照している場合、 部分的な読み出し/書き込み +(「返り値」の節を参照) が行われることになる。 これ以降は読み出し/書き込みは行われない。 リモートプロセスから長さ不明のデータ (例えば NULL +終端された C 文字列) を読み出す際で、 リモート側の一つの \fIiovec\fP 要素が複数のメモリーページ (通常は 4KiB) +にまたがらないようにしている場合は、 この点に注意が必要である。 +(リモートからの読み出しを 2 つの \fIremote_iov\fP 要素に分割し、 1 つの \fIlocal_iov\fP +要素への書き込みにマージすればよい。 最初の読み出しでページ境界まで読み出し、 次の読み出しを次のページ境界から行う。) + +他のプロセスからの読み出しや他のプロセスへの書き込みを行うには、 呼び出し元がケーパビリティ \fBCAP_SYS_PTRACE\fP +を持っていなければならない、もしくは、 リモートプロセスの実ユーザー ID、 実効ユーザー ID、 保存 set\-user\-ID +が呼び出し元の実ユーザー ID と一致し、 かつリモートプロセスの実グループ ID、 実効グループ ID、 保存 set\-group\-ID +が呼び出し元の実グループ ID と一致していなければならない。 (ここで必要なアクセス許可は、 リモートプロセスに対して \fBptrace\fP(2) の +\fBPTRACE_ATTACH\fP を実行するのに必要な許可と全く同じである。) +.SH 返り値 +成功すると、 \fBprocess_vm_readv\fP() は読み出したバイト数を返し、 \fBprocess_vm_writev\fP() +は書き込んだバイト数を返す。 この返り値は、 読み出し/書き込みが部分的に行われた場合には、 要求された総バイト数よりも小さくなることがある +(部分的な転送は \fIiovec\fP 要素単位に行われ、 これらのシステムコールが一つの \fIiovec\fP 要素の一部だけが転送されることはない)。 +呼び出し元は返り値を検査して、 部分的な読み出し/書き込みが起こったかどうかを判定できる。 + +エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +.TP +\fBEINVAL\fP +\fIlocal_iov\fP か \fIremote_iov\fP のいずれかの \fIiov_len\fP の合計値が \fIssize_t\fP +で表現できる値を超えている。 +.TP +\fBEINVAL\fP +\fIflags\fP が 0 でない。 +.TP +\fBEINVAL\fP +\fIliovcnt\fP か \fIriovcnt\fP が大きすぎる。 +.TP +\fBEFAULT\fP +\fIlocal_iov\fP で指定されたメモリーが呼び出し元がアクセス可能なアドレス空間の外にある。 +.TP +\fBEFAULT\fP +\fIremote_iov\fP で指定されたメモリーがプロセス \fIpid\fP がアクセス可能なアドレス空間の外にある。 +.TP +\fBENOMEM\fP +\fIiovec\fP 構造体の内部コピーのためのメモリーを割り当てできなかった。 +.TP +\fBEPERM\fP +呼び出し側がプロセス \fIpid\fP のアドレス空間に対するアクセス許可を +持っていない。 +.TP +\fBESRCH\fP +ID が \fIpid\fP のプロセスが存在しない。 +.SH バージョン +これらのシステムコールは Linux 3.2 で追加された。ライブラリによる +サポートは glibc バージョン 2.15 以降で提供されている。 +.SH 準拠 +これらのシステムコールは非標準で Linux による拡張である。 +.SH 注意 +\fBprocess_vm_readv\fP() と \fBprocess_vm_writev\fP() により実行されるデータ転送をどのように行ったとしても、 +これらがアトミックに行われる保証はない。 + +.\" Original user is MPI, http://www.mcs.anl.gov/research/projects/mpi/ +.\" See also some benchmarks at http://lwn.net/Articles/405284/ +.\" and http://marc.info/?l=linux-mm&m=130105930902915&w=2 +これらのシステムコールは、 (共有メモリーやパイプなどを使った場合に必要となる 2 回のコピーではなく) +1 回のコピー処理でメッセージの交換を許すことで、 高速なメッセージ送信をできるようにするために設計された。 +.SH 例 +以下のサンプルコードは \fBprocess_vm_readv\fP() の使用例を示すものである。 このコードは PID 10 のプロセスのアドレス +0x10000 から 20 バイトを読み取り、 最初の 10 バイトを \fIbuf1\fP に、 残りの 10 バイトを \fIbuf2\fP に書き込む。 +.sp +.nf +#include + +int +main(void) +{ + struct iovec local[2]; + struct iovec remote[1]; + char buf1[10]; + char buf2[10]; + ssize_t nread; + pid_t pid = 10; /* PID of remote process */ + + local[0].iov_base = buf1; + local[0].iov_len = 10; + local[1].iov_base = buf2; + local[1].iov_len = 10; + remote[0].iov_base = (void *) 0x10000; + remote[0].iov_len = 20; + + nread = process_vm_readv(pid, local, 2, remote, 1, 0); + if (nread != 20) + return 1; + else + return 0; +} +.fi +.SH 関連項目 +\fBreadv\fP(2), \fBwritev\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/draft/man3/malloc_get_state.3 b/draft/man3/malloc_get_state.3 new file mode 100644 index 00000000..f659f4f0 --- /dev/null +++ b/draft/man3/malloc_get_state.3 @@ -0,0 +1,79 @@ +.\" Copyright (c) 2012 by 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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MALLOC_GET_STATE 3 2014\-06\-13 GNU "Linux Programmer's Manual" +.SH 名前 +malloc_get_state, malloc_set_state \- malloc 実装の状態を保存/復元する +.SH 書式 +.nf +\fB#include \fP +.sp +\fBvoid* malloc_get_state(void);\fP + +\fBint malloc_set_state(void *\fP\fIstate\fP\fB);\fP +.fi +.SH 説明 +\fBmalloc_get_state\fP() 関数は \fBmalloc\fP(3) 内部のすべての管理用変数を記録する (ただし、 ヒープの実際の内容と +\fBmalloc_hook\fP(3) 関数ポインターの状態は記録されない)。 状態は \fBmalloc\fP(3) で動的に確保されたシステム依存の +opaque な (内部構造は分からない) データ構造体に記録され、 関数の結果としてそのデータ構造体へのポインターが返される +(このメモリーは呼び出し元が責任をもって \fBfree\fP(3) する必要がある)。 + +\fBmalloc_set_state\fP() 関数は、 \fBmalloc\fP(3) 内部のすべての管理用変数を \fIstate\fP が指す opaque +なデータ構造体から復元する。 +.SH 返り値 +成功すると、 \fBmalloc_get_state\fP() は新しく割り当てられたデータ構造体へのポインターを返す。 エラーの場合 +(例えば、データ構造体に必要なメモリーが割り当てられなかったなど)、 \fBmalloc_get_state\fP() は NULL を返す。 + +.\" if(ms->magic != MALLOC_STATE_MAGIC) return -1; +.\" /* Must fail if the major version is too high. */ +.\" if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2; +成功すると、 \fBmalloc_set_state\fP() は 0 を返す。 実装が \fIstate\fP +が正しく作成されたデータ構造体を指していないと検出した場合、 \fBmalloc_set_state\fP() は \-1 を返す。 \fIstate\fP +が参照するデータ構造体のバージョンがこの実装が認識するバージョンよりも新しいと実装が検出した場合、 \fBmalloc_set_state\fP() は \-2 +を返す。 +.SH 準拠 +これらの関数は GNU による拡張である。 +.SH 注意 +これらの関数が役に立つのは、 この \fBmalloc\fP(3) の実装が共有ライブラリの一部として使用され、 +ヒープの内容が何か他の方法で保存/復元される場合である。 この手法は GNU Emacs が「ダンプ」関数 ("dumping" function) +を実装するのに使用されている。 + +.\" i.e., calls __malloc_check_init() +.\" i.e., malloc checking is not already in use +.\" and the caller requested malloc checking +これらの関数がフック関数ポインターの保存と復元を行うことはない。 ただし、 2 つ例外がある。 \fBmalloc_get_state\fP() +が呼び出された際に malloc チェック (\fBmallopt\fP(3) 参照) が使用中の場合、 \fBmalloc_set_state\fP() +は可能なら malloc チェックフックをリセットする。 また、 保存された状態の malloc チェックが使用中でないが、 呼び出し元が malloc +チェックを要求していた場合、 フックは 0 にリセットされる。 +.SH 関連項目 +\fBmalloc\fP(3), \fBmallopt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/draft/man3/malloc_trim.3 b/draft/man3/malloc_trim.3 new file mode 100644 index 00000000..fee6b2b1 --- /dev/null +++ b/draft/man3/malloc_trim.3 @@ -0,0 +1,67 @@ +.\" t +.\" Copyright (c) 2012 by 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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MALLOC_TRIM 3 2014\-05\-28 Linux "Linux Programmer's Manual" +.SH 名前 +malloc_trim \- ヒープの一番上から未使用メモリーを解放する +.SH 書式 +\fB#include \fP + +\fBint malloc_trim(size_t \fP\fIpad\fP\fB);\fP +.SH 説明 +\fBmalloc_trim\fP() 関数は (適切な引き数で \fBsbrk\fP(2) を呼び出して) ヒープの一番上の未使用メモリーの解放を試みる。 + +\fIpad\fP 引き数は、 ヒープの一番上から切り詰める際に残す未使用領域の量を指定する。 この引き数が 0 の場合、 +ヒープの一番上の最小量のメモリーだけを維持できる (つまり 1 ページかそれ未満)。 0 以外の引き数を指定すると、 +ヒープの一番上にある程度の量の未使用領域を残し、 将来の割り当てを \fBsbrk\fP(2) でヒープを拡張せずに行えるようにできる。 +.SH 返り値 +\fBmalloc_trim\fP() 関数はメモリーが実際に解放されシステムに戻された場合に 1 を返し、 どのメモリーも解放できなかった場合は 0 +を返す。 +.SH エラー +.\" .SH VERSIONS +.\" Available already in glibc 2.0, possibly earlier +エラーは定義されていない。 +.SH 準拠 +この関数は GNU による拡張である。 +.SH 注意 +この関数は、 特定の状況では \fBfree\fP(3) により自動的に呼び出される。 \fBmallopt\fP(3) の \fBM_TOP_PAD\fP と +\fBM_TRIM_THRESHOLD\fP の議論を参照。 + +この関数は、 ヒープの一番上以外の場所にある未使用メモリーを解放することはできない。 + +.\" malloc/malloc.c::mTRIm(): +.\" return result | (av == &main_arena ? sYSTRIm (pad, av) : 0); +この関数はメイン領域のメモリーだけを解放する。 +.SH 関連項目 +\fBsbrk\fP(2), \fBmalloc\fP(3), \fBmallopt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/po4a/man2/po/ja.po b/po4a/man2/po/ja.po index 20fad40e..950e4bf6 100644 --- a/po4a/man2/po/ja.po +++ b/po4a/man2/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2015-01-23 22:24+0900\n" -"PO-Revision-Date: 2015-01-26 13:09+0900\n" +"PO-Revision-Date: 2015-01-27 02:55+0900\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -7618,7 +7618,7 @@ msgstr "2013-02-13" #. type: Plain text #: build/C/man2/perfmonctl.2:30 msgid "perfmonctl - interface to IA-64 performance monitoring unit" -msgstr "" +msgstr "perfmonctl - IA-64 の PMU (性能監視ユニット) のインターフェース" #. type: Plain text #: build/C/man2/perfmonctl.2:34 @@ -7643,7 +7643,7 @@ msgid "" "PMU (performance monitoring unit). The PMU consists of PMD (performance " "monitoring data) registers and PMC (performance monitoring control) " "registers, which gather hardware statistics." -msgstr "" +msgstr "IA-64 固有の B() システムコールは PMU (性能監視ユニット; performance monitoring unit) へのインターフェースを提供する。 PMU は PMD (performance monitoring data) レジスターと PMC (performance monitoring control) レジスターで構成され、 ハードウェアの統計を収集する。" #. type: Plain text #: build/C/man2/perfmonctl.2:57 @@ -7651,12 +7651,12 @@ msgid "" "B() applies the operation I to the input arguments " "specified by I. The number of arguments is defined by I. The " "I argument specifies the perfmon context to operate on." -msgstr "" +msgstr "B() は、 操作 I を I で指定された入力引き数で行う。 引き数の数は I で規定される。 I 引き数は操作対象の perfmon コンテキストを指定する。" #. type: Plain text #: build/C/man2/perfmonctl.2:61 msgid "Supported values for I are:" -msgstr "" +msgstr "I に指定できる値は以下のとおりである。" #. type: TP #: build/C/man2/perfmonctl.2:61 @@ -7668,12 +7668,12 @@ msgstr "B" #: build/C/man2/perfmonctl.2:65 #, no-wrap msgid "BIB<, PFM_CREATE_CONTEXT, pfarg_context_t *>IB<, 1);>\n" -msgstr "" +msgstr "BIB<, PFM_CREATE_CONTEXT, pfarg_context_t *>IB<, 1);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:67 msgid "Set up a context." -msgstr "" +msgstr "コンテキストを用意する。" #. type: Plain text #: build/C/man2/perfmonctl.2:74 @@ -7681,7 +7681,7 @@ msgid "" "The I parameter is ignored. A new perfmon context is created as " "specified in I and its file descriptor is returned in Ictx_fd>." -msgstr "" +msgstr "I 引き数は無視される。 新しい perfmon コンテキストを I で指定した内容で作成し、 そのファイルディスクリプターを Ictx_fd> で返す。" #. type: Plain text #: build/C/man2/perfmonctl.2:86 @@ -7690,13 +7690,13 @@ msgid "" "can be used to read event notifications (type I) using " "B(2). The file descriptor is pollable using B(2), B(2), B(7) で状態監視 (ポーリング) することができる。" #. type: Plain text #: build/C/man2/perfmonctl.2:90 msgid "" "The context can be destroyed by calling B(2) on the file descriptor." -msgstr "" +msgstr "コンテキストを破棄するには、 そのファイルディスクリプターに対して B(2) を呼び出す。" #. type: TP #: build/C/man2/perfmonctl.2:90 @@ -7713,7 +7713,7 @@ msgstr "BIB<, PFM_WRITE_PMCS, pfarg_reg_t *>IB<, n);> #. type: Plain text #: build/C/man2/perfmonctl.2:97 msgid "Set PMC registers." -msgstr "" +msgstr "PMC レジスターを設定する。" #. type: TP #: build/C/man2/perfmonctl.2:97 @@ -7731,7 +7731,7 @@ msgstr "BIB<, PFM_WRITE_PMDS, pfarg_reg_t *>IB<, n);> #. type: Plain text #: build/C/man2/perfmonctl.2:104 msgid "Set PMD registers." -msgstr "" +msgstr "PMD レジスターを設定する。" #. type: TP #: build/C/man2/perfmonctl.2:104 @@ -7748,7 +7748,7 @@ msgstr "BIB<, PFM_READ_PMDS, pfarg_reg_t *>IB<, n);>\ #. type: Plain text #: build/C/man2/perfmonctl.2:111 msgid "Read PMD registers." -msgstr "" +msgstr "PMD レジスターを読み出す。" #. type: TP #: build/C/man2/perfmonctl.2:111 @@ -7766,7 +7766,7 @@ msgstr "BIB<, PFM_START, NULL, 0);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:119 msgid "Start monitoring." -msgstr "" +msgstr "監視を開始する。" #. type: TP #: build/C/man2/perfmonctl.2:119 @@ -7783,7 +7783,7 @@ msgstr "BIB<, PFM_STOP, NULL, 0);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:126 msgid "Stop monitoring." -msgstr "" +msgstr "監視を停止する。" #. type: TP #: build/C/man2/perfmonctl.2:126 @@ -7800,7 +7800,7 @@ msgstr "BIB<, PFM_LOAD_CONTEXT, pfarg_load_t *>IB<, #. type: Plain text #: build/C/man2/perfmonctl.2:133 msgid "Attach the context to a thread." -msgstr "" +msgstr "指定したコンテキストをスレッドに接続する。" #. type: TP #: build/C/man2/perfmonctl.2:133 @@ -7817,7 +7817,7 @@ msgstr "BIB<, PFM_UNLOAD_CONTEXT, NULL, 0);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:140 msgid "Detach the context from a thread." -msgstr "" +msgstr "指定したコンテキストをスレッドが切り離す。" #. type: TP #: build/C/man2/perfmonctl.2:140 @@ -7834,7 +7834,7 @@ msgstr "BIB<, PFM_RESTART, NULL, 0);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:147 msgid "Restart monitoring after receiving an overflow notification." -msgstr "" +msgstr "オーバーフロー通知を受信した後、 監視を再開する。" #. type: TP #: build/C/man2/perfmonctl.2:147 @@ -7863,7 +7863,7 @@ msgstr "BIB<, PFM_DEBUG, >IB<, 0);>\n" #. type: Plain text #: build/C/man2/perfmonctl.2:162 msgid "If I is nonzero, enable debugging mode, otherwise disable." -msgstr "" +msgstr "I が 0 以外の場合、デバッグモードを有効にする。 そうでない場合、 無効にする。" #. type: TP #: build/C/man2/perfmonctl.2:162 @@ -7901,26 +7901,26 @@ msgstr "BIB<, PFM_GET_PMC_RESET_VAL, pfarg_reg_t * >IB #. type: Plain text #: build/C/man2/perfmonctl.2:190 msgid "Reset PMC registers to default values." -msgstr "" +msgstr "PMC レジスターをデフォルト値にリセットする。" #. type: Plain text #: build/C/man2/perfmonctl.2:196 msgid "" "B() returns zero when the operation is successful. On error, " "-1 is returned and I is set to indicate the cause of the error." -msgstr "" +msgstr "B() は操作が成功すると 0 を返す。 エラーの場合、 -1 が返り、 I にエラーの原因を示す値が設定される。" #. type: Plain text #: build/C/man2/perfmonctl.2:199 msgid "B() is available since Linux 2.4." -msgstr "" +msgstr "B() は Linux 2.4 以降で利用可能である。" #. type: Plain text #: build/C/man2/perfmonctl.2:202 msgid "" "B() is Linux-specific and is available only on the IA-64 " "architecture." -msgstr "" +msgstr "B() は Linux 固有で、 IA-64 アーキテクチャーでのみ利用できる。" #. type: Plain text #: build/C/man2/perfmonctl.2:207 @@ -7930,7 +7930,7 @@ msgstr "B(1)" #. type: Plain text #: build/C/man2/perfmonctl.2:209 msgid "The perfmon2 interface specification" -msgstr "" +msgstr "perfmon2 インターフェース仕様" #. type: TH #: build/C/man2/personality.2:32 @@ -8318,7 +8318,7 @@ msgstr "" #: build/C/man2/process_vm_readv.2:54 msgid "" "Feature Test Macro Requirements for glibc (see B(7)):" -msgstr "" +msgstr "glibc 向けの機能検査マクロの要件 (B(7) 参照):" #. type: Plain text #: build/C/man2/process_vm_readv.2:58 @@ -8337,7 +8337,7 @@ msgid "" "process (\"the local process\") and the process identified by I (\"the " "remote process\"). The data moves directly between the address spaces of " "the two processes, without passing through kernel space." -msgstr "" +msgstr "これらのシステムコールは、 呼び出し元プロセス (「ローカルプロセス」) と I で指定されるプロセス (「リモートプロセス」) のアドレス空間間でデータを転送する。 データの移動は、 カーネル空間を経由することなく、 2 つのプロセスのアドレス空間間で直接行われる。" #. type: Plain text #: build/C/man2/process_vm_readv.2:98 @@ -8350,7 +8350,7 @@ msgid "" "locations specified by I and I: I is a " "pointer to an array describing address ranges in the calling process, and " "I specifies the number of elements in I." -msgstr "" +msgstr "B() システムコールは、 リモートプロセスからローカルプロセスへデータを転送する。 転送対象のデータは I と I で指定される。 I はプロセス I におけるアドレス範囲を指定する配列へのポインターで、 I は I の要素数を指定する。 データは I と I で指定された場所に転送される。 I は呼び出し元プロセスにおけるアドレス範囲を指定する配列で、 I は I の要素数を指定する。" #. type: Plain text #: build/C/man2/process_vm_readv.2:112 @@ -8360,7 +8360,7 @@ msgid "" "remote process. Other than the direction of the transfer, the arguments " "I, I, I, and I have the same " "meaning as for B()." -msgstr "" +msgstr "B() システムコールは B() の逆で、 ローカルプロセスからリモートプロセスにデータを転送する。 転送の方向が違う以外は、 引き数 I, I, I, I は B() と同じ意味を持つ。" #. type: Plain text #: build/C/man2/process_vm_readv.2:122 @@ -8393,12 +8393,7 @@ msgid "" "B() completely fills I before proceeding to " "I, and so on. Likewise, I is completely read " "before proceeding to I, and so on." -msgstr "" -"バッファーは配列の順序で処理される。これは、 B() が\n" -"I[0] が完全に一杯になるまでデータを詰めてから、\n" -"I[1] に進むといったことを意味する。同様に、\n" -"I[0] を完全に読み出してから I[1] に進み、\n" -"以降も同様である。" +msgstr "バッファーは配列の順序で処理される。 つまり、 B() は I[0] が一杯になるまでデータを詰めてから、 I[1] に進むことを意味する。 同様に、 I[0] を全部読み出してから I[1] に進み、 以降も同様である。" #. type: Plain text #: build/C/man2/process_vm_readv.2:156 @@ -8406,7 +8401,7 @@ msgid "" "Similarly, B() writes out the entire contents of " "I before proceeding to I, and it completely " "fills I before proceeding to I." -msgstr "" +msgstr "同様に、 B() は I の内容を全部読み出してから I に進み、 書き込み先でも I が一杯になってから I に進む。" #. type: Plain text #: build/C/man2/process_vm_readv.2:164 @@ -8414,7 +8409,7 @@ msgid "" "The lengths of I and I do not " "have to be the same. Thus, it is possible to split a single local buffer " "into multiple remote buffers, or vice versa." -msgstr "" +msgstr "長さ I と I は同じである必要はない。 したがって、 ローカル側で 1 つのバッファーのデータがリモート側で複数のバッファーに分割されることがあるし、 その逆も起こりえる。" #. type: Plain text #: build/C/man2/process_vm_readv.2:168 @@ -8429,7 +8424,7 @@ msgid "" "The values specified in the I and I arguments must be less " "than or equal to B (defined in Ilimits.hE> or accessible " "via the call I)." -msgstr "" +msgstr "I と I で指定される値は B 以下でなければならない (B は Ilimits.hE> で定義されており、 I の呼び出しでも入手できる)。" #. type: Plain text #: build/C/man2/process_vm_readv.2:191 @@ -8438,7 +8433,7 @@ msgid "" "transfers. If the counts are too big, or I is invalid, or the " "addresses refer to regions that are inaccessible to the local process, none " "of the vectors will be processed and an error will be returned immediately." -msgstr "" +msgstr "要素数引き数と I のチェックは、 すべてのデータ転送に先立って行われる。 要素数が大きすぎる場合や I が無効な場合、 アドレスがローカルプロセスがアクセスできない領域を参照している場合は、 配列のどの要素も処理されず、 すぐにエラーが返される。" #. type: Plain text #: build/C/man2/process_vm_readv.2:211 @@ -8456,6 +8451,8 @@ msgid "" "entry goes up to the page boundary, while the second starts on the next page " "boundary.)" msgstr "" +"ただし、 これらのシステムコールは、 実際に読み出し/書き込みを行う直前までリモートプロセスのメモリー領域のチェックを行わない点に注意すること。 結果として、 I の要素の一つがリモートプロセスで無効なメモリー領域を参照している場合、 部分的な読み出し/書き込み (「返り値」の節を参照) が行われることになる。 これ以降は読み出し/書き込みは行われない。 リモートプロセスから長さ不明のデータ (例えば NULL 終端された C 文字列) を読み出す際で、 リモート側の一つの I 要素が複数のメモリーページ (通常は 4KiB) にまたがらないようにしている場合は、 この点に注意が必要である。\n" +"(リモートからの読み出しを 2 つの I 要素に分割し、 1 つの I 要素への書き込みにマージすればよい。 最初の読み出しでページ境界まで読み出し、 次の読み出しを次のページ境界から行う。)" #. type: Plain text #: build/C/man2/process_vm_readv.2:225 @@ -8467,7 +8464,7 @@ msgid "" "group-ID of the remote process must match the real group ID of the caller. " "(The permission required is exactly the same as that required to perform a " "B(2) B on the remote process.)" -msgstr "" +msgstr "他のプロセスからの読み出しや他のプロセスへの書き込みを行うには、 呼び出し元がケーパビリティ B を持っていなければならない、もしくは、 リモートプロセスの実ユーザー ID、 実効ユーザー ID、 保存 set-user-ID が呼び出し元の実ユーザー ID と一致し、 かつリモートプロセスの実グループ ID、 実効グループ ID、 保存 set-group-ID が呼び出し元の実グループ ID と一致していなければならない。 (ここで必要なアクセス許可は、 リモートプロセスに対して B(2) の B を実行するのに必要な許可と全く同じである。)" #. type: Plain text #: build/C/man2/process_vm_readv.2:241 @@ -8479,7 +8476,7 @@ msgid "" "I elements. These system calls won't perform a partial transfer that " "splits a single I element.) The caller should check the return value " "to determine whether a partial read/write occurred." -msgstr "" +msgstr "成功すると、 B() は読み出したバイト数を返し、 B() は書き込んだバイト数を返す。 この返り値は、 読み出し/書き込みが部分的に行われた場合には、 要求された総バイト数よりも小さくなることがある (部分的な転送は I 要素単位に行われ、 これらのシステムコールが一つの I 要素の一部だけが転送されることはない)。 呼び出し元は返り値を検査して、 部分的な読み出し/書き込みが起こったかどうかを判定できる。" #. type: Plain text #: build/C/man2/process_vm_readv.2:245 @@ -8491,7 +8488,7 @@ msgstr "エラーの場合は -1 が返され、 I が適切に設定さ msgid "" "The sum of the I values of either I or I " "overflows a I value." -msgstr "" +msgstr "I か I のいずれかの I の合計値が I で表現できる値を超えている。" #. type: Plain text #: build/C/man2/process_vm_readv.2:261 @@ -8508,22 +8505,20 @@ msgstr "I か I が大きすぎる。" msgid "" "The memory described by I is outside the caller's accessible " "address space." -msgstr "" -"I が示すメモリーが呼び出し側がアクセス可能な\n" -"アドレス空間の外にある。" +msgstr "I で指定されたメモリーが呼び出し元がアクセス可能なアドレス空間の外にある。" #. type: Plain text #: build/C/man2/process_vm_readv.2:278 msgid "" "The memory described by I is outside the accessible address " "space of the process I." -msgstr "" +msgstr "I で指定されたメモリーがプロセス I がアクセス可能なアドレス空間の外にある。" #. type: Plain text #: build/C/man2/process_vm_readv.2:283 msgid "" "Could not allocate memory for internal copies of the I structures." -msgstr "" +msgstr "I 構造体の内部コピーのためのメモリーを割り当てできなかった。" #. type: Plain text #: build/C/man2/process_vm_readv.2:287 @@ -8558,7 +8553,7 @@ msgstr "これらのシステムコールは非標準で Linux による拡張 msgid "" "The data transfers performed by B() and " "B() are not guaranteed to be atomic in any way." -msgstr "" +msgstr "B() と B() により実行されるデータ転送をどのように行ったとしても、 これらがアトミックに行われる保証はない。" #. Original user is MPI, http://www.mcs.anl.gov/research/projects/mpi/ #. See also some benchmarks at http://lwn.net/Articles/405284/ @@ -8571,6 +8566,8 @@ msgid "" "double copy that would be required when using, for example, shared memory or " "pipes)." msgstr "" +"これらのシステムコールは、 (共有メモリーやパイプなどを使った場合に必要となる 2 回のコピーではなく)\n" +"1 回のコピー処理でメッセージの交換を許すことで、 高速なメッセージ送信をできるようにするために設計された。" #. type: Plain text #: build/C/man2/process_vm_readv.2:319 @@ -8578,7 +8575,7 @@ msgid "" "The following code sample demonstrates the use of B(). It " "reads 20 bytes at the address 0x10000 from the process with PID 10 and " "writes the first 10 bytes into I and the second 10 bytes into I." -msgstr "" +msgstr "以下のサンプルコードは B() の使用例を示すものである。 このコードは PID 10 のプロセスのアドレス 0x10000 から 20 バイトを読み取り、 最初の 10 バイトを I に、 残りの 10 バイトを I に書き込む。" #. type: Plain text #: build/C/man2/process_vm_readv.2:322 diff --git a/po4a/memory/po/ja.po b/po4a/memory/po/ja.po index 084aad16..cffc65db 100644 --- a/po4a/memory/po/ja.po +++ b/po4a/memory/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2015-01-23 22:24+0900\n" -"PO-Revision-Date: 2015-01-25 07:20+0900\n" +"PO-Revision-Date: 2015-01-27 03:42+0900\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -2635,7 +2635,7 @@ msgstr "2014-06-13" msgid "" "malloc_get_state, malloc_set_state - record and restore state of malloc " "implementation" -msgstr "" +msgstr "malloc_get_state, malloc_set_state - malloc 実装の状態を保存/復元する" #. type: Plain text #: build/C/man3/malloc_get_state.3:31 build/C/man3/malloc_hook.3:18 @@ -2666,7 +2666,7 @@ msgid "" "allocated via B(3), and a pointer to that data structure is returned " "as the function result. (It is the caller's responsibility to B(3) " "this memory.)" -msgstr "" +msgstr "B() 関数は B(3) 内部のすべての管理用変数を記録する (ただし、 ヒープの実際の内容と B(3) 関数ポインターの状態は記録されない)。 状態は B(3) で動的に確保されたシステム依存の opaque な (内部構造は分からない) データ構造体に記録され、 関数の結果としてそのデータ構造体へのポインターが返される (このメモリーは呼び出し元が責任をもって B(3) する必要がある)。" #. type: Plain text #: build/C/man3/malloc_get_state.3:61 @@ -2674,7 +2674,7 @@ msgid "" "The B() function restores the state of all B(3) " "internal bookkeeping variables to the values recorded in the opaque data " "structure pointed to by I." -msgstr "" +msgstr "B() 関数は、 B(3) 内部のすべての管理用変数を I が指す opaque なデータ構造体から復元する。" #. type: Plain text #: build/C/man3/malloc_get_state.3:68 @@ -2682,7 +2682,7 @@ msgid "" "On success, B() returns a pointer to a newly allocated " "opaque data structure. On error (for example, memory could not be allocated " "for the data structure), B() returns NULL." -msgstr "" +msgstr "成功すると、 B() は新しく割り当てられたデータ構造体へのポインターを返す。 エラーの場合 (例えば、データ構造体に必要なメモリーが割り当てられなかったなど)、 B() は NULL を返す。" #. if(ms->magic != MALLOC_STATE_MAGIC) return -1; #. /* Must fail if the major version is too high. */ @@ -2696,7 +2696,7 @@ msgid "" "version of the data structure referred to by I is a more recent " "version than this implementation knows about, B() returns " "-2." -msgstr "" +msgstr "成功すると、 B() は 0 を返す。 実装が I が正しく作成されたデータ構造体を指していないと検出した場合、 B() は -1 を返す。 I が参照するデータ構造体のバージョンがこの実装が認識するバージョンよりも新しいと実装が検出した場合、 B() は -2 を返す。" #. type: Plain text #: build/C/man3/malloc_get_state.3:88 build/C/man3/malloc_hook.3:82 @@ -2711,7 +2711,7 @@ msgid "" "part of a shared library, and the heap contents are saved/restored via some " "other method. This technique is used by GNU Emacs to implement its \"dumping" "\" function." -msgstr "" +msgstr "これらの関数が役に立つのは、 この B(3) の実装が共有ライブラリの一部として使用され、 ヒープの内容が何か他の方法で保存/復元される場合である。 この手法は GNU Emacs が「ダンプ」関数 (\"dumping\" function) を実装するのに使用されている。" #. i.e., calls __malloc_check_init() #. i.e., malloc checking is not already in use @@ -2725,7 +2725,7 @@ msgid "" "checking hooks if possible; if malloc checking was not in use in the " "recorded state, but the caller has requested malloc checking, then the hooks " "are reset to 0." -msgstr "" +msgstr "これらの関数がフック関数ポインターの保存と復元を行うことはない。 ただし、 2 つ例外がある。 B() が呼び出された際に malloc チェック (B(3) 参照) が使用中の場合、 B() は可能なら malloc チェックフックをリセットする。 また、 保存された状態の malloc チェックが使用中でないが、 呼び出し元が malloc チェックを要求していた場合、 フックは 0 にリセットされる。" #. type: Plain text #: build/C/man3/malloc_get_state.3:114 @@ -3587,7 +3587,7 @@ msgstr "2014-05-28" #. type: Plain text #: build/C/man3/malloc_trim.3:29 msgid "malloc_trim - release free memory from the top of the heap" -msgstr "" +msgstr "malloc_trim - ヒープの一番上から未使用メモリーを解放する" #. type: Plain text #: build/C/man3/malloc_trim.3:33 @@ -3599,7 +3599,7 @@ msgstr "BIB<);>" msgid "" "The B() function attempts to release free memory at the top of " "the heap (by calling B(2) with a suitable argument)." -msgstr "" +msgstr "B() 関数は (適切な引き数で B(2) を呼び出して) ヒープの一番上の未使用メモリーの解放を試みる。" #. type: Plain text #: build/C/man3/malloc_trim.3:51 @@ -3610,21 +3610,21 @@ msgid "" "nonzero argument can be used to maintain some trailing space at the top of " "the heap in order to allow future allocations to be made without having to " "extend the heap with B(2)." -msgstr "" +msgstr "I 引き数は、 ヒープの一番上から切り詰める際に残す未使用領域の量を指定する。 この引き数が 0 の場合、 ヒープの一番上の最小量のメモリーだけを維持できる (つまり 1 ページかそれ未満)。 0 以外の引き数を指定すると、 ヒープの一番上にある程度の量の未使用領域を残し、 将来の割り当てを B(2) でヒープを拡張せずに行えるようにできる。" #. type: Plain text #: build/C/man3/malloc_trim.3:56 msgid "" "The B() function returns 1 if memory was actually released " "back to the system, or 0 if it was not possible to release any memory." -msgstr "" +msgstr "B() 関数はメモリーが実際に解放されシステムに戻された場合に 1 を返し、 どのメモリーも解放できなかった場合は 0 を返す。" #. .SH VERSIONS #. Available already in glibc 2.0, possibly earlier #. type: Plain text #: build/C/man3/malloc_trim.3:60 msgid "No errors are defined." -msgstr "" +msgstr "エラーは定義されていない。" #. type: Plain text #: build/C/man3/malloc_trim.3:71 @@ -3632,21 +3632,21 @@ msgid "" "This function is automatically called by B(3) in certain " "circumstances; see the discussion of B and B in " "B(3)." -msgstr "" +msgstr "この関数は、 特定の状況では B(3) により自動的に呼び出される。 B(3) の B と B の議論を参照。" #. type: Plain text #: build/C/man3/malloc_trim.3:74 msgid "" "This function cannot release free memory located at places other than the " "top of the heap." -msgstr "" +msgstr "この関数は、 ヒープの一番上以外の場所にある未使用メモリーを解放することはできない。" #. malloc/malloc.c::mTRIm(): #. return result | (av == &main_arena ? sYSTRIm (pad, av) : 0); #. type: Plain text #: build/C/man3/malloc_trim.3:78 msgid "This function releases only memory in the main arena." -msgstr "" +msgstr "この関数はメイン領域のメモリーだけを解放する。" #. type: Plain text #: build/C/man3/malloc_trim.3:82 diff --git a/release/man2/perfmonctl.2 b/release/man2/perfmonctl.2 new file mode 100644 index 00000000..51130298 --- /dev/null +++ b/release/man2/perfmonctl.2 @@ -0,0 +1,180 @@ +.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. +.\" and Copyright (C) 2013 Michael Kerrisk +.\" Written by Ivana Varekova +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH PERFMONCTL 2 2013\-02\-13 Linux "Linux Programmer's Manual" +.SH 名前 +perfmonctl \- IA\-64 の PMU (性能監視ユニット) のインターフェース +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBlong perfmonctl(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, void *\fP\fIarg\fP\fB, int \fP\fInarg\fP\fB);\fP +.fi +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +IA\-64 固有の \fBperfmonctl\fP() システムコールは PMU (性能監視ユニット; performance monitoring +unit) へのインターフェースを提供する。 PMU は PMD (performance monitoring data) レジスターと PMC +(performance monitoring control) レジスターで構成され、 ハードウェアの統計を収集する。 + +\fBperfmonctl\fP() は、 操作 \fIcmd\fP を \fIarg\fP で指定された入力引き数で行う。 引き数の数は \fInarg\fP で規定される。 +\fIfd\fP 引き数は操作対象の perfmon コンテキストを指定する。 + +\fIcmd\fP に指定できる値は以下のとおりである。 +.TP +\fBPFM_CREATE_CONTEXT\fP +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_CREATE_CONTEXT, pfarg_context_t *\fP\fIctxt\fP\fB, 1);\fP +.fi +コンテキストを用意する。 + +\fIfd\fP 引き数は無視される。 新しい perfmon コンテキストを \fIctxt\fP で指定した内容で作成し、 そのファイルディスクリプターを +\fIctxt\->ctx_fd\fP で返す。 + +ファイルディスクリプターはそれ以降の \fBperfmonctl\fP() の呼び出しで使用したり、 \fBread\fP(2) を使ってイベント通知 +(\fIpfm_msg_t\fP 型) を読み出したりするのに使用できる。 このファイルディスクリプターは \fBselect\fP(2), \fBpoll\fP(2), +\fBepoll\fP(7) で状態監視 (ポーリング) することができる。 + +コンテキストを破棄するには、 そのファイルディスクリプターに対して \fBclose\fP(2) を呼び出す。 +.TP +\fBPFM_WRITE_PMCS\fP +.\" pfm_write_pmcs() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMCS, pfarg_reg_t *\fP\fIpmcs\fP\fB, n);\fP +.fi +PMC レジスターを設定する。 +.TP +\fBPFM_WRITE_PMDS\fP +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP +.fi +.\" pfm_write_pmds() +PMD レジスターを設定する。 +.TP +\fBPFM_READ_PMDS\fP +.\" pfm_read_pmds() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_READ_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP +.fi +PMD レジスターを読み出す。 +.TP +\fBPFM_START\fP +.\" pfm_start() +.nf +.\" .BI "perfmonctl(int " fd ", PFM_START, arg, 1); +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_START, NULL, 0);\fP +.fi +監視を開始する。 +.TP +\fBPFM_STOP\fP +.\" pfm_stop() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_STOP, NULL, 0);\fP +.fi +監視を停止する。 +.TP +\fBPFM_LOAD_CONTEXT\fP +.\" pfm_context_load() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_LOAD_CONTEXT, pfarg_load_t *\fP\fIlargs\fP\fB, 1);\fP +.fi +指定したコンテキストをスレッドに接続する。 +.TP +\fBPFM_UNLOAD_CONTEXT\fP +.\" pfm_context_unload() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_UNLOAD_CONTEXT, NULL, 0);\fP +.fi +指定したコンテキストをスレッドが切り離す。 +.TP +\fBPFM_RESTART\fP +.\" pfm_restart() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_RESTART, NULL, 0);\fP +.fi +オーバーフロー通知を受信した後、 監視を再開する。 +.TP +\fBPFM_GET_FEATURES\fP +.\" pfm_get_features() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_FEARURES, pfarg_features_t *\fP\fIarg\fP\fB, 1);\fP +.fi +.TP +\fBPFM_DEBUG\fP +.\" pfm_debug() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_DEBUG, \fP\fIval\fP\fB, 0);\fP +.fi +\fIval\fP が 0 以外の場合、デバッグモードを有効にする。 そうでない場合、 無効にする。 +.TP +\fBPFM_GET_PMC_RESET_VAL\fP +.\" pfm_get_pmc_reset() +.nf +\fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_PMC_RESET_VAL, pfarg_reg_t * \fP\fIreq\fP\fB, n);\fP +.fi +.\" +.\" +.\" .TP +.\" .B PFM_CREATE_EVTSETS +.\" +.\" create or modify event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_CREATE_EVTSETS, pfarg_setdesc_t *desc , n); +.\" .fi +.\" .TP +.\" .B PFM_DELETE_EVTSETS +.\" delete event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_DELETE_EVTSET, pfarg_setdesc_t *desc , n); +.\" .fi +.\" .TP +.\" .B PFM_GETINFO_EVTSETS +.\" get information about event sets +.\" .nf +.\" .BI "perfmonctl(int " fd ", PFM_GETINFO_EVTSETS, pfarg_setinfo_t *info, n); +.\" .fi +PMC レジスターをデフォルト値にリセットする。 +.SH 返り値 +\fBperfmonctl\fP() は操作が成功すると 0 を返す。 エラーの場合、 \-1 が返り、 \fIerrno\fP にエラーの原因を示す値が設定される。 +.SH バージョン +\fBperfmonctl\fP() は Linux 2.4 以降で利用可能である。 +.SH 準拠 +\fBperfmonctl\fP() は Linux 固有で、 IA\-64 アーキテクチャーでのみ利用できる。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +.SH 関連項目 +\fBgprof\fP(1) + +perfmon2 インターフェース仕様 +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/release/man2/process_vm_readv.2 b/release/man2/process_vm_readv.2 new file mode 100644 index 00000000..509b155a --- /dev/null +++ b/release/man2/process_vm_readv.2 @@ -0,0 +1,212 @@ +.\" Copyright (C) 2011 Christopher Yeoh +.\" and Copyright (C) 2012 Mike Frysinger +.\" and Copyright (C) 2012 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 +.\" +.\" Commit fcf634098c00dd9cd247447368495f0b79be12d1 +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH PROCESS_VM_READV 2 2014\-08\-19 Linux "Linux Programmer's Manual" +.SH 名前 +process_vm_readv, process_vm_writev \- プロセスのアドレス空間間でデータを転送する +.SH 書式 +.nf +\fB#include \fP + +\fBssize_t process_vm_readv(pid_t \fP\fIpid\fP\fB,\fP +\fB const struct iovec *\fP\fIlocal_iov\fP\fB,\fP +\fB unsigned long \fP\fIliovcnt\fP\fB,\fP +\fB const struct iovec *\fP\fIremote_iov\fP\fB,\fP +\fB unsigned long \fP\fIriovcnt\fP\fB,\fP +\fB unsigned long \fP\fIflags\fP\fB);\fP + +\fBssize_t process_vm_writev(pid_t \fP\fIpid\fP\fB,\fP +\fB const struct iovec *\fP\fIlocal_iov\fP\fB,\fP +\fB unsigned long \fP\fIliovcnt\fP\fB,\fP +\fB const struct iovec *\fP\fIremote_iov\fP\fB,\fP +\fB unsigned long \fP\fIriovcnt\fP\fB,\fP +\fB unsigned long \fP\fIflags\fP\fB);\fP +.fi +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBprocess_vm_readv\fP(), \fBprocess_vm_writev\fP(): +.PD 0 +.ad l +.RS 4 +\fB_GNU_SOURCE\fP +.RE +.ad +.PD +.fi +.SH 説明 +これらのシステムコールは、 呼び出し元プロセス (「ローカルプロセス」) と \fIpid\fP で指定されるプロセス (「リモートプロセス」) +のアドレス空間間でデータを転送する。 データの移動は、 カーネル空間を経由することなく、 2 つのプロセスのアドレス空間間で直接行われる。 + +\fBprocess_vm_readv\fP() システムコールは、 リモートプロセスからローカルプロセスへデータを転送する。 転送対象のデータは +\fIremote_iov\fP と \fIriovcnt\fP で指定される。 \fIremote_iov\fP はプロセス \fIpid\fP +におけるアドレス範囲を指定する配列へのポインターで、 \fIriovcnt\fP は \fIremote_iov\fP の要素数を指定する。 データは +\fIlocal_iov\fP と \fIliovcnt\fP で指定された場所に転送される。 \fIlocal_iov\fP +は呼び出し元プロセスにおけるアドレス範囲を指定する配列で、 \fIliovcnt\fP は \fIlocal_iov\fP の要素数を指定する。 + +\fBprocess_vm_writev\fP() システムコールは \fBprocess_vm_readv\fP() の逆で、 +ローカルプロセスからリモートプロセスにデータを転送する。 転送の方向が違う以外は、 引き数 \fIliovcnt\fP, \fIlocal_iov\fP, +\fIriovcnt\fP, \fIremote_iov\fP は \fBprocess_vm_readv\fP() と同じ意味を持つ。 + +引き数 \fIlocal_iov\fP と \fIremote_iov\fP は \fIiovec\fP 構造体の配列へのポイン +タである。 \fIiovec\fP 構造体は \fI\fP で以下のように定義 +されている: + +.in +4n +.nf +struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes to transfer */ +}; +.fi +.in + +バッファーは配列の順序で処理される。 つまり、 \fBprocess_vm_readv\fP() は \fIlocal_iov\fP[0] +が一杯になるまでデータを詰めてから、 \fIlocal_iov\fP[1] に進むことを意味する。 同様に、 \fIremote_iov\fP[0] +を全部読み出してから \fIremote_iov\fP[1] に進み、 以降も同様である。 + +同様に、 \fBprocess_vm_writev\fP() は \fIlocal_iov[0]\fP の内容を全部読み出してから \fIlocal_iov[1]\fP +に進み、 書き込み先でも \fIremote_iov[0]\fP が一杯になってから \fIremote_iov[1]\fP に進む。 + +長さ \fIremote_iov[i].iov_len\fP と \fIlocal_iov[i].iov_len\fP は同じである必要はない。 したがって、 +ローカル側で 1 つのバッファーのデータがリモート側で複数のバッファーに分割されることがあるし、 その逆も起こりえる。 + +\fIflags\fP 引き数は現在使用されておらず、 0 を設定しなければならない。 + +.\" In time, glibc might provide a wrapper that works around this limit, +.\" as is done for readv()/writev() +\fIliovcnt\fP と \fIriovcnt\fP で指定される値は \fBIOV_MAX\fP 以下でなければならない (\fBIOV_MAX\fP は +\fI\fP で定義されており、 \fIsysconf(_SC_IOV_MAX)\fP の呼び出しでも入手できる)。 + +要素数引き数と \fIlocal_iov\fP のチェックは、 すべてのデータ転送に先立って行われる。 要素数が大きすぎる場合や \fIlocal_iov\fP +が無効な場合、 アドレスがローカルプロセスがアクセスできない領域を参照している場合は、 配列のどの要素も処理されず、 すぐにエラーが返される。 + +ただし、 これらのシステムコールは、 実際に読み出し/書き込みを行う直前までリモートプロセスのメモリー領域のチェックを行わない点に注意すること。 +結果として、 \fIremote_iov\fP の要素の一つがリモートプロセスで無効なメモリー領域を参照している場合、 部分的な読み出し/書き込み +(「返り値」の節を参照) が行われることになる。 これ以降は読み出し/書き込みは行われない。 リモートプロセスから長さ不明のデータ (例えば NULL +終端された C 文字列) を読み出す際で、 リモート側の一つの \fIiovec\fP 要素が複数のメモリーページ (通常は 4KiB) +にまたがらないようにしている場合は、 この点に注意が必要である。 +(リモートからの読み出しを 2 つの \fIremote_iov\fP 要素に分割し、 1 つの \fIlocal_iov\fP +要素への書き込みにマージすればよい。 最初の読み出しでページ境界まで読み出し、 次の読み出しを次のページ境界から行う。) + +他のプロセスからの読み出しや他のプロセスへの書き込みを行うには、 呼び出し元がケーパビリティ \fBCAP_SYS_PTRACE\fP +を持っていなければならない、もしくは、 リモートプロセスの実ユーザー ID、 実効ユーザー ID、 保存 set\-user\-ID +が呼び出し元の実ユーザー ID と一致し、 かつリモートプロセスの実グループ ID、 実効グループ ID、 保存 set\-group\-ID +が呼び出し元の実グループ ID と一致していなければならない。 (ここで必要なアクセス許可は、 リモートプロセスに対して \fBptrace\fP(2) の +\fBPTRACE_ATTACH\fP を実行するのに必要な許可と全く同じである。) +.SH 返り値 +成功すると、 \fBprocess_vm_readv\fP() は読み出したバイト数を返し、 \fBprocess_vm_writev\fP() +は書き込んだバイト数を返す。 この返り値は、 読み出し/書き込みが部分的に行われた場合には、 要求された総バイト数よりも小さくなることがある +(部分的な転送は \fIiovec\fP 要素単位に行われ、 これらのシステムコールが一つの \fIiovec\fP 要素の一部だけが転送されることはない)。 +呼び出し元は返り値を検査して、 部分的な読み出し/書き込みが起こったかどうかを判定できる。 + +エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +.TP +\fBEINVAL\fP +\fIlocal_iov\fP か \fIremote_iov\fP のいずれかの \fIiov_len\fP の合計値が \fIssize_t\fP +で表現できる値を超えている。 +.TP +\fBEINVAL\fP +\fIflags\fP が 0 でない。 +.TP +\fBEINVAL\fP +\fIliovcnt\fP か \fIriovcnt\fP が大きすぎる。 +.TP +\fBEFAULT\fP +\fIlocal_iov\fP で指定されたメモリーが呼び出し元がアクセス可能なアドレス空間の外にある。 +.TP +\fBEFAULT\fP +\fIremote_iov\fP で指定されたメモリーがプロセス \fIpid\fP がアクセス可能なアドレス空間の外にある。 +.TP +\fBENOMEM\fP +\fIiovec\fP 構造体の内部コピーのためのメモリーを割り当てできなかった。 +.TP +\fBEPERM\fP +呼び出し側がプロセス \fIpid\fP のアドレス空間に対するアクセス許可を +持っていない。 +.TP +\fBESRCH\fP +ID が \fIpid\fP のプロセスが存在しない。 +.SH バージョン +これらのシステムコールは Linux 3.2 で追加された。ライブラリによる +サポートは glibc バージョン 2.15 以降で提供されている。 +.SH 準拠 +これらのシステムコールは非標準で Linux による拡張である。 +.SH 注意 +\fBprocess_vm_readv\fP() と \fBprocess_vm_writev\fP() により実行されるデータ転送をどのように行ったとしても、 +これらがアトミックに行われる保証はない。 + +.\" Original user is MPI, http://www.mcs.anl.gov/research/projects/mpi/ +.\" See also some benchmarks at http://lwn.net/Articles/405284/ +.\" and http://marc.info/?l=linux-mm&m=130105930902915&w=2 +これらのシステムコールは、 (共有メモリーやパイプなどを使った場合に必要となる 2 回のコピーではなく) +1 回のコピー処理でメッセージの交換を許すことで、 高速なメッセージ送信をできるようにするために設計された。 +.SH 例 +以下のサンプルコードは \fBprocess_vm_readv\fP() の使用例を示すものである。 このコードは PID 10 のプロセスのアドレス +0x10000 から 20 バイトを読み取り、 最初の 10 バイトを \fIbuf1\fP に、 残りの 10 バイトを \fIbuf2\fP に書き込む。 +.sp +.nf +#include + +int +main(void) +{ + struct iovec local[2]; + struct iovec remote[1]; + char buf1[10]; + char buf2[10]; + ssize_t nread; + pid_t pid = 10; /* PID of remote process */ + + local[0].iov_base = buf1; + local[0].iov_len = 10; + local[1].iov_base = buf2; + local[1].iov_len = 10; + remote[0].iov_base = (void *) 0x10000; + remote[0].iov_len = 20; + + nread = process_vm_readv(pid, local, 2, remote, 1, 0); + if (nread != 20) + return 1; + else + return 0; +} +.fi +.SH 関連項目 +\fBreadv\fP(2), \fBwritev\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/release/man3/malloc_get_state.3 b/release/man3/malloc_get_state.3 new file mode 100644 index 00000000..f659f4f0 --- /dev/null +++ b/release/man3/malloc_get_state.3 @@ -0,0 +1,79 @@ +.\" Copyright (c) 2012 by 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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MALLOC_GET_STATE 3 2014\-06\-13 GNU "Linux Programmer's Manual" +.SH 名前 +malloc_get_state, malloc_set_state \- malloc 実装の状態を保存/復元する +.SH 書式 +.nf +\fB#include \fP +.sp +\fBvoid* malloc_get_state(void);\fP + +\fBint malloc_set_state(void *\fP\fIstate\fP\fB);\fP +.fi +.SH 説明 +\fBmalloc_get_state\fP() 関数は \fBmalloc\fP(3) 内部のすべての管理用変数を記録する (ただし、 ヒープの実際の内容と +\fBmalloc_hook\fP(3) 関数ポインターの状態は記録されない)。 状態は \fBmalloc\fP(3) で動的に確保されたシステム依存の +opaque な (内部構造は分からない) データ構造体に記録され、 関数の結果としてそのデータ構造体へのポインターが返される +(このメモリーは呼び出し元が責任をもって \fBfree\fP(3) する必要がある)。 + +\fBmalloc_set_state\fP() 関数は、 \fBmalloc\fP(3) 内部のすべての管理用変数を \fIstate\fP が指す opaque +なデータ構造体から復元する。 +.SH 返り値 +成功すると、 \fBmalloc_get_state\fP() は新しく割り当てられたデータ構造体へのポインターを返す。 エラーの場合 +(例えば、データ構造体に必要なメモリーが割り当てられなかったなど)、 \fBmalloc_get_state\fP() は NULL を返す。 + +.\" if(ms->magic != MALLOC_STATE_MAGIC) return -1; +.\" /* Must fail if the major version is too high. */ +.\" if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2; +成功すると、 \fBmalloc_set_state\fP() は 0 を返す。 実装が \fIstate\fP +が正しく作成されたデータ構造体を指していないと検出した場合、 \fBmalloc_set_state\fP() は \-1 を返す。 \fIstate\fP +が参照するデータ構造体のバージョンがこの実装が認識するバージョンよりも新しいと実装が検出した場合、 \fBmalloc_set_state\fP() は \-2 +を返す。 +.SH 準拠 +これらの関数は GNU による拡張である。 +.SH 注意 +これらの関数が役に立つのは、 この \fBmalloc\fP(3) の実装が共有ライブラリの一部として使用され、 +ヒープの内容が何か他の方法で保存/復元される場合である。 この手法は GNU Emacs が「ダンプ」関数 ("dumping" function) +を実装するのに使用されている。 + +.\" i.e., calls __malloc_check_init() +.\" i.e., malloc checking is not already in use +.\" and the caller requested malloc checking +これらの関数がフック関数ポインターの保存と復元を行うことはない。 ただし、 2 つ例外がある。 \fBmalloc_get_state\fP() +が呼び出された際に malloc チェック (\fBmallopt\fP(3) 参照) が使用中の場合、 \fBmalloc_set_state\fP() +は可能なら malloc チェックフックをリセットする。 また、 保存された状態の malloc チェックが使用中でないが、 呼び出し元が malloc +チェックを要求していた場合、 フックは 0 にリセットされる。 +.SH 関連項目 +\fBmalloc\fP(3), \fBmallopt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/release/man3/malloc_trim.3 b/release/man3/malloc_trim.3 new file mode 100644 index 00000000..fee6b2b1 --- /dev/null +++ b/release/man3/malloc_trim.3 @@ -0,0 +1,67 @@ +.\" t +.\" Copyright (c) 2012 by 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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MALLOC_TRIM 3 2014\-05\-28 Linux "Linux Programmer's Manual" +.SH 名前 +malloc_trim \- ヒープの一番上から未使用メモリーを解放する +.SH 書式 +\fB#include \fP + +\fBint malloc_trim(size_t \fP\fIpad\fP\fB);\fP +.SH 説明 +\fBmalloc_trim\fP() 関数は (適切な引き数で \fBsbrk\fP(2) を呼び出して) ヒープの一番上の未使用メモリーの解放を試みる。 + +\fIpad\fP 引き数は、 ヒープの一番上から切り詰める際に残す未使用領域の量を指定する。 この引き数が 0 の場合、 +ヒープの一番上の最小量のメモリーだけを維持できる (つまり 1 ページかそれ未満)。 0 以外の引き数を指定すると、 +ヒープの一番上にある程度の量の未使用領域を残し、 将来の割り当てを \fBsbrk\fP(2) でヒープを拡張せずに行えるようにできる。 +.SH 返り値 +\fBmalloc_trim\fP() 関数はメモリーが実際に解放されシステムに戻された場合に 1 を返し、 どのメモリーも解放できなかった場合は 0 +を返す。 +.SH エラー +.\" .SH VERSIONS +.\" Available already in glibc 2.0, possibly earlier +エラーは定義されていない。 +.SH 準拠 +この関数は GNU による拡張である。 +.SH 注意 +この関数は、 特定の状況では \fBfree\fP(3) により自動的に呼び出される。 \fBmallopt\fP(3) の \fBM_TOP_PAD\fP と +\fBM_TRIM_THRESHOLD\fP の議論を参照。 + +この関数は、 ヒープの一番上以外の場所にある未使用メモリーを解放することはできない。 + +.\" malloc/malloc.c::mTRIm(): +.\" return result | (av == &main_arena ? sYSTRIm (pad, av) : 0); +この関数はメイン領域のメモリーだけを解放する。 +.SH 関連項目 +\fBsbrk\fP(2), \fBmalloc\fP(3), \fBmallopt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/stats/man2 b/stats/man2 index 4c7a8d74..52a53bb4 100644 --- a/stats/man2 +++ b/stats/man2 @@ -2,7 +2,5 @@ get_robust_list.2,23,14,37 getunwind.2,19,13,32 perf_event_open.2,336,449,785 -perfmonctl.2,42,23,65 -process_vm_readv.2,47,17,64 ptrace.2,130,166,296 quotactl.2,55,47,102 diff --git a/stats/memory b/stats/memory index c1013064..c287ff7c 100644 --- a/stats/memory +++ b/stats/memory @@ -1,7 +1,5 @@ # pagename,#complete,#remaining,#all mallinfo.3,48,17,65 -malloc_get_state.3,18,7,25 -malloc_trim.3,18,8,26 mallopt.3,60,50,110 mcheck.3,29,25,54 mtrace.3,26,11,37 diff --git a/translation_list b/translation_list index 91caa622..cb7192de 100644 --- a/translation_list +++ b/translation_list @@ -262,7 +262,7 @@ ○:LDP man-pages:3.78:2003/07/14:pciconfig_read:2:2015/01/24::ysato444@yahoo.co.jp:Yuichi SATO: @:LDP man-pages:3.78:2003/07/14:pciconfig_write:2:pciconfig_read:2: ×:LDP man-pages:3.78:2015/01/10:perf_event_open:2::::: -×:LDP man-pages:3.78:2013/02/13:perfmonctl:2::::: +○:LDP man-pages:3.78:2013/02/13:perfmonctl:2:2015/01/27::amotoki@gmail.com:Akihiro Motoki: ○:LDP man-pages:3.78:2014/04/15:personality:2:2015/01/24::argrath@ub32.org:Kentaro Shirakata: @:LDP man-pages:3.78:2013/02/12:phys:2:unimplemented:2: ○:LDP man-pages:3.78:2014/07/08:pipe:2:2015/01/24::amotoki@gmail.com:Akihiro Motoki: @@ -276,8 +276,8 @@ @:LDP man-pages:3.78:2013/06/21:pread64:2:pread:2: @:LDP man-pages:3.78:2015/01/22:preadv:2:readv:2: @:LDP man-pages:3.78:2015/01/22:prlimit:2:getrlimit:2: -×:LDP man-pages:3.78:2014/08/19:process_vm_readv:2::::: -※:LDP man-pages:3.78:2014/08/19:process_vm_writev:2:process_vm_readv:2: +○:LDP man-pages:3.78:2014/08/19:process_vm_readv:2:2015/01/27::amotoki@gmail.com:Akihiro Motoki: +@:LDP man-pages:3.78:2014/08/19:process_vm_writev:2:process_vm_readv:2: @:LDP man-pages:3.78:2013/02/12:prof:2:unimplemented:2: @:LDP man-pages:3.78:2015/01/22:pselect:2:select:2: @:LDP man-pages:3.78:2015/01/22:pselect6:2:select:2: @@ -1345,12 +1345,12 @@ ○:LDP man-pages:3.78:2014/05/28:makedev:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: ×:LDP man-pages:3.78:2012/05/06:mallinfo:3::::: ○:LDP man-pages:3.78:2014/05/21:malloc:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: -×:LDP man-pages:3.78:2014/06/13:malloc_get_state:3::::: +○:LDP man-pages:3.78:2014/06/13:malloc_get_state:3:2015/01/27::amotoki@gmail.com:Akihiro Motoki: ○:LDP man-pages:3.78:2010/10/13:malloc_hook:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: ○:LDP man-pages:3.78:2015/01/22:malloc_info:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: -※:LDP man-pages:3.78:2014/06/13:malloc_set_state:3:malloc_get_state:3: +@:LDP man-pages:3.78:2014/06/13:malloc_set_state:3:malloc_get_state:3: ○:LDP man-pages:3.78:2012/05/06:malloc_stats:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: -×:LDP man-pages:3.78:2014/05/28:malloc_trim:3::::: +○:LDP man-pages:3.78:2014/05/28:malloc_trim:3:2015/01/27::amotoki@gmail.com:Akihiro Motoki: ○:LDP man-pages:3.78:2014/06/13:malloc_usable_size:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: ×:LDP man-pages:3.78:2014/07/08:mallopt:3::::: ○:LDP man-pages:3.78:2014/06/13:matherr:3:2015/01/24::amotoki@gmail.com:Akihiro Motoki: diff --git a/untrans.html b/untrans.html index 768da12f..4ddd9cfa 100644 --- a/untrans.html +++ b/untrans.html @@ -33,14 +33,10 @@ get_robust_list.214/3762.16 getunwind.213/3259.38 perf_event_open.2449/78542.80 -perfmonctl.223/6564.62 -process_vm_readv.217/6473.44 ptrace.2166/29643.92 quotactl.247/10253.92 memory mallinfo.317/6573.85 -malloc_get_state.37/2572.00 -malloc_trim.38/2669.23 mallopt.350/11054.55 mcheck.325/5453.70 mtrace.311/3770.27 @@ -62,6 +58,6 @@ stdlib getauxval.334/8660.47 vdso.78/18495.65 -Total 38 pages +Total 34 pages -- 2.11.0