From 9166bcc919ea02b9d0a0809390009a75cb1e5a3f Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Wed, 27 Mar 2013 02:23:10 +0900 Subject: [PATCH] LDP: Update draft and release pages (based on the previous commit) --- manual/LDP_man-pages/draft/man2/epoll_wait.2 | 145 +++++++ manual/LDP_man-pages/draft/man2/execve.2 | 437 +++++++++++++++++++ manual/LDP_man-pages/draft/man2/getcpu.2 | 2 +- manual/LDP_man-pages/draft/man2/getdents.2 | 2 +- manual/LDP_man-pages/draft/man2/gettid.2 | 2 +- manual/LDP_man-pages/draft/man2/io_cancel.2 | 2 +- manual/LDP_man-pages/draft/man2/io_destroy.2 | 2 +- manual/LDP_man-pages/draft/man2/io_getevents.2 | 2 +- manual/LDP_man-pages/draft/man2/io_setup.2 | 2 +- manual/LDP_man-pages/draft/man2/io_submit.2 | 2 +- manual/LDP_man-pages/draft/man2/llseek.2 | 73 ++++ manual/LDP_man-pages/draft/man2/modify_ldt.2 | 104 +++++ manual/LDP_man-pages/draft/man2/mq_getsetattr.2 | 59 +++ manual/LDP_man-pages/draft/man2/pivot_root.2 | 102 +++++ manual/LDP_man-pages/draft/man2/readdir.2 | 2 +- manual/LDP_man-pages/draft/man2/removexattr.2 | 87 ++++ manual/LDP_man-pages/draft/man2/setxattr.2 | 107 +++++ manual/LDP_man-pages/draft/man2/spu_run.2 | 196 +++++++++ manual/LDP_man-pages/draft/man2/stat.2 | 464 +++++++++++++++++++++ manual/LDP_man-pages/draft/man3/realpath.3 | 160 +++++++ manual/LDP_man-pages/draft/man3/regex.3 | 191 +++++++++ manual/LDP_man-pages/draft/man7/glob.7 | 155 +++++++ manual/LDP_man-pages/draft/man7/math_error.7 | 146 +++++++ manual/LDP_man-pages/release/man2/epoll_wait.2 | 8 +- manual/LDP_man-pages/release/man2/execve.2 | 8 +- .../LDP_man-pages/release/man2/get_thread_area.2 | 2 +- manual/LDP_man-pages/release/man2/getcpu.2 | 2 +- manual/LDP_man-pages/release/man2/getdents.2 | 2 +- manual/LDP_man-pages/release/man2/gettid.2 | 2 +- manual/LDP_man-pages/release/man2/io_cancel.2 | 2 +- manual/LDP_man-pages/release/man2/io_destroy.2 | 2 +- manual/LDP_man-pages/release/man2/io_getevents.2 | 2 +- manual/LDP_man-pages/release/man2/io_setup.2 | 2 +- manual/LDP_man-pages/release/man2/io_submit.2 | 2 +- manual/LDP_man-pages/release/man2/ioperm.2 | 16 +- manual/LDP_man-pages/release/man2/kexec_load.2 | 2 +- manual/LDP_man-pages/release/man2/llseek.2 | 2 +- manual/LDP_man-pages/release/man2/modify_ldt.2 | 2 +- manual/LDP_man-pages/release/man2/mq_getsetattr.2 | 2 +- manual/LDP_man-pages/release/man2/pivot_root.2 | 2 +- manual/LDP_man-pages/release/man2/query_module.2 | 2 +- manual/LDP_man-pages/release/man2/readdir.2 | 2 +- manual/LDP_man-pages/release/man2/removexattr.2 | 4 +- .../LDP_man-pages/release/man2/set_thread_area.2 | 2 +- manual/LDP_man-pages/release/man2/setxattr.2 | 8 +- manual/LDP_man-pages/release/man2/spu_run.2 | 2 +- manual/LDP_man-pages/release/man2/stat.2 | 11 +- manual/LDP_man-pages/release/man2/syscalls.2 | 26 +- manual/LDP_man-pages/release/man2/sysctl.2 | 2 +- manual/LDP_man-pages/release/man3/realpath.3 | 6 +- manual/LDP_man-pages/release/man3/regex.3 | 33 +- 51 files changed, 2508 insertions(+), 94 deletions(-) create mode 100644 manual/LDP_man-pages/draft/man2/epoll_wait.2 create mode 100644 manual/LDP_man-pages/draft/man2/execve.2 create mode 100644 manual/LDP_man-pages/draft/man2/llseek.2 create mode 100644 manual/LDP_man-pages/draft/man2/modify_ldt.2 create mode 100644 manual/LDP_man-pages/draft/man2/mq_getsetattr.2 create mode 100644 manual/LDP_man-pages/draft/man2/pivot_root.2 create mode 100644 manual/LDP_man-pages/draft/man2/removexattr.2 create mode 100644 manual/LDP_man-pages/draft/man2/setxattr.2 create mode 100644 manual/LDP_man-pages/draft/man2/spu_run.2 create mode 100644 manual/LDP_man-pages/draft/man2/stat.2 create mode 100644 manual/LDP_man-pages/draft/man3/realpath.3 create mode 100644 manual/LDP_man-pages/draft/man3/regex.3 create mode 100644 manual/LDP_man-pages/draft/man7/glob.7 create mode 100644 manual/LDP_man-pages/draft/man7/math_error.7 diff --git a/manual/LDP_man-pages/draft/man2/epoll_wait.2 b/manual/LDP_man-pages/draft/man2/epoll_wait.2 new file mode 100644 index 00000000..6c45e18b --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/epoll_wait.2 @@ -0,0 +1,145 @@ +.\" Copyright (C) 2003 Davide Libenzi +.\" Davide Libenzi +.\" +.\" %%%LICENSE_START(GPLv2+_SW_3_PARA) +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" 2007-04-30: mtk, Added description of epoll_pwait() +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EPOLL_WAIT 2 2012\-08\-17 Linux "Linux Programmer's Manual" +.SH 名前 +epoll_wait, epoll_pwait \- epoll ファイルディスクリプタの I/O イベントを待つ +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint epoll_wait(int \fP\fIepfd\fP\fB, struct epoll_event *\fP\fIevents\fP\fB,\fP +\fB int \fP\fImaxevents\fP\fB, int \fP\fItimeout\fP\fB);\fP +\fBint epoll_pwait(int \fP\fIepfd\fP\fB, struct epoll_event *\fP\fIevents\fP\fB,\fP +\fB int \fP\fImaxevents\fP\fB, int \fP\fItimeout\fP\fB,\fP +\fB const sigset_t *\fP\fIsigmask\fP\fB);\fP +.fi +.SH 説明 +\fBepoll_wait\fP() システムコールは、ファイルディスクリプタ \fIepfd\fP で参照される +\fBepoll\fP(7) インスタンスに対するイベントを待つ。 \fIevents\fP が指すメモリ領域には、 +呼び出し側が利用可能なイベントが格納される。最大 \fImaxevents\fP 個のイベントが +\fBepoll_wait\fP() によって返される。 +\fImaxevents\fP 引き数は 0 より大きくなければならない。 + +\fItimeout\fP 引き数は、 \fBepoll_wait\fP() が停止する最小時間をミリ秒で指定 +する (この停止時間はシステムクロックの粒度に切り上げられ、カーネルの +スケジューリング遅延により少しだけ長くなる可能性がある)。 +\fItimeout\fP を \-1 に指定すると、 \fBepoll_wait\fP() は無限に停止する。 +\fItimeout\fP を 0 に指定すると、 \fBepoll_wait\fP() は利用可能なイベントが +なくても、すぐに返る。 + +\fIstruct epoll_event\fP は以下のように定義される: +.sp +.in +4n +.nf +typedef union epoll_data { + void *ptr; + int fd; + uint32_t u32; + uint64_t u64; +} epoll_data_t; + +struct epoll_event { + uint32_t events; /* epoll イベント */ + epoll_data_t data; /* ユーザデータ変数 */ +}; +.fi +.in + +返される構造体の \fIdata\fP メンバには、ユーザが \fBepoll_ctl\fP(2) (\fBEPOLL_CTL_ADD\fP, +\fBEPOLL_CTL_MOD\fP) で指定したデータが格納される。 一方、 \fIevents\fP +メンバには返された利用可能なイベントのビットフィールドが格納される。 +.SS epoll_pwait() +\fBepoll_wait\fP() と \fBepoll_pwait\fP() の関係は、 \fBselect\fP(2) と \fBpselect\fP(2) +の関係と同様である。 \fBpselect\fP(2) 同様、 \fBepoll_pwait\fP() +を使うと、アプリケーションは、ファイルディスクリプタが準備できた状態になるか、 シグナルが捕捉されるまで、安全に待つことができる。 + +以下の \fBepoll_pwait\fP() の呼び出しは、 +.nf + + ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask); + +.fi +次の呼び出しを \fIatomic\fP に実行するのと等価である。 +.nf + + sigset_t origmask; + + sigprocmask(SIG_SETMASK, &sigmask, &origmask); + ready = epoll_wait(epfd, &events, maxevents, timeout); + sigprocmask(SIG_SETMASK, &origmask, NULL); +.fi +.PP +\fIsigmask\fP 引き数には NULL を指定してもよい。 その場合には、 \fBepoll_pwait\fP() は \fBepoll_wait\fP() +と等価となる。 +.SH 返り値 +成功した場合、 \fBepoll_wait\fP() は要求された I/O に対して準備ができているファイルディスクリプタの数を返す。 また要求された +\fItimeout\fP ミリ秒の間にファイルディスクリプタが準備できない場合は、0 を返す。 エラーが起こった場合、 \fBepoll_wait\fP() は +\-1 を返し、 \fIerrno\fP を適切に設定する。 +.SH エラー +.TP +\fBEBADF\fP +\fIepfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEFAULT\fP +\fIevents\fP で指されるメモリ領域に書き込み権限でアクセスできない。 +.TP +\fBEINTR\fP +要求されたどのイベントも発生せず、かつ \fItimeout\fP の期限が切れる前に、 +システムコールがシグナルハンドラによって割り込まれた。 +\fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIepfd\fP が \fBepoll\fP ファイルディスクリプタでない。 または \fImaxevents\fP が 0 以下である。 +.SH バージョン +.\" To be precise: kernel 2.5.44. +.\" The interface should be finalized by Linux kernel 2.5.66. +\fBepoll_wait\fP() はカーネル 2.6 で追加された。 +ライブラリによるサポートは glibc バージョン 2.3.2 以降で提供されている。 + +\fBepoll_pwait\fP() はカーネル 2.6.19 で Linux に追加された。 +ライブラリによるサポートは glibc バージョン 2.6 以降で提供されている。 +.SH 準拠 +\fBepoll_wait\fP() は Linux 独自である。 +.SH 注意 +あるスレッドが \fBepoll_pwait\fP() を呼び出して停止されている間に、 +別のスレッドが wait 中の \fBepoll\fP インストールにファイルディスクリプタを +追加することがある。新しいファイルディスクリプタでイベントが発生すると、 +\fBepoll_wait\fP() の呼び出しによる停止が解除されることになる。 + +\fBepoll_wait\fP() で監視中の \fBepoll\fP +インスタンス内のファイルディスクリプタが別のスレッドによってクローズされた場合に何が起こるかの議論については、 \fBselect\fP(2) +を参照してほしい。 +.SH バグ +バージョン 2.6.37 より前のカーネルでは、おおよそ \fILONG_MAX / HZ\fP ミリ秒より大きい \fItimeout\fP 値は \-1 +(つまり無限大) として扱われる。したがって、例えば、\fIsizeof(long)\fP が 4 で、カーネルの \fIHZ\fP の値が 1000 +のシステムでは、 35.79 分よりも大きなタイムアウトは無限大として扱われるということである。 +.SH 関連項目 +\fBepoll_create\fP(2), \fBepoll_ctl\fP(2), \fBepoll\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/execve.2 b/manual/LDP_man-pages/draft/man2/execve.2 new file mode 100644 index 00000000..ed974971 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/execve.2 @@ -0,0 +1,437 @@ +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" and Copyright (c) 2006 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 +.\" +.\" Modified by Michael Haardt +.\" Modified 1993-07-21 by Rik Faith +.\" Modified 1994-08-21 by Michael Chastain : +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1999-11-12 by Urs Thuermann +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2006-09-04 Michael Kerrisk +.\" Added list of process attributes that are not preserved on exec(). +.\" 2007-09-14 Ollie Wild , mtk +.\" Add text describing limits on command-line arguments + environment +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXECVE 2 2012\-10\-27 Linux "Linux Programmer's Manual" +.SH 名前 +execve \- プログラムを実行する +.SH 書式 +\fB#include \fP +.sp +\fBint execve(const char *\fP\fIfilename\fP\fB, char *const \fP\fIargv\fP\fB[], \fP +.br +\fB char *const \fP\fIenvp\fP\fB[]);\fP +.SH 説明 +\fBexecve\fP() は、\fIfilename\fP によって指定されたプログラムを実行する。 \fIfilename\fP は、バイナリ実行形式か、 +以下の形式の行で始まるスクリプトでなければならない。 + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional\-arg] +.fi +.in + +後者の詳細は、後ろの「インタプリタ・スクリプト」の節を参照のこと。 + +\fIargv\fP は新しいプログラムに渡される引き数文字列の配列である。 +慣例では、引き数文字列の最初の要素には実行されたファイルに関連付けられた +ファイル名を含めることになっている。 +\fIenvp\fP は文字列の配列であり、伝統的に \fBkey=value\fP の形式をしており、 +新しいプログラムの環境変数として渡される。 +\fIargv\fP と \fIenvp\fP はいずれもの NULL ポインタで終わっている必要がある。 +引き数配列と環境変数は、呼び出されたプログラムの main 関数を +以下のように定義することによってアクセス可能になる。 + +.in +4n +.nf +int main(int argc, char *argv[], char *envp[]) +.fi +.in + +成功した場合、 \fBexecve\fP() は返らない。 そして、呼び出し元のプロセスの text, data, bss, スタックは、 +読み込まれたプログラムによって上書きされる。 + +元のプログラムが ptrace されている場合、 \fBexecve\fP() が成功した後に そのプログラムに \fBSIGTRAP\fP が送られる。 + +\fIfilename\fP で指定されたプログラムファイルに set\-user\-ID ビットが設定されており、 ファイルが存在するファイルシステムが +\fInosuid\fP (\fBmount\fP(2) の \fBMS_NOSUID\fP フラグ) でマウントされておらず、 呼び出したプロセスが ptrace +されていない場合、 呼び出したプロセスの実効 (effective) ユーザ ID は プログラムファイルの所有者 (owner) に変更される。 +同様に、プログラムファイルに set\-group\-ID ビットが設定されていた場合、 呼び出したプロセスの有効グループ ID は +プログラムファイルのグループに変更される。 + +プロセスの実効ユーザ ID は保存 (saved) set\-user\-ID にコピーされる。 同様に、実効グループ ID は保存 +set\-group\-ID にコピーされる。 このコピーは、set\-user\-ID / set\-group\-ID 許可ビットにより発生する 実効 ID +の変更後に行われる。 + +実行ファイルが動的リンクされた a.out 実行形式で、共有ライブラリの スタブを含むものだった場合、実行の開始時に Linux の +ダイナミック・リンカ \fBld.so\fP(8) が呼び出され、必要な共有ライブラリをメモリに読み込んでリンクを行う。 + +実行ファイルがダイナミック・リンクされた ELF 実行形式だった場合、 +PT_INTERP セグメントに指定されたインタプリタが必要な 共有ライブラリ +(shared library) を読み込むのに使用される。 +通常、インタプリタは glibc 2 をリンクしたバイナリでは +\fI/lib/ld\-linux.so.2\fP である (古い Linux libc5 をリンクした +バイナリでは、通常のインタプリタは \fI/lib/ld\-linux.so.1\fP であった)。 + +以下に示す以外のすべてのプロセス属性は \fBexecve\fP() の前後で保持される。 +.IP * 3 +捕捉されたシグナルの処理方法 (disposition) は デフォルト動作にリセットされる (\fBsignal\fP(7))。 +.IP * +代替シグナルスタックはどれも保持されない (\fBsigaltstack\fP(2))。 +.IP * +メモリマッピングは保持されない (\fBmmap\fP(2))。 +.IP * +付加された (attached) System V 共有メモリセグメントは分離される (\fBshmat\fP(2))。 +.IP * +POSIX 共有メモリ領域はマッピングを解除される (\fBshm_open\fP(3))。 +.IP * +オープンされた POSIX メッセージキューディスクリプタはクローズされる (\fBmq_overview\fP(7))。 +.IP * +オープンされた POSIX 名前付きセマフォはいずれもクローズされる (\fBsem_overview\fP(7))。 +.IP * +POSIX タイマは保持されない (\fBtimer_create\fP(2))。 +.IP * +オープンされたディレクトリストリームはいずれもクローズされる (\fBopendir\fP(3))。 +.IP * +メモリロックは保持されない (\fBmlock\fP(2), \fBmlockall\fP(2))。 +.IP * +終了 (exit) ハンドラは保持されない (\fBatexit\fP(3), \fBon_exit\fP(3))。 +.IP * +浮動小数点関連の環境はデフォルトにリセットされる (\fBfenv\fP(3) 参照)。 +.PP +上記のリストのプロセス属性はいずれも POSIX.1\-2001 で規定されている。 以下に示す Linux 固有のプロセス属性も \fBexecve\fP() +の前後で保持されない。 +.IP * 3 +set\-user\-ID か set\-group\-ID されたプログラムが実行されている場合、 \fBprctl\fP(2) の +\fBPR_SET_DUMPABLE\fP フラグはクリアされる。それ以外の場合、このフラグはセットされる。 +.IP * +\fBprctl\fP(2) の \fBPR_SET_KEEPCAPS\fP フラグはクリアされる。 +.IP * +(Linux 2.4.36 以降 / 2.6.23 以降) set\-user\-ID や set\-group\-ID されたプログラムが実行された場合、 +\fBprctl\fP(2) の \fBPR_SET_PDEATHSIG\fP フラグで設定された parent death シグナルはクリアされる。 +.IP * +プロセス名は新しい実行ファイルの名前にリセットされる。 プロセス名は \fBprctl\fP(2) の \fBPR_SET_NAME\fP で設定でき、 +\fIps\ \-o comm\fP で表示できる。 +.IP * +\fBSECBIT_KEEP_CAPS\fP の \fIsecurebits\fP フラグはクリアされる。 \fBcapabilities\fP(7) 参照。 +.IP * +終了シグナル (termination signal) は \fBSIGCHLD\fP にリセットされる (\fBclone\fP(2) 参照)。 +.PP +以下の点についても注意すること: +.IP * 3 +呼び出し元スレッド以外の全てのスレッドは \fBexecve\fP() 中に破棄される。 mutex、条件変数、その他の pthread +オブジェクトは保持されない。 +.IP * +\fIsetlocale(LC_ALL, "C")\fP 相当の処理がプログラム開始時に実行される。 +.IP * +POSIX.1\-2001 は、動作が無視かデフォルトに設定されている全てのシグナル の処理方法は変更せずそのままにする、と規定している。 +但し、POSIX.1\-2001 には一つ例外があり、 \fBSIGCHLD\fP が無視になっている場合、 +その処理方法を変更せずにそのままにするか、デフォルト動作にリセットするかは 実装依存となっている。 Linux では前者 (変更しない) となっている。 +.IP * +完了していない非同期 I/O 操作はキャンセルされる (\fBaio_read\fP(3), \fBaio_write\fP(3))。 +.IP * +\fBexecve\fP(2) 時のケーパビリティの扱いについては、 \fBcapabilities\fP(7) を参照。 +.IP * +.\" On Linux it appears that these file descriptors are +.\" always open after an execve(), and it looks like +.\" Solaris 8 and FreeBSD 6.1 are the same. -- mtk, 30 Apr 2007 +デフォルトでは、ファイルディスクリプタは \fBexecve\fP() を行った後でもオープンされたままである。 close\-on\-exec +の印が付いているファイルディスクリプタはクローズされる。 \fBfcntl\fP(2) の \fBFD_CLOEXEC\fP の説明を参照。 +(ファイルディスクリプタがクローズされると、このプロセスが ファイルディスクリプタに対応するファイルに対して獲得していた +レコードのロックが全て解放されることになる。) POSIX.1\-2001 では、 ファイルディスクリプタ 0, 1, 2 が \fBexecve\fP() +成功後にどこかでクローズされ、かつ 実行されるファイルに set\-user_ID か set\-group_ID の許可ビットが +セットされていてプロセスが特権を獲得した場合、 システムは何らかのファイルをオープンする際に これらの番号のディスクリプタのどれかを使うことがある、 +とされている。 原則として、移植性が必要なプログラムでは、 特権の有無に関わらず、 \fBexecve\fP() の前後でこれら +3つのファイルディスクリプタがクローズされたままで あることを前提にすることはできない。 +.SS インタプリタ・スクリプト +インタプリタ・スクリプトとは、実行許可が有効になっていて、 最初の行が以下の形になっているテキストファイルのことである。 + +.in +4n +.nf +\fB#!\fP \fIinterpreter \fP[optional\-arg] +.fi +.in + +\fIinterpreter\fP は有効な実行ファイルのパス名でなければならず、 それ自身がスクリプトであってはならない。 \fBexecve\fP() の +\fIfilename\fP 引き数がインタプリタスクリプトを指定している場合、 \fIinterpreter\fP は以下の引き数で起動される。 + +.in +4n +.nf +\fIinterpreter\fP [optional\-arg] \fIfilename\fP arg... +.fi +.in + +\fIarg...\fP は \fBexecve\fP() の \fIargv\fP 引き数が指すワード列である。 + +移植性を持たすには、 \fIoptional\-arg\fP は空か 1ワードだけにすべきである (つまり、ホワイト・スペースを含めるべきではない)。 +下記の「注意」の節を参照。 +.SS 引き数と環境変数の合計サイズの上限 +ほとんどの UNIX の実装は、新しいプログラムに渡すことができる コマンドライン引き数 (\fIargv\fP) と環境変数 (\fIenvp\fP) +の文字列群の合計サイズに何らかの上限を設けている。 POSIX.1 は、 \fBARG_MAX\fP 定数を使ってこの上限を決める実装を認めている +(\fBARG_MAX\fP は \fI\fP で定義されるか、実行時に \fIsysconf(_SC_ARG_MAX)\fP +の呼び出しで入手できるかのいずれかである)。 + +カーネル 2.6.23 より前の Linux では、環境変数と引き数の文字列群を 格納するのに使用されるメモリは 32 ページに制限されていた (32 +ページというのはカーネル定数 \fBMAX_ARG_PAGES\fP で定義される)。したがって、 ページサイズが 4 kB のアーキテクチャでは、 +最大サイズは 128 kB ということになる。 + +.\" For some background on the changes to ARG_MAX in kernels 2.6.23 and +.\" 2.6.25, see: +.\" http://sourceware.org/bugzilla/show_bug.cgi?id=5786 +.\" http://bugzilla.kernel.org/show_bug.cgi?id=10095 +.\" http://thread.gmane.org/gmane.linux.kernel/646709/focus=648101, +.\" checked into 2.6.25 as commit a64e715fc74b1a7dcc5944f848acc38b2c4d4ee2. +.\" Ollie: That doesn't include the lists of pointers, though, +.\" so the actual usage is a bit higher (1 pointer per argument). +カーネル 2.6.23 以降では、ほとんどのアーキテクチャにおいて、 \fBexecve\fP() が呼び出された時点で適用されているリソースのソフト上限 +\fBRLIMIT_STACK\fP に基づいたサイズ上限が使われる (メモリ管理ユニット (MMU) を持たないアーキテクチャは上記の変更の +例外であり、これらのアーキテクチャではカーネル 2.6.23 より前と 同じ上限がそのまま使用される)。 +これらのアーキテクチャでは、合計サイズは許可されたスタックサイズの 1/4 に制限されている (1/4 +の上限を設けているのは、新しいプログラムが必ずある程度の スタック空間を持てることを保証するためである)。 Linux 2.6.25 +以降では、カーネルはこのサイズ上限に 32 ページの下限を 設けている。これにより、 \fBRLIMIT_STACK\fP +が非常に小さく設定された場合でも、アプリケーションが少なくとも Linux 2.6.23 以前で提供されていたのと同じ大きさの引き数と環境変数の空間 +と同じだけは確保できることが保証されている (この最低限の保証は Linux 2.6.23 と 2.6.24 では提供されていない)。 +また、各文字列の上限は 32 ページ (カーネル定数 \fBMAX_ARG_STRLEN\fP) で、文字列数の最大値は 0x7FFFFFFF である。 +.SH 返り値 +成功すると \fBexecve\fP() は返らない。エラーの場合は \-1 を返し、 \fIerrno\fP を適切に設定する。 +.SH エラー +.TP +\fBE2BIG\fP +環境変数 (\fIenvp\fP) と引き数リスト (\fIargv\fP) の合計バイト数が大き過ぎる。 +.TP +\fBEACCES\fP +\fIfilename\fP やスクリプトインタプリタ名の構成要素に検索許可 (search permission) が与えられていない +(\fBpath_resolution\fP(7) も参照すること)。 +.TP +\fBEACCES\fP +ファイルもしくはスクリプトのインタプリタが通常ファイル (regular file) でない。 +.TP +\fBEACCES\fP +ファイルやスクリプトや ELF インタプリタに 実行許可 (execute permission) が与えられていない。 +.TP +\fBEACCES\fP +ファイル・システムが \fInoexec\fP でマウントされている。 +.TP +\fBEFAULT\fP +\fIfilename\fP がアクセス可能なアドレス空間の外を指している。 +.TP +\fBEINVAL\fP +ELF 実行形式で複数の PT_INTERP セグメントが存在する。 (すなわち複数のインタプリタを指定した。) +.TP +\fBEIO\fP +I/O エラーが発生した。 +.TP +\fBEISDIR\fP +ELF インタプリタがディレクトリだった。 +.TP +\fBELIBBAD\fP +ELF インタプリタが理解できるフォーマットでなかった。 +.TP +\fBELOOP\fP +\fIfilename\fP やスクリプトや ELF のインタプリタを解決する際に遭遇した シンボリック・リンクが多過ぎる。 +.TP +\fBEMFILE\fP +そのプロセスがオープンできるファイル数の上限まで既にオープンしている。 +.TP +\fBENAMETOOLONG\fP +\fIfilename\fP が長過ぎる。 +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBENOENT\fP +ファイル \fIfilename\fP かスクリプトや ELF のインタプリタが存在しない。 +.TP +\fBENOEXEC\fP +実行ファイルが理解できない形式であるか、違うアーキテクチャのものか、 その他のフォーマット・エラーにより実行ができなかった。 +.TP +\fBENOMEM\fP +カーネルに十分なメモリがない。 +.TP +\fBENOTDIR\fP +\fIfilename\fP やスクリプトや ELF のインタプリタの構成要素がディレクトリでない。 +.TP +\fBEPERM\fP +ファイル・システムが \fInosuid\fP でマウントされ、ユーザがスーパーユーザでなく、 ファイルに set\-user\-ID あるいは +set\-group\-ID ビットが設定されている。 +.TP +\fBEPERM\fP +プロセスがトレースされ、ユーザがスーパーユーザでなく、 ファイルに set\-user\-ID あるいは set\-group\-ID ビットが設定されている。 +.TP +\fBETXTBSY\fP +実行ファイルを書き込み用にオープンしているプロセスがある。 +.SH 準拠 +.\" SVr4 documents additional error +.\" conditions EAGAIN, EINTR, ELIBACC, ENOLINK, EMULTIHOP; POSIX does not +.\" document ETXTBSY, EPERM, EFAULT, ELOOP, EIO, ENFILE, EMFILE, EINVAL, +.\" EISDIR or ELIBBAD error conditions. +SVr4, 4.3BSD, POSIX.1\-2001. POSIX.1\-2001 には #! 動作についての記述はないが、 他は互換性がある。 +.SH 注意 +set\-user\-id プロセスと set\-group\-ID プロセスは \fBptrace\fP(2) できない。 + +Linux はスクリプトの set\-user\-ID と set\-group\-ID ビットを無視する。 + +ファイルシステムを \fInosuid\fP でマウントした場合に set\-user\-ID/set\-group\-ID の実行ファイルを +どの様に扱うかは、Linux カーネルのバージョンによって異なる: あるバージョンでは、すでに必要な権限を持っている場合を除いて、 その実行を拒否する +(そして \fBEPERM\fP を返す)。別のあるバージョンでは set\-user\-ID/set\-group\-ID ビットのみを無視し \fBexec\fP() +は成功する。 + +#! 実行形式のシェル・スクリプトの 1行目に許されている文字数は、 最大 127 文字である。 + +.\" e.g., Solaris 8 +.\" e.g., FreeBSD before 6.0, but not FreeBSD 6.0 onward +インタプリタ・スクリプトの \fIoptional\-arg\fP 引き数の解釈方法は実装により異なる。 Linux では、インタプリタ名 +\fIinterpreter\fP に続く文字列全体がインタプリタに 1個の引き数として渡される。 しかし、動作が異なるシステムもある。 あるシステムでは、 +\fIoptional\-arg\fP のうち最初のホワイト・スペースまでが 引き数として渡される。 また、別のシステムでは +インタプリタ・スクリプトは複数の引き数を持つことができ、 \fIoptional\-arg\fP 内のホワイト・スペースが引き数の区切りとなる。 + +.\" e.g., EFAULT on Solaris 8 and FreeBSD 6.1; but +.\" HP-UX 11 is like Linux -- mtk, Apr 2007 +.\" Bug filed 30 Apr 2007: http://bugzilla.kernel.org/show_bug.cgi?id=8408 +.\" Bug rejected (because fix would constitute an ABI change). +.\" +Linux では、 \fIargv\fP に NULL を指定することができる。これは、この引き数に NULL ポインタ +1個だけを含むリストへのポインタを指定したのと同じ効果を持つ。 \fB「この間違った機能を利用しないこと」\fP。 これは非標準で、移植性もない。 +他のほとんどの UNIX システムでは、これを行うとエラー (\fBEFAULT\fP) になる。 + +.\" +.\" .SH BUGS +.\" Some Linux versions have failed to check permissions on ELF +.\" interpreters. This is a security hole, because it allows users to +.\" open any file, such as a rewinding tape device, for reading. Some +.\" Linux versions have also had other security holes in +.\" .BR execve () +.\" that could be exploited for denial of service by a suitably crafted +.\" ELF binary. There are no known problems with 2.0.34 or 2.2.15. +POSIX.1\-2001 は、 \fBsysconf\fP(3) が返す値はプロセスの生存中は変化しないべきだとしている。 しかしながら、Linux +2.6.23 以降では、リソース上限 \fBRLIMIT_STACK\fP が変化した場合、 コマンドライン引き数と環境変数を保持するための空間に対する上限が +変化したことを反映して、 \fB_SC_ARG_MAX\fP が返す値も変化する。 +.SS 歴史 +UNIX V6 では \fBexec\fP() コールの引き数リストは 0 で終端され、 \fImain\fP の引き数リストは \-1 で終端されていた。 +そのため、 \fImain\fP の引き数リストは、その後の \fBexec\fP() コールには直接使用できなかった。 UNIX V7 以降では、ともに +NULL で終端される。 +.SH 例 +このプログラムは、以下の二つ目のプログラムから実行するためのものである。 コマンドラインを 1行に 1個ずつ表示するだけのプログラムである。 + +.in +4n +.nf +/* myecho.c */ + +#include +#include + +int +main(int argc, char *argv[]) +{ + int j; + + for (j = 0; j < argc; j++) + printf("argv[%d]: %s\en", j, argv[j]); + + exit(EXIT_SUCCESS); +} +.fi +.in + +以下のプログラムは、コマンドライン引き数で指定した名前のプログラムを 実行するのに使う。 +.in +4n +.nf + +/* execve.c */ + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + char *newargv[] = { NULL, "hello", "world", NULL }; + char *newenviron[] = { NULL }; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \en", argv[0]); + exit(EXIT_FAILURE); + } + + newargv[0] = argv[1]; + + execve(argv[1], newargv, newenviron); + perror("execve"); /* execve() only returns on error */ + exit(EXIT_FAILURE); +} +.fi +.in + +二つ目のプログラムを使って一つ目のプログラムを実行するには 以下のようにする。 + +.in +4n +.nf +$\fB cc myecho.c \-o myecho\fP +$\fB cc execve.c \-o execve\fP +$\fB ./execve ./myecho\fP +argv[0]: ./myecho +argv[1]: hello +argv[2]: world +.fi +.in + +さらに、これらのプログラムを使って、スクリプト・インタプリタの例を示す。 このために、「インタプリタ」として先ほど作成したプログラム \fImyecho\fP +を使うスクリプトを作成する。 + +.in +4n +.nf +$\fB cat > script.sh\fP +\fB#! ./myecho script\-arg\fP +\fB^D\fP +$\fB chmod +x script.sh\fP +.fi +.in + +作成しておいたプログラムを使ってスクリプトを実行する。 + +.in +4n +.nf +$\fB ./execve ./script.sh\fP +argv[0]: ./myecho +argv[1]: script\-arg +argv[2]: ./script.sh +argv[3]: hello +argv[4]: world +.fi +.in +.SH 関連項目 +\fBchmod\fP(2), \fBfork\fP(2), \fBptrace\fP(2), \fBexecl\fP(3), \fBfexecve\fP(3), +\fBgetopt\fP(3), \fBcredentials\fP(7), \fBenviron\fP(7), \fBpath_resolution\fP(7), +\fBld.so\fP(8) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/getcpu.2 b/manual/LDP_man-pages/draft/man2/getcpu.2 index a02eb11a..9f018b18 100644 --- a/manual/LDP_man-pages/draft/man2/getcpu.2 +++ b/manual/LDP_man-pages/draft/man2/getcpu.2 @@ -24,7 +24,7 @@ getcpu \- 呼び出し元スレッドが動作している CPU と NUMA ノー \fBint getcpu(unsigned *\fP\fIcpu\fP\fB, unsigned *\fP\fInode\fP\fB, struct getcpu_cache *\fP\fItcache\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc のラッパー関数はない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBgetcpu\fP() システムコールは、呼び出し元のスレッドやプロセスが 現在動作しているプロセッサやノードの情報を特定し、 diff --git a/manual/LDP_man-pages/draft/man2/getdents.2 b/manual/LDP_man-pages/draft/man2/getdents.2 index c2602238..739d603f 100644 --- a/manual/LDP_man-pages/draft/man2/getdents.2 +++ b/manual/LDP_man-pages/draft/man2/getdents.2 @@ -41,7 +41,7 @@ getdents \- ディレクトリ・エントリを取得する \fB unsigned int \fP\fIcount\fP\fB);\fP .fi -\fI注\fP: このシステムコールに対する glibc のラッパー関数は用意されていない。「注意」の節を参照のこと。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 これはあなたの関心を引くような関数ではない。 POSIX 準拠の C ライブラリインターフェースについては \fBreaddir\fP(3) を見ること。 このページは、カーネルシステムコールの生のインターフェースについて 記載したものである。 diff --git a/manual/LDP_man-pages/draft/man2/gettid.2 b/manual/LDP_man-pages/draft/man2/gettid.2 index 0732ad83..46fa9d9a 100644 --- a/manual/LDP_man-pages/draft/man2/gettid.2 +++ b/manual/LDP_man-pages/draft/man2/gettid.2 @@ -38,7 +38,7 @@ gettid \- スレッドID を取得する \fBpid_t gettid(void);\fP .fi -\fI注\fP: このシステムコールには、glibc のラッパー関数が提供されていない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBgettid\fP() は呼び出し元のスレッド ID (TID) を返す。 シングルスレッドのプロセスでは、スレッド ID は (\fBgetpid\fP(2) が返すプロセス ID (PID) と等しい。 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、 diff --git a/manual/LDP_man-pages/draft/man2/io_cancel.2 b/manual/LDP_man-pages/draft/man2/io_cancel.2 index 2289cf71..c7d84c13 100644 --- a/manual/LDP_man-pages/draft/man2/io_cancel.2 +++ b/manual/LDP_man-pages/draft/man2/io_cancel.2 @@ -20,7 +20,7 @@ io_cancel \- 未処理の非同期 I/O 操作の取り消し \fB struct io_event *\fP\fIresult\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_cancel\fP() システムコールは、過去に \fBio_submit\fP(2) を使って登録さ diff --git a/manual/LDP_man-pages/draft/man2/io_destroy.2 b/manual/LDP_man-pages/draft/man2/io_destroy.2 index 056daee1..39762c3d 100644 --- a/manual/LDP_man-pages/draft/man2/io_destroy.2 +++ b/manual/LDP_man-pages/draft/man2/io_destroy.2 @@ -19,7 +19,7 @@ io_destroy \- 非同期 I/O コンテキストの消去 \fBint io_destroy(aio_context_t \fP\fIctx_id\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_destroy\fP() システムコールは、I/O コンテキストのリストから diff --git a/manual/LDP_man-pages/draft/man2/io_getevents.2 b/manual/LDP_man-pages/draft/man2/io_getevents.2 index c3e498e5..95de9b94 100644 --- a/manual/LDP_man-pages/draft/man2/io_getevents.2 +++ b/manual/LDP_man-pages/draft/man2/io_getevents.2 @@ -21,7 +21,7 @@ io_getevents \- 完了キューから非同期 I/O イベントを読み出す \fB struct io_event *\fP\fIevents\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_getevents\fP() システムコールは、少なくとも \fImin_nr\fP の、最大 diff --git a/manual/LDP_man-pages/draft/man2/io_setup.2 b/manual/LDP_man-pages/draft/man2/io_setup.2 index 0123ee25..132bd81f 100644 --- a/manual/LDP_man-pages/draft/man2/io_setup.2 +++ b/manual/LDP_man-pages/draft/man2/io_setup.2 @@ -19,7 +19,7 @@ io_setup \- 非同期 I/O コンテキストを作成する \fBint io_setup(unsigned \fP\fInr_events\fP\fB, aio_context_t *\fP\fIctx_idp\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_setup\fP() システムコールは、少なくとも \fInr_events\fP 個のイベントを diff --git a/manual/LDP_man-pages/draft/man2/io_submit.2 b/manual/LDP_man-pages/draft/man2/io_submit.2 index c30293e9..62d7e964 100644 --- a/manual/LDP_man-pages/draft/man2/io_submit.2 +++ b/manual/LDP_man-pages/draft/man2/io_submit.2 @@ -19,7 +19,7 @@ io_submit \- 非同期 I/O ブロックを処理待ちキューに登録する \fBint io_submit(aio_context_t \fP\fIctx_id\fP\fB, long \fP\fInr\fP\fB, struct iocb **\fP\fIiocbpp\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_submit\fP() システムコールは、AIO コンテキスト \fIctx_id\fP に \fInr\fP 個 diff --git a/manual/LDP_man-pages/draft/man2/llseek.2 b/manual/LDP_man-pages/draft/man2/llseek.2 new file mode 100644 index 00000000..8261b935 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/llseek.2 @@ -0,0 +1,73 @@ +.\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl) +.\" Written 10 June 1995 by Andries Brouwer +.\" +.\" %%%LICENSE_START(VERBATIM) +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END +.\" +.\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LLSEEK 2 2012\-07\-13 Linux "Linux Programmer's Manual" +.SH 名前 +_llseek \- ファイルの読み書きオフセットの位置を変える +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBint _llseek(unsigned int \fP\fIfd\fP\fB, unsigned long \fP\fIoffset_high\fP\fB,\fP +\fB unsigned long \fP\fIoffset_low\fP\fB, loff_t *\fP\fIresult\fP\fB,\fP +\fB unsigned int \fP\fIwhence\fP\fB);\fP +.fi + +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +\fB_llseek\fP() 関数は、ファイルディスクリプタ (descriptor) \fIfd\fP +に関連づけられたオープンされたファイルのオフセットの位置を、相対的に \fI(offset_high<<32) | offset_low\fP +バイトだけ変更する。 基準となる位置を表す \fIwhence\fP には \fBSEEK_SET\fP, \fBSEEK_CUR\fP, \fBSEEK_END\fP +のいずれかを指定し、それぞれ ファイルの先頭、ファイルの現在位置、 ファイルの最後を表す。 結果のファイル位置を \fIresult\fP 引き数に返す。 +.SH 返り値 +成功した場合は、 \fB_llseek\fP() は 0 を返す。 そうでなれば \-1 という値が返り、エラーを示す \fIerrno\fP が設定される。 +.SH エラー +.TP +\fBEBADF\fP +\fIfd\fP がオープンされたファイルディスクリプタでない。 +.TP +\fBEFAULT\fP +結果をユーザ空間にコピーするときに問題があった。 +.TP +\fBEINVAL\fP +\fIwhence\fP が不正である。 +.SH 準拠 +この関数は Linux 特有であり、移植性の必要なプログラムでは使用してはいけない。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +.SH 関連項目 +\fBlseek\fP(2), \fBlseek64\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/modify_ldt.2 b/manual/LDP_man-pages/draft/man2/modify_ldt.2 new file mode 100644 index 00000000..a3ace67c --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/modify_ldt.2 @@ -0,0 +1,104 @@ +.\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995. +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MODIFY_LDT 2 2012\-07\-13 Linux "Linux Programmer's Manual" +.SH 名前 +modify_ldt \- ldt を設定または取得する +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint modify_ldt(int \fP\fIfunc\fP\fB, void *\fP\fIptr\fP\fB, unsigned long \fP\fIbytecount\fP\fB);\fP +.fi + +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +\fBmodify_ldt\fP() はプロセスのローカル・ディスクリプタ・テーブル (local descriptor table; ldt) +を読み書きする。 ldt は i386 プロセッサで使用されるプロセスごとのメモリ管理テーブルである。 このテーブルに関してのより詳しい情報は +Intel 386 processor handbook を 参照すること。 +.PP +\fIfunc\fP が 0 ならば、 \fBmodify_ldt\fP() は ldt を \fIptr\fP が指しているメモリに読み込む。 +読み込むバイト数は実際の ldt のサイズか \fIbytecount\fP より小さい方である。 +.PP +.\" +.\" FIXME ? say something about func == 2 and func == 0x11? +.\" In Linux 2.4, func == 2 returned "the default ldt" +.\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure. +.\" Linux 2.4 and 2.6 implement an operation for func == 0x11 +\fIfunc\fP が 1 ならば、 \fBmodify_ldt\fP() は ldt エントリの一つを変更する。 \fIptr\fP は \fIuser_desc\fP +構造体を指し、 \fIbytecount\fP はこの構造体の大きさに等しくなければならない。 + +\fIuser_desc\fP 構造体は \fI\fP で以下のように定義されている: +.in +4n +.nf + +struct user_desc { + unsigned int entry_number; + unsigned long base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +}; +.fi +.in +.PP +.\" .PP +.\" The ldt is specific for the calling process. Any attempts to change +.\" the ldt to include the address space of another process or the kernel +.\" will result in a segmentation violation when trying to access the memory +.\" outside of the process address space. The memory protection is enforced +.\" at the paging layer. +Linux 2.4 以前では、この構造体は \fImodify_ldt_ldt_s\fP という名前であった。 +.SH 返り値 +成功した場合は、 \fBmodify_ldt\fP() は (読み込みの場合は) 実際に読み込んだバイト数、 または (書き込みの場合は) 0 を返す。 +失敗した場合は \fBmodify_ldt\fP() は \-1 を返し、 \fIerrno\fP をエラーを示す値に設定する。 +.SH エラー +.TP +\fBEFAULT\fP +\fIptr\fP がアドレス空間の外を指している。 +.TP +\fBEINVAL\fP +\fIptr\fP が 0 である、 または \fIfunc\fP が 1 で \fIbytecount\fP が \fImodify_ldt_ldt_s\fP +構造体のサイズと等しくないか、 \fIfunc\fP が 1 で新しい ldt エントリが無効な値である。 +.TP +\fBENOSYS\fP +\fIfunc\fP が 0 でも 1 でもない。 +.SH 準拠 +このコールは Linux 特有であり、移植を意図したプログラムでは 使用してはいけない。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +.SH 関連項目 +\fBvm86\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/mq_getsetattr.2 b/manual/LDP_man-pages/draft/man2/mq_getsetattr.2 new file mode 100644 index 00000000..61557012 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/mq_getsetattr.2 @@ -0,0 +1,59 @@ +.\" t +.\" Copyright (C) 2006 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 MQ_GETSETATTR 2 2012\-07\-13 Linux "Linux Programmer's Manual" +.SH 名前 +mq_getsetattr \- メッセージキューの属性を設定/取得する +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBint mq_getsetattr(mqd_t \fP\fImqdes\fP\fB, struct mq_attr *\fP\fInewattr\fP\fB,\fP +\fB struct mq_attr *\fP\fIoldattr\fP\fB);\fP +.fi + +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +このシステムコールを使用しないこと。 + +\fBmq_getattr\fP(3) と \fBmq_setattr\fP(3) の実装に使用される低レベルのシステムコールである。 +このシステムコールがどのように動作するかは \fBmq_setattr\fP(3) の説明を参照のこと。 +.SH 準拠 +このインタフェースは非標準である。使用を避けること。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 (実のところ、C +ライブラリを書いているのでない限り、 決してこのシステムコールを呼び出さないこと!) +.SH 関連項目 +\fBmq_getattr\fP(3), \fBmq_overview\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/pivot_root.2 b/manual/LDP_man-pages/draft/man2/pivot_root.2 new file mode 100644 index 00000000..caff68cd --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/pivot_root.2 @@ -0,0 +1,102 @@ +.\" Copyright (C) 2000 by Werner Almesberger +.\" +.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) +.\" May be distributed under GPL +.\" %%%LICENSE_END +.\" +.\" Written 2000-02-23 by Werner Almesberger +.\" Modified 2004-06-17 Michael Kerrisk +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH PIVOT_ROOT 2 2012\-07\-13 Linux "Linux Programmer's Manual" +.SH 名前 +pivot_root \- root ファイルシステムを変更する +.SH 書式 +\fBint pivot_root(const char *\fP\fInew_root\fP\fB, const char *\fP\fIput_old\fP\fB);\fP + +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +.\" +.\" The +.\" .B CAP_SYS_ADMIN +.\" capability is required. +\fBpivot_root\fP() は呼び出し元のプロセスの root ファイルシステムを \fIput_old\fP ディレクトリに移動し、 +\fInew_root\fP を呼び出し元のプロセスの新しい root ファイルシステムにする。 + +\fBpivot_root\fP() の典型的な利用法は、システムの起動中にシステムが一時的な root ファイルシステム (例えば \fBinitrd\fP) +をマウントし、これに続いて本当の root ファイルシステムをマウントし、 後者を必要な全てのプロセス・スレッドの カレント root +に変更するような場合である。 + +古い root ディレクトリを使っていた全てのプロセスやスレッドの カレント root とカレントワーキングディレクトリを、 +\fBpivot_root\fP() が変更するかどうかはわからない。 \fBpivot_root\fP() の呼びだしプロセスは、古い root +やカレントワーキングディレクトリを使っていた プロセスが、いずれの場合でも正しく動作することを保証しなければならない。 +これを簡単に行うには、それらのプロセスの root と カレントワーキングディレクトリを \fBpivot_root\fP() を呼び出す前に +\fInew_root\fP に変更しておくことである。 + +上記の段落は、将来 \fBpivot_root\fP() が変更されるかも知れないことを鑑みて、わざと曖昧に書いてある。 本ページを記述している時点では、 +\fBpivot_root\fP() は古い root ディレクトリを用いている全てのプロセス・スレッドの root と カレントワーキングディレクトリを +\fInew_root\fP に変更する。これはカーネルのスレッドが古い root ディレクトリを busy 状態にしないために必要である。これらのスレッドが +古いディレクトリを root やカレントワーキングディレクトリとしていると、 ファイルシステムに一切アクセスしない場合でも 古い root が busy +になってしまうからである。 将来は、カーネルスレッドがあらゆるファイルシステムへのアクセスを 明示的に放棄するメカニズムができ、このでしゃばりな機能は +\fBpivot_root\fP() から削除されるかもしれない。 + +これは呼び出し元のプロセスについても当てはまることに注意。 \fBpivot_root\fP() +がカレントプロセスのカレントワーキングディレクトリに影響するかどうかは 分からない。したがって \fBpivot_root\fP() の直後に +\fBchdir("/")\fP を呼び出すとよい。 + +\fInew_root\fP および \fIput_old\fP には以下の制限がある: +.IP \- 3 +ディレクトリでなければならない。 +.IP \- 3 +\fInew_root\fP と \fIput_old\fP は現在の root と同じファイルシステムにあってはならない。 +.IP \- 3 +\fIput_old\fP は \fInew_root\fP 以下になければならない。すなわち \fIput_old\fP を差す文字列に 1 個以上の \fI../\fP +を付けることによって \fInew_root\fP と同じディレクトリが得られなければならない。 +.IP \- 3 +他のファイルシステムが \fIput_old\fP にマウントされていてはならない。 +.PP +利用例については \fBpivot_root\fP(8) を参照のこと。 + +現在の root がマウントポイントではない (\fBchroot\fP(2) や \fBpivot_root\fP() の後など。以下も参照) 場合、 古い +root ディレクトリではなく、 そのファイルシステムのマウントポイントが \fIput_old\fP にマウントされる。 + +\fInew_root\fP はマウントポイントでなくてもよい。 この場合 \fI/proc/mounts\fP は、 \fInew_root\fP を root +(\fI/\fP) とするファイルシステムのマウントポイントを表示する。 +.SH 返り値 +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +\fBpivot_root\fP() は \fBstat\fP(2) の返すあらゆるエラーを (\fIerrno\fP に) +返す可能性がある。さらに以下を返すことがある: +.TP +\fBEBUSY\fP +\fInew_root\fP または \fIput_old\fP が、現在の root ファイルシステム上にあるか、既に \fIput_old\fP +になんらかのファイルシステムがマウントされている。 +.TP +\fBEINVAL\fP +\fIput_old\fP が \fInew_root\fP の下層にない。 +.TP +\fBENOTDIR\fP +\fInew_root\fP または \fIput_old\fP がディレクトリでない。 +.TP +\fBEPERM\fP +呼び出し元のプロセスが \fBCAP_SYS_ADMIN\fP ケーパビリティを持っていない。 +.SH バージョン +\fBpivot_root\fP() は Linux 2.3.41 で導入された。 +.SH 準拠 +\fBpivot_root\fP() は Linux に固有のものなので、移植性はない。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +.SH バグ +\fBpivot_root\fP() はシステムの他のプロセス全ての root と カレントワーキングディレクトリとを変更しなくてもよいはずである。 + +\fBpivot_root\fP() の使い方がもうちょっと曖昧になると、 あっという間にわけのわからない状態になってしまうだろう +.SH 関連項目 +\fBchdir\fP(2), \fBchroot\fP(2), \fBstat\fP(2), \fBinitrd\fP(4), \fBpivot_root\fP(8) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/readdir.2 b/manual/LDP_man-pages/draft/man2/readdir.2 index dc43f92c..678dc64a 100644 --- a/manual/LDP_man-pages/draft/man2/readdir.2 +++ b/manual/LDP_man-pages/draft/man2/readdir.2 @@ -42,7 +42,7 @@ readdir \- ディレクトリ・エントリを読み込む \fB unsigned int \fP\fIcount\fP\fB);\fP .fi -\fI注\fP: このシステムコールに対する glibc のラッパー関数は用意されていない。「注意」の節を参照のこと。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 これはあなたの興味をもっている関数ではない。 POSIX 準拠の C ライブラリ・インターフェースについては \fBreaddir\fP(3) を見ること。 このページは裸のカーネルのシステムコール・インターフェースについて 記述しているが、このインターフェースは \fBgetdents\fP(2) diff --git a/manual/LDP_man-pages/draft/man2/removexattr.2 b/manual/LDP_man-pages/draft/man2/removexattr.2 new file mode 100644 index 00000000..71f7eb1d --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/removexattr.2 @@ -0,0 +1,87 @@ +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REMOVEXATTR 2 2013\-01\-19 Linux "Linux Programmer's Manual" +.SH 名前 +removexattr, lremovexattr, fremovexattr \- 拡張属性を削除する +.SH 書式 +.fam C +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBint removexattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB);\fP +\fBint lremovexattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB);\fP +\fBint fremovexattr(int \fP\fIfd\fP\fB, const char\ *\fP\fIname\fP\fB);\fP +.fi +.fam T +.SH 説明 +拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた \fIname\fP:\fIvalue\fP の対である。 +これらは、システム上のすべての inode に関連付けられた通常の属性 (\fBstat\fP(2) が返すデータ) を拡張するものである。 +拡張属性のコンセプトは \fBattr\fP(5) に書かれている。 +.PP +\fBremovexattr\fP() は、ファイルシステム内の指定された \fIpath\fP に対応する、名前 \fIname\fP の拡張属性を削除する。 +.PP +\fBlremovexattr\fP() は \fBremovexattr\fP() と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル +ではなく、リンクそのものの情報を削除する点だけが異なる。 +.PP +\fBfremovexattr\fP() は \fBremovexattr\fP() と同じだが、 \fIpath\fP の代わりに \fIfd\fP +で参照されたオープン済みファイルから拡張属性を削除するだけである点が異なる (\fIfd\fP は \fBopen\fP(2) によって返される)。 +.PP +拡張属性の名前は、普通の NULL 終端された文字列である。 \fIname\fP には、名前空間を表す接頭辞 (prefix) が含まれる。 個々の +inode に対し、互いに独立な名前空間が複数あってもよい。 +.SH 返り値 +成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。 +.SH エラー +.TP +\fBENOATTR\fP +指定された属性が存在しない。(\fBENOATTR\fP は \fI\fP で \fBENODATA\fP +の同義語として定義されている。) +.TP +\fBENOTSUP\fP +拡張属性がそのファイルシステムでサポートされていない、 もしくは無効になっている。 +.PP +上記に加えて、 \fBstat\fP(2) に書かれているエラーが発生する場合もある。 +.SH バージョン +これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。 +.SH 準拠 +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +これらのシステムコールは Linux 独自である。 +.SH 関連項目 +\fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBgetxattr\fP(2), \fBlistxattr\fP(2), \fBopen\fP(2), +\fBsetxattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/setxattr.2 b/manual/LDP_man-pages/draft/man2/setxattr.2 new file mode 100644 index 00000000..e77d5bac --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/setxattr.2 @@ -0,0 +1,107 @@ +.\" Copyright (C) Andreas Gruenbacher, February 2001 +.\" Copyright (C) Silicon Graphics Inc, September 2001 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SETXATTR 2 2013\-01\-19 Linux "Linux Programmer's Manual" +.SH 名前 +setxattr, lsetxattr, fsetxattr \- 拡張属性の値を設定する +.SH 書式 +.fam C +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBint setxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP +\fB const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP +\fBint lsetxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP +\fB const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP +\fBint fsetxattr(int \fP\fIfd\fP\fB, const char\ *\fP\fIname\fP\fB,\fP +\fB const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP +.fi +.fam T +.SH 説明 +拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた \fIname\fP:\fIvalue\fP の対である。 +これらは、システム上のすべての inode に関連付けられた通常の属性 (\fBstat\fP(2) が返すデータ) を拡張するものである。 +拡張属性のコンセプトは \fBattr\fP(5) に書かれている。 +.PP +\fBsetxattr\fP() は、ファイルシステム内の指定された \fIpath\fP に対応する、名前 \fIname\fP の拡張属性の値 \fIvalue\fP +を設定する。 \fIvalue\fP の \fIsize\fP は必ず指定しなければならない。 +.PP +\fBlsetxattr\fP() は \fBsetxattr\fP() と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル +ではなく、リンクそのものの拡張属性を設定する点だけが異なる。 +.PP +\fBfsetxattr\fP() は \fBsetxattr\fP() と同じだが、 \fIpath\fP の代わりに \fIfd\fP +で参照されたオープン済みファイルの情報だけを設定する点が異なる (\fIfiledes\fP は \fBopen\fP(2) によって返される)。 +.PP +拡張属性の名前 は普通の NULL 終端された文字列である。 \fIname\fP には、名前空間を表す接頭辞 (prefix) が含まれる。 個々の +inode に対して、互いに独立な名前空間が複数あってもよい。 拡張属性の値 \fIvalue\fP は、ある一定の長さの任意のテキスト・データまたは +バイナリ・データの集合である。 +.PP +操作の意味を明確にするために \fIflags\fP 引き数を使用することができる。 \fBXATTR_CREATE\fP は属性の作成だけを行うことを指定する。 +指定された名前の属性がすでに存在する場合は失敗する。 \fBXATTR_REPLACE\fP は属性の置換だけを行うことを指定する。 +指定された名前の属性がまだ存在しない場合は失敗する。 デフォルトでは (フラグを指定しない場合)、拡張属性は必要な場合は作成され、 +属性がすでに存在する場合は属性値の置換を行う。 +.SH 返り値 +成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。 +.SH エラー +.TP +\fBEDQUOT\fP +ディスクのクォータ上限に達した。拡張属性を格納できるだけの空き領域がないことを意味する。 +.TP +\fBEEXIST\fP +\fBXATTR_CREATE\fP が指定されたが、その属性はすでに存在している。 +.TP +\fBENOATTR\fP +\fBXATTR_REPLACE\fP が指定されたが、その属性が存在しない。(\fBENOATTR\fP は \fI\fP +で \fBENODATA\fP の同義語として定義されている。) +.TP +\fBENOSPC\fP +拡張属性を記憶するのに十分なスペースが残っていない。 +.TP +\fBENOTSUP\fP +拡張属性がそのファイルシステムでサポートされていない、もしくは無効になっている。 +\fIerrno\fP に \fBENOTSUP\fP がセットされる。 +.PP +上記に加えて、 \fBstat\fP(2) に書かれているエラーが発生する場合もある。 +.SH バージョン +これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。 +.SH 準拠 +.\" .SH AUTHORS +.\" Andreas Gruenbacher, +.\" .RI < a.gruenbacher@computer.org > +.\" and the SGI XFS development team, +.\" .RI < linux-xfs@oss.sgi.com >. +.\" Please send any bug reports or comments to these addresses. +これらのシステムコールは Linux 独自である。 +.SH 関連項目 +\fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBgetxattr\fP(2), \fBlistxattr\fP(2), \fBopen\fP(2), +\fBremovexattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/spu_run.2 b/manual/LDP_man-pages/draft/man2/spu_run.2 new file mode 100644 index 00000000..1f95dcae --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/spu_run.2 @@ -0,0 +1,196 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" %%%LICENSE_START(GPLv2+_SW_3_PARA) +.\" This program is free software; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +.\" the GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" HISTORY: +.\" 2005-09-28, created by Arnd Bergmann +.\" 2006-06-16, revised by Eduardo M. Fleury +.\" 2007-07-10, some polishing by mtk +.\" 2007-09-28, updates for newer kernels, added example +.\" by Jeremy Kerr +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SPU_RUN 2 2012\-08\-05 Linux "Linux Programmer's Manual" +.SH 名前 +spu_run \- SPU コンテキストを実行する +.SH 書式 +.nf +\fB#include \fP + +\fBint spu_run(int \fP\fIfd\fP\fB, unsigned int *\fP\fInpc\fP\fB, unsigned int *\fP\fIevent\fP\fB);\fP +.fi + +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 +.SH 説明 +\fBspu_run\fP() システムコールは、Cell Broadband Engine アーキテクチャを実装した PowerPC マシンで +Synergistic Processor Units (SPU) にアクセスするために 使用される。 \fIfd\fP 引き数は、 +\fBspu_create\fP(2) が返すファイルディスクリプタで、 特定の SPU コンテキストを参照する。 そのコンテキストが物理 SPU +に割り当てられると、 \fInpc\fP で渡された命令ポインタ (instruction pointer) から実行が開始される。 + +SPU コードの実行は同期的 (synchronously) に行われる、つまり SPU が実行中は \fBspu_run\fP() は停止 (block) +する。 SPU コードの実行をメイン CPU や他の SPU と並行して行う必要がある場合は、 最初に、その SPU +コードを実行する新しいスレッドを、(例えば \fBpthread_create\fP(3) などを使って) 生成しなければならない。 + +\fBspu_run\fP() が返るときには、SPU のプログラムカウンタの現在値が \fInpc\fP に書き込まれる。 これにより、連続する +\fBspu_run\fP() の呼び出しで同じ \fInpc\fP ポインタを使うことができる。 + +\fIevent\fP 引き数には、拡張ステータスコード用のバッファを指定する。 \fBSPU_CREATE_EVENTS_ENABLED\fP フラグ付きで +SPU コンテキストが作成されると、 \fBspu_run\fP() が返る前に Linux カーネルによりこのバッファに +拡張ステータスコードが格納される。 + +ステータスコードには以下の定数が一つ以上入る。 +.TP +\fBSPE_EVENT_DMA_ALIGNMENT\fP +DMA (direct memory access) のアライメント・エラーが発生した。 +.TP +\fBSPE_EVENT_INVALID_DMA\fP +無効な MFC (Memory Flow Controller) DMA コマンドを行おうとした。 +.TP +\fBSPE_EVENT_SPE_DATA_STORAGE\fP +DMA ストレージ・エラーが発生した。 +.TP +\fBSPE_EVENT_SPE_ERROR\fP +不正な命令が実行された。 +.PP +NULL は \fIevent\fP 引き数として有効な値である。 この場合、イベントは呼び出し元のプロセスに報告されない。 +.SH 返り値 +成功すると、 \fBspu_run\fP() は \fIspu_status\fP レジスタの値を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP +を下記のエラーコードのいずれかに設定する。 + +\fIspu_status\fP レジスタの値は、ステータスコードと SPU の \fBstop\-and\-signal\fP 命令が返す 14 ビットのコードの +ビットマスクで構成される。 後者の 14 ビットのコードはオプションである。 ステータスコードのビットマスクは下記の通りである。 +.TP +\fB0x02\fP +SPU が \fBstop\-and\-signal\fP 命令で停止した。 +.TP +\fB0x04\fP +SPU が \fBhalt (停止)\fP 命令で止まった。 +.TP +\fB0x08\fP +SPU はチャンネルのウェイト中である。 +.TP +\fB0x10\fP +SPU はシングルステップモードであった。 +.TP +\fB0x20\fP +SPU が不正な命令を実行しようとした。 +.TP +\fB0x40\fP +SPU が不正なチャンネルにアクセスしようとした。 +.TP +\fB0x3fff0000\fP +この値のマスクを適用して得られたビット値には、 stop\-and\-signal 命令から返されたコードが入っている。 これらのビットは 0x02 +ビットがセットされている場合にのみ有効である。 +.PP +\fBspu_run\fP() がエラーを返さなかった場合、下位 8 ビットのうち 1 つ以上は 常にセットされる。 +.SH エラー +.TP +\fBEBADF\fP +\fIfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEFAULT\fP +\fInpc\fP が有効なポインタでない。または \fIevent\fP が NULL 以外で、しかも無効なポインタである。 +.TP +\fBEINTR\fP +\fBspu_run\fP() の実行中にシグナルが発生した。 \fBsignal\fP(7) 参照。 必要であれば、 \fInpc\fP +の値は新しいプログラムカウンタの値に更新される。 +.TP +\fBEINVAL\fP +\fIfd\fP が \fBspu_create\fP(2) が返した有効なファイルディスクリプタでない。 +.TP +\fBENOMEM\fP +Memory Flow Controller (MFC) DMA により発生したページフォールトを 処理するのに必要なメモリがなかった。 +.TP +\fBENOSYS\fP +機能が動作中のシステムで提供されていない。理由は、 ハードウェアで SPU が提供されていないか、 spufs +モジュールがロードされていないか、のどちらかである。 +.SH バージョン +\fBspu_run\fP() システムコールはカーネル 2.6.16 で Linux に追加された。 +.SH 準拠 +このシステムコールは Linux 固有であり、 PowerPC アーキテクチャでのみ実装されている。 +このシステムコールを使ったプログラムは移植性がない。 +.SH 注意 +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使うこと。ただし、 \fBspu_run\fP() +は より抽象度の高い SPU へのインタフェースを実装するライブラリから 利用されることを意図したものであり、通常のアプリケーションから +使用は意図されていない。推奨のライブラリについては +.UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/ +.UE +を参照のこと。 +.SH 例 +以下は、簡単な 1 命令の SPU プログラムを \fBspu_run\fP() システムコールを使って実行させる例である。 + +.nf +#include +#include +#include +#include +#include +#include + +#define handle_error(msg) \e + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +int main(void) +{ + int context, fd, spu_status; + uint32_t instruction, npc; + + context = spu_create("/spu/example\-context", 0, 0755); + if (context == \-1) + handle_error("spu_create"); + + /* write a \(aqstop 0x1234\(aq instruction to the SPU\(aqs + * local store memory + */ + instruction = 0x00001234; + + fd = open("/spu/example\-context/mem", O_RDWR); + if (fd == \-1) + handle_error("open"); + write(fd, &instruction, sizeof(instruction)); + + /* set npc to the starting instruction address of the + * SPU program. Since we wrote the instruction at the + * start of the mem file, the entry point will be 0x0 + */ + npc = 0; + + spu_status = spu_run(context, &npc, NULL); + if (spu_status == \-1) + handle_error("open"); + + /* we should see a status code of 0x1234002: + * 0x00000002 (spu was stopped due to stop\-and\-signal) + * | 0x12340000 (the stop\-and\-signal code) + */ + printf("SPU Status: 0x%08x\en", spu_status); + + exit(EXIT_SUCCESS); +} +.fi +.\" .SH AUTHORS +.\" Arnd Bergmann , Jeremy Kerr +.SH 関連項目 +\fBclose\fP(2), \fBspu_create\fP(2), \fBcapabilities\fP(7), \fBspufs\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/stat.2 b/manual/LDP_man-pages/draft/man2/stat.2 new file mode 100644 index 00000000..ca0189cb --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/stat.2 @@ -0,0 +1,464 @@ +.\" t +.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 +.\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 +.\" and Copyright (c) 2007 Michael Kerrisk +.\" +.\" %%%LICENSE_START(VERBATIM) +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END +.\" +.\" Modified by Michael Haardt +.\" Modified 1993-07-24 by Rik Faith +.\" Modified 1995-05-18 by Todd Larason +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 1995-01-09 by Richard Kettlewell +.\" Modified 1998-05-13 by Michael Haardt +.\" Modified 1999-07-06 by aeb & Albert Cahalan +.\" Modified 2000-01-07 by aeb +.\" Modified 2004-06-23 by Michael Kerrisk +.\" 2007-06-08 mtk: Added example program +.\" 2007-07-05 mtk: Added details on underlying system call interfaces +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STAT 2 2012\-11\-11 Linux "Linux Programmer's Manual" +.SH 名前 +stat, fstat, lstat \- ファイルの状態を取得する +.SH 書式 +\fB#include \fP +.br +\fB#include \fP +.br +\fB#include \fP +.sp +\fBint stat(const char *\fP\fIpath\fP\fB, struct stat *\fP\fIbuf\fP\fB);\fP +.br +\fBint fstat(int \fP\fIfd\fP\fB, struct stat *\fP\fIbuf\fP\fB);\fP +.br +\fBint lstat(const char *\fP\fIpath\fP\fB, struct stat *\fP\fIbuf\fP\fB);\fP +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.ad l +.PD 0 +.sp +\fBlstat\fP(): +.RS 4 +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +.br +|| /* glibc 2.10 以降: */ _POSIX_C_SOURCE\ >=\ 200112L +.RE +.PD +.ad +.SH 説明 +.PP +これらの関数はファイルについての情報を返す。 +ファイルそのものに対するアクセス許可は必要としないが、 +\(em\fBstat\fP() と \fBlstat\fP() の場合には \(em +そのファイルへ至る \fIpath\fP を構成する全てのディレクトリに対する +実行 (検索) 許可が必要である。 +.PP +\fBstat\fP() は \fIpath\fP で指定されたファイルの状態を取得して \fIbuf\fP へ格納する。 + +\fBlstat\fP() は \fBstat\fP() と同じであるが、 \fIpath\fP がシンボリックリンクの場合、リンクが参照しているファイルではなく、 +リンク自身の状態を取得する点が異なる。 + +\fBfstat\fP() は \fBstat\fP() と同じだが、 状態を取得するファイルをファイル・ディスクリプタ \fIfd\fP で指定する。 +.PP +これらのシステムコールはいずれも、結果を \fIstat\fP 構造体に入れて返す。 \fIstat\fP 構造体には以下のフィールドが含まれている: +.PP +.in +4n +.nf +struct stat { + dev_t st_dev; /* ファイルがあるデバイスの ID */ + ino_t st_ino; /* inode 番号 */ + mode_t st_mode; /* アクセス保護 */ + nlink_t st_nlink; /* ハードリンクの数 */ + uid_t st_uid; /* 所有者のユーザ ID */ + gid_t st_gid; /* 所有者のグループ ID */ + dev_t st_rdev; /* デバイス ID (特殊ファイルの場合) */ + off_t st_size; /* 全体のサイズ (バイト単位) */ + blksize_t st_blksize; /* ファイルシステム I/O での + ブロックサイズ */ + blkcnt_t st_blocks; /* 割り当てられた 512B のブロック数 */ + time_t st_atime; /* 最終アクセス時刻 */ + time_t st_mtime; /* 最終修正時刻 */ + time_t st_ctime; /* 最終状態変更時刻 */ +}; +.fi +.in +.PP +\fIst_dev\fP フィールドは、このファイルが存在するデバイスを示す (マクロ \fBmajor\fP(3), \fBminor\fP(3) +は、このフィールドのデバイス ID を分解するのに役立つだろう)。 + +\fIst_rdev\fP フィールドは、このファイル (inode) が表すデバイスを示す。 + +\fIst_size\fP フィールドは、(通常のファイルかシンボリックリンクの場合に) +ファイルの大きさをバイト単位で示す。 シンボリックリンクの大きさは、 +シンボリックリンクに含まれている パス名の長さ (終端の NULL バイトは含まない) +である。 + +\fIst_blocks\fP フィールドは、ファイルの大きさを 512 バイトのブロックサイズ単位で示す フィールドは、ファイルに割り当てされたブロック数を +512 バイト単位で示す。 (ファイルに穴があるような場合、この値は \fIst_size\fP/512 より小さくなることもある)。 + +\fIst_blksize\fP フィールドは、効率的にファイルシステム I/O ができる「好ましい」 ブロックサイズを示す +(もっと小さい単位でファイルに書き込みを行うと、 読み出し\-\-修正\-\-再書き込みといった非効率な動作になってしまうかもしれない)。 +.PP +全ての Linux のファイルシステムが全ての時間フィールドを 実装しているわけではない。 ファイルやディレクトリのアクセスが \fIst_atime\fP +フィールドを更新しないようなかたちでマウントできるファイルシステムもある。 (\fBmount\fP(8) の \fInoatime\fP, +\fInodiratime\fP, \fIrelatime\fP や \fBmount\fP(2) の関連する情報を参照)。 また、ファイルが \fBO_NOATIME\fP +付きでオープンされている場合には \fIst_atime\fP は更新されない。 \fBopen\fP(2) 参照。 + +\fIst_atime\fP フィールドはファイルアクセスがあった場合に変更される (例えば、 \fBexecve\fP(2), \fBmknod\fP(2), +\fBpipe\fP(2), \fButime\fP(2) を使用した場合や \fBread\fP(2) で 1 バイト以上読み込んだ場合など)。 +\fBmmap\fP(2) などの他のルーチンでは、 \fIst_atime\fP は更新されることもあれば、そうでない場合もある。 + +\fIst_mtime\fP フィールドは、ファイルが修正された場合に変更される (例えば、 \fBmknod\fP(2), \fBtruncate\fP(2), +\fButime\fP(2) を使用した場合や \fBwrite\fP(2) で 1 バイト以上書き込みをした場合など)。 さらに、ディレクトリの +\fIst_mtime\fP は、そのディレクトリで ファイルが作成されたり削除されたりすると変更される。 \fIst_mtime\fP フィールドは +所有者やグループやハード・リンク数やモードの変更では変更 \fIされない。\fP + +\fIst_ctime\fP フィールドは書き込みや inode 情報 (所有者、グループ、リンク数、モードなど) の 設定によって変更される。 +.PP +以下の POSIX マクロは、 \fIst_mode\fP フィールド で使用されるファイル種別のチェックのために定義されている : +.RS 4 +.TP 1.2i +\fBS_ISREG\fP(m) +通常のファイルか? +.TP +\fBS_ISDIR\fP(m) +ディレクトリか? +.TP +\fBS_ISCHR\fP(m) +キャラクター・デバイスか? +.TP +\fBS_ISBLK\fP(m) +ブロック・デバイスか? +.TP +\fBS_ISFIFO\fP(m) +FIFO (名前付きパイプ) か? +.TP +\fBS_ISLNK\fP(m) +シンボリックリンクか? (POSIX.1\-1996 にはない) +.TP +\fBS_ISSOCK\fP(m) +ソケットか? (POSIX.1\-1996 にはない) +.RE +.PP +以下のフラグが \fIst_mode\fP フィールド用に定義されている: +.in +4n +.TS +lB l l. +S_IFMT 0170000 ファイル種別を示すビット領域を表すビットマスク +S_IFSOCK 0140000 ソケット +S_IFLNK 0120000 シンボリックリンク +S_IFREG 0100000 通常のファイル +S_IFBLK 0060000 ブロック・デバイス +S_IFDIR 0040000 ディレクトリ +S_IFCHR 0020000 キャラクター・デバイス +S_IFIFO 0010000 FIFO +S_ISUID 0004000 set\-user\-ID bit +S_ISGID 0002000 set\-group\-ID bit (下記参照) +S_ISVTX 0001000 スティッキー・ビット (下記参照) +S_IRWXU 00700 ファイル所有者のアクセス許可用のビットマスク +S_IRUSR 00400 所有者の読み込み許可 +S_IWUSR 00200 所有者の書き込み許可 +S_IXUSR 00100 所有者の実行許可 +S_IRWXG 00070 グループのアクセス許可用のビットマスク +S_IRGRP 00040 グループの読み込み許可 +S_IWGRP 00020 グループの書き込み許可 +S_IXGRP 00010 グループの実行許可 +S_IRWXO 00007 他人 (others) のアクセス許可用のビットマスク +S_IROTH 00004 他人の読み込み許可 +S_IWOTH 00002 他人の書き込み許可 +S_IXOTH 00001 他人の実行許可 +.TE +.in +.P +set\-group\-ID bit (\fBS_ISGID\fP) にはいくつかの特殊な使用法がある: ディレクトリに設定した場合には、そのディレクトリが +BSD 方式で使用される ことを示す。つまり、そのディレクトリに作成されたファイルのグループID は 作成したプロセスの実効 (effective) +グループID ではなく、ディレクトリの グループID を継承する。また、そのディレクトリに作成されたディレクトリにも \fBS_ISGID\fP +ビットが設定される。グループ実行ビット (\fBS_IXGRP\fP) が設定されていないファイルに設定された場合は、 set\-group\-ID +ビットはファイル/レコードの 強制的な (mandatory) ロックを表す。 +.P +ディレクトリにスティッキービット (S_ISVTX) が設定された場合は、 そのディレクトリのファイルの名前を変更したり、削除したりできるのは、 +そのファイルの所有者か、そのディレクトリの所有者か、特権プロセス だけとなる。 +.SH 返り値 +成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。 +.SH エラー +.TP +\fBEACCES\fP +\fIpath\fP が所属するディレクトリとその上位のディレクトリのいずれかに 対する検索許可がなかった (\fBpath_resolution\fP(7) +も参照のこと)。 +.TP +\fBEBADF\fP +\fIfd\fP が不正である。 +.TP +\fBEFAULT\fP +アドレスが間違っている。 +.TP +\fBELOOP\fP +パスを辿る際に解決すべきシンボリックリンクが多過ぎた。 +.TP +\fBENAMETOOLONG\fP +\fIpath\fP が長過ぎる。 +.TP +\fBENOENT\fP +\fIpath\fP の構成要素が存在しないか、 \fIpath\fP が空文字列である。 +.TP +\fBENOMEM\fP +カーネルのメモリが足りない。 +.TP +\fBENOTDIR\fP +\fIpath\fP の前半部分 (prefix) の構成要素がディレクトリではない。 +.TP +\fBEOVERFLOW\fP +\fIpath\fP または \fIfd\fP が、ファイルサイズ、inode 番号、ブロック数が +それぞれ \fIoff_t\fP 型、 \fIino_t\fP 型、 \fIblkcnt_t\fP 型で表現できないファイルを +参照している。このエラーが起こるのは、例えば、32 ビットプラットフォーム上で +\fI\-D_FILE_OFFSET_BITS=64\fP を指定せずにコンパイルされたアプリケーションが、 +ファイルサイズが \fI(1<<31)\-1\fP バイトを超えるファイルに対して +\fBstat\fP() を呼び出した場合である。 +.SH 準拠 +.\" SVr4 documents additional +.\" .BR fstat () +.\" error conditions EINTR, ENOLINK, and EOVERFLOW. SVr4 +.\" documents additional +.\" .BR stat () +.\" and +.\" .BR lstat () +.\" error conditions EINTR, EMULTIHOP, ENOLINK, and EOVERFLOW. +これらのシステムコールは SVr4, 4.3BSD, POSIX.1\-2001 に準拠している。 \fBstat\fP() と \fBfstat\fP() +コールは SVr4, SVID, POSIX, X/OPEN, 4.3BSD に準拠している。 \fBlstat\fP() コールは 4.3BSD と +SVr4 に準拠している。 + +POSIX.1\-2001 では、シンボリックリンクに対する \fBlstat\fP() で +有効な情報を返すように求められていたのは、 \fIstat\fP 構造体の \fIst_size\fP +と \fIst_mode\fP のファイル種別要素だけであった。 +POSIX.1\-2008 では規定が厳しくなり、 \fBlstat\fP() は \fIst_mode\fP の +アクセス許可ビット以外の全てのフィールドに有効な情報を返すことが +求められるようになっている。 + +\fIst_blocks\fP と \fIst_blksize\fP フィールドの使用はあまり移植性がない +(これらのフィールドは BSD によって導入された。 システムごとに解釈が +異なっており、 NFS マウントの場合には同じシステムでも異なる可能性がある)。 +\fI\fP から \fIblkcnt_t\fP の \fIblksize_t\fP 型定義を +読み込みたい場合は、(\fIどの\fPヘッダファイルをインクルードするよりも前に) +\fB_XOPEN_SOURCE\fP を 500 以上の値で定義すること。 +.LP +POSIX.1\-1990 には \fBS_IFMT\fP, \fBS_IFSOCK\fP, \fBS_IFLNK\fP, \fBS_IFREG\fP, +\fBS_IFBLK\fP, \fBS_IFDIR\fP, \fBS_IFCHR\fP, \fBS_IFIFO\fP, \fBS_ISVTX\fP 定数に関する +記述はなかったが、代わりに \fBS_ISDIR\fP() のようなマクロを使用するように +要求していた。 \fBS_IF*\fP 定数は POSIX.1\-2001 以降には存在する。 + +マクロ \fBS_ISLNK\fP() と \fBS_ISSOCK\fP() は POSIX.1\-1996 にはないが、 +POSIX.1\-2001 には両方とも存在する。 前者は SVID 4 に、後者は SUSv2 に +由来している。 +.LP +UNIX V7 (とその後のシステム) は \fBS_IREAD\fP, \fBS_IWRITE\fP, \fBS_IEXEC\fP を持っており、 +POSIX はその同義語として \fBS_IRUSR\fP, \fBS_IWUSR\fP, \fBS_IXUSR\fP を規定している。 +.SS 他のシステム +各種システムで使用されていた(いる)値: +.ad l +.TS +l l l l l. +16進 名前 ls 8進数 説明 +f000 S_IFMT 170000 ファイル種別フィールドのビットマスク +0000 000000 T{ +SCO では 使用不能 inode; BSD では不明なファイル種別; +SVID\-v2 と XPG2 では 0 と 0100000 の両方が通常のファイル +T} +1000 S_IFIFO p| 010000 FIFO (名前付きパイプ) +2000 S_IFCHR c 020000 キャラクタ特殊ファイル (V7) +3000 S_IFMPC 030000 多重化されたキャラクタ特殊ファイル (V7) +4000 S_IFDIR d/ 040000 ディレクトリ (V7) +5000 S_IFNAM 050000 T{ +XENIX の二つの副型を持つ名前付きの特殊ファイル +副型は \fIst_rdev\fP の値 1, 2 で区別される +T} +0001 S_INSEM s 000001 XENIX の IFNAM セマフォ副型 +0002 S_INSHD m 000002 XENIX の IFNAM 共有データ副型 +6000 S_IFBLK b 060000 ブロック特殊ファイル (V7) +7000 S_IFMPB 070000 多重化されたブロック特殊ファイル (V7) +8000 S_IFREG \- 100000 通常ファイル (V7) +9000 S_IFCMP 110000 VxFS 圧縮ファイル +9000 S_IFNWK n 110000 ネットワーク特殊ファイル (HP\-UX) +a000 S_IFLNK l@ 120000 シンボリックリンク (BSD) +b000 S_IFSHAD 130000 T{ +Solaris の ACL 用の隠し inode (ユーザ空間からは見えない) +T} +c000 S_IFSOCK s= 140000 ソケット (BSD; VxFS の "S_IFSOC") +d000 S_IFDOOR D> 150000 Solaris の door ファイル +e000 S_IFWHT w% 160000 BSD の空白ファイル (inode を使用しない) +0200 S_ISVTX 001000 T{ +スティッキービット: 使用後もスワップに残す (V7) +.br +予約 (SVID\-v2) +.br +ディレクトリ以外: ファイルをキャッシュしない (SunOS) +.br +ディレクトリの場合: 削除制限フラグ (SVID\-v4.2) +T} +0400 S_ISGID 002000 T{ +実行時の set\-group\-ID (V7) +.br +ディレクトリの場合: GID の伝搬に BSD 方式を使用する +T} +0400 S_ENFMT 002000 T{ +System V ファイルロックを強制する (S_ISGID と共有) +T} +0800 S_ISUID 004000 実行時の set\-user\-ID (V7) +0800 S_CDF 004000 T{ +ディレクトリがコンテキスト依存ファイル (HP\-UX) +T} +.TE +.ad + +スティッキー コマンドは Version 32V AT&T UNIX で登場した。 +.SH 注意 +.\" As at kernel 2.6.25, XFS and JFS support nanosecond timestamps, +.\" but ext2, ext3, and Reiserfs do not. +カーネル 2.5.48 以降では、 \fIstat\fP 構造体は 3 つのファイルのタイムスタンプ +関連のフィールドでナノ秒単位の精度に対応している。 glibc では、機能検査 +マクロ \fB_BSD_SOURCE\fP か \fB_SVID_SOURCE\fP が定義された場合に、各フィールドの +ナノ秒の情報を \fIst_atim.tv_nsec\fP という形式の名前で公開する。 +これらのフィールドは POSIX.1\-2008 で規定されており、 +バージョン 2.12 以降の glibc では、 +\fB_POSIX_C_SOURCE\fP が 200809L 以上の値で定義されるか、 +\fB_XOPEN_SOURCE\fP が 700 以上の値で定義された場合に、 +これらのフィールドが公開される。 +上記のマクロのいずれも定義されていない場合、ナノ秒の値は +\fIst_atimensec\fP という形式の名前で公開される。 +秒より細かいタイムスタンプをサポートしていないファイルシステムでは、 +ナノ秒のフィールドは 0 に設定される。 + +Linux では、 \fBlstat\fP() は一般には自動マウント動作 (automounter action) の +きっかけとならないが、 \fBstat\fP() はきっかけとなる (\fBfstatat\fP(2) を参照)。 + +\fI/proc\fP ディレクトリ以下にあるファイルのほとんどでは、 \fBstat\fP() を呼び出した際に、 \fIst_size\fP +フィールドにファイルサイズが返されない。 代わりに \fIst_size\fP フィールドには 0 が返される。 +.SS 背後のカーネル・インタフェース +.\" +.\" A note from Andries Brouwer, July 2007 +.\" +.\" > Is the story not rather more complicated for some calls like +.\" > stat(2)? +.\" +.\" Yes and no, mostly no. See /usr/include/sys/stat.h . +.\" +.\" The idea is here not so much that syscalls change, but that +.\" the definitions of struct stat and of the types dev_t and mode_t change. +.\" This means that libc (even if it does not call the kernel +.\" but only calls some internal function) must know what the +.\" format of dev_t or of struct stat is. +.\" The communication between the application and libc goes via +.\" the include file that defines a _STAT_VER and +.\" _MKNOD_VER describing the layout of the data that user space +.\" uses. Each (almost each) occurrence of stat() is replaced by +.\" an occurrence of xstat() where the first parameter of xstat() +.\" is this version number _STAT_VER. +.\" +.\" Now, also the definitions used by the kernel change. +.\" But glibc copes with this in the standard way, and the +.\" struct stat as returned by the kernel is repacked into +.\" the struct stat as expected by the application. +.\" Thus, _STAT_VER and this setup cater for the application-libc +.\" interface, rather than the libc-kernel interface. +.\" +.\" (Note that the details depend on gcc being used as c compiler.) +時間の経過とともに、 \fIstat\fP 構造体のサイズが大きくなり、この影響で \fBstat\fP() には 3つのバージョンが存在する: +\fIsys_stat\fP() (スロットは \fI__NR_oldstat\fP)、 \fIsys_newstat\fP() (スロットは +\fI__NR_stat\fP)、 \fIsys_stat64\fP() (カーネル 2.4 で導入; スロットは \fI__NR_stat64\fP). glibc +の \fBstat\fP() ラッパー関数はこれらの詳細をアプリケーションから隠蔽してくれる。 +具体的には、カーネルが提供しているシステムコールのうち最新のバージョンを 起動し、古いバイナリの場合には必要に応じて返された情報を再構成 +(repack) する。 \fBfstat\fP() と \fBlstat\fP() についても同様である。 +.SH 例 +以下のプログラムは \fBstat\fP() を呼び出し、返ってきた \fIstat\fP 構造体のフィールドのいくつかを表示する。 +.nf + +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat sb; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \en", argv[0]); + exit(EXIT_FAILURE); + } + + if (stat(argv[1], &sb) == \-1) { + perror("stat"); + exit(EXIT_FAILURE); + } + + printf("File type: "); + + switch (sb.st_mode & S_IFMT) { + case S_IFBLK: printf("block device\en"); break; + case S_IFCHR: printf("character device\en"); break; + case S_IFDIR: printf("directory\en"); break; + case S_IFIFO: printf("FIFO/pipe\en"); break; + case S_IFLNK: printf("symlink\en"); break; + case S_IFREG: printf("regular file\en"); break; + case S_IFSOCK: printf("socket\en"); break; + default: printf("unknown?\en"); break; + } + + printf("I\-node number: %ld\en", (long) sb.st_ino); + + printf("Mode: %lo (octal)\en", + (unsigned long) sb.st_mode); + + printf("Link count: %ld\en", (long) sb.st_nlink); + printf("Ownership: UID=%ld GID=%ld\en", + (long) sb.st_uid, (long) sb.st_gid); + + printf("Preferred I/O block size: %ld bytes\en", + (long) sb.st_blksize); + printf("File size: %lld bytes\en", + (long long) sb.st_size); + printf("Blocks allocated: %lld\en", + (long long) sb.st_blocks); + + printf("Last status change: %s", ctime(&sb.st_ctime)); + printf("Last file access: %s", ctime(&sb.st_atime)); + printf("Last file modification: %s", ctime(&sb.st_mtime)); + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBaccess\fP(2), \fBchmod\fP(2), \fBchown\fP(2), \fBfstatat\fP(2), \fBreadlink\fP(2), +\fButime\fP(2), \fBcapabilities\fP(7), \fBsymlink\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/realpath.3 b/manual/LDP_man-pages/draft/man3/realpath.3 new file mode 100644 index 00000000..5470c85f --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/realpath.3 @@ -0,0 +1,160 @@ +.\" Copyright (C) 1999 Andries Brouwer (aeb@cwi.nl) +.\" +.\" %%%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 +.\" +.\" Rewritten old page, 990824, aeb@cwi.nl +.\" 2004-12-14, mtk, added discussion of resolved_path == NULL +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REALPATH 3 2013\-03\-15 "" "Linux Programmer's Manual" +.SH 名前 +realpath \- 正規化された絶対パス名を返す +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBchar *realpath(const char *\fP\fIpath\fP\fB, char *\fP\fIresolved_path\fP\fB);\fP +.fi +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBrealpath\fP(): +.ad l +.RS 4 +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +.RE +.ad +.SH 説明 +\fBrealpath\fP() は \fIpath\fP として与えられた NULL 終端された文字列中の すべてのシンボリックリンクを展開し、 \fI/./\fP, +\fI/../\fP による参照や余分な \(aq/\(aq を解決して、正規化された絶対パス名を生成する。 得られた絶対パス名は、最大で +\fBPATH_MAX\fP バイトの NULL 終端された文字列として、 \fIresolved_path\fP により参照されるバッファに格納される。 +結果として返るパスの中には、シンボリックリンクや \fI/./\fP, \fI/../\fP といった要素は含まれない。 + +.\" Even if we use resolved_path == NULL, then realpath() will still +.\" return ENAMETOOLONG if the resolved pathname would exceed PATH_MAX +.\" bytes -- MTK, Dec 04 +.\" .SH HISTORY +.\" The +.\" .BR realpath () +.\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry. +\fIresolved_path\fP に NULL が指定されると、 \fBrealpath\fP() は \fBmalloc\fP(3) +を使って解決したパス名を保持するためのバッファを 最大で \fBPATH_MAX\fP バイトまで割り当て、このバッファへのポインタを返す。 呼び出し元は、 +\fBfree\fP(3) を使ってこのバッファを解放すべきである。 +.SH 返り値 +エラーがなかった場合、 \fBrealpath\fP() は \fIresolved_path\fP へのポインターを返す。 + +それ以外の場合は、ヌル (NULL) ポインターが返り、配列 \fIresolved_path\fP の内容は不定となり、 \fIerrno\fP +にエラーの内容を示す値がセットされる。 +.SH エラー +.TP +\fBEACCES\fP +パスのディレクトリ部分に、読み出し許可または検索許可が与えられていない。 +.TP +\fBEINVAL\fP +.\" (In libc5 this would just cause a segfault.) +\fIpath\fP が NULL である。 (バージョン 2.3 より前の glibc では、 \fIresolved_path\fP が NULL +の場合にもこのエラーが返される。) +.TP +\fBEIO\fP +ファイルシステムを読むときに、I/Oエラーが起こった。 +.TP +\fBELOOP\fP +パス名の変換にあたり、解決すべきシンボリック・リンクの数が多過ぎた。 +.TP +\fBENAMETOOLONG\fP +パス名の一要素の文字数が \fBNAME_MAX\fP を越えている、またはパス名全体の文字数が \fBPATH_MAX\fP を越えている。 +.TP +\fBENOENT\fP +指定されたファイルが存在しない。 +.TP +\fBENOTDIR\fP +パスのディレクトリ要素が、ディレクトリでない。 +.SH バージョン +Linux では、この関数が登場したのは libc 4.5.21 である。 +.SH 準拠 +4.4BSD, POSIX.1\-2001. + +POSIX.1\-2001 では \fIresolved_path\fP が NULL の場合の動作は実装に依存するとしている。 POSIX.1\-2008 +では、このマニュアルページに書かれている動作が規定されている。 +.SH 注意 +4.4BSD と Solaris では、パス名の長さの上限は (\fI\fP の中にある) +\fBMAXPATHLEN\fP である。SUSv2 では \fBPATH_MAX\fP と \fBNAME_MAX\fP が規定されており、 これらは +\fI\fP で定義されているか、 \fBpathconf\fP(3) +関数から得られる。以下のようなソースコードになっていることが多い。 +.LP +.in +4n +.nf +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf(path, _PC_PATH_MAX); + if (path_max <= 0) + path_max = 4096; +#endif +.fi +.in +.LP +(バグの章も参照のこと。) +.LP +.\" 2012-05-05, According to Casper Dik, the statement about +.\" Solaris was not true at least as far back as 1997, and +.\" may never have been true. +.\" +.\" The 4.4BSD, Linux and SUSv2 versions always return an absolute +.\" pathname. +.\" Solaris may return a relative pathname when the +.\" .I path +.\" argument is relative. +\fBrealpath\fP() のプロトタイプ宣言は、 libc4 と libc5 では +\fI\fP にあるが、それ以外の環境ではいずれも +\fI\fP にある。 +.SS "GNU による拡張" +呼び出しが \fBEACCES\fP か \fBENOENT\fP で失敗し \fIresolved_path\fP が NULL +でない場合、読むことができない、もしくは存在しない \fIpath\fP のディレクトリ要素 (prefix) が \fIresolved_path\fP +で返される。 +.SH バグ +この関数の POSIX.1\-2001 版は、設計段階から問題がある。 出力バッファ \fIresolved_path\fP +の適切なサイズを決定することができないからである。 POSIX.1\-2001 ではバッファ・サイズとして \fBPATH_MAX\fP +は十分だとされているが、 \fBPATH_MAX\fP は定義済の定数である必要はなく、 \fBpathconf\fP(3) +を使って得られる値であってもよいことになっている。 \fBpathconf\fP(3) からバッファ・サイズを取得したとしても必ずしも十分ではない。 +なぜなら、POSIX で警告されているように、 \fBpathconf\fP(3) の返り値が大き過ぎて適切にメモリを確保することができない +かもしれない一方で、 \fBpathconf\fP(3) は \fBPATH_MAX\fP に制限がないことを示す \-1 を返すかもしれないからである。 +\fIresolved_path\ ==\ NULL\fP の機能を使うと、この設計上の問題を回避することができる。 この機能は POSIX.1\-2001 +では標準化されていないが、 POSIX.1\-2008 では標準化されている。 +.LP +libc4 と libc5 の実装はバッファ・オーバーフローの可能性を持っていた (libc\-5.4.13 で修正されたが)。したがって、 +\fBmount\fP(8) のような set\-user\-ID されるプログラムでは、この関数相当の関数を自前で持つ必要があった。 +.SH 関連項目 +\fBreadlink\fP(2), \fBcanonicalize_file_name\fP(3), \fBgetcwd\fP(3), \fBpathconf\fP(3), +\fBsysconf\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/regex.3 b/manual/LDP_man-pages/draft/man3/regex.3 new file mode 100644 index 00000000..012f3dc1 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/regex.3 @@ -0,0 +1,191 @@ +.de xx +.in \\n(INu+\\$1 +.ti -\\$1 +.. +.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.) +.\" +.\" %%%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 +.\" +.\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk) +.\" Tiny change in formatting - aeb, 950812 +.\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) +.\" +.\" show the synopsis section nicely +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REGEX 3 2013\-02\-11 GNU "Linux Programmer's Manual" +.SH 名前 +regcomp, regexec, regerror, regfree \- POSIX regex 関数 +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP + +\fBint regcomp(regex_t *\fP\fIpreg\fP\fB, const char *\fP\fIregex\fP\fB, int \fP\fIcflags\fP\fB);\fP + +\fBint regexec(const regex_t *\fP\fIpreg\fP\fB, const char *\fP\fIstring\fP\fB, size_t \fP\fInmatch\fP\fB,\fP +\fB regmatch_t \fP\fIpmatch[]\fP\fB, int \fP\fIeflags\fP\fB);\fP + +\fBsize_t regerror(int \fP\fIerrcode\fP\fB, const regex_t *\fP\fIpreg\fP\fB, char *\fP\fIerrbuf\fP\fB,\fP +\fB size_t \fP\fIerrbuf_size\fP\fB);\fP + +\fBvoid regfree(regex_t *\fP\fIpreg\fP\fB);\fP +.fi +.SH 説明 +.SS "POSIX regex コンパイル" +\fBregcomp\fP() は、正規表現をコンパイルして、 \fBregexec\fP() での検索処理に適合する形態にする。 + +\fBregcomp\fP() はパターンを記憶するバッファへのポインタ \fIpreg\fP、 ヌル文字で終端された文字列 \fIregex\fP、 +そしてコンパイルの形式を決めるためのフラグ \fIcflag\fP を引数に伴う。 + +全ての正規表現検索は、コンパイルされたパターンによって行わなければならない。 よって、 \fBregexec\fP() に指定するのは、必ず +(\fBregcomp\fP() によってコンパイルされた) パターンバッファへのアドレスでなければならない。 + +\fIcflags\fP には以下に示す定数一つ以上のビットごとの OR (bitwise\-or) を指定する。 +.TP +\fBREG_EXTENDED\fP +\fIregex\fP に \fBPOSIX\fP 拡張正規表現を使用する。もしこのフラグが設定されない場合、 \fBPOSIX\fP 標準正規表現が使われる。 +.TP +\fBREG_ICASE\fP +大文字小文字の違いを無視する。このフラグを指定してコンパイルされた パターンバッファを用いて \fBregexec\fP() +関数を呼び出すと、大文字小文字の区別を付けずに検索が行われる。 +.TP +\fBREG_NOSUB\fP +マッチの場所を報告しない。渡されたパターンバッファがこのフラグを設定してコンパイルされていた場合、 \fBregexec\fP() の引き数 +\fInmatch\fP, \fIpmatch\fP が無視される。 +.TP +\fBREG_NEWLINE\fP +全ての文字にマッチするオペレータに改行をマッチさせない。 + +改行を含まない非マッチング文字リスト (\fB[^...]\fP) に改行をマッチさせない。 + +\fBregexec\fP() の実行時に指定するフラグ \fIeflags\fP に \fBREG_NOTBOL\fP +を含むかどうかにかかわらず、行頭にマッチするオペレータ (\fB^\fP) を改行直後の空文字列にマッチさせる。 + +\fIeflags\fP に \fBREG_NOTEOL\fP を含むかどうかにかかわらず、行末にマッチするオペレータ (\fB$\fP) +を改行直前の空文字列にマッチさせる。 +.SS "POSIX regex マッチング" +\fBregexec\fP() は、 プリコンパイルされたパターンバッファ \fIpreg\fP をヌル文字で終端された文字列にマッチさせる。 \fInmatch\fP +と \fIpmatch\fP はマッチングの位置に関する情報を取得するのに用いられる。 \fIeflags\fP には \fBREG_NOTBOL\fP と +\fBREG_NOTEOL\fP のどちらか、もしくは両方のビットごとの \fBOR\fP (bitwise\-\fBor\fP) +を指定し、以下で説明するようにマッチング動作を変化させる。 +.TP +\fBREG_NOTBOL\fP +行頭にマッチするオペレータは、必ずマッチに失敗する (コンパイル時のフラグ \fBREG_NEWLINE\fP の項目も参照)。 +このフラグは、複数行にまたがる文字列を \fBregexec\fP() で検索する際に、文字列の先頭を行の先頭として解釈させない場合に用いる。 +.TP +\fBREG_NOTEOL\fP +行末にマッチするオペレータは、必ずマッチに失敗する (コンパイル時のフラグ \fBREG_NEWLINE\fP の項目も参照)。 +.SS バイトオフセット +パターンバッファのコンパイル時に \fBREG_NOSUB\fP が設定されない場合は、マッチング位置情報を得ることができる。 \fIpmatch\fP +は、少なくとも \fInmatch\fP の大きさを持つように指定しなければならない。 \fBregexec\fP() +の実行によって、それらに部分文字列マッチング位置情報が代入される。 \fIi\fP 番目の括弧で始まる部分正規表現のオフセットは \fIpmatch[i]\fP +に格納される。正規表現全体のマッチアドレスは \fIpmatch[0]\fP に格納される。 (\fIN\fP 個の部分正規表現のマッチのオフセットを返すためには、 +\fInmatch\fP は最低限 \fIN+1\fP でなければならない点に注意すること。) 未使用の構造体要素には \-1 が値として代入される。 + +\fIpmatch\fP の型である \fIregmatch_t\fP 構造体は、 \fI\fP 内で定義される。 + +.in +4n +.nf +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; +.fi +.in + +構造体要素 \fIrm_so\fP の値が \-1 でない場合、それは文字列内での次の最大のマッチング部分の開始 オフセット位置を示す。それに対し、構造体要素 +\fIrm_eo\fP はマッチング部分の終了オフセット位置を示し、 マッチング部分の直後の文字のオフセット位置が使用される。 +.SS "POSIX エラーレポート" +\fBregerror\fP() は、 \fBregcomp\fP() と \fBregexec\fP() +の実行によって得られるエラーコードから、エラーメッセージ文字列を 得るのに用いられる。 + +\fBregerror\fP() はエラーコード \fIerrcode\fP、 パターンバッファ \fIpreg\fP、 文字列バッファへのポインタ +\fIerrbuf\fP、 文字列バッファのサイズ \fIerrbuf_size\fP を引数にとる。 +この関数は、ヌル文字で終端されたエラーメッセージ文字列を格納するのに必要な \fIerrbuf\fP のサイズを返す。もし \fIerrbuf\fP と +\fIerrbuf_size\fP の両方が非 0 値であれば、 \fIerrbuf\fP には最初の \fIerrbuf_size \- 1\fP +文字分にエラーメッセージと終端の NULL バイト (\(aq\e0\(aq) が収まるように代入される。 +.SS "POSIX パターンバッファ解放" +引数にコンパイルされたパターンバッファ \fIpreg\fP を与えて \fBregfree\fP() を呼び出すと、 \fBregcomp\fP() +によるコンパイル時にパターンバッファに割り当てられたメモリが解放される。 +.SH 返り値 +\fBregcomp\fP() は、コンパイルの成功時には 0 を返し、失敗時にはエラーコードを返す。 + +\fBregexec\fP() は、マッチングの成功時には 0 を返し、失敗時には \fBREG_NOMATCH\fP を返す。 +.SH エラー +\fBregcomp\fP() は以下のエラーを返す。 +.TP +\fBREG_BADBR\fP +無効な後方参照オペレータの使用。 +.TP +\fBREG_BADPAT\fP +グループやリストなどの、パターンオペレータの無効な使用。 +.TP +\fBREG_BADRPT\fP +\(aq*\(aq が最初の文字としてくるような、無効な繰り返しオペレータの使用。 +.TP +\fBREG_EBRACE\fP +インターバルオペレータ \fB{}\fP (brace interval operators) が閉じていない。 +.TP +\fBREG_EBRACK\fP +リストオペレータ \fB[]\fP (bracket list operators) が閉じていない。 +.TP +\fBREG_ECOLLATE\fP +照合順序の要素 (collating element) として有効ではない。 (訳注) 詳細は \fBregex\fP(7) を参照。 +.TP +\fBREG_ECTYPE\fP +未知のキャラクタクラス名。 +.TP +\fBREG_EEND\fP +未定義エラー。これは POSIX.2 には定義されていない。 +.TP +\fBREG_EESCAPE\fP +正規表現がバックスラッシュで終っている。 +.TP +\fBREG_EPAREN\fP +グループオペレータ \fB()\fP (parenthesis group operators) が閉じていない。 +.TP +\fBREG_ERANGE\fP +無効な範囲オペレータの使用。 例えば、範囲の終了位置が開始位置よりも前にあるような場合。 +.TP +\fBREG_ESIZE\fP +正規表現のコンパイルに、64Kb 以上のパターンバッファが必要。 これは POSIX.2 には定義されていない。 +.TP +\fBREG_ESPACE\fP +regex ルーチンがメモリを使いはたしている。 +.TP +\fBREG_ESUBREG\fP +サブエクスプレッション \e\fB(...\e\fP) (subexpression) への無効な後方参照。 +.SH 準拠 +POSIX.1\-2001. +.SH 関連項目 +\fBgrep\fP(1), \fBregex\fP(7) +.br +glibc マニュアルのセクション \fIRegular Expression Matching\fP +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man7/glob.7 b/manual/LDP_man-pages/draft/man7/glob.7 new file mode 100644 index 00000000..b88238f0 --- /dev/null +++ b/manual/LDP_man-pages/draft/man7/glob.7 @@ -0,0 +1,155 @@ +.\" Copyright (c) 1998 Andries Brouwer +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" 2003-08-24 fix for / by John Kristoff + joey +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GLOB 7 2012\-07\-28 Linux "Linux Programmer's Manual" +.SH 名前 +glob \- パス名を glob する +.SH 説明 +昔々 UNIX V6 では、ワイルドカードパターンを展開する \fI/etc/glob\fP と言うプログラムがあった。その後すぐに、 +この機能はシェルに組み込まれるようになった。 + +今日では、この機能をユーザープログラムからも実行できるよう、 \fBglob\fP(3) というライブラリルーチンも存在している。 + +glob の規則を以下に述べる (POSIX.2 3.13)。 +.SS ワイルドカードマッチ +文字列に \(aq?\(aq, \(aq*\(aq, \(aq[\(aq が含まれていると、 それはワイルドカードパターンとみなされる。 「glob +する」というのは、ワイルドカードパターンを展開して、 そのパターンにマッチするパス名のリストを得ることである。 マッチは以下のように定義される。 + +(ブラケット外部の) \(aq?\(aq はあらゆる単一の文字にマッチする。 + +(ブラケット外部の) \(aq*\(aq はあらゆる文字列にマッチする。 空文字列 (empty string) にもマッチする。 +.PP +\fB文字クラス (character class)\fP +.sp +"\fI[...]\fP" と言う表記は、先頭の \(aq[\(aq に続く最初の文字が \(aq!\(aq で +なければ、ブラケットの中に含まれている文字のどれか一つにマッチする。 ブラケットの内部に含まれる文字列は空であってはならない。 したがって +\(aq]\(aq も最初の文字に指定すればブラケットの内部に含めることが できる (つまり "\fI[][!]\fP" は \(aq[\(aq, +\(aq]\(aq, \(aq!\(aq の 3 文字のどれかにマッチする)。 +.PP +\fB領域指定 (range)\fP +.sp +特殊な表記法が一つ存在する。\(aq\-\(aq を挟む二つの文字は領域指定となる。 (つまり "\fI[A\-Fa\-f0\-9]\fP" は +"\fI[ABCDEFabcdef0123456789]\fP" と等価となる。) \(aq\-\(aq 文字そのものを入れたい場合は、 +ブラケットの先頭または最後の文字に指定すればよい。 (つまり "\fI[]\-]\fP" は二つの文字 \(aq]\(aq と \(aq\-\(aq +にマッチし、"\fI[\-\-0]\fP" は \(aq\-\(aq, \(aq.\(aq, \(aq0\(aq の 3 文字にマッチする。この間の +\(aq/\(aq にはマッチしない。後述を参照。) +.PP +\fB補集合 (complementation)\fP +.sp +"\fI[!...]\fP" と言う表記は、ブラケットの内部に含まれない単一の文字にマッチする (ただし先頭にある \(aq!\(aq は除外)。 (つまり +"\fI[!]a\-]\fP" は \(aq]\(aq, \(aqa\(aq, \(aq\-\(aq 以外のすべての文字の、どれか一つにマッチする。) + +バックスラッシュ \(aq\e\(aq を前置すれば、 \(aq?\(aq, \(aq*\(aq, \(aq[\(aq は通常の文字として扱われる。 +またはシェルのコマンドラインの一部に指定する場合は、 クォートで囲っても同じ効果が得られる。ブラケットの内部では、 +これらの文字はその文字自身だけを意味する。 すなわち "\fI[[?*\e]\fP" は \(aq[\(aq, \(aq?\(aq, \(aq*\(aq, +\(aq\e\(aq のどれか一文字にマッチする。 +.SS "パス名 (pathname)" +glob 動作は、パス名のそれぞれの部分に独立に適用される。 パス名に存在する \(aq/\(aq は \(aq?\(aq や \(aq*\(aq +ワイルドカードにはマッチしない。 また "\fI[.\-0]\fP" のような領域指定にもマッチしない。 領域指定は陽に \(aq/\(aq +文字を含むことはできない。これは文法エラーとなる。 + +\(aq.\(aq で始まるパス名では、この文字は陽にマッチさせなければならない。 (つまり \fIrm\ *\fP は .profile を削除しない。また +\fItar\ c\ *\fP ではすべてのファイルはアーカイブされない。 \fItar\ c\ .\fP の方が良い。) +.SS 空のリスト +先に与えた、わかりやすく簡単なルール、 「ワイルドカードパターンをマッチしたパス名のリストに展開する」と言うのは、 オリジナルの UNIX +における定義であった。 これはパターンが空のリストに展開されることも許可されていた。 例えば + +.nf + xv \-wait 0 *.gif *.jpg +.fi + +において、*.gif ファイルが全くない場合でも、 これは空のリストに展開されるため、エラーにならない。 しかし POSIX +では、文法的に正しくないパターンや、 マッチがなかったパターンは、 そのまま変更されずに残されることになっている。 \fIbash\fP +では、次のコマンドで昔からの振る舞いに設定することができる。 + +.\" In Bash v1, by setting allow_null_glob_expansion=true + shopt \-s nullglob + +(同様の問題は別のところでも起こっている。例えば、古いスクリプトにおける + +.nf + rm \`find . \-name "*~"\` +.fi + +のような記述は、新しいスクリプトでは + +.nf + rm \-f nosuchfile \`find . \-name "*~"\` +.fi + +のようにしなければならない。さもないと \fIrm\fP を引き数リストなしで呼び出す可能性があり、 エラーメッセージが出てしまう。) +.SH 注意 +.SS 正規表現 +ワイルドカードパターンは正規表現と多少似ているが、しかしこの両者は異なる。 まず第一に、前者がファイル名にマッチするのに対して、 +後者はテキストにマッチする。第二に、ルールも同じではない。 例えば正規表現における \(aq*\(aq は、 前置された文字の 0 +以上の繰り返しを表す。 + +正規表現にもブラケット表現はあるが、否定は \(aq^\(aq でなされる。 POSIX ではワイルドカードパターンにおける "\fI[^...]\fP" +を未定義であるとしている。 +.SS 文字クラスと国際化 +領域指定は、もともとはもちろん ASCII における順序並びを意味していた。 したがって "\fI[\ \-%]\fP" は "\fI[\ !"#$%]\fP" +の意味であり、 "\fI[a\-z]\fP" は「すべての小文字」の意味であった。 UNIX の実装の中には、これを拡張したものが存在し、 そこでは X\-Y +という領域指定は、X のコードと Y のコードに挟まれたコードを持つ文字すべてを表すようになっていた。 +しかし、これにはユーザーがローカルなシステムにおける 文字コードを知らなければならず、 さらにローカルなアルファベットに対する照合順序 +(collating sequence) が文字コードの順序と異なっている場合には不便であった。 (訳注: collating sequence +に関しては \fBregex\fP(7) を参照して下さい。) したがって POSIX では、ワイルドカードパターンと正規表現の双方において、 +ブラケット表記を大幅に拡張している。 これまで我々は、ブラケット表記には三つの要素が含まれうることを見てきた。 すなわち (i) 否定、(ii) +単一の文字、(iii) 領域指定、の三つである。 POSIX では、領域指定をより国際化に便利なように定義しており、 +また三つのタイプをブラケット表記の要素として追加している。 + +(iii) 領域指定 X\-Y は X と Y に挟まれた (両端含む) すべての文字を意味する。 このとき、カレントロケール (current +locale) の \fBLC_COLLATE\fP カテゴリで定義されている照合順序が用いられる。 + +(iv) 名前付き文字クラス: 以下のようなものである。 +.nf + +[:alnum:] [:alpha:] [:blank:] [:cntrl:] +[:digit:] [:graph:] [:lower:] [:print:] +[:punct:] [:space:] [:upper:] [:xdigit:] + +.fi +これを用いれば "\fI[a\-z]\fP" の代わりに "\fI[[:lower:]]\fP" のような指定ができる。 またデンマークのように、アルファベットの +\(aqz\(aq 以降に 3 つの文字が存在するような場合でも、同じような動作が期待できる。 これらの文字クラスはカレントロケールの +\fBLC_CTYPE\fP カテゴリで定義されている。 + +(v) 照合順序におけるシンボル: "\fI[.ch.]\fP" や "\fI[.a\-acute.]\fP" のように "\fI[.\fP" と "\fI.]\fP" +で挟まれた文字列は、カレントロケールで定義された照合順序の要素となる。 ある一つの要素が複数の文字からなる場合もありうることに注意。 + +(vi) 等価クラス表現 (equivalence class expressions): +"\fI[=a=]\fP" のように "\fI[=\fP" と "\fI=]\fP" とで挟まれた文字列であり、 +カレントロケールで定義された等価クラスのメンバーである照合要素のいずれかを表す。 +例えば、"\fI[[=a=]]\fP" は "\fI[a\('a\(`a\(:a\(^a]\fP"、つまり +"\fI[a[.a\-acute.][.a\-grave.][.a\-umlaut.][.a\-circumflex.]]\fP" と等価になる。 +.SH 関連項目 +\fBsh\fP(1), \fBfnmatch\fP(3), \fBglob\fP(3), \fBlocale\fP(7), \fBregex\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man7/math_error.7 b/manual/LDP_man-pages/draft/man7/math_error.7 new file mode 100644 index 00000000..35d1e002 --- /dev/null +++ b/manual/LDP_man-pages/draft/man7/math_error.7 @@ -0,0 +1,146 @@ +.\" Copyright (c) 2008, Linux Foundation, written 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 MATH_ERROR 7 2008\-08\-11 Linux "Linux Programmer's Manual" +.SH 名前 +math_error \- 数学関数からのエラーの検出 +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +\fB#include \fP +.fi +.SH 説明 +エラーが発生すると、ほとんどのライブラリ関数は (\-1 や NULL などの) 特別な値を返すことでエラーを通知する。 +\fI\fP で宣言されている数学関数は、通常は浮動小数点値を返すので、 他の機構を使ってエラーを通知する。 エラー通知機構は +2 種類あり、 古いものが \fIerrno\fP を設定するやり方であり、新しいものが \fBfenv\fP(3) で説明されている浮動小数点例外機構である。 +(\fBfeclearexcept\fP(3) と \fBfetestexcept\fP(3) を使用する。これらについては以下で概要を説明している。) + +移植性が必要なプログラムで、数学関数からのエラーを確認する必要がある場合には、 数学関数を呼び出す前に \fIerrno\fP を 0 に設定し、 +.in +4n +.nf + +feclearexcept(FE_ALL_EXCEPT); + +.fi +.in +を呼び出すべきである。 + +数学関数から返ってきた際に、 \fIerrno\fP が 0 以外か、 +.in +4n +.nf + +fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | + FE_UNDERFLOW); + +.fi +.in +.\" enum +.\" { +.\" FE_INVALID = 0x01, +.\" __FE_DENORM = 0x02, +.\" FE_DIVBYZERO = 0x04, +.\" FE_OVERFLOW = 0x08, +.\" FE_UNDERFLOW = 0x10, +.\" FE_INEXACT = 0x20 +.\" }; +の呼び出しが 0 以外を返した場合 (\fBfenv\fP(3) 参照)、数学関数でエラーが発生している。 + +数学関数で発生するエラー条件については以下で説明する。 +.SS "領域エラー (domain error)" +\fI領域エラー\fP が発生するのは、数学関数に渡された引き数の値がその関数が定義されている 領域に入っていない場合である (例えば \fBlog\fP(3) +に負の引き数を渡した場合)。 領域エラーが発生すると、 数学関数は普通は NaN を返し (同じ状況で違う値を返す関数もある)、 \fIerrno\fP に +\fBEDOM\fP を設定し、「無効 (invalid)」 浮動小数点例外 (\fBFE_INVALID\fP) を上げる。 +.SS "極エラー (pole error)" +\fI極エラー\fP が発生するのは、関数の数学的な結果が無限大そのものとなる場合である (例えば 0 の対数は負の無限大である)。 +極エラーが発生すると、その関数の返り値は (符号付きの) \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP +のいずれかとなる (前記の値のうちどれが返るかは関数の返り値の型により決まり、 それぞれ \fIdouble\fP, \fIfloat\fP, \fIlong +double\fP に対応する)。 結果の符号は、その関数の数学的な定義から決定される。 \fIerrno\fP は \fBERANGE\fP に設定され、「0 +による除算 (divide\-by\-zero)」 浮動小数点例外 (\fBFE_DIVBYZERO\fP) が上がる。 +.SS "範囲エラー (range エラー)" +\fI範囲エラー\fP が発生するのは、関数の結果の値がその関数の返り値の型では表現できない場合 +である。関数の返り値は、範囲エラーがオーバーフローであったかアンダーフロー であったかによって異なる。 + +浮動小数点のオーバーフローは、結果が有限だが、大き過ぎて 結果を返す型では表現できない場合に発生する。 オーバーフローが発生すると、 その関数は +\fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP のいずれかを返す +(前記の値のうちどれが返るかは関数の返り値の型により決まり、 それぞれ \fIdouble\fP, \fIfloat\fP, \fIlong double\fP +に対応する)。 \fIerrno\fP は \fBERANGE\fP に設定され、「オーバーフロー (overflow)」 浮動小数点例外 +(\fBFE_OVERFLOW\fP) が上がる。 + +浮動小数点のアンダーフローは、 結果が小さ過ぎて、結果を返す型では表現できない場合に発生する。 アンダーフローが発生すると、数学関数は通常は 0.0 +を返す (C99 では、指定された型において最小の正規化された正の値より大きくない 値を持つ実装定義 (implementation\-defined) +の値を返す、となっている)。 \fIerrno\fP は \fBERANGE\fP に設定され、「アンダーフロー」浮動小数点例外 (\fBFE_UNDERFLOW\fP) +が上がる。 + +いくつかの関数では、渡された引き数の値や、正しい関数の結果が \fIsubnormal (非正規化数)\fP になる場合に範囲エラーを上げる。 +subnormal な値とは、0 ではないが、その値が小さすぎて (仮数部の最上位ビットが 1 となる) 標準形では表現できないような値である。 +subnormal な値の表現では、仮数部の上位側のビットに 1 個以上の 0 が 含まれることになる。 +.SH 注意 +.\" See CONFORMANCE in the glibc 2.8 (and earlier) source. +C99 と POSIX.1\-2001 で規定されている \fImath_errhandling\fP 識別子は glibc ではサポートされていない。 +この識別子は、2 つのエラー通知機構 (\fIerrno\fP と \fBfetestexcept\fP(3) 経由で取得できる例外) +のうちどちらが使用されているかを通知 することになっている。 標準では、少なくとも一つは使用されることが要求されているが、 +両方とも利用可能であってもよいとされている。 glibc での現在の (バージョン 2.8 での) 状況はかなり混乱している。 ほとんどの関数 +(ただし全部ではない) はエラー時に例外を上げる。 いくつかの関数は \fIerrno\fP も設定する。 \fIerrno\fP +を設定するが、例外を上げない関数も少しだけ存在する。 どちらも行わない関数もごく少数だが存在する。 詳細については個々のマニュアルページを参照のこと。 + +.\" http://www.securecoding.cert.org/confluence/display/seccode/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions +\fIerrno\fP と \fBfetestexcept\fP(3) の両方を使ってエラーチェックを行うことで複雑になるのを避けるため、 +多くの場合、関数呼び出しを行う前に不正な引き数かのチェックを行う 方法が推奨されている。 例えば、以下のコードは、 \fBlog\fP(3) の引き数が +NaN でも (極エラーとなる) 0 でも (領域エラーとなる) 0 未満 でもないことを保証するものである。 +.in +4n +.nf + +double x, r; + +if (isnan(x) || islessequal(x, 0)) { + /* Deal with NaN / pole error / domain error */ +} + +r = log(x); + +.fi +.in +このページに書かれていることは、 (\fI\fP で宣言されている) 複素数関数にはあてはまらない。 一般に、C99 や +POSIX.1\-2001 ではこれらの関数がエラーを返すことを 要求してない。 + +\fBgcc\fP(1) の \fI\-fno\-math\-errno\fP オプションを使うと、実行ファイルで、標準の実装よりも高速な数学関数の +実装が使用されるようになるが、 エラー時に \fIerrno\fP が設定されない (\fBgcc\fP(1) の \fI\-ffast\-math\fP +オプションを指定した場合にも \fI\-fno\-math\-errno\fP は有効になる)。 このオプションを指定した場合でも、 +\fBfetestexcept\fP(3) を使ったエラーの検査は可能である。 +.SH 関連項目 +\fBgcc\fP(1), \fBerrno\fP(3), \fBfenv\fP(3), \fBfpclassify\fP(3), \fBINFINITY\fP(3), +\fBisgreater\fP(3), \fBmatherr\fP(3), \fBnan\fP(3) + +\fIinfo libc\fP +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/release/man2/epoll_wait.2 b/manual/LDP_man-pages/release/man2/epoll_wait.2 index 648e39a4..6c45e18b 100644 --- a/manual/LDP_man-pages/release/man2/epoll_wait.2 +++ b/manual/LDP_man-pages/release/man2/epoll_wait.2 @@ -134,11 +134,9 @@ struct epoll_event { インスタンス内のファイルディスクリプタが別のスレッドによってクローズされた場合に何が起こるかの議論については、 \fBselect\fP(2) を参照してほしい。 .SH バグ -In kernels before 2.6.37, a \fItimeout\fP value larger than approximately -\fILONG_MAX / HZ\fP milliseconds is treated as \-1 (i.e., infinity). Thus, for -example, on a system where the \fIsizeof(long)\fP is 4 and the kernel \fIHZ\fP -value is 1000, this means that timeouts greater than 35.79 minutes are -treated as infinity. +バージョン 2.6.37 より前のカーネルでは、おおよそ \fILONG_MAX / HZ\fP ミリ秒より大きい \fItimeout\fP 値は \-1 +(つまり無限大) として扱われる。したがって、例えば、\fIsizeof(long)\fP が 4 で、カーネルの \fIHZ\fP の値が 1000 +のシステムでは、 35.79 分よりも大きなタイムアウトは無限大として扱われるということである。 .SH 関連項目 \fBepoll_create\fP(2), \fBepoll_ctl\fP(2), \fBepoll\fP(7) .SH この文書について diff --git a/manual/LDP_man-pages/release/man2/execve.2 b/manual/LDP_man-pages/release/man2/execve.2 index 99c2ba0e..ed974971 100644 --- a/manual/LDP_man-pages/release/man2/execve.2 +++ b/manual/LDP_man-pages/release/man2/execve.2 @@ -134,15 +134,13 @@ set\-user\-ID か set\-group\-ID されたプログラムが実行されてい .IP * \fBprctl\fP(2) の \fBPR_SET_KEEPCAPS\fP フラグはクリアされる。 .IP * -(Since Linux 2.4.36 / 2.6.23) If a set\-user\-ID or set\-group\-ID program is -being executed, then the parent death signal set by \fBprctl\fP(2) -\fBPR_SET_PDEATHSIG\fP flag is cleared. +(Linux 2.4.36 以降 / 2.6.23 以降) set\-user\-ID や set\-group\-ID されたプログラムが実行された場合、 +\fBprctl\fP(2) の \fBPR_SET_PDEATHSIG\fP フラグで設定された parent death シグナルはクリアされる。 .IP * プロセス名は新しい実行ファイルの名前にリセットされる。 プロセス名は \fBprctl\fP(2) の \fBPR_SET_NAME\fP で設定でき、 \fIps\ \-o comm\fP で表示できる。 .IP * -The \fBSECBIT_KEEP_CAPS\fP \fIsecurebits\fP flag is cleared. See -\fBcapabilities\fP(7). +\fBSECBIT_KEEP_CAPS\fP の \fIsecurebits\fP フラグはクリアされる。 \fBcapabilities\fP(7) 参照。 .IP * 終了シグナル (termination signal) は \fBSIGCHLD\fP にリセットされる (\fBclone\fP(2) 参照)。 .PP diff --git a/manual/LDP_man-pages/release/man2/get_thread_area.2 b/manual/LDP_man-pages/release/man2/get_thread_area.2 index 3becd0a1..2e22242f 100644 --- a/manual/LDP_man-pages/release/man2/get_thread_area.2 +++ b/manual/LDP_man-pages/release/man2/get_thread_area.2 @@ -20,7 +20,7 @@ get_thread_area \- スレッド局所記憶 (TLS) 領域を取り出す .sp \fBint get_thread_area(struct user_desc *\fP\fIu_info\fP\fB);\fP -\fI注\fP: このシステムコールには、glibc のラッパー関数が提供されていない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBget_thread_area\fP() は、カレント・スレッドのスレッド局所記憶 (thread\-local storage; TLS) 配列の中のエントリを返す。 エントリのインデックスは、ユーザから引き数として渡される \fIu_info\->entry_number\fP diff --git a/manual/LDP_man-pages/release/man2/getcpu.2 b/manual/LDP_man-pages/release/man2/getcpu.2 index a02eb11a..9f018b18 100644 --- a/manual/LDP_man-pages/release/man2/getcpu.2 +++ b/manual/LDP_man-pages/release/man2/getcpu.2 @@ -24,7 +24,7 @@ getcpu \- 呼び出し元スレッドが動作している CPU と NUMA ノー \fBint getcpu(unsigned *\fP\fIcpu\fP\fB, unsigned *\fP\fInode\fP\fB, struct getcpu_cache *\fP\fItcache\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc のラッパー関数はない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBgetcpu\fP() システムコールは、呼び出し元のスレッドやプロセスが 現在動作しているプロセッサやノードの情報を特定し、 diff --git a/manual/LDP_man-pages/release/man2/getdents.2 b/manual/LDP_man-pages/release/man2/getdents.2 index c2602238..739d603f 100644 --- a/manual/LDP_man-pages/release/man2/getdents.2 +++ b/manual/LDP_man-pages/release/man2/getdents.2 @@ -41,7 +41,7 @@ getdents \- ディレクトリ・エントリを取得する \fB unsigned int \fP\fIcount\fP\fB);\fP .fi -\fI注\fP: このシステムコールに対する glibc のラッパー関数は用意されていない。「注意」の節を参照のこと。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 これはあなたの関心を引くような関数ではない。 POSIX 準拠の C ライブラリインターフェースについては \fBreaddir\fP(3) を見ること。 このページは、カーネルシステムコールの生のインターフェースについて 記載したものである。 diff --git a/manual/LDP_man-pages/release/man2/gettid.2 b/manual/LDP_man-pages/release/man2/gettid.2 index 0732ad83..46fa9d9a 100644 --- a/manual/LDP_man-pages/release/man2/gettid.2 +++ b/manual/LDP_man-pages/release/man2/gettid.2 @@ -38,7 +38,7 @@ gettid \- スレッドID を取得する \fBpid_t gettid(void);\fP .fi -\fI注\fP: このシステムコールには、glibc のラッパー関数が提供されていない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBgettid\fP() は呼び出し元のスレッド ID (TID) を返す。 シングルスレッドのプロセスでは、スレッド ID は (\fBgetpid\fP(2) が返すプロセス ID (PID) と等しい。 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、 diff --git a/manual/LDP_man-pages/release/man2/io_cancel.2 b/manual/LDP_man-pages/release/man2/io_cancel.2 index 2289cf71..c7d84c13 100644 --- a/manual/LDP_man-pages/release/man2/io_cancel.2 +++ b/manual/LDP_man-pages/release/man2/io_cancel.2 @@ -20,7 +20,7 @@ io_cancel \- 未処理の非同期 I/O 操作の取り消し \fB struct io_event *\fP\fIresult\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_cancel\fP() システムコールは、過去に \fBio_submit\fP(2) を使って登録さ diff --git a/manual/LDP_man-pages/release/man2/io_destroy.2 b/manual/LDP_man-pages/release/man2/io_destroy.2 index 056daee1..39762c3d 100644 --- a/manual/LDP_man-pages/release/man2/io_destroy.2 +++ b/manual/LDP_man-pages/release/man2/io_destroy.2 @@ -19,7 +19,7 @@ io_destroy \- 非同期 I/O コンテキストの消去 \fBint io_destroy(aio_context_t \fP\fIctx_id\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_destroy\fP() システムコールは、I/O コンテキストのリストから diff --git a/manual/LDP_man-pages/release/man2/io_getevents.2 b/manual/LDP_man-pages/release/man2/io_getevents.2 index c3e498e5..95de9b94 100644 --- a/manual/LDP_man-pages/release/man2/io_getevents.2 +++ b/manual/LDP_man-pages/release/man2/io_getevents.2 @@ -21,7 +21,7 @@ io_getevents \- 完了キューから非同期 I/O イベントを読み出す \fB struct io_event *\fP\fIevents\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_getevents\fP() システムコールは、少なくとも \fImin_nr\fP の、最大 diff --git a/manual/LDP_man-pages/release/man2/io_setup.2 b/manual/LDP_man-pages/release/man2/io_setup.2 index 0123ee25..132bd81f 100644 --- a/manual/LDP_man-pages/release/man2/io_setup.2 +++ b/manual/LDP_man-pages/release/man2/io_setup.2 @@ -19,7 +19,7 @@ io_setup \- 非同期 I/O コンテキストを作成する \fBint io_setup(unsigned \fP\fInr_events\fP\fB, aio_context_t *\fP\fIctx_idp\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_setup\fP() システムコールは、少なくとも \fInr_events\fP 個のイベントを diff --git a/manual/LDP_man-pages/release/man2/io_submit.2 b/manual/LDP_man-pages/release/man2/io_submit.2 index c30293e9..62d7e964 100644 --- a/manual/LDP_man-pages/release/man2/io_submit.2 +++ b/manual/LDP_man-pages/release/man2/io_submit.2 @@ -19,7 +19,7 @@ io_submit \- 非同期 I/O ブロックを処理待ちキューに登録する \fBint io_submit(aio_context_t \fP\fIctx_id\fP\fB, long \fP\fInr\fP\fB, struct iocb **\fP\fIiocbpp\fP\fB);\fP .fi -\fI注\fP: このシステムコールには glibc ラッパー関数がない。「注意」の節を参照すること。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .PP \fBio_submit\fP() システムコールは、AIO コンテキスト \fIctx_id\fP に \fInr\fP 個 diff --git a/manual/LDP_man-pages/release/man2/ioperm.2 b/manual/LDP_man-pages/release/man2/ioperm.2 index 7a0285b9..4c50910e 100644 --- a/manual/LDP_man-pages/release/man2/ioperm.2 +++ b/manual/LDP_man-pages/release/man2/ioperm.2 @@ -47,20 +47,18 @@ ioperm \- ポートの入出力許可を設定する \fBint ioperm(unsigned long \fP\fIfrom\fP\fB, unsigned long \fP\fInum\fP\fB, int \fP\fIturn_on\fP\fB);\fP .SH 説明 -\fBioperm\fP() sets the port access permission bits for the calling thread for -\fInum\fP bits starting from port address \fIfrom\fP. If \fIturn_on\fP is nonzero, -then permission for the specified bits is enabled; otherwise it is -disabled. If \fIturn_on\fP is nonzero, the calling thread must be privileged -(\fBCAP_SYS_RAWIO\fP). +\fBioperm\fP() は、引き数 \fIfrom\fP の I/O ポートアドレスから \fInum\fP +ビット分の領域に対する、呼び出し元スレッドのアクセス許可ビットを設定する。 \fIturn_on\fP が 0 +以外の場合、指定されたビットに対応する許可が有効になる。 \fIturn_on\fP が 0 以外の場合、呼び出し元プロセスは特権 +(\fBCAP_SYS_RAWIO\fP) を持っていなければならない。 Linux 2.6.8 より前のバージョンでは、この方法で設定できるのは 0x3ff 番地までの I/Oポートに限られていた。これよりも大きなアドレスのポートに対しては \fBiopl\fP(2) 関数を使わなければならなかった。Linux 2.6.8 以降では、65,536 個の I/O ポートを指定できる。 -Permissions are not inherited by the child created by \fBfork\fP(2); following -a \fBfork\fP(2) the child must turn on those permissions that it needs. -Permissions are preserved across \fBexecve\fP(2); this is useful for giving -port access permissions to unprivileged programs. +アクセス権は \fBfork\fP(2) で作成された子プロセスには継承されない。子プロセスでは、\fBfork\fP(2) +の後で必要なアクセス権を有効にしなければならない。 \fBexecve\fP(2) の前後でアクセス権は保存される。この機能は +非特権プログラムにポートへのアクセス権を 与えるのに使用できる。 このシステムコールはほとんど i386 アーキテクチャのためだけのものである。 その他の多くのアーキテクチャでは存在しないか、常にエラーを返す。 .SH 返り値 diff --git a/manual/LDP_man-pages/release/man2/kexec_load.2 b/manual/LDP_man-pages/release/man2/kexec_load.2 index dfca0172..0fed7452 100644 --- a/manual/LDP_man-pages/release/man2/kexec_load.2 +++ b/manual/LDP_man-pages/release/man2/kexec_load.2 @@ -39,7 +39,7 @@ kexec_load \- 新しいカーネルを後で実行するためにロードする .br \fB struct kexec_segment *\fP\fIsegments\fP\fB, unsigned long \fP\fIflags\fP\fB);\fP -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBkexec_load\fP() システムコールは、新しいカーネルをロードし、 その後の \fBreboot\fP(2) で実行できるようにする。 diff --git a/manual/LDP_man-pages/release/man2/llseek.2 b/manual/LDP_man-pages/release/man2/llseek.2 index cd7a7e5e..8261b935 100644 --- a/manual/LDP_man-pages/release/man2/llseek.2 +++ b/manual/LDP_man-pages/release/man2/llseek.2 @@ -43,7 +43,7 @@ _llseek \- ファイルの読み書きオフセットの位置を変える \fB unsigned int \fP\fIwhence\fP\fB);\fP .fi -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fB_llseek\fP() 関数は、ファイルディスクリプタ (descriptor) \fIfd\fP に関連づけられたオープンされたファイルのオフセットの位置を、相対的に \fI(offset_high<<32) | offset_low\fP diff --git a/manual/LDP_man-pages/release/man2/modify_ldt.2 b/manual/LDP_man-pages/release/man2/modify_ldt.2 index 4ccee7ee..a3ace67c 100644 --- a/manual/LDP_man-pages/release/man2/modify_ldt.2 +++ b/manual/LDP_man-pages/release/man2/modify_ldt.2 @@ -36,7 +36,7 @@ modify_ldt \- ldt を設定または取得する \fBint modify_ldt(int \fP\fIfunc\fP\fB, void *\fP\fIptr\fP\fB, unsigned long \fP\fIbytecount\fP\fB);\fP .fi -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBmodify_ldt\fP() はプロセスのローカル・ディスクリプタ・テーブル (local descriptor table; ldt) を読み書きする。 ldt は i386 プロセッサで使用されるプロセスごとのメモリ管理テーブルである。 このテーブルに関してのより詳しい情報は diff --git a/manual/LDP_man-pages/release/man2/mq_getsetattr.2 b/manual/LDP_man-pages/release/man2/mq_getsetattr.2 index 942a55d8..61557012 100644 --- a/manual/LDP_man-pages/release/man2/mq_getsetattr.2 +++ b/manual/LDP_man-pages/release/man2/mq_getsetattr.2 @@ -40,7 +40,7 @@ mq_getsetattr \- メッセージキューの属性を設定/取得する \fB struct mq_attr *\fP\fIoldattr\fP\fB);\fP .fi -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 このシステムコールを使用しないこと。 diff --git a/manual/LDP_man-pages/release/man2/pivot_root.2 b/manual/LDP_man-pages/release/man2/pivot_root.2 index 377aa9a9..caff68cd 100644 --- a/manual/LDP_man-pages/release/man2/pivot_root.2 +++ b/manual/LDP_man-pages/release/man2/pivot_root.2 @@ -18,7 +18,7 @@ pivot_root \- root ファイルシステムを変更する .SH 書式 \fBint pivot_root(const char *\fP\fInew_root\fP\fB, const char *\fP\fIput_old\fP\fB);\fP -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 .\" .\" The diff --git a/manual/LDP_man-pages/release/man2/query_module.2 b/manual/LDP_man-pages/release/man2/query_module.2 index 24a78d54..19ed8a77 100644 --- a/manual/LDP_man-pages/release/man2/query_module.2 +++ b/manual/LDP_man-pages/release/man2/query_module.2 @@ -23,7 +23,7 @@ query_module \- モジュールに関連する各種の情報をカーネルに \fB size_t \fP\fIbufsize\fP\fB, size_t *\fP\fIret\fP\fB);\fP .fi -\fI注\fP: このシステムコールの glibc のラッパー関数はない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBNote\fP: This system call is present only in kernels before Linux 2.6. diff --git a/manual/LDP_man-pages/release/man2/readdir.2 b/manual/LDP_man-pages/release/man2/readdir.2 index dc43f92c..678dc64a 100644 --- a/manual/LDP_man-pages/release/man2/readdir.2 +++ b/manual/LDP_man-pages/release/man2/readdir.2 @@ -42,7 +42,7 @@ readdir \- ディレクトリ・エントリを読み込む \fB unsigned int \fP\fIcount\fP\fB);\fP .fi -\fI注\fP: このシステムコールに対する glibc のラッパー関数は用意されていない。「注意」の節を参照のこと。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 これはあなたの興味をもっている関数ではない。 POSIX 準拠の C ライブラリ・インターフェースについては \fBreaddir\fP(3) を見ること。 このページは裸のカーネルのシステムコール・インターフェースについて 記述しているが、このインターフェースは \fBgetdents\fP(2) diff --git a/manual/LDP_man-pages/release/man2/removexattr.2 b/manual/LDP_man-pages/release/man2/removexattr.2 index 993ad7a6..71f7eb1d 100644 --- a/manual/LDP_man-pages/release/man2/removexattr.2 +++ b/manual/LDP_man-pages/release/man2/removexattr.2 @@ -61,8 +61,8 @@ inode に対し、互いに独立な名前空間が複数あってもよい。 .SH エラー .TP \fBENOATTR\fP -The named attribute does not exist. (\fBENOATTR\fP is defined to be a synonym -for \fBENODATA\fP in \fI\fP.) +指定された属性が存在しない。(\fBENOATTR\fP は \fI\fP で \fBENODATA\fP +の同義語として定義されている。) .TP \fBENOTSUP\fP 拡張属性がそのファイルシステムでサポートされていない、 もしくは無効になっている。 diff --git a/manual/LDP_man-pages/release/man2/set_thread_area.2 b/manual/LDP_man-pages/release/man2/set_thread_area.2 index 3fdafa84..bf53e2ab 100644 --- a/manual/LDP_man-pages/release/man2/set_thread_area.2 +++ b/manual/LDP_man-pages/release/man2/set_thread_area.2 @@ -20,7 +20,7 @@ set_thread_area \- スレッド局所記憶 (TLS) 領域を設定する .sp \fBint set_thread_area(struct user_desc *\fP\fIu_info\fP\fB);\fP -\fI注\fP: このシステムコールには、glibc のラッパー関数が提供されていない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBset_thread_area\fP() は、カレント・スレッドのスレッド局所記憶 (thread\-local storage; TLS) 配列の中のエントリを設定する。 \fBset_thread_area\fP() により設定される TLS 配列のエントリは、ユーザから引き数として渡される diff --git a/manual/LDP_man-pages/release/man2/setxattr.2 b/manual/LDP_man-pages/release/man2/setxattr.2 index 7a8af3c4..e77d5bac 100644 --- a/manual/LDP_man-pages/release/man2/setxattr.2 +++ b/manual/LDP_man-pages/release/man2/setxattr.2 @@ -71,16 +71,14 @@ inode に対して、互いに独立な名前空間が複数あってもよい .SH エラー .TP \fBEDQUOT\fP -Disk quota limits meant that there is insufficient space remaining to store -the extended attribute. +ディスクのクォータ上限に達した。拡張属性を格納できるだけの空き領域がないことを意味する。 .TP \fBEEXIST\fP \fBXATTR_CREATE\fP が指定されたが、その属性はすでに存在している。 .TP \fBENOATTR\fP -\fBXATTR_REPLACE\fP was specified, and the attribute does not exist. -(\fBENOATTR\fP is defined to be a synonym for \fBENODATA\fP in -\fI\fP.) +\fBXATTR_REPLACE\fP が指定されたが、その属性が存在しない。(\fBENOATTR\fP は \fI\fP +で \fBENODATA\fP の同義語として定義されている。) .TP \fBENOSPC\fP 拡張属性を記憶するのに十分なスペースが残っていない。 diff --git a/manual/LDP_man-pages/release/man2/spu_run.2 b/manual/LDP_man-pages/release/man2/spu_run.2 index ccbaf3ca..1f95dcae 100644 --- a/manual/LDP_man-pages/release/man2/spu_run.2 +++ b/manual/LDP_man-pages/release/man2/spu_run.2 @@ -38,7 +38,7 @@ spu_run \- SPU コンテキストを実行する \fBint spu_run(int \fP\fIfd\fP\fB, unsigned int *\fP\fInpc\fP\fB, unsigned int *\fP\fIevent\fP\fB);\fP .fi -\fINote\fP: There is no glibc wrapper for this system call; see NOTES. +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBspu_run\fP() システムコールは、Cell Broadband Engine アーキテクチャを実装した PowerPC マシンで Synergistic Processor Units (SPU) にアクセスするために 使用される。 \fIfd\fP 引き数は、 diff --git a/manual/LDP_man-pages/release/man2/stat.2 b/manual/LDP_man-pages/release/man2/stat.2 index 52d5eb4d..ca0189cb 100644 --- a/manual/LDP_man-pages/release/man2/stat.2 +++ b/manual/LDP_man-pages/release/man2/stat.2 @@ -235,11 +235,12 @@ BSD 方式で使用される ことを示す。つまり、そのディレクト \fIpath\fP の前半部分 (prefix) の構成要素がディレクトリではない。 .TP \fBEOVERFLOW\fP -\fIpath\fP or \fIfd\fP refers to a file whose size, inode number, or number of -blocks cannot be represented in, respectively, the types \fIoff_t\fP, \fIino_t\fP, -or \fIblkcnt_t\fP. This error can occur when, for example, an application -compiled on a 32\-bit platform without \fI\-D_FILE_OFFSET_BITS=64\fP calls -\fBstat\fP() on a file whose size exceeds \fI(1<<31)\-1\fP bytes. +\fIpath\fP または \fIfd\fP が、ファイルサイズ、inode 番号、ブロック数が +それぞれ \fIoff_t\fP 型、 \fIino_t\fP 型、 \fIblkcnt_t\fP 型で表現できないファイルを +参照している。このエラーが起こるのは、例えば、32 ビットプラットフォーム上で +\fI\-D_FILE_OFFSET_BITS=64\fP を指定せずにコンパイルされたアプリケーションが、 +ファイルサイズが \fI(1<<31)\-1\fP バイトを超えるファイルに対して +\fBstat\fP() を呼び出した場合である。 .SH 準拠 .\" SVr4 documents additional .\" .BR fstat () diff --git a/manual/LDP_man-pages/release/man2/syscalls.2 b/manual/LDP_man-pages/release/man2/syscalls.2 index 1d0ba8a2..0838dca2 100644 --- a/manual/LDP_man-pages/release/man2/syscalls.2 +++ b/manual/LDP_man-pages/release/man2/syscalls.2 @@ -301,10 +301,10 @@ T} \fBmq_timedsend\fP(2) 2.6.6 \fBmq_unlink\fP(2) 2.6.6 \fBmremap\fP(2) 2.0 -\fBmsgctl\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBmsgget\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBmsgrcv\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBmsgsnd\fP(2) 2.0 See notes on \fBipc\fP(2) +\fBmsgctl\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBmsgget\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBmsgrcv\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBmsgsnd\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 \fBmsync\fP(2) 2.0 .\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on .\" PowerPC, but unimplemented? @@ -399,9 +399,9 @@ T} \fBsched_setscheduler\fP(2) 2.0 \fBsched_yield\fP(2) 2.0 \fBselect\fP(2) 1.0 -\fBsemctl\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBsemget\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBsemop\fP(2) 2.0 See notes on \fBipc\fP(2) +\fBsemctl\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBsemget\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBsemop\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 \fBsemtimedop\fP(2) 2.6; 2.4.22 \fBsend\fP(2) 2.0 \fBsocketcall\fP(2) の「注意」の節を参照 \fBsendfile\fP(2) 2.2 @@ -446,11 +446,11 @@ T} \fBsetup\fP(2) 2.2 で削除 \fBsetxattr\fP(2) 2.6; 2.4.18 \fBsgetmask\fP(2) 1.0 -\fBshmat\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBshmctl\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBshmdt\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBshmget\fP(2) 2.0 See notes on \fBipc\fP(2) -\fBshutdown\fP(2) 2.0 See notes on \fBsocketcall\fP(2) +\fBshmat\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBshmctl\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBshmdt\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBshmget\fP(2) 2.0 \fBipc\fP(2) の「注意」の節を参照 +\fBshutdown\fP(2) 2.0 \fBsocketcall\fP(2) の「注意」の節を参照 \fBsigaction\fP(2) 1.0 \fBsigaltstack\fP(2) 2.2 \fBsignal\fP(2) 1.0 @@ -525,7 +525,7 @@ T} \fButrap_install\fP(2) 2.2 Sparc \fBvfork\fP(2) 2.2 \fBvhangup\fP(2) 1.0 -\fBvm86old\fP(2) 1.0 Was "vm86"; renamed in 2.0.28/2.2 +\fBvm86old\fP(2) 1.0 以前は "vm86"; 2.0.28/2.2 で改名された \fBvm86\fP(2) 2.0.28; 2.2 \fBvmsplice\fP(2) 2.6.17 \fBwait4\fP(2) 1.0 diff --git a/manual/LDP_man-pages/release/man2/sysctl.2 b/manual/LDP_man-pages/release/man2/sysctl.2 index 7b8a7ac1..c556d261 100644 --- a/manual/LDP_man-pages/release/man2/sysctl.2 +++ b/manual/LDP_man-pages/release/man2/sysctl.2 @@ -44,7 +44,7 @@ sysctl \- システム・パラメーターを読み書きする \fBint _sysctl(struct __sysctl_args *\fP\fIargs\fP\fB);\fP .fi -\fI注\fP: このシステムコールには、glibc のラッパー関数が提供されていない。「注意」の節を参照。 +\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBこのシステムコールを使用しないこと!\fP 「注意」の節を参照。 diff --git a/manual/LDP_man-pages/release/man3/realpath.3 b/manual/LDP_man-pages/release/man3/realpath.3 index 43847cdc..5470c85f 100644 --- a/manual/LDP_man-pages/release/man3/realpath.3 +++ b/manual/LDP_man-pages/release/man3/realpath.3 @@ -136,9 +136,9 @@ POSIX.1\-2001 では \fIresolved_path\fP が NULL の場合の動作は実装に \fI\fP にあるが、それ以外の環境ではいずれも \fI\fP にある。 .SS "GNU による拡張" -If the call fails with either \fBEACCES\fP or \fBENOENT\fP and \fIresolved_path\fP is -not NULL, then the prefix of \fIpath\fP that is not readable or does not exist -is returned in \fIresolved_path\fP. +呼び出しが \fBEACCES\fP か \fBENOENT\fP で失敗し \fIresolved_path\fP が NULL +でない場合、読むことができない、もしくは存在しない \fIpath\fP のディレクトリ要素 (prefix) が \fIresolved_path\fP +で返される。 .SH バグ この関数の POSIX.1\-2001 版は、設計段階から問題がある。 出力バッファ \fIresolved_path\fP の適切なサイズを決定することができないからである。 POSIX.1\-2001 ではバッファ・サイズとして \fBPATH_MAX\fP diff --git a/manual/LDP_man-pages/release/man3/regex.3 b/manual/LDP_man-pages/release/man3/regex.3 index 44bbbe24..012f3dc1 100644 --- a/manual/LDP_man-pages/release/man3/regex.3 +++ b/manual/LDP_man-pages/release/man3/regex.3 @@ -55,7 +55,7 @@ regcomp, regexec, regerror, regfree \- POSIX regex 関数 \fBvoid regfree(regex_t *\fP\fIpreg\fP\fB);\fP .fi .SH 説明 -.SS "POSIX regex compiling" +.SS "POSIX regex コンパイル" \fBregcomp\fP() は、正規表現をコンパイルして、 \fBregexec\fP() での検索処理に適合する形態にする。 \fBregcomp\fP() はパターンを記憶するバッファへのポインタ \fIpreg\fP、 ヌル文字で終端された文字列 \fIregex\fP、 @@ -74,9 +74,8 @@ regcomp, regexec, regerror, regfree \- POSIX regex 関数 関数を呼び出すと、大文字小文字の区別を付けずに検索が行われる。 .TP \fBREG_NOSUB\fP -Do not report position of matches. The \fInmatch\fP and \fIpmatch\fP arguments to -\fBregexec\fP() are ignored if the pattern buffer supplied was compiled with -this flag set. +マッチの場所を報告しない。渡されたパターンバッファがこのフラグを設定してコンパイルされていた場合、 \fBregexec\fP() の引き数 +\fInmatch\fP, \fIpmatch\fP が無視される。 .TP \fBREG_NEWLINE\fP 全ての文字にマッチするオペレータに改行をマッチさせない。 @@ -88,7 +87,7 @@ this flag set. \fIeflags\fP に \fBREG_NOTEOL\fP を含むかどうかにかかわらず、行末にマッチするオペレータ (\fB$\fP) を改行直前の空文字列にマッチさせる。 -.SS "POSIX regex matching" +.SS "POSIX regex マッチング" \fBregexec\fP() は、 プリコンパイルされたパターンバッファ \fIpreg\fP をヌル文字で終端された文字列にマッチさせる。 \fInmatch\fP と \fIpmatch\fP はマッチングの位置に関する情報を取得するのに用いられる。 \fIeflags\fP には \fBREG_NOTBOL\fP と \fBREG_NOTEOL\fP のどちらか、もしくは両方のビットごとの \fBOR\fP (bitwise\-\fBor\fP) @@ -100,16 +99,12 @@ this flag set. .TP \fBREG_NOTEOL\fP 行末にマッチするオペレータは、必ずマッチに失敗する (コンパイル時のフラグ \fBREG_NEWLINE\fP の項目も参照)。 -.SS "Byte offsets" -Unless \fBREG_NOSUB\fP was set for the compilation of the pattern buffer, it is -possible to obtain match addressing information. \fIpmatch\fP must be -dimensioned to have at least \fInmatch\fP elements. These are filled in by -\fBregexec\fP() with substring match addresses. The offsets of the -subexpression starting at the \fIi\fPth open parenthesis are stored in -\fIpmatch[i]\fP. The entire regular expression's match addresses are stored in -\fIpmatch[0]\fP. (Note that to return the offsets of \fIN\fP subexpression -matches, \fInmatch\fP must be at least \fIN+1\fP.) Any unused structure elements -will contain the value \-1. +.SS バイトオフセット +パターンバッファのコンパイル時に \fBREG_NOSUB\fP が設定されない場合は、マッチング位置情報を得ることができる。 \fIpmatch\fP +は、少なくとも \fInmatch\fP の大きさを持つように指定しなければならない。 \fBregexec\fP() +の実行によって、それらに部分文字列マッチング位置情報が代入される。 \fIi\fP 番目の括弧で始まる部分正規表現のオフセットは \fIpmatch[i]\fP +に格納される。正規表現全体のマッチアドレスは \fIpmatch[0]\fP に格納される。 (\fIN\fP 個の部分正規表現のマッチのオフセットを返すためには、 +\fInmatch\fP は最低限 \fIN+1\fP でなければならない点に注意すること。) 未使用の構造体要素には \-1 が値として代入される。 \fIpmatch\fP の型である \fIregmatch_t\fP 構造体は、 \fI\fP 内で定義される。 @@ -124,7 +119,7 @@ typedef struct { 構造体要素 \fIrm_so\fP の値が \-1 でない場合、それは文字列内での次の最大のマッチング部分の開始 オフセット位置を示す。それに対し、構造体要素 \fIrm_eo\fP はマッチング部分の終了オフセット位置を示し、 マッチング部分の直後の文字のオフセット位置が使用される。 -.SS "POSIX error reporting" +.SS "POSIX エラーレポート" \fBregerror\fP() は、 \fBregcomp\fP() と \fBregexec\fP() の実行によって得られるエラーコードから、エラーメッセージ文字列を 得るのに用いられる。 @@ -133,7 +128,7 @@ typedef struct { この関数は、ヌル文字で終端されたエラーメッセージ文字列を格納するのに必要な \fIerrbuf\fP のサイズを返す。もし \fIerrbuf\fP と \fIerrbuf_size\fP の両方が非 0 値であれば、 \fIerrbuf\fP には最初の \fIerrbuf_size \- 1\fP 文字分にエラーメッセージと終端の NULL バイト (\(aq\e0\(aq) が収まるように代入される。 -.SS "POSIX pattern buffer freeing" +.SS "POSIX パターンバッファ解放" 引数にコンパイルされたパターンバッファ \fIpreg\fP を与えて \fBregfree\fP() を呼び出すと、 \fBregcomp\fP() によるコンパイル時にパターンバッファに割り当てられたメモリが解放される。 .SH 返り値 @@ -165,7 +160,7 @@ typedef struct { 未知のキャラクタクラス名。 .TP \fBREG_EEND\fP -Nonspecific error. This is not defined by POSIX.2. +未定義エラー。これは POSIX.2 には定義されていない。 .TP \fBREG_EESCAPE\fP 正規表現がバックスラッシュで終っている。 @@ -189,7 +184,7 @@ POSIX.1\-2001. .SH 関連項目 \fBgrep\fP(1), \fBregex\fP(7) .br -The glibc manual section, \fIRegular Expression Matching\fP +glibc マニュアルのセクション \fIRegular Expression Matching\fP .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部 である。プロジェクトの説明とバグ報告に関する情報は -- 2.11.0