割り当てはブロックサイズ単位で行われるため、 \fBfallocate\fP() は指定されたより
も大きなディスク領域を割り当てることがある。
.SS ファイル空間の割り当て解除
-Specifying the \fBFALLOC_FL_PUNCH_HOLE\fP flag (available since Linux 2.6.38)
-in \fImode\fP deallocates space (i.e., creates a hole) in the byte range
-starting at \fIoffset\fP and continuing for \fIlen\fP bytes. Within the specified
-range, partial file system blocks are zeroed, and whole file system blocks
-are removed from the file. After a successful call, subsequent reads from
-this range will return zeroes.
+\fBFALLOC_FL_PUNCH_HOLE\fP フラグ (Linux 2.6.38 以降で利用可能) を \fImode\fP に指定すると、
+\fIoffset\fP で始まる \fIlen\fP バイトの領域の空間を解放する (ホールを作成する)。 指定された範囲のうち、
+部分的に使用しているファイルシステムブロックは 0 で埋められ、 全体を使用しているファイルシステムブロックはそのファイルから削除される。
+呼び出しが成功すると、 これ以降のこの範囲からの読み出しでは 0 を返す。
-The \fBFALLOC_FL_PUNCH_HOLE\fP flag must be ORed with \fBFALLOC_FL_KEEP_SIZE\fP in
-\fImode\fP; in other words, even when punching off the end of the file, the
-file size (as reported by \fBstat\fP(2)) does not change.
+\fBFALLOC_FL_PUNCH_HOLE\fP フラグは \fBFALLOC_FL_KEEP_SIZE\fP と論理和 (OR) をとって \fImode\fP
+に指定しなければならない。 つまり、 ファイル末尾の punch off を行った場合でも、 (\fBstat\fP(2) で報告される)
+ファイルサイズが変化しない。
-Not all file systems support \fBFALLOC_FL_PUNCH_HOLE\fP; if a file system
-doesn't support the operation, an error is returned.
+すべてのファイルシステムで \fBFALLOC_FL_PUNCH_HOLE\fP がサポートされているわけではない。
+ファイルシステムがこの操作をサポートしていない場合は、 エラーが返る。
.SH 返り値
\fBfallocate\fP() は成功すると 0 を返し、エラーの場合は \-1 を返す。
.SH エラー
\fImode\fP をサポートしていない。
.TP
\fBEPERM\fP
-The file referred to by \fIfd\fP is marked immutable (see \fBchattr\fP(1)). Or:
-\fImode\fP specifies \fBFALLOC_FL_PUNCH_HOLE\fP and the file referred to by \fIfd\fP
-is marked append\-only (see \fBchattr\fP(1)).
+\fIfd\fP が参照するファイルに変更不可 (immutable) の属性が付いている (\fBchattr\fP(1) 参照)。 \fImode\fP に
+\fBFALLOC_FL_PUNCH_HOLE\fP が指定されたが、 \fIfd\fP が参照するファイルに追加のみ (append\-only)
+の属性が付いている (\fBchattr\fP(1) 参照)。
.TP
\fBESPIPE\fP
\fIfd\fP がパイプか FIFO を参照している。
\fBlseek\fP() 関数は、オフセットをファイルの末尾を越えた位置に設定できる (但し、これによりファイルのサイズが変わらない)。
もしデータがこのオフセット位置以降に書き込まれた場合、 間の空隙の部分 ("穴 (hole)") の読み出しがあると、
実際にそこにデータを書き込まれるまでは NULL バイト (\(aq\e0\(aq) の列が返される。
-.SS "Seeking file data and holes"
-Linux バージョン 3.1 以降では、
-\fIwhence\fP に以下の値も指定することができる。
+.SS ファイルのデータとホールの探索
+Linux バージョン 3.1 以降では、 \fIwhence\fP に以下の値も指定することができる。
.TP
\fBSEEK_DATA\fP
-Adjust the file offset to the next location in the file greater than or
-equal to \fIoffset\fP containing data. If \fIoffset\fP points to data, then the
-file offset is set to \fIoffset\fP.
+ファイルオフセットを \fIoffset\fP 以上で次にデータがある位置に設定する。 \fIoffset\fP がデータを指している場合には、
+ファイルオフセットは \fIoffset\fP に設定される。
.TP
\fBSEEK_HOLE\fP
-Adjust the file offset to the next hole in the file greater than or equal to
-\fIoffset\fP. If \fIoffset\fP points into the middle of a hole, then the file
-offset is set to \fIoffset\fP. If there is no hole past \fIoffset\fP, then the
-file offset is adjusted to the end of the file (i.e., there is an implicit
-hole at the end of any file).
+ファイルオフセットを、 位置が \fIoffset\fP 以上の次のホール (hole) に設定する。 \fIoffset\fP
+がホールの内部にある場合は、ファイルシステムは \fIoffset\fP に設定される。 \fIoffset\fP 以降にホールがない場合は、
+ファイルオフセットはファイル末尾に設定される (つまり、 どのファイルの末尾にも暗黙のホールが存在するということだ)。
.PP
-In both of the above cases, \fBlseek\fP() fails if \fIoffset\fP points past the
-end of the file.
+上記のどちらの場合も、 \fIoffset\fP がファイル末尾よりも先を指している場合には \fBlseek\fP() は失敗する。
-These operations allow applications to map holes in a sparsely allocated
-file. This can be useful for applications such as file backup tools, which
-can save space when creating backups and preserve holes, if they have a
-mechanism for discovering holes.
+これらの操作を使うことで、 アプリケーションが、 まばら (sparse ) にページが割り当てられたファイルでホールをマップすることができる。
+この機能はファイルバックアップツールなどのアプリケーションで有用である。 ホールを見つける仕組みがあれば、 ファイルバックアップツールで、
+バックアップを作成する際に保存領域を節約し、ホールを保持することができる。
.\" https://lkml.org/lkml/2011/4/22/79
.\" http://lwn.net/Articles/440255/
.\" http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
-For the purposes of these operations, a hole is a sequence of zeros that
-(normally) has not been allocated in the underlying file storage. However,
-a file system is not obliged to report holes, so these operations are not a
-guaranteed mechanism for mapping the storage space actually allocated to a
-file. (Furthermore, a sequence of zeros that actually has been written to
-the underlying storage may not be reported as a hole.) In the simplest
-implementation, a file system can support the operations by making
-\fBSEEK_HOLE\fP always return the offset of the end of the file, and making
-\fBSEEK_DATA\fP always return \fIoffset\fP (i.e., even if the location referred to
-by \fIoffset\fP is a hole, it can be considered to consist of data that is a
-sequence of zeros).
+これらの操作の目的としては、 ホールは (通常は) バックエンドのファイルストレージには割り当てられていない連続する 0 の列である。
+しかし、ファイルシステムにはホールを報告する義務はなく、 そのため、 これらの操作は、
+ファイルに実際に割り当てられたストレージ領域をマッピングする方法としては確実性のある仕組みではない。
+(また、バックエンドのストレージに実際に書き込まれた連続する 0 の列はホールとして報告されないこともある。) 最も単純な実装としては、
+\fBSEEK_HOLE\fP は常にファイル末尾のオフセットを返すようにし、 \fBSEEK_DATA\fP は常に \fIoffset\fP を返すようにすることで、
+ファイルシステムはこれらの操作をサポートすることができる (\fBSEEK_DATA\fP は常に \fIoffset\fP を返すというのは、 \fIoffset\fP
+が参照する場所がホールであったとしても、 連続する 0 の列のデータで構成されているとみなすということである)。
-The \fB_GNU_SOURCE\fP feature test macro must be defined in order to obtain the
-definitions of \fBSEEK_DATA\fP and \fBSEEK_HOLE\fP from \fI<unistd.h>\fP.
+\fI<unistd.h>\fP から \fBSEEK_DATA\fP と \fBSEEK_HOLE\fP の定義を得るには、 機能検査マクロ
+\fB_GNU_SOURCE\fP を定義しなければならない。
.SH 返り値
成功した場合、 \fBlseek\fP() は結果のファイル位置をファイルの先頭からのバイト数で返す。 エラーの場合、値 \fI(off_t)\ \-1\fP
が返され、 \fIerrno\fP にエラーが指示される。
SVr4, 4.3BSD, POSIX.1\-2001.
.\" FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
-\fBSEEK_DATA\fP and \fBSEEK_HOLE\fP are nonstandard extensions also present in
-Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the
-next POSIX revision (Issue 8).
+\fBSEEK_DATA\fP と \fBSEEK_HOLE\fP は非標準の拡張で、 Solaris, FreeBSD, DragonFly BSD
+にも存在する。 これらは POSIX の次の版 (Issue 8) に入れるよう提案されている。
.SH 注意
いくつかのデバイスでは seek ができない。 POSIX はどのデバイスが \fBlseek\fP() に対応すべきかは規定していない。
\fBint munmap(void *\fP\fIaddr\fP\fB, size_t \fP\fIlength\fP\fB);\fP
.fi
-See NOTES for information on feature test macro requirements.
+機能検査マクロの要件に関する情報は「注意」の節を参照。
.SH 説明
\fBmmap\fP() は、新しいマッピングを呼び出し元プロセスの仮想アドレス空間に作成する。 新しいマッピングの開始アドレスは \fIaddr\fP
で指定される。マッピングの長さは \fIlength\fP 引き数で指定される。
\fBMAP_DENYWRITE\fP がセットされているが \fIfd\fP で指定されているオブジェクトは書き込み用に開かれている。
.TP
\fBEOVERFLOW\fP
-On 32\-bit architecture together with the large file extension (i.e., using
-64\-bit \fIoff_t\fP): the number of pages used for \fIlength\fP plus number of
-pages used for \fIoffset\fP would overflow \fIunsigned long\fP (32 bits).
+32 ビットアーキテクチャで large file 拡張を使っている場合 (つまり 64 ビットの \fIoff_t\fP を使う場合)、 \fIlength\fP
+で使うページ数と \fIoffset\fP で使うページ数を足した値は \fIunsigned long\fP (32 ビット) を超えてしまう
+(オーバーフローしてしまう) 場合がある。
.LP
マップ領域を利用する際に、以下のシグナルが発生することがある:
.TP
にならないように選択される。 \fBMAP_FIXED\fP フラグが指定され、かつ \fIaddr\fP が 0 (NULL)
の場合には、マップされるアドレスが 0 (NULL) になる。
-Certain \fIflags\fP constants are defined only if either \fB_BSD_SOURCE\fP or
-\fB_SVID_SOURCE\fP is defined. (Requiring \fB_GNU_SOURCE\fP also suffices, and
-requiring that macro specifically would have been more logical, since these
-flags are all Linux specific.) The relevant flags are: \fBMAP_32BIT\fP,
-\fBMAP_ANONYMOUS\fP (and the synonym \fBMAP_ANON\fP), \fBMAP_DENYWRITE\fP,
-\fBMAP_EXECUTABLE\fP, \fBMAP_FILE\fP, \fBMAP_GROWSDOWN\fP, \fBMAP_HUGETLB\fP,
-\fBMAP_LOCKED\fP, \fBMAP_NONBLOCK\fP, \fBMAP_NORESERVE\fP, \fBMAP_POPULATE\fP, and
-\fBMAP_STACK\fP.
+特定の \fIflags\fP 定数は \fB_BSD_SOURCE\fP か \fB_SVID_SOURCE\fP のいずれかが定義された場合にのみ定義される。
+(\fB_GNU_SOURCE\fP も定義されている必要がある。これらのフラグはすべて Linux 固有のものなので、 特に \fB_GNU_SOURCE\fP
+を必要とする点はもっと論理的に決められるべきであった。) 関係するフラグは \fBMAP_32BIT\fP, \fBMAP_ANONYMOUS\fP
+(とその同義語の \fBMAP_ANON\fP), \fBMAP_DENYWRITE\fP, \fBMAP_EXECUTABLE\fP, \fBMAP_FILE\fP,
+\fBMAP_GROWSDOWN\fP, \fBMAP_HUGETLB\fP, \fBMAP_LOCKED\fP, \fBMAP_NONBLOCK\fP,
+\fBMAP_NORESERVE\fP, \fBMAP_POPULATE\fP, \fBMAP_STACK\fP である。
.SH バグ
Linux においては、上記の \fBMAP_NORESERVE\fP で述べられているような保証はない。
デフォルトでは、システムがメモリを使い切った場合には、 どのプロセスがいつ強制終了されるか分からないからである。
より前のカーネルでは、 この場合に \fBmmap\fP() は成功していた (マッピングは作成されず、 \fIaddr\fP が返されていた)。 カーネル
2.6.12 以降では、 \fBmmap\fP() はエラー \fBEINVAL\fP で失敗する。
-POSIX specifies that the system shall always zero fill any partial page at
-the end of the object and that system will never write any modification of
-the object beyond its end. On Linux, when you write data to such partial
-page after the end of the object, the data stays in the page cache even
-after the file is closed and unmapped and even though the data is never
-written to the file itself, subsequent mappings may see the modified
-content. In some cases, this could be fixed by calling \fBmsync\fP(2) before
-the unmap takes place; however, this doesn't work on tmpfs (for example,
-when using POSIX shared memory interface documented in \fBshm_overview\fP(7)).
+POSIX では、 システムはオブジェクト末尾の部分ページを常に 0 で埋め、 末尾より後ろのオブジェクトを決して変更してはならない、と規定している。
+Linux では、 オブジェクト末尾より後ろの部分ページにデータを書き込んだ場合、
+そのファイルをクローズしてアンマップした後であってもページキャッシュにデータが残り続け、 データがファイル自体に書き込まれていなくても、
+それ以降のマッピングで変更された内容が見える可能性がある。 いくつかの場合では、 アンマップを行う前に \fBmsync\fP(2) を呼び出すことで、
+この状況を修正することができる。 しかし、 これは tmpfs では機能しない (例えば、 \fBshm_overview\fP(7) で説明されている
+POSIX 共有メモリインターフェースを使った場合)。
.SH 例
.\" FIXME . Add an example here that uses an anonymous shared region for
.\" IPC between parent and child.
.SH 説明
関数 \fBgetenv\fP() は、環境リストから名前が \fIname\fP の環境変数を検索し、対応する \fIvalue\fP 文字列へのポインタを返す。
-The GNU\-specific \fBsecure_getenv\fP() function is just like \fBgetenv\fP()
-except that it returns NULL in cases where "secure execution" is required.
-Secure execution is required if one of the following conditions was true
-when the program run by the calling process was loaded:
+GNU 固有の \fBsecure_getenv\fP() 関数は \fBgetenv\fP() と同様だが、 "secure execution"
+(「安全な実行」) が必要な場合には NULL を返す点が異なる。 "secure execution" が必要となるのは、
+呼び出し元プロセスにより実行されるプログラムがロードされる際に、 以下の条件のいずれか一つが成立する場合である。
.IP * 3
-the process's effective user ID did not match its real user ID or the
-process's effective group ID did not match its real group ID (typically this
-is the result of executing a set\-user\-ID or set\-group\-ID program);
+プロセスの実効ユーザ ID がプロセスの実ユーザ ID と一致しない場合、またはプロセスの実効グループ ID がプロセスの実グループ ID
+と一致しない場合 (通常、この状況になるのは、 set\-user\-ID プログラムか set\-group\-ID プログラムを実行した場合である)。
.IP *
-the effective capability bit was set on the executable file; or
+実行ファイルで実効ケーパビリティビットがセットされている場合。
.IP *
-the process has a nonempty permitted capability set.
+プロセスの許可ケーパビリティセットが空でない場合。
.PP
-Secure execution may also required if triggered by some Linux security
-modules.
+Linux セキュリティモジュールにより要求された場合にも "secure execution" は必要となる。
-The \fBsecure_getenv\fP() function is intended for use in general\-purpose
-libraries to avoid vulnerabilities that could occur if set\-user\-ID or
-set\-group\-ID programs accidentally trusted the environment.
+\fBsecure_getenv\fP() 関数は、 set\-user\-ID プログラムや set\-group\-ID
+プログラムが実行環境を偶然信用してしまった場合に起こり得る脆弱性を、 汎用ライブラリで回避するために使うことを意図して作られた。
.SH 返り値
関数 \fBgetenv\fP() は、環境における値 value へのポインタを返す。 \fIname\fP にマッチする環境変数が存在しないときには NULL
を返す。
の返り値により参照される文字列は静的に割り当てられてもよく、 文字列の内容は後続の \fBgetenv\fP(), \fBputenv\fP(3),
\fBsetenv\fP(3), \fBunsetenv\fP(3) の呼び出しにより変更されることがある。
-The "secure execution" mode of \fBsecure_getenv\fP() is controlled by the
-\fBAT_SECURE\fP flag contained in the auxiliary vector passed from the kernel
-to user space.
+\fBsecure_getenv\fP() の "secure execution" モードは、 カーネルからユーザ空間に渡される補助ベクトル
+(auxiliary vector) の \fBAT_SECURE\fP フラグにより制御される。
.SH 関連項目
\fBclearenv\fP(3), \fBgetauxval\fP(3), \fBputenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3),
\fBcapabilities\fP(7), \fBenviron\fP(7)
.SH 注意
.\" https://bugzilla.redhat.com/show_bug.cgi?id=450187
.\" http://sourceware.org/bugzilla/show_bug.cgi?id=9957
-The use of these hook functions is not safe in multithreaded programs, and
-they are now deprecated. Programmers should instead preempt calls to the
-relevant functions by defining and exporting functions such as "malloc" and
-"free".
+マルチスレッドプログラムでは、 これらのフック関数の使用は安全ではなく、 今では非推奨である。 プログラマは、 "malloc" や "free"
+のような関数を定義して公開して、 関連する関数を呼び出すようにすべきである。
.SH 例
これらの変数の使い方の簡単な例を以下に示す。
.sp
.SH 説明
.\" .SH VERSIONS
.\" Available already in glibc 2.0, possibly earlier
-The \fBmalloc_stats\fP() function prints (on standard error) statistics about
-memory allocated by \fBmalloc\fP(3) and related functions. For each arena
-(allocation area), this function prints the total amount of memory allocated
-and the total number of bytes consumed by in\-use allocations. (These two
-values correspond to the \fIarena\fP and \fIuordblks\fP fields retrieved by
-\fBmallinfo\fP(3).) In addition, the function prints the sum of these two
-statistics for all arenas, and the maximum number of blocks and bytes that
-were ever simultaneously allocated using \fBmmap\fP(2).
+\fBmalloc_stats\fP() 関数は \fBmalloc\fP(3) や関連する関数により割り当てられたメモリに関する統計を (標準エラーに)
+出力する。 各領域 (割り当てエリア) について、 この関数は割り当てられているメモリの総量と現在の割り当てが使用している総バイト数を出力する
+(これらの二つの値は \fBmallinfo\fP(3) で取得できる \fIarena\fP と \fIuordblks\fP フィールドに対応している)。
+また、この関数は、 すべての領域のこれら二つの統計情報の合計値と、 \fBmmap\fP(2)
+を使って同時に割り当てられたブロック数とバイト数の最大値を表示する。
.SH 準拠
この関数は GNU による拡張である。
.SH 注意
-More detailed information about memory allocations in the main arena can be
-obtained using \fBmallinfo\fP(3).
+\fBmallinfo\fP(3) を使用すると、 メイン領域のメモリ割り当てに関するより詳細な情報を取得できる。
.SH 関連項目
\fBmmap\fP(2), \fBmallinfo\fP(3), \fBmalloc\fP(3), \fBmalloc_info\fP(3), \fBmallopt\fP(3)
.SH この文書について
\fBstrcat\fP() 関数は、\fIdest\fP 文字列の後に \fIsrc\fP 文字列を付け加える。 その際に、\fIdest\fP の最後にある終端の
NULL バイト (\(aq\e0\(aq) は上書きされ、新たに生成された文字列の末尾に終端の NULL バイトが付与される。 二つの文字列
\fIsrc\fP と \fIdest\fP は重なってはならない。 また、文字列 \fIdest\fP は、連結後の結果を格納するのに 十分な大きさでなければならない。
-\fIdest\fP
-ã\81\8cå\8d\81å\88\86ã\81ªå¤§ã\81\8dã\81\95ã\81§ã\81ªã\81\84å ´å\90\88ã\80\81ã\83\97ã\83ã\82°ã\83©ã\83 ã\81\8cã\81©ã\81®ã\82\88ã\81\86ã\81ªå\8b\95ä½\9cã\82\92ã\81\99ã\82\8bã\81\8bå\88\86ã\81\8bã\82\89ã\81ªã\81\84ã\80\82ã\83\90ã\83\83ã\83\95ã\82¡ã\82ªã\83¼ã\83\90ã\83¼ã\83©ã\83³ã\81¯ã\82»ã\82ã\83¥ã\82¢ã\81ªã\83\97ã\83ã\82°ã\83©ã\83 ã\82\92æ\94»æ\92\83ã\81\99ã\82\8bé\9a\9bã\81«å¥½ã\82\93ã\81§ä½¿ã\82\8fã\82\8cã\82\8bæ\96¹æ³\95ã\81§ã\81\82ã\82\8bã\80\82
+\fIdest\fP が十分な大きさでない場合、プログラムがどのような動作をするか分からない。
+バッファオーバーランはセキュアなプログラムを攻撃する際に好んで使われる方法である。
.PP
\fBstrncat\fP() も同様だが、以下の点が異なる。
.IP * 3
size_t strlcat(char *dest, const char *src, size_t size);
.\" https://lwn.net/Articles/506530/
-This function appends the null\-terminated string \fIsrc\fP to the string
-\fIdest\fP, copying at most \fIsize\-strlen(dest)\-1\fP from \fIsrc\fP, and adds a null
-terminator to the result, \fIunless\fP \fIsize\fP is less than \fIstrlen(dest)\fP.
-This function fixes the buffer overrun problem of \fBstrcat\fP(), but the
-caller must still handle the possibility of data loss if \fIsize\fP is too
-small. The function returns the length of the string \fBstrlcat\fP() tried to
-create; if the return value is greater than or equal to \fIsize\fP, data loss
-occurred. If data loss matters, the caller \fImust\fP either check the
-arguments before the call, or test the function return value. \fBstrlcat\fP()
-is not present in glibc and is not standardized by POSIX, but is available
-on Linux via the \fIlibbsd\fP library.
+この関数は、 NULL 終端された文字列 \fIsrc\fP を文字列 \fIdest\fP に追加する。 具体例には、 \fIsize\fP が
+\fIstrlen(dest)\fP より大きい場合には最大で \fIsize\-strlen(dest)\-1\fP バイトを \fIsrc\fP からコピーし、
+結果の末尾に終端の NULL バイトを追加する。 この関数では \fBstrcat\fP() のバッファオーバーランが発生するという問題が修正されているが、
+\fIsize\fP が小さすぎた場合にはデータが失われる問題には、 依然として呼び出し側で対処する必要がある。 この関数は \fBstrlcat\fP()
+が作成しようとした文字列の長さを返す。 返り値が \fIsize\fP 以上の場合、 データロスが発生している。 データロスが問題となる場合は、
+呼び出し側で、 呼び出し前に引き数をチェックするか、 この関数の返り値を検査するかのいずれかをしなければならない。 \fBstrlcat\fP() は
+glibc には存在せず、 POSIX による標準化もされていないが、 Linux では \fIlibbsd\fP ライブラリ経由で利用できる。
.SH 関連項目
\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBstrcpy\fP(3), \fBstring\fP(3),
\fBstrncpy\fP(3), \fBwcscat\fP(3), \fBwcsncat\fP(3)
\fBstrncpy\fP() は効率的でなく間違いを起こしやすいと考えるプログラマもいるだろう。 プログラマが \fIdest\fP の大きさが \fIsrc\fP
の長さよりも 大きいことを知っている (つまり、そのことをチェックするコードを 書いている) 場合は、 \fBstrcpy()\fP を使うことができる。
-One valid (and intended) use of \fBstrncpy\fP() is to copy a C string to a
-fixed\-length buffer while ensuring both that the buffer is not overflowed
-and that unused bytes in the target buffer are zeroed out (perhaps to
-prevent information leaks if the buffer is to be written to media or
-transmitted to another process via an interprocess communication technique).
+\fBstrncpy\fP() の正しい (かつ意図された) 用途は、 C 文字列の固定長バッファへのコピーを、 バッファがオーバーフローしないことと、
+宛先バッファの未使用バイトが 0 で埋められることの両方を保証しつつ行うことである。 (宛先バッファを 0 で埋めるのは、 たいていの場合、
+バッファを媒体に書き込んだり、別のプロセスにプロセス間通信を用いて送信したりした場合に情報洩れを防ぐためである)。
\fIsrc\fP の最初の \fIn\fP バイトに終端のヌルバイトがない場合、 \fBstrncpy\fP()
は \fIdest\fP に終端されていない文字列を生成する。以下のようにして
.fi
.in
.PP
-(Of course, the above technique ignores the fact that information contained
-in \fIsrc\fP is lost in the copying to \fIdest\fP.)
+(もちろん、上記の方法では、 \fIsrc\fP に入っている情報が \fIdest\fP へのコピー時に失われるという事実は無視している。)
いくつかのシステム (BSD、Solaris など) では以下の関数が提供されている。
.\" "strlcpy and strlcat - consistent, safe, string copy and concatenation"
.\" 1999 USENIX Annual Technical Conference
.\" https://lwn.net/Articles/506530/
-This function is similar to \fBstrncpy\fP(), but it copies at most \fIsize\-1\fP
-bytes to \fIdest\fP, always adds a terminating null byte, and does not pad the
-target with (further) null bytes. This function fixes some of the problems
-of \fBstrcpy\fP() and \fBstrncpy\fP(), but the caller must still handle the
-possibility of data loss if \fIsize\fP is too small. The return value of the
-function is the length of \fIsrc\fP, which allows truncation to be easily
-detected: if the return value is greater than or equal to \fIsize\fP,
-truncation occurred. If loss of data matters, the caller \fImust\fP either
-check the arguments before the call, or test the function return value.
-\fBstrlcpy\fP() is not present in glibc and is not standardized by POSIX, but
-is available on Linux via the \fIlibbsd\fP library.
+この関数は \fBstrncpy\fP() と同様だが、 最大でも \fIsize\-1\fP バイトしか \fIdest\fP にコピーをせず、 末尾への終端の NULL
+バイトの追加が必ず行われ、 宛先バッファ (の未使用部分) への NULL バイトの書き込みが行われない。 この関数では \fBstrcpy\fP() や
+\fBstrncpy\fP() の持つ問題のいくつかが修正されているが、 \fIsize\fP が小さすぎた場合にはデータが失われる問題には、
+依然として呼び出し側で対処する必要がある。 この関数の返り値は \fIsrc\fP の長さである。 これにより、
+末尾の切り詰めが行われたかを簡単に検出することができる。 返り値が \fIsize\fP 以上の場合には、 末尾の切り詰めが発生している。
+データロスが問題となる場合は、 呼び出し側で、 呼び出し前に引き数をチェックするか、 この関数の返り値を検査するかのいずれかをしなければならない。
+\fBstrlcpy\fP() は glibc には存在せず、 POSIX による標準化もされていないが、 Linux では \fIlibbsd\fP
+ライブラリ経由で利用できる。
.SH バグ
\fBstrcpy\fP() の受け側の文字列が十分な大きさでない場合、何が起こるかわからない。
固定長文字列を溢れさせるのは、マシンの制御を掌中に収めるために クラッカーが好んで使うテクニックである。
形で入手できる資料はない、しかし、そのような攻撃は論理的に存在可能である。 もし、この事が心配なら、(\fI/dev/urandom\fP ではなく)
\fI/dev/random\fP を利用すればいい。
.LP
-Writing to \fI/dev/random\fP or \fI/dev/urandom\fP will update the entropy pool
-with the data written, but this will not result in a higher entropy count.
-This means that it will impact the contents read from both files, but it
-will not make reads from \fI/dev/random\fP faster.
+\fI/dev/random\fP や \fI/dev/urandom\fP に書き込みを行うと、 書き込まれたデータでエントロピー・プールが更新される。 しかし、
+エントロピー・カウントが増えるわけではない。 つまり、 \fI/dev/random\fP と \fI/dev/urandom\fP
+の両方のファイルから読み出される内容に影響があるが、 \fI/dev/random\fP からの読み出しが早くなるわけではないということだ。
.SS 使い方
\fI/dev/random\fP と \fI/dev/urandom\fP のどちらを使うべきか迷った場合、たいていは \fI/dev/urandom\fP
の方を使いたいと思っているはずだろう。 一般に、長期に渡って使われる GPG/SSL/SSH のキー以外の全てのものに \fI/dev/urandom\fP
読み込み専用のファイル \fIuuid\fP と \fIboot_id\fP は 6fd5a44b\-35f4\-4ad4\-a9b9\-6b9be13e1fe9 のような
ランダムな文字列を保持している。 前者は読み込みの度に新たに生成され、 後者は 1 度だけ生成される。
.SS "ioctl(2) インタフェース"
-The following \fBioctl\fP(2) requests are defined on file descriptors
-connected to either \fI/dev/random\fP or \fI/dev/urandom\fP. All requests
-performed will interact with the input entropy pool impacting both
-\fI/dev/random\fP and \fI/dev/urandom\fP. The \fBCAP_SYS_ADMIN\fP capability is
-required for all requests except \fBRNDGETENTCNT\fP.
+以下の \fBioctl\fP(2) 要求が \fI/dev/random\fP や \fI/dev/urandom\fP
+に接続されたファイルディスクリプタに対して定義されている。 実行されたすべての要求は、 \fI/dev/random\fP と \fI/dev/urandom\fP
+に影響を与える入力エントロピー・プールとやり取りを行う。 \fBRNDGETENTCNT\fP 以外のすべての要求には \fBCAP_SYS_ADMIN\fP
+ケーパビリティが必要である。
.TP
\fBRNDGETENTCNT\fP
-Retrieve the entropy count of the input pool, the contents will be the same
-as the \fIentropy_avail\fP file under proc. The result will be stored in the
-int pointed to by the argument.
+入力エントロピー・プールのカウントを取得する。 取得される内容は proc の \fIentropy_avail\fP ファイルと同じである。
+結果は引き数が指す整数 (int) に格納される。
.TP
\fBRNDADDTOENTCNT\fP
-Increment or decrement the entropy count of the input pool by the value
-pointed to by the argument.
+入力エントロピー・プールのカウントを引き数が指す値だけ加算または減算する。
.TP
\fBRNDGETPOOL\fP
Linux 2.6.9 で削除された。
.TP
\fBRNDADDENTROPY\fP
-Add some additional entropy to the input pool, incrementing the entropy
-count. This differs from writing to \fI/dev/random\fP or \fI/dev/urandom\fP,
-which only adds some data but does not increment the entropy count. The
-following structure is used:
+入力プールに追加のエントロピーを追加し、エントロピー・カウントを増やす。 この要求は \fI/dev/random\fP や \fI/dev/urandom\fP
+への書き込みとは異なる。 \fI/dev/random\fP や \fI/dev/urandom\fP への書き込みでは、 何らかのデータが追加されるだけで、
+エントロピー・カウントは増やされない。 以下の構造体が使用される。
.IP
.nf
struct rand_pool_info {
};
.fi
.IP
-Here \fIentropy_count\fP is the value added to (or subtracted from) the entropy
-count, and \fIbuf\fP is the buffer of size \fIbuf_size\fP which gets added to the
-entropy pool.
+\fIentropy_count\fP はエントロピー・カウントに加算 (または減算) する値である。 \fIbuf\fP は大きさが \fIbuf_size\fP
+のバッファで、この内容がエントロピー・プールに追加される。
.TP
\fBRNDZAPENTCNT\fP, \fBRNDCLEARPOOL\fP
-Zero the entropy count of all pools and add some system data (such as wall
-clock) to the pools.
+すべてのプールのエントロピー・カウントを 0 にし、何らかのシステムデータ (現在の時刻など) をプールに追加する。
.SH ファイル
/dev/random
.br
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-04-30 20:29+0900\n"
-"PO-Revision-Date: 2013-05-06 01:59+0900\n"
+"PO-Revision-Date: 2013-05-07 00:42+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"range, partial file system blocks are zeroed, and whole file system blocks "
"are removed from the file. After a successful call, subsequent reads from "
"this range will return zeroes."
-msgstr ""
+msgstr "B<FALLOC_FL_PUNCH_HOLE> フラグ (Linux 2.6.38 以降で利用可能) を I<mode> に指定すると、 I<offset> で始まる I<len> バイトの領域の空間を解放する (ホールを作成する)。 指定された範囲のうち、 部分的に使用しているファイルシステムブロックは 0 で埋められ、 全体を使用しているファイルシステムブロックはそのファイルから削除される。 呼び出しが成功すると、 これ以降のこの範囲からの読み出しでは 0 を返す。"
#. type: Plain text
#: build/C/man2/fallocate.2:108
"The B<FALLOC_FL_PUNCH_HOLE> flag must be ORed with B<FALLOC_FL_KEEP_SIZE> in "
"I<mode>; in other words, even when punching off the end of the file, the "
"file size (as reported by B<stat>(2)) does not change."
-msgstr ""
+msgstr "B<FALLOC_FL_PUNCH_HOLE> フラグは B<FALLOC_FL_KEEP_SIZE> と論理和 (OR) をとって I<mode> に指定しなければならない。 つまり、 ファイル末尾の punch off を行った場合でも、 (B<stat>(2) で報告される) ファイルサイズが変化しない。"
#. type: Plain text
#: build/C/man2/fallocate.2:112
msgid ""
"Not all file systems support B<FALLOC_FL_PUNCH_HOLE>; if a file system "
"doesn't support the operation, an error is returned."
-msgstr ""
+msgstr "すべてのファイルシステムで B<FALLOC_FL_PUNCH_HOLE> がサポートされているわけではない。 ファイルシステムがこの操作をサポートしていない場合は、 エラーが返る。"
#. type: Plain text
#: build/C/man2/fallocate.2:115
"The file referred to by I<fd> is marked immutable (see B<chattr>(1)). Or: "
"I<mode> specifies B<FALLOC_FL_PUNCH_HOLE> and the file referred to by I<fd> "
"is marked append-only (see B<chattr>(1))."
-msgstr ""
+msgstr "I<fd> が参照するファイルに変更不可 (immutable) の属性が付いている (B<chattr>(1) 参照)。 I<mode> に B<FALLOC_FL_PUNCH_HOLE> が指定されたが、 I<fd> が参照するファイルに追加のみ (append-only) の属性が付いている (B<chattr>(1) 参照)。"
#. type: TP
#: build/C/man2/fallocate.2:183 build/C/man2/posix_fadvise.2:97
"they are now deprecated. Programmers should instead preempt calls to the "
"relevant functions by defining and exporting functions such as \"malloc\" "
"and \"free\"."
-msgstr ""
+msgstr "マルチスレッドプログラムでは、 これらのフック関数の使用は安全ではなく、 今では非推奨である。 プログラマは、 \"malloc\" や \"free\" のような関数を定義して公開して、 関連する関数を呼び出すようにすべきである。"
#. type: Plain text
#: build/C/man3/malloc_hook.3:91
"B<mallinfo>(3).) In addition, the function prints the sum of these two "
"statistics for all arenas, and the maximum number of blocks and bytes that "
"were ever simultaneously allocated using B<mmap>(2)."
-msgstr ""
+msgstr "B<malloc_stats>() 関数は B<malloc>(3) や関連する関数により割り当てられたメモリに関する統計を (標準エラーに) 出力する。 各領域 (割り当てエリア) について、 この関数は割り当てられているメモリの総量と現在の割り当てが使用している総バイト数を出力する (これらの二つの値は B<mallinfo>(3) で取得できる I<arena> と I<uordblks> フィールドに対応している)。 また、この関数は、 すべての領域のこれら二つの統計情報の合計値と、 B<mmap>(2) を使って同時に割り当てられたブロック数とバイト数の最大値を表示する。"
#. type: Plain text
#: build/C/man3/malloc_stats.3:61
msgid ""
"More detailed information about memory allocations in the main arena can be "
"obtained using B<mallinfo>(3)."
-msgstr ""
+msgstr "B<mallinfo>(3) を使用すると、 メイン領域のメモリ割り当てに関するより詳細な情報を取得できる。"
#. type: Plain text
#: build/C/man3/malloc_stats.3:67
#. type: Plain text
#: build/C/man2/mmap.2:54
msgid "See NOTES for information on feature test macro requirements."
-msgstr ""
+msgstr "機能検査マクロの要件に関する情報は「注意」の節を参照。"
#. type: Plain text
#: build/C/man2/mmap.2:63
"On 32-bit architecture together with the large file extension (i.e., using "
"64-bit I<off_t>): the number of pages used for I<length> plus number of "
"pages used for I<offset> would overflow I<unsigned long> (32 bits)."
-msgstr ""
+msgstr "32 ビットアーキテクチャで large file 拡張を使っている場合 (つまり 64 ビットの I<off_t> を使う場合)、 I<length> で使うページ数と I<offset> で使うページ数を足した値は I<unsigned long> (32 ビット) を超えてしまう (オーバーフローしてしまう) 場合がある。"
#. type: Plain text
#: build/C/man2/mmap.2:489
"B<MAP_EXECUTABLE>, B<MAP_FILE>, B<MAP_GROWSDOWN>, B<MAP_HUGETLB>, "
"B<MAP_LOCKED>, B<MAP_NONBLOCK>, B<MAP_NORESERVE>, B<MAP_POPULATE>, and "
"B<MAP_STACK>."
-msgstr ""
+msgstr "特定の I<flags> 定数は B<_BSD_SOURCE> か B<_SVID_SOURCE> のいずれかが定義された場合にのみ定義される。 (B<_GNU_SOURCE> も定義されている必要がある。これらのフラグはすべて Linux 固有のものなので、 特に B<_GNU_SOURCE> を必要とする点はもっと論理的に決められるべきであった。) 関係するフラグは B<MAP_32BIT>, B<MAP_ANONYMOUS> (とその同義語の B<MAP_ANON>), B<MAP_DENYWRITE>, B<MAP_EXECUTABLE>, B<MAP_FILE>, B<MAP_GROWSDOWN>, B<MAP_HUGETLB>, B<MAP_LOCKED>, B<MAP_NONBLOCK>, B<MAP_NORESERVE>, B<MAP_POPULATE>, B<MAP_STACK> である。"
#. type: Plain text
#: build/C/man2/mmap.2:592
"content. In some cases, this could be fixed by calling B<msync>(2) before "
"the unmap takes place; however, this doesn't work on tmpfs (for example, "
"when using POSIX shared memory interface documented in B<shm_overview>(7))."
-msgstr ""
+msgstr "POSIX では、 システムはオブジェクト末尾の部分ページを常に 0 で埋め、 末尾より後ろのオブジェクトを決して変更してはならない、と規定している。 Linux では、 オブジェクト末尾より後ろの部分ページにデータを書き込んだ場合、 そのファイルをクローズしてアンマップした後であってもページキャッシュにデータが残り続け、 データがファイル自体に書き込まれていなくても、 それ以降のマッピングで変更された内容が見える可能性がある。 いくつかの場合では、 アンマップを行う前に B<msync>(2) を呼び出すことで、 この状況を修正することができる。 しかし、 これは tmpfs では機能しない (例えば、 B<shm_overview>(7) で説明されている POSIX 共有メモリインターフェースを使った場合)。"
#. type: Plain text
#: build/C/man2/mmap.2:642
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-04-30 20:30+0900\n"
-"PO-Revision-Date: 2013-05-05 01:57+0900\n"
+"PO-Revision-Date: 2013-05-07 01:56+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"with the data written, but this will not result in a higher entropy count. "
"This means that it will impact the contents read from both files, but it "
"will not make reads from I</dev/random> faster."
-msgstr ""
+msgstr "I</dev/random> や I</dev/urandom> に書き込みを行うと、 書き込まれたデータでエントロピー・プールが更新される。 しかし、 エントロピー・カウントが増えるわけではない。 つまり、 I</dev/random> と I</dev/urandom> の両方のファイルから読み出される内容に影響があるが、 I</dev/random> からの読み出しが早くなるわけではないということだ。"
#. type: Plain text
#: build/C/man4/random.4:74
"performed will interact with the input entropy pool impacting both I</dev/"
"random> and I</dev/urandom>. The B<CAP_SYS_ADMIN> capability is required "
"for all requests except B<RNDGETENTCNT>."
-msgstr ""
+msgstr "以下の B<ioctl>(2) 要求が I</dev/random> や I</dev/urandom> に接続されたファイルディスクリプタに対して定義されている。 実行されたすべての要求は、 I</dev/random> と I</dev/urandom> に影響を与える入力エントロピー・プールとやり取りを行う。 B<RNDGETENTCNT> 以外のすべての要求には B<CAP_SYS_ADMIN> ケーパビリティが必要である。"
#. type: TP
#: build/C/man4/random.4:233
"Retrieve the entropy count of the input pool, the contents will be the same "
"as the I<entropy_avail> file under proc. The result will be stored in the "
"int pointed to by the argument."
-msgstr ""
+msgstr "入力エントロピー・プールのカウントを取得する。 取得される内容は proc の I<entropy_avail> ファイルと同じである。 結果は引き数が指す整数 (int) に格納される。"
#. type: TP
#: build/C/man4/random.4:240
msgid ""
"Increment or decrement the entropy count of the input pool by the value "
"pointed to by the argument."
-msgstr ""
+msgstr "入力エントロピー・プールのカウントを引き数が指す値だけ加算または減算する。"
#. type: TP
#: build/C/man4/random.4:244
"count. This differs from writing to I</dev/random> or I</dev/urandom>, "
"which only adds some data but does not increment the entropy count. The "
"following structure is used:"
-msgstr ""
+msgstr "入力プールに追加のエントロピーを追加し、エントロピー・カウントを増やす。 この要求は I</dev/random> や I</dev/urandom> への書き込みとは異なる。 I</dev/random> や I</dev/urandom> への書き込みでは、 何らかのデータが追加されるだけで、 エントロピー・カウントは増やされない。 以下の構造体が使用される。"
#. type: Plain text
#: build/C/man4/random.4:262
"Here I<entropy_count> is the value added to (or subtracted from) the entropy "
"count, and I<buf> is the buffer of size I<buf_size> which gets added to the "
"entropy pool."
-msgstr ""
+msgstr "I<entropy_count> はエントロピー・カウントに加算 (または減算) する値である。 I<buf> は大きさが I<buf_size> のバッファで、この内容がエントロピー・プールに追加される。"
#. type: TP
#: build/C/man4/random.4:271
msgid ""
"Zero the entropy count of all pools and add some system data (such as wall "
"clock) to the pools."
-msgstr ""
+msgstr "すべてのプールのエントロピー・カウントを 0 にし、何らかのシステムデータ (現在の時刻など) をプールに追加する。"
#. type: Plain text
#: build/C/man4/random.4:277
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-04-30 20:30+0900\n"
-"PO-Revision-Date: 2013-05-05 03:30+0900\n"
+"PO-Revision-Date: 2013-05-07 03:41+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
#: build/C/man2/lseek.2:90
#, no-wrap
msgid "Seeking file data and holes"
-msgstr ""
+msgstr "ファイルのデータとホールの探索"
#. type: Plain text
#: build/C/man2/lseek.2:93
msgid ""
"Since version 3.1, Linux supports the following additional values for "
"I<whence>:"
-msgstr ""
-"Linux バージョン 3.1 以降では、\n"
-"I<whence> に以下の値も指定することができる。"
+msgstr "Linux バージョン 3.1 以降では、 I<whence> に以下の値も指定することができる。"
#. type: TP
#: build/C/man2/lseek.2:93
"Adjust the file offset to the next location in the file greater than or "
"equal to I<offset> containing data. If I<offset> points to data, then the "
"file offset is set to I<offset>."
-msgstr ""
+msgstr "ファイルオフセットを I<offset> 以上で次にデータがある位置に設定する。 I<offset> がデータを指している場合には、 ファイルオフセットは I<offset> に設定される。"
#. type: TP
#: build/C/man2/lseek.2:104
"offset is set to I<offset>. If there is no hole past I<offset>, then the "
"file offset is adjusted to the end of the file (i.e., there is an implicit "
"hole at the end of any file)."
-msgstr ""
+msgstr "ファイルオフセットを、 位置が I<offset> 以上の次のホール (hole) に設定する。 I<offset> がホールの内部にある場合は、ファイルシステムは I<offset> に設定される。 I<offset> 以降にホールがない場合は、 ファイルオフセットはファイル末尾に設定される (つまり、 どのファイルの末尾にも暗黙のホールが存在するということだ)。"
#. type: Plain text
#: build/C/man2/lseek.2:124
msgid ""
"In both of the above cases, B<lseek>() fails if I<offset> points past the "
"end of the file."
-msgstr ""
+msgstr "上記のどちらの場合も、 I<offset> がファイル末尾よりも先を指している場合には B<lseek>() は失敗する。"
#. type: Plain text
#: build/C/man2/lseek.2:130
"file. This can be useful for applications such as file backup tools, which "
"can save space when creating backups and preserve holes, if they have a "
"mechanism for discovering holes."
-msgstr ""
+msgstr "これらの操作を使うことで、 アプリケーションが、 まばら (sparse ) にページが割り当てられたファイルでホールをマップすることができる。 この機能はファイルバックアップツールなどのアプリケーションで有用である。 ホールを見つける仕組みがあれば、 ファイルバックアップツールで、 バックアップを作成する際に保存領域を節約し、ホールを保持することができる。"
#. https://lkml.org/lkml/2011/4/22/79
#. http://lwn.net/Articles/440255/
"B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
"by I<offset> is a hole, it can be considered to consist of data that is a "
"sequence of zeros)."
-msgstr ""
+msgstr "これらの操作の目的としては、 ホールは (通常は) バックエンドのファイルストレージには割り当てられていない連続する 0 の列である。 しかし、ファイルシステムにはホールを報告する義務はなく、 そのため、 これらの操作は、 ファイルに実際に割り当てられたストレージ領域をマッピングする方法としては確実性のある仕組みではない。 (また、バックエンドのストレージに実際に書き込まれた連続する 0 の列はホールとして報告されないこともある。) 最も単純な実装としては、 B<SEEK_HOLE> は常にファイル末尾のオフセットを返すようにし、 B<SEEK_DATA> は常に I<offset> を返すようにすることで、 ファイルシステムはこれらの操作をサポートすることができる (B<SEEK_DATA> は常に I<offset> を返すというのは、 I<offset> が参照する場所がホールであったとしても、 連続する 0 の列のデータで構成されているとみなすということである)。"
#. type: Plain text
#: build/C/man2/lseek.2:162
msgid ""
"The B<_GNU_SOURCE> feature test macro must be defined in order to obtain the "
"definitions of B<SEEK_DATA> and B<SEEK_HOLE> from I<E<lt>unistd.hE<gt>>."
-msgstr ""
+msgstr "I<E<lt>unistd.hE<gt>> から B<SEEK_DATA> と B<SEEK_HOLE> の定義を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義しなければならない。"
#. type: Plain text
#: build/C/man2/lseek.2:170
"B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
"Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
"next POSIX revision (Issue 8)."
-msgstr ""
+msgstr "B<SEEK_DATA> と B<SEEK_HOLE> は非標準の拡張で、 Solaris, FreeBSD, DragonFly BSD にも存在する。 これらは POSIX の次の版 (Issue 8) に入れるよう提案されている。"
#. type: Plain text
#: build/C/man2/lseek.2:214
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-04-30 20:30+0900\n"
-"PO-Revision-Date: 2013-05-03 13:02+0900\n"
+"PO-Revision-Date: 2013-05-07 01:04+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"except that it returns NULL in cases where \"secure execution\" is "
"required. Secure execution is required if one of the following conditions "
"was true when the program run by the calling process was loaded:"
-msgstr ""
+msgstr "GNU 固有の B<secure_getenv>() 関数は B<getenv>() と同様だが、 \"secure execution\" (「安全な実行」) が必要な場合には NULL を返す点が異なる。 \"secure execution\" が必要となるのは、 呼び出し元プロセスにより実行されるプログラムがロードされる際に、 以下の条件のいずれか一つが成立する場合である。"
#. type: IP
#: build/C/man3/getenv.3:69 build/C/man3/getenv.3:74 build/C/man3/getenv.3:76
"the process's effective user ID did not match its real user ID or the "
"process's effective group ID did not match its real group ID (typically this "
"is the result of executing a set-user-ID or set-group-ID program);"
-msgstr ""
+msgstr "プロセスの実効ユーザ ID がプロセスの実ユーザ ID と一致しない場合、またはプロセスの実効グループ ID がプロセスの実グループ ID と一致しない場合 (通常、この状況になるのは、 set-user-ID プログラムか set-group-ID プログラムを実行した場合である)。"
#. type: Plain text
#: build/C/man3/getenv.3:76
msgid "the effective capability bit was set on the executable file; or"
-msgstr ""
+msgstr "実行ファイルで実効ケーパビリティビットがセットされている場合。"
#. type: Plain text
#: build/C/man3/getenv.3:78
msgid "the process has a nonempty permitted capability set."
-msgstr ""
+msgstr "プロセスの許可ケーパビリティセットが空でない場合。"
#. type: Plain text
#: build/C/man3/getenv.3:81
msgid ""
"Secure execution may also required if triggered by some Linux security "
"modules."
-msgstr ""
+msgstr "Linux セキュリティモジュールにより要求された場合にも \"secure execution\" は必要となる。"
#. type: Plain text
#: build/C/man3/getenv.3:88
"The B<secure_getenv>() function is intended for use in general-purpose "
"libraries to avoid vulnerabilities that could occur if set-user-ID or set-"
"group-ID programs accidentally trusted the environment."
-msgstr ""
+msgstr "B<secure_getenv>() 関数は、 set-user-ID プログラムや set-group-ID プログラムが実行環境を偶然信用してしまった場合に起こり得る脆弱性を、 汎用ライブラリで回避するために使うことを意図して作られた。"
#. type: Plain text
#: build/C/man3/getenv.3:93
"The \"secure execution\" mode of B<secure_getenv>() is controlled by the "
"B<AT_SECURE> flag contained in the auxiliary vector passed from the kernel "
"to user space."
-msgstr ""
+msgstr "B<secure_getenv>() の \"secure execution\" モードは、 カーネルからユーザ空間に渡される補助ベクトル (auxiliary vector) の B<AT_SECURE> フラグにより制御される。"
#. type: Plain text
#: build/C/man3/getenv.3:137
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-04-30 20:30+0900\n"
-"PO-Revision-Date: 2013-05-04 00:20+0900\n"
+"PO-Revision-Date: 2013-05-07 03:00+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"overlap, and the I<dest> string must have enough space for the result. If "
"I<dest> is not large enough, program behavior is unpredictable; I<buffer "
"overruns are a favorite avenue for attacking secure programs>."
-msgstr "B<strcat>() 関数は、I<dest> 文字列の後に I<src> 文字列を付け加える。 その際に、I<dest> の最後にある終端の NULL バイト (\\(aq\\e0\\(aq) は上書きされ、新たに生成された文字列の末尾に終端の NULL バイトが付与される。 二つの文字列 I<src> と I<dest> は重なってはならない。 また、文字列 I<dest> は、連結後の結果を格納するのに 十分な大きさでなければならない。 I<dest> が十分な大きさでない場合、プログラムがどのような動作をするか分からない。バッファオーバーランはセキュアなプログラムを攻撃する際に好んで使われる方法である。"
+msgstr "B<strcat>() 関数は、I<dest> 文字列の後に I<src> 文字列を付け加える。 その際に、I<dest> の最後にある終端の NULL バイト (\\(aq\\e0\\(aq) は上書きされ、新たに生成された文字列の末尾に終端の NULL バイトが付与される。 二つの文字列 I<src> と I<dest> は重なってはならない。 また、文字列 I<dest> は、連結後の結果を格納するのに 十分な大きさでなければならない。 I<dest> が十分な大きさでない場合、プログラムがどのような動作をするか分からない。 バッファオーバーランはセキュアなプログラムを攻撃する際に好んで使われる方法である。"
#. type: Plain text
#: build/C/man3/strcat.3:60
"arguments before the call, or test the function return value. B<strlcat>() "
"is not present in glibc and is not standardized by POSIX, but is available "
"on Linux via the I<libbsd> library."
-msgstr ""
+msgstr "この関数は、 NULL 終端された文字列 I<src> を文字列 I<dest> に追加する。 具体例には、 I<size> が I<strlen(dest)> より大きい場合には最大で I<size-strlen(dest)-1> バイトを I<src> からコピーし、 結果の末尾に終端の NULL バイトを追加する。 この関数では B<strcat>() のバッファオーバーランが発生するという問題が修正されているが、 I<size> が小さすぎた場合にはデータが失われる問題には、 依然として呼び出し側で対処する必要がある。 この関数は B<strlcat>() が作成しようとした文字列の長さを返す。 返り値が I<size> 以上の場合、 データロスが発生している。 データロスが問題となる場合は、 呼び出し側で、 呼び出し前に引き数をチェックするか、 この関数の返り値を検査するかのいずれかをしなければならない。 B<strlcat>() は glibc には存在せず、 POSIX による標準化もされていないが、 Linux では I<libbsd> ライブラリ経由で利用できる。"
#. type: Plain text
#: build/C/man3/strcat.3:151
"and that unused bytes in the target buffer are zeroed out (perhaps to "
"prevent information leaks if the buffer is to be written to media or "
"transmitted to another process via an interprocess communication technique)."
-msgstr ""
+msgstr "B<strncpy>() の正しい (かつ意図された) 用途は、 C 文字列の固定長バッファへのコピーを、 バッファがオーバーフローしないことと、 宛先バッファの未使用バイトが 0 で埋められることの両方を保証しつつ行うことである。 (宛先バッファを 0 で埋めるのは、 たいていの場合、 バッファを媒体に書き込んだり、別のプロセスにプロセス間通信を用いて送信したりした場合に情報洩れを防ぐためである)。"
#. type: Plain text
#: build/C/man3/strcpy.3:130
msgid ""
"(Of course, the above technique ignores the fact that information contained "
"in I<src> is lost in the copying to I<dest>.)"
-msgstr ""
+msgstr "(もちろん、上記の方法では、 I<src> に入っている情報が I<dest> へのコピー時に失われるという事実は無視している。)"
#. type: Plain text
#: build/C/man3/strcpy.3:148
"check the arguments before the call, or test the function return value. "
"B<strlcpy>() is not present in glibc and is not standardized by POSIX, but "
"is available on Linux via the I<libbsd> library."
-msgstr ""
+msgstr "この関数は B<strncpy>() と同様だが、 最大でも I<size-1> バイトしか I<dest> にコピーをせず、 末尾への終端の NULL バイトの追加が必ず行われ、 宛先バッファ (の未使用部分) への NULL バイトの書き込みが行われない。 この関数では B<strcpy>() や B<strncpy>() の持つ問題のいくつかが修正されているが、 I<size> が小さすぎた場合にはデータが失われる問題には、 依然として呼び出し側で対処する必要がある。 この関数の返り値は I<src> の長さである。 これにより、 末尾の切り詰めが行われたかを簡単に検出することができる。 返り値が I<size> 以上の場合には、 末尾の切り詰めが発生している。 データロスが問題となる場合は、 呼び出し側で、 呼び出し前に引き数をチェックするか、 この関数の返り値を検査するかのいずれかをしなければならない。 B<strlcpy>() は glibc には存在せず、 POSIX による標準化もされていないが、 Linux では I<libbsd> ライブラリ経由で利用できる。"
#. type: Plain text
#: build/C/man3/strcpy.3:194
# pagename,#complete,#remaining,#all
-fallocate.2,51,4,55
madvise.2,71,11,82
mallinfo.3,48,17,65
malloc_get_state.3,18,7,25
-malloc_hook.3,42,1,43
malloc_info.3,47,10,57
-malloc_stats.3,17,2,19
malloc_trim.3,18,8,26
malloc_usable_size.3,17,5,22
mallopt.3,60,51,111
mcheck.3,29,25,54
-mmap.2,134,4,138
mtrace.3,26,11,37
subpage_prot.2,24,12,36
cpuid.4,11,13,24
hpsa.4,34,23,57
msr.4,11,6,17
-random.4,53,7,60
# pagename,#complete,#remaining,#all
fopencookie.3,65,33,98
-lseek.2,53,8,61
symlink.7,20,46,66
# pagename,#complete,#remaining,#all
getauxval.3,48,33,81
-getenv.3,32,7,39
-# pagename,#complete,#remaining,#all
-strcat.3,34,1,35
-strcpy.3,34,3,37
@:LDP man-pages:3.51:2013/02/12:lock:2:unimplemented:2:
○:LDP man-pages:3.51:2004/06/17:lookup_dcookie:2:2013/03/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:
@:LDP man-pages:3.51:2013/01/19:lremovexattr:2:removexattr:2:
-â\98\86:LDP man-pages:3.50=>3.51:2013/03/27:lseek:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
+â\97\8b:LDP man-pages:3.51:2013/03/27:lseek:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
@:LDP man-pages:3.51:2013/01/19:lsetxattr:2:setxattr:2:
@:LDP man-pages:3.51:2012/11/11:lstat:2:stat:2:
@:LDP man-pages:3.51:2012/11/11:lstat64:2:lstat:2:
○:LDP man-pages:3.51:2012/05/04:mknodat:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
○:LDP man-pages:3.51:2011/09/14:mlock:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
@:LDP man-pages:3.51:2011/09/14:mlockall:2:mlock:2:
-â\98\86:LDP man-pages:3.50=>3.51:2013/04/17:mmap:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
+â\97\8b:LDP man-pages:3.51:2013/04/17:mmap:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
○:LDP man-pages:3.51:2012/04/16:mmap2:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
○:LDP man-pages:3.51:2012/07/13:modify_ldt:2:2013/03/25::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:
○:LDP man-pages:3.51:2012/07/05:mount:2:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
@:LDP man-pages:3.51:2010/06/12:getdelim:3:getline:3:
○:LDP man-pages:3.51:2007/07/26:getdirentries:3:2013/03/25::nakano@apm.seikei.ac.jp:NAKANO Takeo:
×:LDP man-pages:3.51:2013/02/05:getdtablesize:3:::::
-â\98\86:LDP man-pages:3.41=>3.51:2012/08/14:getenv:3:2003/09/28::nakano@apm.seikei.ac.jp:NAKANO Takeo:
+â\97\8b:LDP man-pages:3.51:2012/08/14:getenv:3:2003/09/28::nakano@apm.seikei.ac.jp:NAKANO Takeo:
○:LDP man-pages:3.51:2002/02/28:getfsent:3:2013/03/25::nakano@apm.seikei.ac.jp:NAKANO Takeo:
@:LDP man-pages:3.51:2002/02/28:getfsfile:3:getfsent:3:
@:LDP man-pages:3.51:2002/02/28:getfsspec:3:getfsent:3:
○:LDP man-pages:3.51:2010/10/13:malloc_hook:3:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
×:LDP man-pages:3.51:2012/04/28:malloc_info:3:::::
※:LDP man-pages:3.51:2012/05/04:malloc_set_state:3:malloc_get_state:3:
-×:LDP man-pages:3.51:2012/05/06:malloc_stats:3:::::
+○:LDP man-pages:3.51:2012/05/06:malloc_stats:3:2013/05/06::amotoki@gmail.com:Akihiro MOTOKI:
×:LDP man-pages:3.51:2012/03/29:malloc_trim:3:::::
×:LDP man-pages:3.51:2012/03/29:malloc_usable_size:3:::::
×:LDP man-pages:3.51:2012/04/30:mallopt:3:::::
@:LDP man-pages:3.51:2002/10/09:ptmx:4:pts:4:
○:LDP man-pages:3.51:2002/10/09:pts:4:2013/03/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:
○:LDP man-pages:3.51:1992/11/21:ram:4:2013/03/25:o:ishikawa@linux.or.jp:ISHIKAWA Mutsumi:
-â\98\86:LDP man-pages:3.50=>3.51:2013/03/15:random:4:2013/03/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:
+â\97\8b:LDP man-pages:3.51:2013/03/15:random:4:2013/03/26::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI:
○:LDP man-pages:3.51:2010/02/25:rtc:4:2013/03/26::ysato444@yahoo.co.jp:Yuichi SATO:
○:LDP man-pages:3.51:2012/05/03:sd:4:2013/03/26::amotoki@gmail.com:Akihiro MOTOKI:
○:LDP man-pages:3.51:2012/08/05:sk98lin:4:2013/03/25::amotoki@gmail.com:Akihiro MOTOKI:
<TR><TD>ptrace.2</TD><TD>218/278</TD><TD>21.58</TD></TR>
<TR><TD>quotactl.2</TD><TD>55/102</TD><TD>46.08</TD></TR>
<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>memory</B></TD></TR>
-<TR class="over80"><TD>fallocate.2</TD><TD>4/55</TD><TD>92.73</TD></TR>
<TR class="over80"><TD>madvise.2</TD><TD>11/82</TD><TD>86.59</TD></TR>
<TR class="over70"><TD>mallinfo.3</TD><TD>17/65</TD><TD>73.85</TD></TR>
<TR class="over70"><TD>malloc_get_state.3</TD><TD>7/25</TD><TD>72.00</TD></TR>
-<TR class="over80"><TD>malloc_hook.3</TD><TD>1/43</TD><TD>97.67</TD></TR>
<TR class="over80"><TD>malloc_info.3</TD><TD>10/57</TD><TD>82.46</TD></TR>
-<TR class="over80"><TD>malloc_stats.3</TD><TD>2/19</TD><TD>89.47</TD></TR>
<TR><TD>malloc_trim.3</TD><TD>8/26</TD><TD>69.23</TD></TR>
<TR class="over70"><TD>malloc_usable_size.3</TD><TD>5/22</TD><TD>77.27</TD></TR>
<TR><TD>mallopt.3</TD><TD>51/111</TD><TD>54.05</TD></TR>
<TR><TD>mcheck.3</TD><TD>25/54</TD><TD>53.70</TD></TR>
-<TR class="over80"><TD>mmap.2</TD><TD>4/138</TD><TD>97.10</TD></TR>
<TR class="over70"><TD>mtrace.3</TD><TD>11/37</TD><TD>70.27</TD></TR>
<TR><TD>subpage_prot.2</TD><TD>12/36</TD><TD>66.67</TD></TR>
<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>net</B></TD></TR>
<TR><TD>cpuid.4</TD><TD>13/24</TD><TD>45.83</TD></TR>
<TR><TD>hpsa.4</TD><TD>23/57</TD><TD>59.65</TD></TR>
<TR><TD>msr.4</TD><TD>6/17</TD><TD>64.71</TD></TR>
-<TR class="over80"><TD>random.4</TD><TD>7/60</TD><TD>88.33</TD></TR>
<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>stdio</B></TD></TR>
<TR><TD>fopencookie.3</TD><TD>33/98</TD><TD>66.33</TD></TR>
-<TR class="over80"><TD>lseek.2</TD><TD>8/61</TD><TD>86.89</TD></TR>
<TR><TD>symlink.7</TD><TD>46/66</TD><TD>30.30</TD></TR>
<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>stdlib</B></TD></TR>
<TR><TD>getauxval.3</TD><TD>33/81</TD><TD>59.26</TD></TR>
-<TR class="over80"><TD>getenv.3</TD><TD>7/39</TD><TD>82.05</TD></TR>
-<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>string</B></TD></TR>
-<TR class="over80"><TD>strcat.3</TD><TD>1/35</TD><TD>97.14</TD></TR>
-<TR class="over80"><TD>strcpy.3</TD><TD>3/37</TD><TD>91.89</TD></TR>
<TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>time</B></TD></TR>
<TR class="over70"><TD>clock_getcpuclockid.3</TD><TD>9/44</TD><TD>79.55</TD></TR>
<TR><TD>utimensat.2</TD><TD>50/107</TD><TD>53.27</TD></TR>
<TR class="over80"><TD>zdump.8</TD><TD>1/22</TD><TD>95.45</TD></TR>
-<TR><TD COLSPAN=3>Total 67 pages</TD></TR>
+<TR><TD COLSPAN=3>Total 58 pages</TD></TR>
</TABLE>
</BODY></HTML>