OSDN Git Service

LDP: Update draft based on the previous commit
authorAkihiro Motoki <amotoki@gmail.com>
Thu, 25 Mar 2021 12:12:55 +0000 (21:12 +0900)
committerAkihiro Motoki <amotoki@gmail.com>
Thu, 25 Mar 2021 12:12:55 +0000 (21:12 +0900)
68 files changed:
manual/LDP_man-pages/draft/man2/bdflush.2
manual/LDP_man-pages/draft/man2/link.2
manual/LDP_man-pages/draft/man2/lseek.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/open.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/open_by_handle_at.2
manual/LDP_man-pages/draft/man2/pipe.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/read.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/reboot.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/sync.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man2/write.2 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/asprintf.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cabs.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cacos.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cacosh.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/carg.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/casin.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/casinh.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/catan.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/catanh.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ccos.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ccosh.3
manual/LDP_man-pages/draft/man3/cexp.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cexp2.3
manual/LDP_man-pages/draft/man3/cimag.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/clog.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/clog10.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/conj.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cpow.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/cproj.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/creal.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/csin.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/csinh.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/csqrt.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ctan.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ctanh.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ctermid.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fclose.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fcloseall.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/ferror.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fflush.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fgetc.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fgetwc.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/flockfile.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fmtmsg.3
manual/LDP_man-pages/draft/man3/fopen.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fopencookie.3
manual/LDP_man-pages/draft/man3/fpurge.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fputwc.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fseek.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/fseeko.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/getline.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/gets.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/getw.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/open_memstream.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/popen.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/printf.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/puts.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/remove.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/scanf.3
manual/LDP_man-pages/draft/man3/setbuf.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/tempnam.3
manual/LDP_man-pages/draft/man3/tmpfile.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/tmpnam.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/unlocked_stdio.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man3/wprintf.3 [new file with mode: 0644]
manual/LDP_man-pages/draft/man7/bootparam.7
manual/LDP_man-pages/draft/man7/complex.7
manual/LDP_man-pages/draft/man7/symlink.7 [new file with mode: 0644]

index a31181e..6f88676 100644 (file)
@@ -85,7 +85,7 @@ bdflush \- バッファーダーティーフラッシュデーモンを起動、
 \fBEPERM\fP
 呼び出し元に \fBCAP_SYS_ADMIN\fP ケーパビリティがない。
 .SH バージョン
-Since version 2.23, glibc no longer supports this obsolete system call.
+バージョン 2.23 以降の glibc では、この廃止予定のシステムコールはサポートされていない。
 .SH 準拠
 \fBbdflush\fP()  は Linux 特有であり移植を意図したプログラムで使用すべきではない。
 .SH 関連項目
index 7661c47..ffab156 100644 (file)
@@ -105,14 +105,12 @@ _ATFILE_SOURCE
 \fBAT_EMPTY_PATH\fP (Linux 2.6.39 以降)
 .\" commit 11a7b371b64ef39fc5fb1b6f2218eef7c4d035e3
 .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed
-If \fIoldpath\fP is an empty string, create a link to the file referenced by
-\fIolddirfd\fP (which may have been obtained using the \fBopen\fP(2)  \fBO_PATH\fP
-flag).  In this case, \fIolddirfd\fP can refer to any type of file except a
-directory.  This will generally not work if the file has a link count of
-zero (files created with \fBO_TMPFILE\fP and without \fBO_EXCL\fP are an
-exception).  The caller must have the \fBCAP_DAC_READ_SEARCH\fP capability in
-order to use this flag.  This flag is Linux\-specific; define \fB_GNU_SOURCE\fP
-to obtain its definition.
+\fIoldpath\fP が空文字列の場合、 \fIolddirfd\fP が参照するファイルへのリンクを作成する (\fIolddirfd\fP は
+\fBopen\fP(2) の \fBO_PATH\fP フラグを使って取得する)。 この場合、 \fIolddirfd\fP
+はディレクトリ以外の任意の型のファイルを参照することができる。 一般的には、 ファイルのリンクカウントが 0 の場合は、この操作は成功しない (ただし、
+\fBO_TMPFILE\fP が指定され \fBO_EXCL\fP を指定せずに作成されたファイルは例外である)。 このフラグを使用するためには、 呼び出し元は
+\fBCAP_DAC_READ_SEARCH\fP ケーパビリティを持っていなければならない。 このフラグは Linux 固有で、 この定義を得るには
+\fB_GNU_SOURCE\fP を定義すること。
 .TP 
 \fBAT_SYMLINK_FOLLOW\fP (Linux 2.6.18 以降)
 \fBlinkat\fP() は (\fBlink\fP() 同様) デフォルトでは \fIoldpath\fP がシンボリックリンクの場合リンクの展開を行わない。
@@ -251,15 +249,13 @@ file that has been deleted.
 .\" behaves like Linux, and contributors to a March 2005
 .\" thread in the Austin mailing list reported that some
 .\" other (System V) implementations did/do the same -- MTK, Apr 05
-POSIX.1\-2001 says that \fBlink\fP()  should dereference \fIoldpath\fP if it is a
-symbolic link.  However, since kernel 2.0, Linux does not do so: if
-\fIoldpath\fP is a symbolic link, then \fInewpath\fP is created as a (hard) link
-to the same symbolic link file (i.e., \fInewpath\fP becomes a symbolic link to
-the same file that \fIoldpath\fP refers to).  Some other implementations behave
-in the same manner as Linux.  POSIX.1\-2008 changes the specification of
-\fBlink\fP(), making it implementation\-dependent whether or not \fIoldpath\fP is
-dereferenced if it is a symbolic link.  For precise control over the
-treatment of symbolic links when creating a link, use \fBlinkat\fP().
+POSIX.1\-2001 では、 \fIoldpath\fP がシンボリックリンクである場合、 \fBlink\fP()  は \fIoldpath\fP
+の参照を解決すべきであると記述されている。 しかし、カーネル 2.0 以降の Linux ではそのようになっていない。 \fIoldpath\fP
+がシンボリックリンクである場合、 \fInewpath\fP は同じシンボリックリンクファイルへの (ハード) リンクとして作成される (つまり
+\fInewpath\fP は \fIoldpath\fP が参照していた同じファイルへのシンボリックリンクになる)。 他のいくつかの実装でも Linux
+と同じように動作する。 POSIX.1\-2008 では \fBlink\fP()  の仕様が変更され、 \fIoldpath\fP
+がシンボリックリンクの場合にシンボリックリンクの参照を 解決するかどうかは実装依存となった。
+リンク作成時のシンボリックリンクの扱いについての詳細な制御を行う場合には \fBlinkat\fP() を使用すること。
 .SS "glibc での注意"
 \fBlinkat\fP() が利用できない古いカーネルでは、 \fBAT_SYMLINK_FOLLOW\fP が指定されていない場合、 glibc ラッパー関数は
 \fBlink\fP() を使用するモードにフォールバックする。 \fIoldpath\fP と \fInewpath\fP が相対パスの場合、 glibc は
diff --git a/manual/LDP_man-pages/draft/man2/lseek.2 b/manual/LDP_man-pages/draft/man2/lseek.2
new file mode 100644 (file)
index 0000000..6732478
--- /dev/null
@@ -0,0 +1,194 @@
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" and Copyright (c) 2011, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" All rights reserved.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)lseek.2    6.5 (Berkeley) 3/10/91
+.\"
+.\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
+.\" Modified 1995-06-10 by Andries Brouwer <aeb@cwi.nl>
+.\" Modified 1996-10-31 by Eric S. Raymond <esr@thyrsus.com>
+.\" Modified 1998-01-17 by Michael Haardt
+.\"   <michael@cantor.informatik.rwth-aachen.de>
+.\" Modified 2001-09-24 by Michael Haardt <michael@moria.de>
+.\" Modified 2003-08-21 by Andries Brouwer <aeb@cwi.nl>
+.\" 2011-09-18, mtk, Added SEEK_DATA + SEEK_HOLE
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Modified 1998-05-11, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated 2001-12-14, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2003-09-08, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25
+.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-07, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH LSEEK 2 2020\-08\-13 Linux "Linux Programmer's Manual"
+.SH 名前
+lseek \- ファイルの読み書きオフセットの位置を変える
+.SH 書式
+\fB#include <sys/types.h>\fP
+.br
+\fB#include <unistd.h>\fP
+.PP
+\fBoff_t lseek(int \fP\fIfd\fP\fB, off_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
+.SH 説明
+\fBlseek\fP()  repositions the file offset of the open file description
+associated with the file descriptor \fIfd\fP to the argument \fIoffset\fP
+according to the directive \fIwhence\fP as follows:
+.TP 
+\fBSEEK_SET\fP
+ファイルオフセットは \fIoffset\fP バイトに設定される。
+.TP 
+\fBSEEK_CUR\fP
+ファイルオフセットは現在位置に \fIoffset\fP バイトを足した位置になる。
+.TP 
+\fBSEEK_END\fP
+ファイルオフセットはファイルのサイズに \fIoffset\fP バイトを足した位置になる。
+.PP
+\fBlseek\fP() は、オフセットをファイルの末尾を越えた位置に設定できる (但し、これによりファイルのサイズが変わらない)。
+もしデータがこのオフセット位置以降に書き込まれた場合、 間の空隙の部分 ("穴 (hole)") の読み出しがあると、
+実際にそこにデータを書き込まれるまではヌルバイト (\(aq\e0\(aq) の列が返される。
+.SS ファイルのデータとホールの探索
+Linux バージョン 3.1 以降では、 \fIwhence\fP に以下の値も指定することができる。
+.TP 
+\fBSEEK_DATA\fP
+ファイルオフセットを \fIoffset\fP 以上で次にデータがある位置に設定する。 \fIoffset\fP がデータを指している場合には、
+ファイルオフセットは \fIoffset\fP に設定される。
+.TP 
+\fBSEEK_HOLE\fP
+ファイルオフセットを、 位置が \fIoffset\fP 以上の次のホール (hole) に設定する。 \fIoffset\fP
+がホールの内部にある場合は、ファイルシステムは \fIoffset\fP に設定される。 \fIoffset\fP 以降にホールがない場合は、
+ファイルオフセットはファイル末尾に設定される (つまり、 どのファイルの末尾にも暗黙のホールが存在するということだ)。
+.PP
+上記のどちらの場合も、 \fIoffset\fP がファイル末尾よりも先を指している場合には \fBlseek\fP() は失敗する。
+.PP
+これらの操作を使うことで、 アプリケーションが、 まばら (sparse ) にページが割り当てられたファイルでホールをマップすることができる。
+この機能はファイルバックアップツールなどのアプリケーションで有用である。 ホールを見つける仕組みがあれば、 ファイルバックアップツールで、
+バックアップを作成する際に保存領域を節約し、ホールを保持することができる。
+.PP
+.\" https://lkml.org/lkml/2011/4/22/79
+.\" http://lwn.net/Articles/440255/
+.\" http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
+これらの操作の目的としては、 ホールは (通常は) バックエンドのファイルストレージには割り当てられていない連続する 0 の列である。
+しかし、ファイルシステムにはホールを報告する義務はなく、 そのため、 これらの操作は、
+ファイルに実際に割り当てられたストレージ領域をマッピングする方法としては確実性のある仕組みではない。
+(また、バックエンドのストレージに実際に書き込まれた連続する 0 の列はホールとして報告されないこともある。) 最も単純な実装としては、
+\fBSEEK_HOLE\fP は常にファイル末尾のオフセットを返すようにし、 \fBSEEK_DATA\fP は常に \fIoffset\fP を返すようにすることで、
+ファイルシステムはこれらの操作をサポートすることができる (\fBSEEK_DATA\fP は常に \fIoffset\fP を返すというのは、 \fIoffset\fP
+が参照する場所がホールであったとしても、 連続する 0 の列のデータで構成されているとみなすということである)。
+.PP
+\fI<unistd.h>\fP から \fBSEEK_DATA\fP と \fBSEEK_HOLE\fP の定義を得るには、 機能検査マクロ
+\fB_GNU_SOURCE\fP を定義しなければならない。
+.PP
+\fBSEEK_HOLE\fP, \fBSEEK_DATA\fP 操作に対応しているのは以下のファイルシステムである。
+.IP * 3
+Btrfs (Linux 3.1 以降)
+.IP * 3
+.\" commit 93862d5e1ab875664c6cc95254fc365028a48bb1
+OCFS (Linux 3.2 以降)
+.IP *
+XFS (Linux 3.5 以降)
+.IP *
+ext4 (Linux 3.8 以降)
+.IP *
+\fBtmpfs\fP(5)  (Linux 3.8 以降)
+.IP *
+.\" commit 1c6dcbe5ceff81c2cf8d929646af675cd59fe7c0
+.\" commit 24bab491220faa446d945624086d838af41d616c
+NFS (Linux 3.18 以降)
+.IP *
+.\" commit 0b5da8db145bfd44266ac964a2636a0cf8d7c286
+FUSE (Linux 4.5 以降)
+.IP *
+.\" commit 3a27411cb4bc3ce31db228e3569ad01b462a4310
+GFS2 (Linux 4.15 以降)
+.SH 返り値
+成功した場合、 \fBlseek\fP()  は結果のファイル位置をファイルの先頭からのバイト数で返す。 エラーの場合、値 \fI(off_t)\ \-1\fP
+が返され、 \fIerrno\fP にエラーが指示される。
+.SH エラー
+.TP 
+\fBEBADF\fP
+\fIfd\fP がオープンされたファイルディスクリプターでない。
+.TP 
+\fBEINVAL\fP
+.\" Some systems may allow negative offsets for character devices
+.\" and/or for remote filesystems.
+\fIwhence\fP が有効な値ではない。または、seek の結果、ファイルオフセットが負に
+なってしまうか、 seek 可能なデバイスの末尾を越えてしまう。
+.TP 
+\fBENXIO\fP
+\fIwhence\fP is \fBSEEK_DATA\fP or \fBSEEK_HOLE\fP, and \fIoffset\fP is beyond the end
+of the file, or \fIwhence\fP is \fBSEEK_DATA\fP and \fIoffset\fP is within a hole at
+the end of the file.
+.TP 
+\fBEOVERFLOW\fP
+.\" HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
+結果のファイルオフセットを \fIoff_t\fP 型で表現することができない。
+.TP 
+\fBESPIPE\fP
+\fIfd\fP がパイプ、ソケット、FIFO を参照している。
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD.
+.PP
+.\" FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
+\fBSEEK_DATA\fP と \fBSEEK_HOLE\fP は非標準の拡張で、 Solaris, FreeBSD, DragonFly BSD
+にも存在する。 これらは POSIX の次の版 (Issue 8) に入れるよう提案されている。
+.SH 注意
+ファイルディスクリプター、オープンファイル記述、ファイルの関係の説明については \fBopen\fP(2) を参照。
+.PP
+If the \fBO_APPEND\fP file status flag is set on the open file description,
+then a \fBwrite\fP(2)  \fIalways\fP moves the file offset to the end of the file,
+regardless of the use of \fBlseek\fP().
+.PP
+The \fIoff_t\fP data type is a signed integer data type specified by POSIX.1.
+.PP
+いくつかのデバイスでは seek ができない。 POSIX はどのデバイスが \fBlseek\fP()  に対応すべきかは規定していない。
+.PP
+.\" Other systems return the number of written characters,
+.\" using SEEK_SET to set the counter. (Of written characters.)
+On Linux, using \fBlseek\fP()  on a terminal device fails with the error
+\fBESPIPE\fP.
+.SH 関連項目
+\fBdup\fP(2), \fBfallocate\fP(2), \fBfork\fP(2), \fBopen\fP(2), \fBfseek\fP(3),
+\fBlseek64\fP(3), \fBposix_fallocate\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man2/open.2 b/manual/LDP_man-pages/draft/man2/open.2
new file mode 100644 (file)
index 0000000..c7a7d9a
--- /dev/null
@@ -0,0 +1,1033 @@
+.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
+.\" and Copyright (C) 1993 Michael Haardt, Ian Jackson.
+.\" and Copyright (C) 2008 Greg Banks
+.\" and Copyright (C) 2006, 2008, 2013, 2014 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%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 1993-07-21 by Rik Faith <faith@cs.unc.edu>
+.\" Modified 1994-08-21 by Michael Haardt
+.\" Modified 1996-04-13 by Andries Brouwer <aeb@cwi.nl>
+.\" Modified 1996-05-13 by Thomas Koenig
+.\" Modified 1996-12-20 by Michael Haardt
+.\" Modified 1999-02-19 by Andries Brouwer <aeb@cwi.nl>
+.\" Modified 1998-11-28 by Joseph S. Myers <jsm28@hermes.cam.ac.uk>
+.\" Modified 1999-06-03 by Michael Haardt
+.\" Modified 2002-05-07 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\" 2004-12-08, mtk, reordered flags list alphabetically
+.\" 2004-12-08, Martin Pool <mbp@sourcefrog.net> (& mtk), added O_NOATIME
+.\" 2007-09-18, mtk, Added description of O_CLOEXEC + other minor edits
+.\" 2008-01-03, mtk, with input from Trond Myklebust
+.\"     <trond.myklebust@fys.uio.no> and Timo Sirainen <tss@iki.fi>
+.\"     Rewrite description of O_EXCL.
+.\" 2008-01-11, Greg Banks <gnb@melbourne.sgi.com>: add more detail
+.\"     on O_DIRECT.
+.\" 2008-02-26, Michael Haardt: Reorganized text for O_CREAT and mode
+.\"
+.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and
+.\" O_TTYINIT.  Eventually these may need to be documented.  --mtk
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated 1999-08-14, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated 2001-05-25, Yuichi SATO <ysato444@yahoo.co.jp>
+.\" Updated & Modified 2002-01-02, Yuichi SATO
+.\" Updated & Modified 2002-07-07, Yuichi SATO
+.\" Updated & Modified 2002-09-19, Yuichi SATO
+.\" Updated & Modified 2003-07-30, Yuichi SATO
+.\" Updated & Modified 2003-11-27, Yuichi SATO
+.\" Updated & Modified 2005-01-01, Yuichi SATO
+.\" Updated & Modified 2005-09-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated & Modified 2005-10-14, Akihiro MOTOKI
+.\" Updated & Modified 2006-01-18, Akihiro MOTOKI
+.\" Updated & Modified 2006-04-15, Akihiro MOTOKI, LDP v2.29
+.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43
+.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46
+.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66
+.\" Updated 2008-02-12, Akihiro MOTOKI, LDP v2.77
+.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79
+.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
+.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24
+.\" Updated 2012-05-08, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2012-05-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-08-16, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH OPEN 2 2020\-11\-01 Linux "Linux Programmer's Manual"
+.SH 名前
+open, openat, creat \- ファイルのオープン、作成を行う
+.SH 書式
+.nf
+\fB#include <sys/types.h>\fP
+\fB#include <sys/stat.h>\fP
+\fB#include <fcntl.h>\fP
+.PP
+\fBint open(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB);\fP
+\fBint open(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB);\fP
+.PP
+\fBint creat(const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB);\fP
+.PP
+\fBint openat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB);\fP
+\fBint openat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB);\fP
+.PP
+/* Documented separately, in \fBopenat2\fP(2): */
+\fBint openat2(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB,\fP
+\fB            const struct open_how *\fP\fIhow\fP\fB, size_t \fP\fIsize\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBopenat\fP():
+.PD 0
+.ad l
+.RS 4
+.TP  4
+glibc 2.10 以降:
+_POSIX_C_SOURCE\ >=\ 200809L
+.TP 
+glibc 2.10 より前:
+_ATFILE_SOURCE
+.RE
+.ad
+.PD
+.SH 説明
+The \fBopen\fP()  system call opens the file specified by \fIpathname\fP.  If the
+specified file does not exist, it may optionally (if \fBO_CREAT\fP is specified
+in \fIflags\fP)  be created by \fBopen\fP().
+.PP
+The return value of \fBopen\fP()  is a file descriptor, a small, nonnegative
+integer that is used in subsequent system calls (\fBread\fP(2), \fBwrite\fP(2),
+\fBlseek\fP(2), \fBfcntl\fP(2), etc.) to refer to the open file.  The file
+descriptor returned by a successful call will be the lowest\-numbered file
+descriptor not currently open for the process.
+.PP
+デフォルトでは、新しいファイルディスクリプターは \fBexecve\fP(2) を実行した後も
+オープンされたままとなる (つまり、 \fBfcntl\fP(2) に説明がある \fBFD_CLOEXEC\fP
+ファイルディスクリプターフラグは最初は無効である); 後述の \fBO_CLOEXEC\fP フラグ
+を使うとこのデフォルトを変更することができる。 ファイルオフセット
+(file offset) はファイルの先頭に設定される (\fBlseek\fP(2) 参照)。
+.PP
+\fBopen\fP()  を呼び出すと、「オープンファイル記述」 \fI(open file description)\fP
+が作成される。ファイル記述とは、システム全体のオープン中のファイルのテーブルのエントリーである。
+このオープンファイル記述は、ファイルオフセットとファイル状態フラグ (下記参照) が保持する。
+ファイルディスクリプターはオープンファイルっ記述への参照である。 この後で \fIpathname\fP
+が削除されたり、他のファイルを参照するように変更されたりしても、 この参照は影響を受けない。 オープンファイル記述の詳細な説明は「注意」の節を参照。
+.PP
+引き数 \fIflags\fP には、アクセスモード \fBO_RDONLY\fP, \fBO_WRONLY\fP, \fBO_RDWR\fP
+のどれかひとつが入っていなければならない。 これらはそれぞれ読み込み専用、書き込み専用、読み書き用に ファイルをオープンすることを要求するものである。
+.PP
+.\" SUSv4 divides the flags into:
+.\" * Access mode
+.\" * File creation
+.\" * File status
+.\" * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
+.\" though it's not clear what the difference between "other" and
+.\" "File creation" flags is.  I raised an Aardvark to see if this
+.\" can be clarified in SUSv4; 10 Oct 2008.
+.\" http://thread.gmane.org/gmane.comp.standards.posix.austin.general/64/focus=67
+.\" TC1 (balloted in 2013), resolved this, so that those three constants
+.\" are also categorized" as file status flags.
+.\"
+In addition, zero or more file creation flags and file status flags can be
+bitwise\-\fIor\fP'd in \fIflags\fP.  The \fIfile creation flags\fP are \fBO_CLOEXEC\fP,
+\fBO_CREAT\fP, \fBO_DIRECTORY\fP, \fBO_EXCL\fP, \fBO_NOCTTY\fP, \fBO_NOFOLLOW\fP,
+\fBO_TMPFILE\fP, and \fBO_TRUNC\fP.  The \fIfile status flags\fP are all of the
+remaining flags listed below.  The distinction between these two groups of
+flags is that the file creation flags affect the semantics of the open
+operation itself, while the file status flags affect the semantics of
+subsequent I/O operations.  The file status flags can be retrieved and (in
+some cases)  modified; see \fBfcntl\fP(2)  for details.
+.PP
+すべてのファイル作成フラグとファイル状態フラグを以下のリストに示す。
+.TP 
+\fBO_APPEND\fP
+The file is opened in append mode.  Before each \fBwrite\fP(2), the file offset
+is positioned at the end of the file, as if with \fBlseek\fP(2).  The
+modification of the file offset and the write operation are performed as a
+single atomic step.
+.IP
+.\" For more background, see
+.\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
+.\" http://nfs.sourceforge.net/
+\fBO_APPEND\fP may lead to corrupted files on NFS filesystems if more than one
+process appends data to a file at once.  This is because NFS does not
+support appending to a file, so the client kernel has to simulate it, which
+can't be done without a race condition.
+.TP 
+\fBO_ASYNC\fP
+シグナル駆動 I/O (signal\-driven I/O) を有効にする: このファイルディスクリプターへの
+入力または出力が可能になった場合に、シグナルを生成する (デフォルトは \fBSIGIO\fP であるが、 \fBfcntl\fP(2)
+によって変更可能である)。 この機能が使用可能なのは端末、疑似端末、ソケットのみであり、 (Linux 2.6 以降では) パイプと FIFO
+に対しても使用できる。 さらに詳しい説明は \fBfcntl\fP(2)  を参照すること。 下記の「バグ」も参照。
+.TP 
+\fBO_CLOEXEC\fP (Linux 2.6.23 以降)
+.\" NOTE! several other man pages refer to this text
+.\" FIXME . for later review when Issue 8 is one day released...
+.\" POSIX proposes to fix many APIs that provide hidden FDs
+.\" http://austingroupbugs.net/tag_view_page.php?tag_id=8
+.\" http://austingroupbugs.net/view.php?id=368
+新しいファイルディスクリプターに対して close\-on\-exec フラグを有効にする。 このフラグを指定することで、 プログラムは
+\fBFD_CLOEXEC\fP フラグをセットするために \fBfcntl\fP(2) \fBF_SETFD\fP 操作を別途呼び出す必要がなくなる。
+.IP
+.\" This flag fixes only one form of the race condition;
+.\" The race can also occur with, for example, file descriptors
+.\" returned by accept(), pipe(), etc.
+ある種のマルチスレッドのプログラムはこのフラグの使用は不可欠である点に注意すること。 なぜなら、個別に \fBFD_CLOEXEC\fP フラグを設定する
+\fBfcntl\fP(2) \fBF_SETFD\fP 操作を呼び出したとしても、あるスレッドがファイルディスクリプターを オープンするのと同時に別のスレッドが
+\fBfork\fP(2) と \fBexecve\fP(2) を実行するという競合条件を避けるのには十分ではないからである。
+実行の順序に依存して、この競合条件の結果、 \fBopen\fP() が返したファイルディスクリプターが \fBfork\fP(2)
+で作成された子プロセスにより実行されるプログラムに意図せず見えてしまう可能性がある。 (この種の競合は、 本質的に、 close\-on\-exec
+フラグをセットすべきファイルディスクリプターを作成するどのシステムコールでも起こり得るものであり、 他のいろいろな Linux
+システムコールでこの問題に対処するために \fBO_CLOEXEC\fP と同等の機能が提供されている。)
+.TP 
+\fBO_CREAT\fP
+If \fIpathname\fP does not exist, create it as a regular file.
+.IP
+The owner (user ID) of the new file is set to the effective user ID of the
+process.
+.IP
+.\" As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
+.\" XFS (since 2.6.14).
+The group ownership (group ID) of the new file is set either to the
+effective group ID of the process (System V semantics)  or to the group ID
+of the parent directory (BSD semantics).  On Linux, the behavior depends on
+whether the set\-group\-ID mode bit is set on the parent directory: if that
+bit is set, then BSD semantics apply; otherwise, System V semantics apply.
+For some filesystems, the behavior also depends on the \fIbsdgroups\fP and
+\fIsysvgroups\fP mount options described in \fBmount\fP(8).
+.IP
+The \fImode\fP argument specifies the file mode bits to be applied when a new
+file is created.  If neither \fBO_CREAT\fP nor \fBO_TMPFILE\fP is specified in
+\fIflags\fP, then \fImode\fP is ignored (and can thus be specified as 0, or simply
+omitted).  The \fImode\fP argument \fBmust\fP be supplied if \fBO_CREAT\fP or
+\fBO_TMPFILE\fP is specified in \fIflags\fP; if it is not supplied, some arbitrary
+bytes from the stack will be applied as the file mode.
+.IP
+The effective mode is modified by the process's \fIumask\fP in the usual way:
+in the absence of a default ACL, the mode of the created file is \fI(mode\ &\ \(tiumask)\fP.
+.IP
+Note that \fImode\fP applies only to future accesses of the newly created file;
+the \fBopen\fP()  call that creates a read\-only file may well return a
+read/write file descriptor.
+.IP
+\fImode\fP のために以下のシンボル定数が提供されている :
+.RS
+.TP  9
+\fBS_IRWXU\fP
+00700 ユーザー (ファイルの所有者) に読み込み、書き込み、 実行の許可がある。
+.TP 
+\fBS_IRUSR\fP
+00400 ユーザーに読み込みの許可がある。
+.TP 
+\fBS_IWUSR\fP
+00200 ユーザーに書き込みの許可がある。
+.TP 
+\fBS_IXUSR\fP
+00100 ユーザーに実行の許可がある。
+.TP 
+\fBS_IRWXG\fP
+00070 グループに読み込み、書き込み、実行の許可がある。
+.TP 
+\fBS_IRGRP\fP
+00040 グループに読み込みの許可がある。
+.TP 
+\fBS_IWGRP\fP
+00020 グループに書き込みの許可がある。
+.TP 
+\fBS_IXGRP\fP
+00010 グループに実行の許可がある。
+.TP 
+\fBS_IRWXO\fP
+00007 他人 (others) に読み込み、書き込み、実行の許可がある。
+.TP 
+\fBS_IROTH\fP
+00004 他人に読み込みの許可がある。
+.TP 
+\fBS_IWOTH\fP
+00002 他人に書き込みの許可がある。
+.TP 
+\fBS_IXOTH\fP
+00001 他人に実行の許可がある。
+.RE
+.IP
+According to POSIX, the effect when other bits are set in \fImode\fP is
+unspecified.  On Linux, the following bits are also honored in \fImode\fP:
+.RS
+.TP  9
+\fBS_ISUID\fP
+0004000 set\-user\-ID bit
+.TP 
+\fBS_ISGID\fP
+0002000 set\-group\-ID bit (see \fBinode\fP(7)).
+.TP 
+\fBS_ISVTX\fP
+0001000 sticky bit (see \fBinode\fP(7)).
+.RE
+.TP 
+\fBO_DIRECT\fP (Linux 2.4.10 以降)
+このファイルに対する I/O のキャッシュの効果を最小化しようとする。このフラグを使うと、一般的に性能が低下する。
+しかしアプリケーションが独自にキャッシングを行っているような 特別な場合には役に立つ。 ファイルの I/O
+はユーザー空間バッファーに対して直接行われる。 \fBO_DIRECT\fP フラグ自身はデータを同期で転送しようとはするが、 \fBO_SYNC\fP
+フラグのようにデータと必要なメタデータの転送が保証されるわけではない。同期 I/O を保証するためには、 \fBO_DIRECT\fP に加えて
+\fBO_SYNC\fP を使用しなければならない。下記の「注意」の節の議論も参照。
+.IP
+ブロックデバイスに対する似通った意味のインターフェースが \fBraw\fP(8)  で説明されている (但し、このインターフェースは非推奨である)。
+.TP 
+\fBO_DIRECTORY\fP
+.\" But see the following and its replies:
+.\" http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
+.\" [PATCH] open: O_DIRECTORY and O_CREAT together should fail
+.\" O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
+\fIpathname\fP がディレクトリでなければオープンは失敗する。 このフラグは、 \fBopendir\fP(3)  が FIFO
+やテープデバイスに対してコールされた場合の サービス不能 (denial\-of\-service) 攻撃を避けるために カーネル 2.1.126
+で追加された。
+.TP 
+\fBO_DSYNC\fP
+ファイルに対する書き込み操作は、同期 I/O の\fIデータ\fP完全性完了の要件に基づいて行われる。
+.IP
+\fBwrite\fP(2) (や同様のコール) が返るまでに、
+書き込まれたデータおよびデータを取得するのに必要なファイルメタデータが裏で利用されているハードウェアに転送される (つまり、\fBwrite\fP(2)
+の後に \fBfdatasync\fP(2) を呼び出したのと同じようになる)。 \fI下記の「注意」も参照のこと\fP。
+.TP 
+\fBO_EXCL\fP
+この呼び出しでファイルが作成されることを保証する。このフラグが \fBO_CREAT\fP と一緒に指定され、 \fIpathname\fP
+のファイルが既に存在した場合、 \fBopen\fP() は \fBEEXIST\fP エラーで失敗する。
+.IP
+.\" POSIX.1-2001 explicitly requires this behavior.
+これら二つのフラグが指定された際、シンボリックリンクは辿られない。 \fIpathname\fP がシンボリックリンクの場合、
+シンボリックリンクがどこを指しているかに関わらず \fBopen\fP()  は失敗する。
+.IP
+一般的には、 \fBO_CREAT\fP を指定せずに \fBO_EXCL\fP を使用した場合の
+\fBO_EXCL\fP の動作は規定されていない。
+これには一つ例外があり、Linux 2.6 以降では、
+\fIpathname\fP がブロックデバイスを参照している場合、
+\fBO_CREAT\fP なしで \fBO_EXCL\fP を使用することができる。
+システムがそのブロックデバイスを使用中の場合 (例えば、
+マウントされているなど)、 \fBopen\fP() はエラー \fBEBUSY\fP で失敗する。
+.IP
+NFS では、 \fBO_EXCL\fP は、Linux 2.6 以降で NFSv3 以降を使っている場合でのみサポートされる。 \fBO_EXCL\fP
+サポートが提供されていない NFS 環境では、このフラグに頼って ロック処理を実行するプログラムは競合状態 (race condition) に出会う
+可能性がある。 ロックファイルを使用して不可分 (atomic) なファイルロックを実現し、 NFS が \fBO_EXCL\fP
+をサポートしているかに依存しないようにしたい場合、 移植性のある方法は、同じファイルシステム上に他と名前の重ならない ファイル (例えばホスト名と
+PID を組み合わせた名前) を作成し、 \fBlink\fP(2)  を使用してそのロックファイルへのリンクを作成することである。 \fBlink\fP(2)
+コールの返り値が 0 ならばロックに成功している。 あるいは、そのファイルに \fBstat\fP(2)  を使用してリンク数 (link count) が
+2 になっているかをチェックする。 そうなっていれば、同じくロックに成功しているということである。
+.TP 
+\fBO_LARGEFILE\fP
+(LFS) \fIoff_t\fP ではサイズを表せない (だだし \fIoff64_t\fP ではサイズを表せる)ファ
+イルをオープン可能にする。この定義を有効にするためには、(\fIどの\fPヘッダーファイ
+ルをインクルードするよりも前に) \fB_LARGEFILE64_SOURCE\fP マクロを定義しなければ
+ならない。
+32 ビットシステムにおいて大きなファイルにアクセスしたい場合、
+(\fBO_LARGEFILE\fP を使うよりも) \fB_FILE_OFFSET_BITS\fP 機能検査マクロを 64 に
+セットする方が望ましい方法である (\fBfeature_test_macros\fP(7) を参照)。
+.TP 
+\fBO_NOATIME\fP (Linux 2.6.8 以降)
+Do not update the file last access time (\fIst_atime\fP in the inode)  when the
+file is \fBread\fP(2).
+.IP
+This flag can be employed only if one of the following conditions is true:
+.RS
+.IP * 3
+.\" Strictly speaking: the filesystem UID
+The effective UID of the process matches the owner UID of the file.
+.IP *
+The calling process has the \fBCAP_FOWNER\fP capability in its user namespace
+and the owner UID of the file has a mapping in the namespace.
+.RE
+.IP
+.\" The O_NOATIME flag also affects the treatment of st_atime
+.\" by mmap() and readdir(2), MTK, Dec 04.
+This flag is intended for use by indexing or backup programs, where its use
+can significantly reduce the amount of disk activity.  This flag may not be
+effective on all filesystems.  One example is NFS, where the server
+maintains the access time.
+.TP 
+\fBO_NOCTTY\fP
+\fIpathname\fP が端末 (terminal) デバイス \(em \fBtty\fP(4) 参照 \(em を指している
+場合に、たとえそのプロセスが制御端末を持っていなくても、オープンしたファイル
+は制御端末にはならない。
+.TP 
+\fBO_NOFOLLOW\fP
+If the trailing component (i.e., basename) of \fIpathname\fP is a symbolic
+link, then the open fails, with the error \fBELOOP\fP.  Symbolic links in
+earlier components of the pathname will still be followed.  (Note that the
+\fBELOOP\fP error that can occur in this case is indistinguishable from the
+case where an open fails because there are too many symbolic links found
+while resolving components in the prefix part of the pathname.)
+.IP
+This flag is a FreeBSD extension, which was added to Linux in version
+2.1.126, and has subsequently been standardized in POSIX.1\-2008.
+.IP
+.\" The headers from glibc 2.0.100 and later include a
+.\" definition of this flag; \fIkernels before 2.1.126 will ignore it if
+.\" used\fP.
+See also \fBO_PATH\fP below.
+.TP 
+\fBO_NONBLOCK\fP または \fBO_NDELAY\fP
+When possible, the file is opened in nonblocking mode.  Neither the
+\fBopen\fP()  nor any subsequent I/O operations on the file descriptor which is
+returned will cause the calling process to wait.
+.IP
+Note that the setting of this flag has no effect on the operation of
+\fBpoll\fP(2), \fBselect\fP(2), \fBepoll\fP(7), and similar, since those interfaces
+merely inform the caller about whether a file descriptor is "ready", meaning
+that an I/O operation performed on the file descriptor with the
+\fBO_NONBLOCK\fP flag \fIclear\fP would not block.
+.IP
+Note that this flag has no effect for regular files and block devices; that
+is, I/O operations will (briefly) block when device activity is required,
+regardless of whether \fBO_NONBLOCK\fP is set.  Since \fBO_NONBLOCK\fP semantics
+might eventually be implemented, applications should not depend upon
+blocking behavior when specifying this flag for regular files and block
+devices.
+.IP
+For the handling of FIFOs (named pipes), see also \fBfifo\fP(7).  For a
+discussion of the effect of \fBO_NONBLOCK\fP in conjunction with mandatory file
+locks and with file leases, see \fBfcntl\fP(2).
+.TP 
+\fBO_PATH\fP (Linux 2.6.39 以降)
+.\" commit 1abf0c718f15a56a0a435588d1b104c7a37dc9bd
+.\" commit 326be7b484843988afe57566b627fb7a70beac56
+.\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d
+.\"
+.\" http://thread.gmane.org/gmane.linux.man/2790/focus=3496
+.\"    Subject: Re: [PATCH] open(2): document O_PATH
+.\"    Newsgroups: gmane.linux.man, gmane.linux.kernel
+.\"
+このフラグを指定して取得したファイルディスクリプターは、 ファイルシステムツリー内での場所を示すため、
+純粋にファイルディスクリプターレベルでの作用する操作を実行するため、 の二つの目的で使用することができる。 ファイル自身はオープンされず、
+他のファイル操作 (例えば \fBread\fP(2), \fBwrite\fP(2), \fBfchmod\fP(2), \fBfchown\fP(2),
+\fBfgetxattr\fP(2), \fBioctl\fP(2), \fBmmap\fP(2)) はエラー \fBEBADF\fP で失敗する。
+.IP
+取得したファイルディスクリプターに対して以下の操作を行うことが「できる」。
+.RS
+.IP * 3
+\fBclose\fP(2).
+.IP *
+.\" commit 332a2e1244bd08b9e3ecd378028513396a004a24
+\fBfchdir\fP(2), if the file descriptor refers to a directory (since Linux
+3.5).
+.IP *
+\fBfstat\fP(2) (Linux 3.6 以降).
+.IP *
+.\" fstat(): commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2
+.\" fstatfs(): commit 9d05746e7b16d8565dddbe3200faa1e669d23bbf
+\fBfstatfs\fP(2) (Linux 3.12 以降).
+.IP *
+ファイルディスクリプターの複製 (\fBdup\fP(2), \fBfcntl\fP(2)  \fBF_DUPFD\fP など)
+.IP *
+ファイルディスクリプターフラグの取得と設定 (\fBfcntl\fP(2) の \fBF_GETFD\fP と \fBF_SETFD\fP)
+.IP *
+\fBfcntl\fP(2) の \fBF_GETFL\fP 操作を使ったオープンされたファイルの状態フラグの取得。 返されるフラグには \fBO_PATH\fP
+ビットが含まれる。
+.IP *
+\fBopenat\fP() や他の "*at()" 系のシステムコールの \fIdirfd\fP 引数としてそのファイルディスクリプターを渡す。 これには、
+ファイルがディレクトリでない場合に \fBlinkat\fP(2) に \fBAT_EMPTY_PATH\fP が指定された場合 (や procfs 経由で
+\fBAT_SYMLINK_FOLLOW\fP が使用された場合) を含む。
+.IP *
+そのファイルディスクリプターを別のプロセスに UNIX ドメインソケット経由で渡す。 (\fBunix\fP(7) の \fBSCM_RIGHTS\fP を参照)
+.RE
+.IP
+\fIflags\fP に \fBO_PATH\fP が指定された場合、 \fBO_CLOEXEC\fP, \fBO_DIRECTORY\fP, \fBO_NOFOLLOW\fP
+以外のフラグビットは無視される。
+.IP
+Opening a file or directory with the \fBO_PATH\fP flag requires no permissions
+on the object itself (but does require execute permission on the directories
+in the path prefix).  Depending on the subsequent operation, a check for
+suitable file permissions may be performed (e.g., \fBfchdir\fP(2)  requires
+execute permission on the directory referred to by its file descriptor
+argument).  By contrast, obtaining a reference to a filesystem object by
+opening it with the \fBO_RDONLY\fP flag requires that the caller have read
+permission on the object, even when the subsequent operation (e.g.,
+\fBfchdir\fP(2), \fBfstat\fP(2))  does not require read permission on the object.
+.IP
+\fIpathname\fP がシンボリックリンクで \fBO_NOFOLLOW\fP フラグも合わせて指定された場合、
+この呼び出しではシンボリックリンクを参照するファイルディスクリプターを返す。 このファイルディスクリプターは、 空のパス名を指定した
+\fBfchownat\fP(2), \fBfstatat\fP(2), \fBlinkat\fP(2), \fBreadlinkat\fP(2) の呼び出しで
+\fIdirfd\fP 引数として使うことで、 そのシンボリックリンクに対して操作を行うことができる。
+.IP
+If \fIpathname\fP refers to an automount point that has not yet been triggered,
+so no other filesystem is mounted on it, then the call returns a file
+descriptor referring to the automount directory without triggering a mount.
+\fBfstatfs\fP(2)  can then be used to determine if it is, in fact, an
+untriggered automount point (\fB.f_type == AUTOFS_SUPER_MAGIC\fP).
+.IP
+One use of \fBO_PATH\fP for regular files is to provide the equivalent of
+POSIX.1's \fBO_EXEC\fP functionality.  This permits us to open a file for which
+we have execute permission but not read permission, and then execute that
+file, with steps something like the following:
+.IP
+.in +4n
+.EX
+char buf[PATH_MAX];
+fd = open("some_prog", O_PATH);
+snprintf(buf, PATH_MAX, "/proc/self/fd/%d", fd);
+execl(buf, "some_prog", (char *) NULL);
+.EE
+.in
+.IP
+An \fBO_PATH\fP file descriptor can also be passed as the argument of
+\fBfexecve\fP(3).
+.TP 
+\fBO_SYNC\fP
+ファイルに対する書き込み操作は、同期 I/O の\fIファイル\fP完全性完了の要件に基づいて行われる (これに対し \fBO_DSYNC\fP では同期 I/O
+の\fIデータ\fP完全性完了が提供される)。
+.IP
+\fBwrite\fP(2) (や同様のコール) が返るまでに、 書き込まれたデータと関連するファイルメタデータが裏で利用されているハードウェアに転送される
+(つまり、\fBwrite\fP(2) の後に \fBfsync\fP(2) を呼び出したのと同じようになる)。 \fI下記の「注意」も参照のこと\fP。
+.TP 
+\fBO_TMPFILE\fP (Linux 3.11 以降)
+.\" commit 60545d0d4610b02e55f65d141c95b18ccf855b6e
+.\" commit f4e0c30c191f87851c4a53454abb55ee276f4a7e
+.\" commit bb458c644a59dbba3a1fe59b27106c5e68e1c4bd
+名前なしの一時的な通常ファイルを作成する。 \fIpathname\fP 引き数はディレクトリを指定する。 名前なしの inode
+がそのディレクトリが存在するファイルシステムに作成される。 そのファイルに名前を付与しない限り、 作成されたファイルに書き込まれた内容は、
+最後のファイルディスクリプターがクローズされる際に失われる。
+.IP
+\fBO_TMPFILE\fP は必ず \fBO_RDWR\fP か \fBO_WRONLY\fP のいずれかと一緒に使わなければならない。 \fBO_EXCL\fP
+も指定することができる。 \fBO_EXCL\fP が指定されなかった場合、 \fBlinkat\fP(2)
+を使って、そのファイルシステムにこの一時ファイルへのリンクを作成し、ファイルを永続化することができる。 以下のコードのようにすればよい。
+.IP
+.in +4n
+.EX
+char path[PATH_MAX];
+fd = open("/path/to/dir", O_TMPFILE | O_RDWR,
+                        S_IRUSR | S_IWUSR);
+
+/* \(aqfd\(aq に対するファイル I/O ... */
+
+linkat(fd, NULL, AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
+
+/* If the caller doesn\(aqt have the CAP_DAC_READ_SEARCH
+   capability (needed to use AT_EMPTY_PATH with linkat(2)),
+   and there is a proc(5) filesystem mounted, then the
+   linkat(2) call above can be replaced with:
+
+snprintf(path, PATH_MAX,  "/proc/self/fd/%d", fd);
+linkat(AT_FDCWD, path, AT_FDCWD, "/path/for/file",
+                        AT_SYMLINK_FOLLOW);
+*/
+.EE
+.in
+.IP
+この場合、 \fBopen\fP() の \fImode\fP 引き数は \fBO_CREAT\fP と同様にファイルのアクセス許可モードの決定に使われる。
+.IP
+\fBO_TMPFILE\fP とともに \fBO_EXCL\fP を指定すると、
+一時ファイルに対して上記の方法でファイルシステムへのリンクを行うことができなくなる (この場合の \fBO_EXCL\fP の意味は他の場合の
+\fBO_EXCL\fP の意味とは異なる点に注意)。
+.IP
+.\" Inspired by http://lwn.net/Articles/559147/
+\fBO_TMPFILE\fP には主に二つの用途がある。
+.RS
+.IP * 3
+改善された \fBtmpfile\fP(3) の機能: (1) クローズ時に自動的に削除される、 (2) パス名では決して参照できない、 (3)
+シンボリックリンク攻撃ができない、 (4) 呼び出し元が一意な名前を考える必要がない、 という特長を持つ競合のない一時ファイルの作成。
+.IP *
+最初は見えないファイルを作成し、 それからデータを書き込んだり、適切なファイルシステム属性を持つように調整したり (\fBfchown\fP(2),
+\fBfchmod\fP(2), \fBfsetxattr\fP(2) など) した後、 準備が全て整った状態で (上述の \fBlinkat\fP(2) を使って)
+ファイルシステム内にアトミックにリンクを行う。
+.RE
+.IP
+.\" To check for support, grep for "tmpfile" in kernel sources
+.\" commit 99b6436bc29e4f10e4388c27a3e4810191cc4788
+.\" commit ab29743117f9f4c22ac44c13c1647fb24fb2bafe
+.\" commit ef3b9af50bfa6a1f02cd7b3f5124b712b1ba3e3c
+.\" commit 50732df02eefb39ab414ef655979c2c9b64ad21c
+\fBO_TMPFILE\fP requires support by the underlying filesystem; only a subset of
+Linux filesystems provide that support.  In the initial implementation,
+support was provided in the ext2, ext3, ext4, UDF, Minix, and shmem
+filesystems.  Support for other filesystems has subsequently been added as
+follows: XFS (Linux 3.15); Btrfs (Linux 3.16); F2FS (Linux 3.16); and ubifs
+(Linux 4.9)
+.TP 
+\fBO_TRUNC\fP
+ファイルが既に存在し、通常ファイルであり、 アクセスモードで書き込みが許可されている (つまり、 \fBO_RDWR\fP または \fBO_WRONLY\fP
+の) 場合、長さ 0 に切り詰め (truncate) られる。 ファイルが FIFO または端末デバイスファイルの場合、 \fBO_TRUNC\fP
+フラグは無視される。 それ以外の場合、 \fBO_TRUNC\fP の効果は未定義である。
+.SS creat()
+\fBcreat\fP() の呼び出しは、 \fIflags\fP に \fBO_CREAT|O_WRONLY|O_TRUNC\fP を指定して \fBopen\fP()
+を呼び出すのと等価である。
+.SS openat()
+\fBopenat\fP() システムコールは \fBopen\fP() と全く同様に動作するが、以下で説明する点が異なる。
+.PP
+\fIpathname\fP で指定されたパス名が相対パスの場合、このパス名はファイルディスクリプター \fIdirfd\fP
+が参照するディレクトリに対する相対パスと解釈される (\fBopen\fP()
+に相対パス名を渡した場合のように、呼び出したプロセスのカレントワーキングディレクトリに対する相対パスではない)。
+.PP
+\fIpathname\fP で指定されたパス名が相対パスで、 \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP の場合、 (\fBopen\fP()
+と同様に) \fIpathname\fP は呼び出したプロセスのカレントワーキングディレクトリに対する相対パスと解釈される。
+.PP
+.\"
+\fIpathname\fP で指定されたパス名が絶対パスの場合、 \fIdirfd\fP は無視される。
+.SS openat2(2)
+The \fBopenat2\fP(2)  system call is an extension of \fBopenat\fP(), and provides
+a superset of the features of \fBopenat\fP().  It is documented separately, in
+\fBopenat2\fP(2).
+.SH 返り値
+\fBopen\fP(), \fBopenat\fP(), and \fBcreat\fP()  return the new file descriptor (a
+nonnegative integer), or \-1 if an error occurred (in which case, \fIerrno\fP is
+set appropriately).
+.SH エラー
+\fBopen\fP(), \fBopenat\fP(), \fBcreat\fP() は以下のエラーで失敗する。
+.TP 
+\fBEACCES\fP
+ファイルに対する要求されたアクセスが許されていないか、 \fIpathname\fP のディレクトリ部分の何れかのディレクトリに検索許可がなかった。
+またはファイルが存在せず、親ディレクトリへの書き込み許可がなかった。 (\fBpath_resolution\fP(7)  も参照すること。)
+.TP 
+\fBEACCES\fP
+.\" commit 30aba6656f61ed44cba445a3c0d38b296fa9e8f5
+Where \fBO_CREAT\fP is specified, the \fIprotected_fifos\fP or
+\fIprotected_regular\fP sysctl is enabled, the file already exists and is a
+FIFO or regular file, the owner of the file is neither the current user nor
+the owner of the containing directory, and the containing directory is both
+world\- or group\-writable and sticky.  For details, see the descriptions of
+\fI/proc/sys/fs/protected_fifos\fP and \fI/proc/sys/fs/protected_regular\fP in
+\fBproc\fP(5).
+.TP 
+\fBEBUSY\fP
+\fBO_EXCL\fP was specified in \fIflags\fP and \fIpathname\fP refers to a block device
+that is in use by the system (e.g., it is mounted).
+.TP 
+\fBEDQUOT\fP
+\fBO_CREAT\fP が指定された場合で、そのファイルが存在せず、ディスクブロックか inode がそのファイルシステムのユーザークォータに達していた。
+.TP 
+\fBEEXIST\fP
+\fIpathname\fP は既に存在し、 \fBO_CREAT\fP と \fBO_EXCL\fP が使用された。
+.TP 
+\fBEFAULT\fP
+\fIpathname\fP がアクセス可能なアドレス空間の外を指している。
+.TP 
+\fBEFBIG\fP
+\fBEOVERFLOW\fP 参照。
+.TP 
+\fBEINTR\fP
+遅いデバイス (例えば FIFO、 \fBfifo\fP(7)  参照) のオープンが完了するのを待って停止している間に
+システムコールがシグナルハンドラーにより割り込まれた。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEINVAL\fP
+ファイルシステムが \fBO_DIRECT\fP フラグをサポートしていない。 詳細は\fB注意\fPを参照。
+.TP 
+\fBEINVAL\fP
+.\" In particular, __O_TMPFILE instead of O_TMPFILE
+\fIflags\fP に無効な値が入っている。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP に \fBO_TMPFILE\fP が指定されたが、 \fBO_WRONLY\fP も \fBO_RDWR\fP も指定されていなかった。
+.TP 
+\fBEINVAL\fP
+\fBO_CREAT\fP was specified in \fIflags\fP and the final component ("basename") of
+the new file's \fIpathname\fP is invalid (e.g., it contains characters not
+permitted by the underlying filesystem).
+.TP 
+\fBEINVAL\fP
+The final component ("basename") of \fIpathname\fP is invalid (e.g., it
+contains characters not permitted by the underlying filesystem).
+.TP 
+\fBEISDIR\fP
+\fIpathname\fP はディレクトリを参照しており、書き込み要求が含まれていた (つまり \fBO_WRONLY\fP または \fBO_RDWR\fP
+が設定されている)。
+.TP 
+\fBEISDIR\fP
+\fIpathname\fP が存在するディレクトリを参照していて、 \fBO_TMPFILE\fP および \fBO_WRONLY\fP と \fBO_RDWR\fP
+の一方が \fIflags\fP に指定されていたが、 このカーネルバージョンでは \fBO_TMPFILE\fP 機能が提供されていない。
+.TP 
+\fBELOOP\fP
+\fIpathname\fP を解決する際に遭遇したシンボリックリンクが多過ぎる。
+.TP 
+\fBELOOP\fP
+\fIpathname\fP がシンボリックリンクで、 \fIflags\fP に \fBO_NOFOLLOW\fP が指定されたが、 \fBO_PATH\fP
+が指定されていなかった。
+.TP 
+\fBEMFILE\fP
+The per\-process limit on the number of open file descriptors has been
+reached (see the description of \fBRLIMIT_NOFILE\fP in \fBgetrlimit\fP(2)).
+.TP 
+\fBENAMETOOLONG\fP
+\fIpathname\fP が長過ぎる。
+.TP 
+\fBENFILE\fP
+オープンされているファイルの総数がシステム全体の制限に達している。
+.TP 
+\fBENODEV\fP
+\fIpathname\fP がデバイススペシャルファイルを参照しており、対応するデバイスが存在しない。 (これは Linux
+カーネルのバグであり、この場合には \fBENXIO\fP が返されるべきである)
+.TP 
+\fBENOENT\fP
+\fBO_CREAT\fP is not set and the named file does not exist.
+.TP 
+\fBENOENT\fP
+\fIpathname\fP の中のディレクトリ部分が存在しないか、壊れた (dangling)  シンボリックリンク (symbolic link)
+である。
+.TP 
+\fBENOENT\fP
+\fIpathname\fP が存在しないディレクトリを参照していて、 \fBO_TMPFILE\fP および \fBO_WRONLY\fP と \fBO_RDWR\fP
+の一方が \fIflags\fP に指定されていたが、 このカーネルバージョンでは \fBO_TMPFILE\fP 機能が提供されていない。
+.TP 
+\fBENOMEM\fP
+The named file is a FIFO, but memory for the FIFO buffer can't be allocated
+because the per\-user hard limit on memory allocation for pipes has been
+reached and the caller is not privileged; see \fBpipe\fP(7).
+.TP 
+\fBENOMEM\fP
+十分なカーネルメモリーがない。
+.TP 
+\fBENOSPC\fP
+\fIpathname\fP を作成する必要があるが、 \fIpathname\fP を含んでいるデバイスに新しいファイルのための空き容量がない。
+.TP 
+\fBENOTDIR\fP
+\fIpathname\fP に含まれるディレクトリ部分のどれかが実際にはディレクトリでない。 または \fBO_DIRECTORY\fP が指定されており、
+\fIpathname\fP がディレクトリでない。
+.TP 
+\fBENXIO\fP
+\fBO_NONBLOCK\fP | \fBO_WRONLY\fP が設定されており、指定したファイルが FIFO で そのファイルを読み込み用でオープンしている
+FIFO が存在しない。
+.TP 
+\fBENXIO\fP
+ファイルがデバイススペシャルファイルで、対応するデバイスが存在しない。
+.TP 
+\fBENXIO\fP
+The file is a UNIX domain socket.
+.TP 
+\fBEOPNOTSUPP\fP
+\fIpathname\fP を含んでいるファイルシステムが \fBO_TMPFILE\fP をサポートしていない。
+.TP 
+\fBEOVERFLOW\fP
+.\" See http://bugzilla.kernel.org/show_bug.cgi?id=7253
+.\" "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
+.\" Reported 2006-10-03
+\fIpathname\fP が参照しているのが、大き過ぎてオープンできない通常のファイルである。 通常、このエラーが発生するは、32
+ビットプラットフォーム上で \fI\-D_FILE_OFFSET_BITS=64\fP を指定せずにコンパイルされたアプリケーションが、ファイルサイズが
+\fI(1<31)\-1\fP バイトを超えるファイルを開こうとした場合である。 上記の \fBO_LARGEFILE\fP も参照。 これは POSIX.1
+で規定されているエラーである。 2.6.24 より前のカーネルでは、Linux はこの場合にエラー \fBEFBIG\fP を返していた。
+.TP 
+\fBEPERM\fP
+.\" Strictly speaking, it's the filesystem UID... (MTK)
+\fBO_NOATIME\fP フラグが指定されたが、呼び出し元の実効ユーザー ID が ファイルの所有者と一致せず、かつ呼び出し元に特権がない。
+.TP 
+\fBEPERM\fP
+操作が file seal により禁止されている。 \fBfcntl\fP(2)  参照。
+.TP 
+\fBEROFS\fP
+\fIpathname\fP が読み込み専用のファイルシステム上のファイルを参照しており、 書き込みアクセスが要求された。
+.TP 
+\fBETXTBSY\fP
+\fIpathname\fP が現在実行中の実行イメージを参照しており、書き込みが要求された。
+.TP 
+\fBETXTBSY\fP
+\fIpathname\fP refers to a file that is currently in use as a swap file, and
+the \fBO_TRUNC\fP flag was specified.
+.TP 
+\fBETXTBSY\fP
+\fIpathname\fP refers to a file that is currently being read by the kernel
+(e.g., for module/firmware loading), and write access was requested.
+.TP 
+\fBEWOULDBLOCK\fP
+\fBO_NONBLOCK\fP フラグが指定されたが、そのファイルには矛盾するリースが設定されていた (\fBfcntl\fP(2)  参照)。
+.PP
+\fBopenat\fP() では以下のエラーも発生する。
+.TP 
+\fBEBADF\fP
+\fIdirfd\fP が有効なファイルディスクリプターではない。
+.TP 
+\fBENOTDIR\fP
+\fIpathname\fP が相対パス名で、 \fIdirfd\fP がディレクトリ以外のファイルを参照しているファイルディスクリプターである。
+.SH バージョン
+\fBopenat\fP()  はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサポートはバージョン 2.4 で glibc
+に追加された。
+.SH 準拠
+\fBopen\fP(), \fBcreat\fP()  SVr4, 4.3BSD, POSIX.1\-2001, POSIX.1\-2008.
+.PP
+\fBopenat\fP(): POSIX.1\-2008.
+.PP
+\fBopenat2\fP()  は Linux 固有である。
+.PP
+フラグ \fBO_DIRECT\fP, \fBO_NOATIME\fP, \fBO_PATH\fP, \fBO_TMPFILE\fP は Linux 特有のものである。
+これらのフラグの定義を得るためには \fB_GNU_SOURCE\fP を定義しなければならない。
+.PP
+フラグ \fBO_CLOEXEC\fP, \fBO_DIRECTORY\fP, \fBO_NOFOLLOW\fP は POSIX.1\-2001 では規定されていないが、
+POSIX.1\-2008 では規定されている。 glibc 2.12 以降では、これらの定義を得るには、 \fB_POSIX_C_SOURCE\fP を
+200809L 以上の値で定義するか、 \fB_XOPEN_SOURCE\fP を 700 以上の値で定義する。 glibc 2.11 以前では、
+これらの定義を得るには \fB_GNU_SOURCE\fP を定義する。
+.PP
+\fBfeature_test_macros\fP(7) に注意書きがあるように、 \fB_POSIX_C_SOURCE\fP, \fB_XOPEN_SOURCE\fP,
+\fB_GNU_SOURCE\fP などの機能検査マクロは\fIどの\fPヘッダーファイルをインクルードするより前に定義しなければならない。
+.SH 注意
+Under Linux, the \fBO_NONBLOCK\fP flag is sometimes used in cases where one
+wants to open but does not necessarily have the intention to read or write.
+For example, this may be used to open a device in order to get a file
+descriptor for use with \fBioctl\fP(2).
+.PP
+.\" Linux 2.0, 2.5: truncate
+.\" Solaris 5.7, 5.8: truncate
+.\" Irix 6.5: truncate
+.\" Tru64 5.1B: truncate
+.\" HP-UX 11.22: truncate
+.\" FreeBSD 4.7: truncate
+\fBO_RDONLY | O_TRUNC\fP の影響は未定義であり、その動作は実装によって異なる。 多くのシステムではファイルは実際に切り詰められる。
+.PP
+\fBopen\fP()  はスペシャルファイルをオープンすることができるが、 \fBcreat\fP()  でスペシャルファイルを作成できない点に注意すること。
+代わりに \fBmknod\fP(2)  を使用する。
+.PP
+ファイルが新しく作成されると、 ファイルの \fIst_atime\fP, \fIst_ctime\fP, \fIst_mtime\fP フィールド
+(それぞれ最終アクセス時刻、最終状態変更時刻、最終修正時刻である。 \fBstat\fP(2)  参照) が現在時刻に設定される。 さらに親ディレクトリの
+\fIst_ctime\fP と \fIst_mtime\fP も現在時刻に設定される。 それ以外の場合で、O_TRUNC フラグでファイルが修正されたときは、
+ファイルの \fIst_ctime\fP と \fIst_mtime\fP フィールドが現在時刻に設定される。
+.PP
+The files in the \fI/proc/[pid]/fd\fP directory show the open file descriptors
+of the process with the PID \fIpid\fP.  The files in the \fI/proc/[pid]/fdinfo\fP
+directory show even more information about these file descriptors.  See
+\fBproc\fP(5)  for further details of both of these directories.
+.PP
+.\"
+.\"
+The Linux header file \fB<asm/fcntl.h>\fP doesn't define \fBO_ASYNC\fP;
+the (BSD\-derived)  \fBFASYNC\fP synonym is defined instead.
+.SS オープンファイル記述
+オープンファイル記述という用語は POSIX
+で使用されている用語で、オープンされているファイルのシステム共通のテーブルのエントリーを参照するものである。
+別の文脈では、このオブジェクトはいろいろな呼び方があり、
+「オープンファイルオブジェクト」、「ファイルハンドル」、「オープンファイルテーブルエントリー」、 カーネル開発者の用語では \fIstruct file\fP
+などと呼ばれる。
+.PP
+ファイルディスクリプターが (\fBdup\fP(2) や同様のシステムコールを使って) 複製される際に、
+複製されたファイルディスクリプターは元のファイルディスクリプターと同じオープンファイル記述を参照する。 結果として 2
+つのファイルディスクリプターはファイルオフセットとファイル状態フラグを共有する。 このような共有はプロセス間でも起こり得る。 \fBfork\fP(2)
+で作成された子プロセスは親プロセスのファイルディスクリプターの複製を継承し、これらの複製は同じオープンファイル記述を参照する。
+.PP
+1 つのファイルに対して \fBopen\fP() を行う毎に、新しいオープンファイル記述が作成される。 したがって、 1 つのファイル inode
+に対して複数のオープンファイル記述が存在することがありえる。
+.PP
+.\"
+.\"
+On Linux, one can use the \fBkcmp\fP(2)  \fBKCMP_FILE\fP operation to test whether
+two file descriptors (in the same process or in two different processes)
+refer to the same open file description.
+.SS "同期 I/O"
+POSIX.1\-2008 の「同期 I/O」の選択肢として複数種類が規定されており、 動作を制御するために \fBopen\fP() フラグとして
+\fBO_SYNC\fP, \fBO_DSYNC\fP, \fBO_RSYNC\fP が規定されている。 この選択肢を実装がサポートしているかに関わらず、
+各実装では少なくとも通常のファイルに対して \fBO_SYNC\fP が利用できなければならない。
+.PP
+Linux implements \fBO_SYNC\fP and \fBO_DSYNC\fP, but not \fBO_RSYNC\fP.  Somewhat
+incorrectly, glibc defines \fBO_RSYNC\fP to have the same value as \fBO_SYNC\fP.
+(\fBO_RSYNC\fP is defined in the Linux header file \fI<asm/fcntl.h>\fP on
+HP PA\-RISC, but it is not used.)
+.PP
+\fBO_SYNC\fP は、 同期 I/O での\fIファイル\fP完全性完了を提供する。 つまり、
+書き込み操作はデータとすべての関連メタデータを裏で利用されているハードウェアにフラッシュすることを意味する。 \fBO_DSYNC\fP は、 同期 I/O
+での\fIデータ\fP完全性完了を提供する。 つまり、 書き込み操作はデータを裏で利用されているハードウェアにフラッシュするが、
+それ以降の読み出し操作が正常に完了するのに必要なメタデータの更新のみをフラッシュする。 データ完全性完了は、
+ファイル完全性完了を必要としないアプリケーションで、 ディスク操作の数を減らすことができる。
+.PP
+2 種類の完了の違いを理解するために、 ファイルメタデータの 2 つの要素、 ファイルの最終修正時刻 (\fIst_mtime\fP)
+とファイル長、を考える。 すべての書き込み操作は最終修正時刻を更新するが、 ファイルの末尾にデータを追加する書き込み操作のみがファイル長を変更する。
+最終修正時刻は、 読み出しが正常に完了するのに必要ではないが、 ファイル長は必要である。 したがって、 \fBO_DSYNC\fP
+はファイル長のメタデータの更新がフラッシュされることだけを保証する (これに対して \fBO_SYNC\fP
+では最終修正時刻のメタデータも常にフラッシュされる)。
+.PP
+Linux 2.6.33 より前では、 Linux は \fBopen\fP() では \fBO_SYNC\fP フラグのみを実装していた。 しかしながら、
+このフラグが指定された場合、 ほとんどのファイルシステムで提供されていたのは実際には同期 I/O での\fIデータ\fP完全性完了と等価なものであった
+(つまり、 \fBO_SYNC\fP は実際には \fBO_DSYNC\fP と等価なものとして実装されていた)。
+.PP
+.\"
+Linux 2.6.33 行こう では、 正しい \fBO_SYNC\fP のサポートが提供されている。 しかしながら、
+バイナリレベルの後方互換性を保証するため、 \fBO_DSYNC\fP は以前の \fBO_SYNC\fP と同じ値で定義されており、 \fBO_SYNC\fP は
+\fBO_DSYNC\fP フラグの値を含む新しい (2 ビットの) フラグ値として定義されている。 これにより、
+新しいヘッダーを使ってコンパイルされたアプリケーションで、 2.6.33 より前のカーネルで少なくとも \fBO_DSYNC\fP
+の動作は同じになることが保証される。
+.SS "C ライブラリとカーネルの違い"
+.\"
+Since version 2.26, the glibc wrapper function for \fBopen\fP()  employs the
+\fBopenat\fP()  system call, rather than the kernel's \fBopen\fP()  system call.
+For certain architectures, this is also true in glibc versions before 2.26.
+.SS NFS
+NFS を実現しているプロトコルには多くの不備があり、特に \fBO_SYNC\fP と \fBO_NDELAY\fP に影響する。
+.PP
+.\"
+.\"
+UID マッピングを使用している NFS ファイルシステムでは、 \fBopen\fP()  がファイルディスクリプターを返した場合でも \fBread\fP(2)
+が \fBEACCES\fP で拒否される場合がある。 これはクライアントがアクセス許可のチェックを行って \fBopen\fP()
+を実行するが、読み込みや書き込みの際には サーバーで UID マッピングが行われるためである。
+.SS FIFOs
+.\"
+.\"
+Opening the read or write end of a FIFO blocks until the other end is also
+opened (by another process or thread).  See \fBfifo\fP(7)  for further details.
+.SS ファイルアクセスモード
+「アクセスモード」の値 \fBO_RDONLY\fP, \fBO_WRONLY\fP, \fBO_RDWR\fP は、 \fIflags\fP
+に指定できる他の値と違い、個々のビットを指定するものではなく、 これらの値は \fIflags\fP の下位 2 ビットを定義する。 \fBO_RDONLY\fP,
+\fBO_WRONLY\fP, \fBO_RDWR\fP はそれぞれ 0, 1, 2 に定義されている。 言い換えると、 \fBO_RDONLY |
+O_WRONLY\fP の組み合わせは論理的に間違いであり、確かに \fBO_RDWR\fP と同じ意味ではない。
+.PP
+.\" See for example util-linux's disk-utils/setfdprm.c
+.\" For some background on access mode 3, see
+.\" http://thread.gmane.org/gmane.linux.kernel/653123
+.\" "[RFC] correct flags to f_mode conversion in __dentry_open"
+.\" LKML, 12 Mar 2008
+.\"
+.\"
+Linux では、特別な、非標準なアクセスモードとして 3 (バイナリでは 11) が 予約されており \fIflags\fP に指定できる。
+このアクセスモードを指定すると、ファイルの読み出し/書き込み許可をチェックし、 読み出しにも書き込みにも使用できないファイルディスクリプターを返す。
+この非標準のアクセスモードはいくつかの Linux ドライバで、デバイス固有の \fBioctl\fP(2)
+操作にのみ使用されるファイルディスクリプターを返すために使われている。
+.SS "openat() や他のディレクトリファイルディスクリプター API の基本原理"
+\fBopenat\fP()  and the other system calls and library functions that take a
+directory file descriptor argument (i.e., \fBexecveat\fP(2), \fBfaccessat\fP(2),
+\fBfanotify_mark\fP(2), \fBfchmodat\fP(2), \fBfchownat\fP(2), \fBfspick\fP(2),
+\fBfstatat\fP(2), \fBfutimesat\fP(2), \fBlinkat\fP(2), \fBmkdirat\fP(2),
+\fBmove_mount\fP(2), \fBmknodat\fP(2), \fBname_to_handle_at\fP(2), \fBopen_tree\fP(2),
+\fBopenat2\fP(2), \fBreadlinkat\fP(2), \fBrenameat\fP(2), \fBstatx\fP(2),
+\fBsymlinkat\fP(2), \fBunlinkat\fP(2), \fButimensat\fP(2), \fBmkfifoat\fP(3), and
+\fBscandirat\fP(3))  address two problems with the older interfaces that
+preceded them.  Here, the explanation is in terms of the \fBopenat\fP()  call,
+but the rationale is analogous for the other interfaces.
+.PP
+First, \fBopenat\fP()  allows an application to avoid race conditions that
+could occur when using \fBopen\fP()  to open files in directories other than
+the current working directory.  These race conditions result from the fact
+that some component of the directory prefix given to \fBopen\fP()  could be
+changed in parallel with the call to \fBopen\fP().  Suppose, for example, that
+we wish to create the file \fIdir1/dir2/xxx.dep\fP if the file \fIdir1/dir2/xxx\fP
+exists.  The problem is that between the existence check and the
+file\-creation step, \fIdir1\fP or \fIdir2\fP (which might be symbolic links)
+could be modified to point to a different location.  Such races can be
+avoided by opening a file descriptor for the target directory, and then
+specifying that file descriptor as the \fIdirfd\fP argument of (say)
+\fBfstatat\fP(2)  and \fBopenat\fP().  The use of the \fIdirfd\fP file descriptor
+also has other benefits:
+.IP * 3
+the file descriptor is a stable reference to the directory, even if the
+directory is renamed; and
+.IP *
+the open file descriptor prevents the underlying filesystem from being
+dismounted, just as when a process has a current working directory on a
+filesystem.
+.PP
+二つ目として、 \fBopenat\fP() を使うと、アプリケーションが管理するファイルディスクリプターにより、
+スレッド単位の「カレントワーキングディレクトリ」を実装することができる (この機能は、 \fI/proc/self/fd/dirfd\fP
+を使った方法でも実現することができるが、 効率の面で落とる)。
+.PP
+The \fIdirfd\fP argument for these APIs can be obtained by using \fBopen\fP()  or
+\fBopenat\fP()  to open a directory (with either the \fBO_RDONLY\fP or the
+\fBO_PATH\fP flag).  Alternatively, such a file descriptor can be obtained by
+applying \fBdirfd\fP(3)  to a directory stream created using \fBopendir\fP(3).
+.PP
+.\"
+.\"
+When these APIs are given a \fIdirfd\fP argument of \fBAT_FDCWD\fP or the
+specified pathname is absolute, then they handle their pathname argument in
+the same way as the corresponding conventional APIs.  However, in this case,
+several of the APIs have a \fIflags\fP argument that provides access to
+functionality that is not available with the corresponding conventional
+APIs.
+.SS O_DIRECT
+\fBO_DIRECT\fP フラグを使用する場合、ユーザー空間バッファーの長さやアドレス、 I/O
+のファイルオフセットに関してアラインメントの制限が課されることがある。 Linux では、アラインメントの制限はファイルシステムやカーネルのバージョンに
+よって異なり、全く制限が存在しない場合もある。 しかしながら、現在のところ、指定されたファイルやファイルシステムに対して
+こうした制限があるかを見つけるための、アプリケーション向けのインターフェースで ファイルシステム非依存のものは存在しない。
+いくつかのファイルシステムでは、制限を確認するための独自のインターフェースが 提供されている。例えば、 \fBxfsctl\fP(3)  の
+\fBXFS_IOC_DIOINFO\fP 命令である。
+.PP
+Linux 2.4 では、転送サイズ、 ユーザーバッファーのアライメント、ファイルオフセットは、
+ファイルシステムの論理ブロックサイズの倍数でなければならない。 Linux 2.6.0 以降では、
+内部で使われるストレージの論理ブロックサイズのアライメント (通常は 512 バイト) で十分である。 論理ブロックサイズは \fBioctl\fP(2)
+\fBBLKSSZGET\fP 操作や以下のシェルコマンドから知ることができる。
+.PP
+.in +4n
+.EX
+blockdev \-\-getss
+.EE
+.in
+.PP
+メモリーバッファーがプライベートマッピング (\fBmmap\fP(2) の \fBMAP_PRIVATE\fP
+フラグで作成されたマッピング) の場合には、\fBO_DIRECT\fP I/O は
+\fBfork\fP(2) システムコールと同時に決して実行すべきではない
+(プライベートマッピングには、ヒープ領域に割り当てられたメモリーや静的に
+割り当てたバッファーも含まれる)。非同期 I/O インターフェース (AIO) 経由
+やプロセス内の他のスレッドから発行された、このような I/O は、
+\fBfork\fP(2) が呼び出される前に完了されるべきである。
+そうしなかった場合、データ破壊や、親プロセスや子プロセスでの予期しない
+動作が起こる可能性がある。
+\fBO_DIRECT\fP I/O 用のメモリーバッファーが \fBshmat\fP(2) や\fBMAP_SHARED\fP フラグ
+付きの \fBmmap\fP(2) で作成された場合には、この制限はあてはまらない。
+\fBmadvise\fP(2) でメモリーバッファーにアドバイス \fBMADV_DONTFORK\fP が設定され
+ている場合にも、この制限はあてはまらない(\fBMADV_DONTFORK\fP はそのメモリー
+バッファーが \fBfork\fP(2) 後に子プロセスからは利用できないことを保証するも
+のである)。
+.PP
+\fBO_DIRECT\fP フラグは SGI IRIX で導入された。SGI IRIX にも Linux 2.4 と同様の (ユーザーバッファーの)
+アラインメントの制限がある。 また、IRIX には適切な配置とサイズを取得するための \fBfcntl\fP(2)  コールがある。 FreeBSD 4.x
+も同じ名前のフラグを導入したが、アラインメントの制限はない。
+.PP
+\fBO_DIRECT\fP support was added under Linux in kernel version 2.4.10.  Older
+Linux kernels simply ignore this flag.  Some filesystems may not implement
+the flag, in which case \fBopen\fP()  fails with the error \fBEINVAL\fP if it is
+used.
+.PP
+アプリケーションは、同じファイル、 特に同じファイルの重複するバイト領域に対して、 \fBO_DIRECT\fP と通常の I/O
+を混ぜて使うのは避けるべきである。 ファイルシステムがこのような状況において一貫性の問題を正しく 扱うことができる場合であっても、全体の I/O
+スループットは どちらか一方を使用するときと比べて低速になるであろう。 同様に、アプリケーションは、同じファイルに対して \fBmmap\fP(2)  と直接
+I/O (\fBO_DIRECT\fP)  を混ぜて使うのも避けるべきである。
+.PP
+NFS で \fBO_DIRECT\fP を使った場合の動作はローカルのファイルシステムの場合と違う。
+古いカーネルや、ある種の設定でコンパイルされたカーネルは、 \fBO_DIRECT\fP と NFS の組み合わせをサポートしていないかもしれない。 NFS
+プロトコル自体はサーバにフラグを渡す機能は持っていないので、 \fBO_DIRECT\fP I/O
+はクライアント上のページキャッシュをバイパスするだけになり、 サーバは I/O をキャッシュしているかもしれない。 クライアントは、
+\fBO_DIRECT\fP の同期機構を保持するため、サーバに対して I/O を同期して行うように依頼する。 サーバによっては、こうした状況下、特に I/O
+サイズが小さい場合に 性能が大きく劣化する。 また、サーバによっては、I/O が安定したストレージにまで行われたと、
+クライアントに対して嘘をつくものもある。 これは、サーバの電源故障が起こった際にデータの完全性が保たれない
+危険は少しあるが、性能面での不利な条件を回避するために行われている。 Linux の NFS クライアントでは \fBO_DIRECT\fP I/O
+でのアラインメントの制限はない。
+.PP
+まとめると、 \fBO_DIRECT\fP は、注意して使うべきであるが、強力なツールとなる可能性を持っている。 アプリケーションは \fBO_DIRECT\fP
+をデフォルトでは無効になっている性能向上のためのオプションと 考えておくのがよいであろう。
+.SH バグ
+.\" FIXME . Check bugzilla report on open(O_ASYNC)
+.\" See http://bugzilla.kernel.org/show_bug.cgi?id=5993
+現在のところ、 \fBopen\fP()  の呼び出し時に \fBO_ASYNC\fP を指定してシグナル駆動 I/O を有効にすることはできない。
+このフラグを有効にするには \fBfcntl\fP(2)  を使用すること。
+.PP
+カーネルが \fBO_TMPFILE\fP 機能をサポートしているかを判定する際に、 \fBEISDIR\fP と \fBENOENT\fP の 2
+つのエラーコードをチェックしなければならない。
+.PP
+When both \fBO_CREAT\fP and \fBO_DIRECTORY\fP are specified in \fIflags\fP and the
+file specified by \fIpathname\fP does not exist, \fBopen\fP()  will create a
+regular file (i.e., \fBO_DIRECTORY\fP is ignored).
+.SH 関連項目
+\fBchmod\fP(2), \fBchown\fP(2), \fBclose\fP(2), \fBdup\fP(2), \fBfcntl\fP(2), \fBlink\fP(2),
+\fBlseek\fP(2), \fBmknod\fP(2), \fBmmap\fP(2), \fBmount\fP(2), \fBopen_by_handle_at\fP(2),
+\fBopenat2\fP(2), \fBread\fP(2), \fBsocket\fP(2), \fBstat\fP(2), \fBumask\fP(2),
+\fBunlink\fP(2), \fBwrite\fP(2), \fBfopen\fP(3), \fBacl\fP(5), \fBfifo\fP(7), \fBinode\fP(7),
+\fBpath_resolution\fP(7), \fBsymlink\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index db08289..cc105fe 100644 (file)
@@ -238,7 +238,7 @@ FreeBSD には \fBgetfh\fP() と \fBopenfh\fP() というほとんど同じ機
 のシンボリックリンク経由で対応するデバイス UUID を検索できる。 (UUID を取得するもっと便利な方法は \fBlibblkid\fP(3)
 ライブラリを使用することである。) そのプロセスは、逆に、 この UUID を使ってデバイス名を検索し、 対応するマウントポイントを取得することで、
 \fBopen_by_handle_at\fP() で使用する \fImount_fd\fP 引き数を生成することができる。
-.SH EXAMPLES
+.SH 
 以下の 2 つのプログラムは \fBname_to_handle_at\fP() と \fBopen_by_handle_at\fP()
 の使用例を示したものである。 最初のプログラム (\fIt_name_to_handle_at.c\fP) は \fBname_to_handle_at\fP()
 を使用して、 コマンドライン引き数で指定されたファイルに対応するファイルハンドルとマウント ID を取得する。 ハンドルとマウント ID
diff --git a/manual/LDP_man-pages/draft/man2/pipe.2 b/manual/LDP_man-pages/draft/man2/pipe.2
new file mode 100644 (file)
index 0000000..65bda21
--- /dev/null
@@ -0,0 +1,224 @@
+.\" Copyright (C) 2005, 2008, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" (A few fragments remain from an earlier (1992) version by
+.\" Drew Eckhardt <drew@cs.colorado.edu>.)
+.\"
+.\" %%%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 <michael@moria.de>
+.\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
+.\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
+.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Modified 2005, mtk: added an example program
+.\" Modified 2008-01-09, mtk: rewrote DESCRIPTION; minor additions
+.\"     to EXAMPLE text.
+.\" 2008-10-10, mtk: add description of pipe2()
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
+.\"         all rights reserved.
+.\" Translated Thu Jun 26 21:09:51 JST 1997
+.\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
+.\" Updated & Modified Thu Feb 10 00:47:11 JST 2005
+.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
+.\" Updated & Modified Sat Dec 17 08:10:16 JST 2005 by Yuichi SATO
+.\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
+.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH PIPE 2 2020\-06\-09 Linux "Linux Programmer's Manual"
+.SH 名前
+pipe, pipe2 \- パイプを生成する
+.SH 書式
+.nf
+\fB#include <unistd.h>\fP
+.PP
+/* On Alpha, IA\-64, MIPS, SuperH, and SPARC/SPARC64; see NOTES */
+\fBstruct fd_pair {\fP
+\fBlong fd[2];\fP
+\fB};\fP
+\fBstruct fd_pair pipe();\fP
+.PP
+/* On all other architectures */
+\fBint pipe(int \fP\fIpipefd\fP\fB[2]);\fP
+
+\fB#define _GNU_SOURCE\fP             /* feature_test_macros(7) 参照 */
+\fB#include <fcntl.h>\fP              /* O_* 定数の定義の取得 */
+\fB#include <unistd.h>\fP
+.PP
+\fBint pipe2(int \fP\fIpipefd\fP\fB[2], int \fP\fIflags\fP\fB);\fP
+.fi
+.SH 説明
+\fBpipe\fP()  はパイプを生成する。 パイプは、プロセス間通信に使用できる単方向のデータチャネルである。 配列 \fIpipefd\fP
+は、パイプの両端を参照する二つのファイルディスクリプターを 返すのに使用される。 \fIpipefd[0]\fP がパイプの読み出し側、
+\fIpipefd[1]\fP がパイプの書き込み側である。 パイプの書き込み側に書き込まれたデータは、
+パイプの読み出し側から読み出されるまでカーネルでバッファーリングされる。 さらなる詳細は \fBpipe\fP(7)  を参照のこと。
+.PP
+\fBpipe2\fP()  は \fIflags\fP が 0 の場合には \fBpipe\fP()  と同じである。 \fIflags\fP に以下の値をビット毎の論理和
+(OR) で指定することで、 異なる動作をさせることができる。
+.TP 
+\fBO_CLOEXEC\fP
+新しく生成される二つのファイルディスクリプターの close\-on\-exec (\fBFD_CLOEXEC\fP)  フラグをセットする。
+このフラグが役に立つ理由については、 \fBopen\fP(2)  の \fBO_CLOEXEC\fP フラグの説明を参照のこと。
+.TP 
+\fBO_DIRECT\fP (Linux 3.4 以降)
+.\" commit 9883035ae7edef3ec62ad215611cb8e17d6a1a5d
+「パケット」モードで入出力を行うパイプを作成する。 このパイプへの \fBwrite\fP(2) それぞれが別のパケットとして扱われ、 このパイプからの
+\fBread\fP(2) では一度に一つパケットが読み出される。 以下の点に注意すること。
+.RS
+.IP * 3
+\fBPIPE_BUF\fP バイト (\fBpipe\fP(7) 参照) より大きいデータを書き込んだ場合、複数のパケットに分割される。
+定数 \fBPIPE_BUF\fP は \fI<limits.h>\fP で定義されている。
+.IP *
+\fBread\fP(2)
+で次のパケットよりも小さなバッファーサイズを指定した場合、要求されたバイト数のデータが読み出され、そのパケットの超過分のバイトは破棄される。
+可能性のある最大サイズのパケットを読み出すには、\fBPIPE_BUF\fP のバッファーサイズを指定すれば十分である (上の項目を参照)。
+.IP *
+長さ 0 のパケットはサポートされていない。 (バッファーサイズ 0 を指定した \fBread\fP(2) は何も行わず 0 を返す)。
+.RE
+.IP
+このフラグをサポートしていない古いカーネルでは、エラー \fBEINVAL\fP が返る。これによりカーネルがサポートしていないことが分かる。
+.IP
+.\" commit 0dbf5f20652108106cb822ad7662c786baaa03ff
+.\" FIXME . But, it is not possible to specify O_DIRECT when opening a FIFO
+Since Linux 4.5, it is possible to change the \fBO_DIRECT\fP setting of a pipe
+file descriptor using \fBfcntl\fP(2).
+.TP 
+\fBO_NONBLOCK\fP
+Set the \fBO_NONBLOCK\fP file status flag on the open file descriptions
+referred to by the new file descriptors.  Using this flag saves extra calls
+to \fBfcntl\fP(2)  to achieve the same result.
+.SH 返り値
+On success, zero is returned.  On error, \-1 is returned, \fIerrno\fP is set
+appropriately, and \fIpipefd\fP is left unchanged.
+.PP
+.\" http://austingroupbugs.net/view.php?id=467
+On Linux (and other systems), \fBpipe\fP()  does not modify \fIpipefd\fP on
+failure.  A requirement standardizing this behavior was added in
+POSIX.1\-2008 TC2.  The Linux\-specific \fBpipe2\fP()  system call likewise does
+not modify \fIpipefd\fP on failure.
+.SH エラー
+.TP 
+\fBEFAULT\fP
+\fIpipefd\fP が無効な値である。
+.TP 
+\fBEINVAL\fP
+(\fBpipe2\fP())  \fIflags\fP に無効な値が入っている。
+.TP 
+\fBEMFILE\fP
+The per\-process limit on the number of open file descriptors has been
+reached.
+.TP 
+\fBENFILE\fP
+オープンされているファイルの総数がシステム全体の制限に達している。
+.TP 
+\fBENFILE\fP
+The user hard limit on memory that can be allocated for pipes has been
+reached and the caller is not privileged; see \fBpipe\fP(7).
+.SH バージョン
+\fBpipe2\fP()  はバージョン 2.6.27 で Linux に追加された。 glibc によるサポートはバージョン 2.9 以降で利用できる。
+.SH 準拠
+\fBpipe\fP(): POSIX.1\-2001, POSIX.1\-2008.
+.PP
+\fBpipe2\fP()  は Linux 固有である。
+.SH 注意
+.\" See http://math-atlas.sourceforge.net/devel/assembly/64.psabi.1.33.ps.Z
+.\" for example, section 3.2.1 "Registers and the Stack Frame".
+The System V ABI on some architectures allows the use of more than one
+register for returning multiple values; several architectures (namely,
+Alpha, IA\-64, MIPS, SuperH, and SPARC/SPARC64)  (ab)use this feature in
+order to implement the \fBpipe\fP()  system call in a functional manner: the
+call doesn't take any arguments and returns a pair of file descriptors as
+the return value on success.  The glibc \fBpipe\fP()  wrapper function
+transparently deals with this.  See \fBsyscall\fP(2)  for information regarding
+registers used for storing second file descriptor.
+.SH 例
+.\" fork.2 refers to this example program.
+The following program creates a pipe, and then \fBfork\fP(2)s to create a child
+process; the child inherits a duplicate set of file descriptors that refer
+to the same pipe.  After the \fBfork\fP(2), each process closes the file
+descriptors that it doesn't need for the pipe (see \fBpipe\fP(7)).  The parent
+then writes the string contained in the program's command\-line argument to
+the pipe, and the child reads this string a byte at a time from the pipe and
+echoes it on standard output.
+.SS プログラムのソース
+.EX
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+int
+main(int argc, char *argv[])
+{
+    int pipefd[2];
+    pid_t cpid;
+    char buf;
+
+    if (argc != 2) {
+        fprintf(stderr, "Usage: %s <string>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    if (pipe(pipefd) == \-1) {
+        perror("pipe");
+        exit(EXIT_FAILURE);
+    }
+
+    cpid = fork();
+    if (cpid == \-1) {
+        perror("fork");
+        exit(EXIT_FAILURE);
+    }
+
+    if (cpid == 0) {    /* 子プロセスがパイプから読み込む */
+        close(pipefd[1]);  /* 使用しない write 側はクローズする */
+
+        while (read(pipefd[0], &buf, 1) > 0)
+            write(STDOUT_FILENO, &buf, 1);
+
+        write(STDOUT_FILENO, "\en", 1);
+        close(pipefd[0]);
+        _exit(EXIT_SUCCESS);
+
+    } else {            /* 親プロセスは argv[1] をパイプへ書き込む */
+        close(pipefd[0]);          /* 使用しない read 側はクローズする */
+        write(pipefd[1], argv[1], strlen(argv[1]));
+        close(pipefd[1]);          /* 読み込み側が EOF に出会う */
+        wait(NULL);                /* 子プロセスを待つ */
+        exit(EXIT_SUCCESS);
+    }
+}
+.EE
+.SH 関連項目
+\fBfork\fP(2), \fBread\fP(2), \fBsocketpair\fP(2), \fBsplice\fP(2), \fBtee\fP(2),
+\fBvmsplice\fP(2), \fBwrite\fP(2), \fBpopen\fP(3), \fBpipe\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man2/read.2 b/manual/LDP_man-pages/draft/man2/read.2
new file mode 100644 (file)
index 0000000..5e34574
--- /dev/null
@@ -0,0 +1,183 @@
+.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
+.\"  and Copyright (C) 1993 Michael Haardt, Ian Jackson.
+.\"  and Copyright (C) 2009-2015 Michael Kerrisk, <mtk.manpages.gmail.com>
+.\"
+.\" %%%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 Sat Jul 24 00:06:00 1993 by Rik Faith <faith@cs.unc.edu>
+.\" Modified Wed Jan 17 16:02:32 1996 by Michael Haardt
+.\"   <michael@cantor.informatik.rwth-aachen.de>
+.\" Modified Thu Apr 11 19:26:35 1996 by Andries Brouwer <aeb@cwi.nl>
+.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
+.\" Modified Fri Jan 31 16:47:33 1997 by Eric S. Raymond <esr@thyrsus.com>
+.\" Modified Sat Jul 12 20:45:39 1997 by Michael Haardt
+.\"   <michael@cantor.informatik.rwth-aachen.de>
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Modified 1997-09-28, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated & Modified 2005-02-24, Yuichi SATO <ysato444@yahoo.co.jp>
+.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-10-14, Akihiro MOTOKI
+.\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77
+.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH READ 2 2018\-02\-02 Linux "Linux Programmer's Manual"
+.SH 名前
+read \- ファイルディスクリプターから読み込む
+.SH 書式
+.nf
+\fB#include <unistd.h>\fP
+.PP
+\fBssize_t read(int \fP\fIfd\fP\fB, void *\fP\fIbuf\fP\fB, size_t \fP\fIcount\fP\fB);\fP
+.fi
+.SH 説明
+\fBread\fP()  はファイルディスクリプター (file descriptor)  \fIfd\fP から最大 \fIcount\fP バイトを \fIbuf\fP
+で始まるバッファーへ読み込もうとする。
+.PP
+On files that support seeking, the read operation commences at the file
+offset, and the file offset is incremented by the number of bytes read.  If
+the file offset is at or past the end of file, no bytes are read, and
+\fBread\fP()  returns zero.
+.PP
+\fIcount\fP が 0 の場合、 \fBread\fP() は以下で説明するエラーを検出する\fI場合がある\fP。 どのエラーもなかった場合、もしくは
+\fBread\fP() がエラーのチェックを行わない場合、 \fIcount\fP が 0 で呼び出された \fBread\fP() は 0 を返し、何も行わない。
+.PP
+According to POSIX.1, if \fIcount\fP is greater than \fBSSIZE_MAX\fP, the result
+is implementation\-defined; see NOTES for the upper limit on Linux.
+.SH 返り値
+On success, the number of bytes read is returned (zero indicates end of
+file), and the file position is advanced by this number.  It is not an error
+if this number is smaller than the number of bytes requested; this may
+happen for example because fewer bytes are actually available right now
+(maybe because we were close to end\-of\-file, or because we are reading from
+a pipe, or from a terminal), or because \fBread\fP()  was interrupted by a
+signal.  See also NOTES.
+.PP
+On error, \-1 is returned, and \fIerrno\fP is set appropriately.  In this case,
+it is left unspecified whether the file position (if any) changes.
+.SH エラー
+.TP 
+\fBEAGAIN\fP
+The file descriptor \fIfd\fP refers to a file other than a socket and has been
+marked nonblocking (\fBO_NONBLOCK\fP), and the read would block.  See
+\fBopen\fP(2)  for further details on the \fBO_NONBLOCK\fP flag.
+.TP 
+\fBEAGAIN\fP または \fBEWOULDBLOCK\fP
+.\" Actually EAGAIN on Linux
+ファイルディスクリプター \fIfd\fP がソケットを参照していて、非停止 (nonblocking) モード (\fBO_NONBLOCK\fP)
+に設定されており、読み込みを行うと停止する状況にある。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2
+つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なファイルディスクリプターでないか、読み込みのために オープン (open) されていない。
+.TP 
+\fBEFAULT\fP
+\fIbuf\fP がアクセス可能なアドレス空間の外にある。
+.TP 
+\fBEINTR\fP
+何のデータも読み込まないうちにシグナルに割り込まれた。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEINVAL\fP
+\fIfd\fP is attached to an object which is unsuitable for reading; or the file
+was opened with the \fBO_DIRECT\fP flag, and either the address specified in
+\fIbuf\fP, the value specified in \fIcount\fP, or the file offset is not suitably
+aligned.
+.TP 
+\fBEINVAL\fP
+\fIfd\fP が \fBtimerfd_create\fP(2)  の呼び出しで作成されたが、 \fBread\fP()  に間違ったサイズのバッファーが渡された。
+さらなる情報は \fBtimerfd_create\fP(2)  を参照のこと。
+.TP 
+\fBEIO\fP
+I/O error.  This will happen for example when the process is in a background
+process group, tries to read from its controlling terminal, and either it is
+ignoring or blocking \fBSIGTTIN\fP or its process group is orphaned.  It may
+also occur when there is a low\-level I/O error while reading from a disk or
+tape.  A further possible cause of \fBEIO\fP on networked filesystems is when
+an advisory lock had been taken out on the file descriptor and this lock has
+been lost.  See the \fILost locks\fP section of \fBfcntl\fP(2)  for further
+details.
+.TP 
+\fBEISDIR\fP
+\fIfd\fP がディレクトリを参照している。
+.PP
+\fIfd\fP に接続されたオブジェクトによっては、他のエラーが起こるかもしれない。
+.SH 準拠
+SVr4, 4.3BSD, POSIX.1\-2001.
+.SH 注意
+The types \fIsize_t\fP and \fIssize_t\fP are, respectively, unsigned and signed
+integer data types specified by POSIX.1.
+.PP
+.\" commit e28cc71572da38a5a12c1cfe4d7032017adccf69
+On Linux, \fBread\fP()  (and similar system calls) will transfer at most
+0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually
+transferred.  (This is true on both 32\-bit and 64\-bit systems.)
+.PP
+On NFS filesystems, reading small amounts of data will update the timestamp
+only the first time, subsequent calls may not do so.  This is caused by
+client side attribute caching, because most if not all NFS clients leave
+\fIst_atime\fP (last file access time)  updates to the server, and client side
+reads satisfied from the client's cache will not cause \fIst_atime\fP updates
+on the server as there are no server\-side reads.  UNIX semantics can be
+obtained by disabling client\-side attribute caching, but in most situations
+this will substantially increase server load and decrease performance.
+.SH バグ
+POSIX.1\-2008/SUSv4 セクション XSI 2.9.7 ("Thread Interactions with Regular File
+Operations") によると、
+.PP
+.RS 4
+以下のすべての関数では、 通常ファイルもしくはシンボリックリンクに対する操作では POSIX.1\-2008
+で規定された効果が互いにアトミックに行われなければならない: ...
+.RE
+.PP
+.\" http://thread.gmane.org/gmane.linux.kernel/1649458
+.\"    From: Michael Kerrisk (man-pages <mtk.manpages <at> gmail.com>
+.\"    Subject: Update of file offset on write() etc. is non-atomic with I/O
+.\"    Date: 2014-02-17 15:41:37 GMT
+.\"    Newsgroups: gmane.linux.kernel, gmane.linux.file-systems
+.\" commit 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4
+.\"    Author: Linus Torvalds <torvalds@linux-foundation.org>
+.\"    Date:   Mon Mar 3 09:36:58 2014 -0800
+.\"
+.\"        vfs: atomic f_pos accesses as per POSIX
+この後に書かれている API の中に \fBread\fP() と \fBreadv\fP(2) である。 スレッド(やプロセス)
+間でアトミックに適用することが求められる効果の一つとして、 ファイルオフセットの更新がある。 しかしながら、 バージョン 3.14 より前の Linux
+では、 この限りではない。 オープンファイル記述 (open file description) を共有する 2 つのプロセスが同時に
+\fBread\fP() (や \fBreadv\fP(2)) を実行した場合、 この I/O 操作ではファイルオフセットの更新に関してはアトミックではなく、 2
+つのプロセスの read で取得されるデータブロックが (間違って) 重なる可能性がある。 この問題は Linux 3.14 で修正された。
+.SH 関連項目
+\fBclose\fP(2), \fBfcntl\fP(2), \fBioctl\fP(2), \fBlseek\fP(2), \fBopen\fP(2), \fBpread\fP(2),
+\fBreaddir\fP(2), \fBreadlink\fP(2), \fBreadv\fP(2), \fBselect\fP(2), \fBwrite\fP(2),
+\fBfread\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man2/reboot.2 b/manual/LDP_man-pages/draft/man2/reboot.2
new file mode 100644 (file)
index 0000000..4c43483
--- /dev/null
@@ -0,0 +1,166 @@
+.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998
+.\"
+.\" %%%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, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
+.\"     Added notes on capability requirements
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 Ueyama Rui
+.\"         all rights reserved.
+.\" Translated Mon Sep 29 23:21:04 JST 1997
+.\"         by Ueyama Rui <rui@campus.ne.jp>
+.\" Updated & Modified Mon Mar 1 1999
+.\"         by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Updated Sat Oct 11 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH REBOOT 2 2019\-03\-06 Linux "Linux Programmer's Manual"
+.SH 名前
+reboot \- 再起動する。または Ctrl\-Alt\-Delを有効・無効にする
+.SH 書式
+/* カーネル 2.1.30 以降では、定数としてシンボリックな名前
+   LINUX_REBOOT_* が定義されており、呼び出しの第 4 引数として
+   指定することができる。*/
+.PP
+\fB#include <unistd.h>\fP
+.br
+\fB#include <linux/reboot.h>\fP
+.PP
+\fBint reboot(int \fP\fImagic\fP\fB, int \fP\fImagic2\fP\fB, int \fP\fIcmd\fP\fB, void
+*\fP\fIarg\fP\fB);\fP
+
+/* Under glibc and most alternative libc's (including uclibc, dietlibc,
+   musl and a few others), some of the constants involved have gotten
+   symbolic names RB_*, and the library call is a 1\-argument
+   wrapper around the system call: */
+.PP
+\fB#include <unistd.h>\fP
+.br
+\fB#include <sys/reboot.h>\fP
+.PP
+\fBint reboot(int \fP\fIcmd\fP\fB);\fP
+.SH 説明
+\fBreboot\fP()  はシステムを再起動する。または再起動のキーストロークである Ctrl\-Alt\-Delete (CAD) を有効/無効にする。
+このキーストロークは \fBloadkeys\fP(1)  によって変更できる。
+.PP
+\fImagic\fP が \fBLINUX_REBOOT_MAGIC1\fP (値は 0xfee1dead) であり、かつ \fImagic2\fP が
+\fBLINUX_REBOOT_MAGIC2\fP (672274793) でなければ、このシステムコールは (エラー \fBEINVAL\fP で) 失敗する。
+しかし 2.1.17 からは \fBLINUX_REBOOT_MAGIC2A\fP (85072278) が、 また 2.1.97 からは
+\fBLINUX_REBOOT_MAGIC2B\fP (369367448) が、 2.5.71 からは \fBLINUX_REBOOT_MAGIC2C\fP
+(537993216) が \fImagic2\fP の値として指定できるようになった (これらの定数の 16 進での 表記にはちょっとした意味がある)。
+.PP
+\fIcmd\fP 引数には以下の値を指定できる。
+.TP 
+\fBLINUX_REBOOT_CMD_CAD_OFF\fP
+(\fBRB_DISABLE_CAD\fP, 0)  CAD を無効にする。 これ以降に CAD キーストロークが入力されると、 \fBSIGINT\fP
+シグナルが init (プロセス 1) に送られる。 このシグナルを受けると、おそらく init プロセスは 前もって定められた動作を行うことになる
+(多分すべてのプロセスの kill, sync, 再起動)。
+.TP 
+\fBLINUX_REBOOT_CMD_CAD_ON\fP
+(\fBRB_ENABLE_CAD\fP, 0x89abcdef)  CAD を有効にする。 これ以降に CAD キーストロークが入力されると、 ただちに
+\fBLINUX_REBOOT_CMD_RESTART\fP に関連付けられた動作が行われるようになる。
+.TP 
+\fBLINUX_REBOOT_CMD_HALT\fP
+(\fBRB_HALT_SYSTEM\fP, 0xcdef0123; Linux 1.1.76 以降)  "System halted."
+というメッセージが表示され、システムは停止 (halt) する。 制御は ROM モニタに移る (ROM モニタがある場合)。 先に
+\fBsync\fP(2)  を行なわないと、データが失われる。
+.TP 
+\fBLINUX_REBOOT_CMD_KEXEC\fP
+(\fBRB_KEXEC\fP, 0x45584543, Linux 2.6.13 以降) \fBkexec_load\fP(2)
+を使って事前にロードされたカーネルを実行する。このオプションが利用できるのは、カーネルのコンフィグで \fBCONFIG_KEXEC\fP
+が有効になっている場合にのみである。
+.TP 
+\fBLINUX_REBOOT_CMD_POWER_OFF\fP
+(\fBRB_POWER_OFF\fP, 0x4321fedc; Linux 2.1.30 以降)  "Power down"
+というメッセージが表示され、システムは停止 (stop) する。 可能な場合はシステムの電源が落とされる。 先に \fBsync\fP(2)
+を行なわないと、データが失われる。
+.TP 
+\fBLINUX_REBOOT_CMD_RESTART\fP
+(\fBRB_AUTOBOOT\fP, 0x1234567)  "Restarting system." というメッセージが表示され、
+デフォルトの再起動処理がただちに実行される。 先に \fBsync\fP(2)  を行なわないと、データが失われる。
+.TP 
+\fBLINUX_REBOOT_CMD_RESTART2\fP
+(0xa1b2c3d4; Linux 2.1.30 以降)  "Restarting system with command \(aq%s\(aq"
+というメッセージが表示され、 ただちに ( \fIarg\fP に指定されたコマンドを用いて) 再起動 (restart) が行われる。 先に
+\fBsync\fP(2)  を行なわないと、データが失われる。
+.TP 
+\fBLINUX_REBOOT_CMD_SW_SUSPEND\fP
+(\fBRB_SW_SUSPEND\fP, 0xd000fce1; Linux 2.5.18 以降). システムがディスクにサスペンド (ハイバネーション)
+される。このオプションはカーネルで \fBCONFIG_HIBERNATION\fP が有効になっている場合にのみ利用できる。
+.PP
+スーパーユーザーだけが \fBreboot\fP()  を呼び出すことができる。
+.PP
+.\"
+上述のアクションの実際の効果はアーキテクチャーに依存する。 i386 アーキテクチャーでは、現在のところ (2.1.122) 付加引数は
+何も行わないが、再起動のタイプをカーネルのコマンドライン引数 ("reboot=...") によって定めることができる。 これには warm または
+cold と、 hard または BIOS 経由の再起動を 設定できる。
+.SS "PID 名前空間内での動作"
+.\" commit cf3f89214ef6a33fad60856bc5ffd7bb2fc4709b
+.\" see also commit 923c7538236564c46ee80c253a416705321f13e3
+Since Linux 3.4, if \fBreboot\fP()  is called from a PID namespace other than
+the initial PID namespace with one of the \fIcmd\fP values listed below, it
+performs a "reboot" of that namespace: the "init" process of the PID
+namespace is immediately terminated, with the effects described in
+\fBpid_namespaces\fP(7).
+.PP
+The values that can be supplied in \fIcmd\fP when calling \fBreboot\fP()  in this
+case are as follows:
+.TP 
+\fBLINUX_REBOOT_CMD_RESTART\fP, \fBLINUX_REBOOT_CMD_RESTART2\fP
+The "init" process is terminated, and \fBwait\fP(2)  in the parent process
+reports that the child was killed with a \fBSIGHUP\fP signal.
+.TP 
+\fBLINUX_REBOOT_CMD_POWER_OFF\fP, \fBLINUX_REBOOT_CMD_HALT\fP
+The "init" process is terminated, and \fBwait\fP(2)  in the parent process
+reports that the child was killed with a \fBSIGINT\fP signal.
+.PP
+For the other \fIcmd\fP values, \fBreboot\fP()  returns \-1 and \fIerrno\fP is set to
+\fBEINVAL\fP.
+.SH 返り値
+\fIcmd\fP がシステムの停止や再起動を表す値の場合、呼び出しが成功すると \fBreboot\fP()  は返らない。 \fIcmd\fP
+が他の値の場合には、成功すると 0 が返る。 \fIcmd\fP の値に関わらず、失敗の場合には \-1 が返り、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEFAULT\fP
+\fBLINUX_REBOOT_CMD_RESTART2\fP の時にユーザースペースのデータの取得に問題があった。
+.TP 
+\fBEINVAL\fP
+magic の数字か \fIcmd\fP が間違っている。
+.TP 
+\fBEPERM\fP
+The calling process has insufficient privilege to call \fBreboot\fP(); the
+caller must have the \fBCAP_SYS_BOOT\fP inside its user namespace.
+.SH 準拠
+\fBreboot\fP()  は Linux に特有であり、移植を考慮したプログラムでは用いるべきではない。
+.SH 関連項目
+\fBsystemctl\fP(1), \fBsystemd\fP(1), \fBkexec_load\fP(2), \fBsync\fP(2),
+\fBbootparam\fP(7), \fBcapabilities\fP(7), \fBctrlaltdel\fP(8), \fBhalt\fP(8),
+\fBshutdown\fP(8)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man2/sync.2 b/manual/LDP_man-pages/draft/man2/sync.2
new file mode 100644 (file)
index 0000000..7e6a219
--- /dev/null
@@ -0,0 +1,141 @@
+.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
+.\" and Copyright (c) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%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 <michael@moria.de>
+.\" Modified Sat Jul 24 12:02:47 1993 by Rik Faith <faith@cs.unc.edu>
+.\" Modified 15 Apr 1995 by Michael Chastain <mec@shell.portal.com>:
+.\"   Added reference to `bdflush(2)'.
+.\" Modified 960414 by Andries Brouwer <aeb@cwi.nl>:
+.\"   Added the fact that since 1.3.20 sync actually waits.
+.\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond <esr@thyrsus.com>
+.\" Modified 2001-10-10 by aeb, following Michael Kerrisk.
+.\" 2011-09-07, mtk, Added syncfs() documentation,
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 Daisuke Sato
+.\"         all rights reserved.
+.\" Translated Sat Apr 19 15:22:53 JST 1997
+.\"         by Daisuke Sato
+.\" Modified Sun Mar 21 17:23:38 JST 1999
+.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated Tue Oct 16 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Mon Sep  8 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH SYNC 2 2020\-08\-13 Linux "Linux Programmer's Manual"
+.SH 名前
+sync, syncfs \- ファイルシステムキャッシュをディスクに書き込む
+.SH 書式
+\fB#include <unistd.h>\fP
+.PP
+\fBvoid sync(void);\fP
+.PP
+\fBint syncfs(int \fP\fIfd\fP\fB);\fP
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBsync\fP():
+.ad l
+.RS 4
+.\"    || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+_XOPEN_SOURCE\ >=\ 500
+    || /* Since glibc 2.19: */ _DEFAULT_SOURCE
+    || /* Glibc versions <= 2.19: */ _BSD_SOURCE
+.RE
+.ad
+.PP
+\fBsyncfs\fP():
+.ad l
+.RS 4
+_GNU_SOURCE
+.RE
+.ad
+.SH 説明
+\fBsync\fP()  causes all pending modifications to filesystem metadata and
+cached file data to be written to the underlying filesystems.
+.PP
+\fBsyncfs\fP() は \fBsync\fP() と同様だが、オープンされたファイルディスクリプター \fIfd\fP
+が参照するファイルを含むファイルシステムだけを同期する点が異なる。
+.SH 返り値
+\fBsyncfs\fP() は成功すると 0 を返す。エラーが発生した場合は \-1 を返し、
+\fIerrno\fP にエラーを示す値を設定する。
+.SH エラー
+\fBsync\fP() は常に成功する。
+.PP
+\fBsyncfs\fP() は少なくとも以下の理由で失敗する可能性がある:
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なファイルディスクリプターでない。。
+.TP 
+\fBEIO\fP
+An error occurred during synchronization.  This error may relate to data
+written to any file on the filesystem, or on metadata related to the
+filesystem itself.
+.TP 
+\fBENOSPC\fP
+Disk space was exhausted while synchronizing.
+.TP 
+\fBENOSPC\fP, \fBEDQUOT\fP
+Data was written to a files on NFS or another filesystem which does not
+allocate space at the time of a \fBwrite\fP(2)  system call, and some previous
+write failed due to insufficient storage space.
+.SH バージョン
+\fBsyncfs\fP() は Linux 2.6.39 で初めて登場した。
+ライブラリによるサポートは glibc バージョン 2.14 で追加された。
+.SH 準拠
+\fBsync\fP(): POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD.
+.PP
+\fBsyncfs\fP() is Linux 固有である。
+.SH 注意
+Linux での \fBsync\fP() のプロトタイプは、さまざまな標準規格での規定に準拠し、
+glibc 2.2.2 から上述のようになった。
+glibc 2.2.1 以前ではプロトタイプは "int sync(void)" で、
+\fBsync\fP()  は常に 0 を返していた。
+.PP
+According to the standard specification (e.g., POSIX.1\-2001), \fBsync\fP()
+schedules the writes, but may return before the actual writing is done.
+However Linux waits for I/O completions, and thus \fBsync\fP()  or \fBsyncfs\fP()
+provide the same guarantees as \fBfsync\fP()  called on every file in the
+system or filesystem respectively.
+.PP
+.\" commit 735e4ae5ba28c886d249ad04d3c8cc097dad6336
+In mainline kernel versions prior to 5.8, \fBsyncfs\fP()  will fail only when
+passed a bad file descriptor (\fBEBADF\fP).  Since Linux 5.8, \fBsyncfs\fP()  will
+also report an error if one or more inodes failed to be written back since
+the last \fBsyncfs\fP()  call.
+.SH バグ
+Before version 1.3.20 Linux did not wait for I/O to complete before
+returning.
+.SH 関連項目
+\fBsync\fP(1), \fBfdatasync\fP(2), \fBfsync\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man2/write.2 b/manual/LDP_man-pages/draft/man2/write.2
new file mode 100644 (file)
index 0000000..42129b3
--- /dev/null
@@ -0,0 +1,225 @@
+.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
+.\"             and Copyright (C) 1993 Michael Haardt, Ian Jackson.
+.\" and Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%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 Sat Jul 24 13:35:59 1993 by Rik Faith <faith@cs.unc.edu>
+.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith <faith@cs.unc.edu>
+.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt
+.\"   <michael@cantor.informatik.rwth-aachen.de>
+.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
+.\" 2001-12-13 added remark by Zack Weinberg
+.\" 2007-06-18 mtk:
+.\"            Added details about seekable files and file offset.
+.\"    Noted that write() may write less than 'count' bytes, and
+.\"    gave some examples of why this might occur.
+.\"    Noted what happens if write() is interrupted by a signal.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated Tue Mar  4 00:18:20 JST 1997
+.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated & Modified Wed Jun 13 20:57:55 JST 2001
+.\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
+.\" Updated Mon Jun 25 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-10-14 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46
+.\" Updated 2007-09-01, Akihiro MOTOKI, LDP v2.64
+.\" Updated 2008-04-13, Akihiro MOTOKI, LDP v3.20
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-04, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH WRITE 2 2019\-10\-10 Linux "Linux Programmer's Manual"
+.SH 名前
+write \- ファイルディスクリプター (file descriptor) に書き込む
+.SH 書式
+\fB#include <unistd.h>\fP
+.PP
+\fBssize_t write(int \fP\fIfd\fP\fB, const void *\fP\fIbuf\fP\fB, size_t \fP\fIcount\fP\fB);\fP
+.SH 説明
+\fBwrite\fP()  writes up to \fIcount\fP bytes from the buffer starting at \fIbuf\fP
+to the file referred to by the file descriptor \fIfd\fP.
+.PP
+書き込まれるバイト数は \fIcount\fP よりも小さくなることがある。 例えば、書き込み対象の物理メディアに十分な領域がない場合、 リソース上限
+\fBRLIMIT_FSIZE\fP に達した場合 (\fBsetrlimit\fP(2)  参照)、 \fIcount\fP バイト未満の書き込みが行われた後で
+呼び出しがシグナルハンドラーにより割り込まれた場合、 などである。 (\fBpipe\fP(7)  も参照のこと。)
+.PP
+seek 可能なファイル (つまり \fBlseek\fP(2)  が適用できるファイル、例えば通常のファイル) では、
+書き込みはファイルオフセットから行われ、 ファイルオフセットは実際に書き込みが行われたバイト数分 加算される。ファイルが \fBO_APPEND\fP で
+\fBopen\fP(2)  された場合、ファイルオフセットは書き込み前に ファイルの末尾に設定される。
+ファイルオフセットの調整と書き込み操作はアトミックな処理として 実行される。
+.PP
+POSIX は \fBwrite\fP()  が行なわれた後に実行した \fBread\fP(2)  が 新しいデータを返すことを要求している。
+全てのファイルシステムが POSIX 準拠ではない点に注意すること。
+.PP
+According to POSIX.1, if \fIcount\fP is greater than \fBSSIZE_MAX\fP, the result
+is implementation\-defined; see NOTES for the upper limit on Linux.
+.SH 返り値
+On success, the number of bytes written is returned.  On error, \-1 is
+returned, and \fIerrno\fP is set to indicate the cause of the error.
+.PP
+Note that a successful \fBwrite\fP()  may transfer fewer than \fIcount\fP bytes.
+Such partial writes can occur for various reasons; for example, because
+there was insufficient space on the disk device to write all of the
+requested bytes, or because a blocked \fBwrite\fP()  to a socket, pipe, or
+similar was interrupted by a signal handler after it had transferred some,
+but before it had transferred all of the requested bytes.  In the event of a
+partial write, the caller can make another \fBwrite\fP()  call to transfer the
+remaining bytes.  The subsequent call will either transfer further bytes or
+may result in an error (e.g., if the disk is now full).
+.PP
+If \fIcount\fP is zero and \fIfd\fP refers to a regular file, then \fBwrite\fP()  may
+return a failure status if one of the errors below is detected.  If no
+errors are detected, or error detection is not performed, 0 will be returned
+without causing any other effect.  If \fIcount\fP is zero and \fIfd\fP refers to a
+file other than a regular file, the results are not specified.
+.SH エラー
+.TP 
+\fBEAGAIN\fP
+The file descriptor \fIfd\fP refers to a file other than a socket and has been
+marked nonblocking (\fBO_NONBLOCK\fP), and the write would block.  See
+\fBopen\fP(2)  for further details on the \fBO_NONBLOCK\fP flag.
+.TP 
+\fBEAGAIN\fP または \fBEWOULDBLOCK\fP
+.\" Actually EAGAIN on Linux
+ファイルディスクリプター \fIfd\fP がソケットを参照していて、非停止 (nonblocking) モード (\fBO_NONBLOCK\fP)
+に設定されており、書き込みを行うと停止する状況にある。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2
+つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なファイルディスクリプターでないか書き込みのためにオープン (open) されていない。
+.TP 
+\fBEDESTADDRREQ\fP
+\fIfd\fP が、 \fBconnect\fP(2)  を使って通信相手のアドレスが設定されていないデータグラムソケットを 参照している。
+.TP 
+\fBEDQUOT\fP
+\fIfd\fP が参照するファイルを含むファイルシステムのディスクブロックのユーザークォータの上限に達している。
+.TP 
+\fBEFAULT\fP
+\fIbuf\fP がアクセス可能なアドレス空間の外にある。
+.TP 
+\fBEFBIG\fP
+実装定義の最大ファイルサイズまたはプロセスのファイルサイズ制限を 超えてファイルに書き込もうとした。
+または許可されたオフセット値の限界を超えた先の位置に 書き込もうとした。
+.TP 
+\fBEINTR\fP
+何のデータも書かない間にシグナルにより割り込まれた (interrupt)。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEINVAL\fP
+\fIfd\fP が書き込みが不適切なオブジェクトを参照している。 もしくは、ファイルが \fBO_DIRECT\fP フラグを指定してオープンされているが、
+\fIbuf\fP に指定されたアドレス、 \fIcount\fP に指定された値、 ファイルオフセットのいずれかのアラインメントが不適切である。
+.TP 
+\fBEIO\fP
+.\" commit 088737f44bbf6378745f5b57b035e57ee3dc4750
+A low\-level I/O error occurred while modifying the inode.  This error may
+relate to the write\-back of data written by an earlier \fBwrite\fP(), which may
+have been issued to a different file descriptor on the same file.  Since
+Linux 4.13, errors from write\-back come with a promise that they \fImay\fP be
+reported by subsequent.  \fBwrite\fP()  requests, and \fIwill\fP be reported by a
+subsequent \fBfsync\fP(2)  (whether or not they were also reported by
+\fBwrite\fP()).  An alternate cause of \fBEIO\fP on networked filesystems is when
+an advisory lock had been taken out on the file descriptor and this lock has
+been lost.  See the \fILost locks\fP section of \fBfcntl\fP(2)  for further
+details.
+.TP 
+\fBENOSPC\fP
+\fIfd\fP によって参照されるファイルを含むデバイス (device) に十分な空きがない。
+.TP 
+\fBEPERM\fP
+操作が file seal により禁止されている。 \fBfcntl\fP(2)  参照。
+.TP 
+\fBEPIPE\fP
+\fIfd\fP がパイプ (pipe) かソケット (socket) に接続されており、 その反対側 (読み込み側) がクローズ (close)
+されている。 これが発生した場合には、書き込みを行なうプロセスは \fBSIGPIPE\fP シグナル (signal)も受ける。
+(したがって、プログラムがこのシグナルを捕獲 (catch)、停止 (block)、無視 (ignore)  した場合のみ、write
+の返り値を参照できる。)
+.PP
+\fIfd\fP に接続されたオブジェクトによっては、他のエラーが起こるかもしれない。
+.SH 準拠
+.\" SVr4 documents additional error
+.\" conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
+SVr4, 4.3BSD, POSIX.1\-2001.
+.PP
+SVr4 では write が割り込まれると、データが書き込まれる直前ではなく、 その時点で \fBEINTR\fP が返る。
+.SH 注意
+The types \fIsize_t\fP and \fIssize_t\fP are, respectively, unsigned and signed
+integer data types specified by POSIX.1.
+.PP
+A successful return from \fBwrite\fP()  does not make any guarantee that data
+has been committed to disk.  On some filesystems, including NFS, it does not
+even guarantee that space has successfully been reserved for the data.  In
+this case, some errors might be delayed until a future \fBwrite\fP(),
+\fBfsync\fP(2), or even \fBclose\fP(2).  The only way to be sure is to call
+\fBfsync\fP(2)  after you are done writing all your data.
+.PP
+\fBwrite\fP()  が 1 バイトも書き込まないうちにシグナルハンドラーにより割り込まれた場合、 \fBwrite\fP()  はエラー \fBEINTR\fP
+で失敗する。 1バイトでも書き込んだ後で割り込まれた場合には、 \fBwrite\fP()  は成功し、書き込んだバイト数を返す。
+.PP
+.\" commit e28cc71572da38a5a12c1cfe4d7032017adccf69
+On Linux, \fBwrite\fP()  (and similar system calls) will transfer at most
+0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually
+transferred.  (This is true on both 32\-bit and 64\-bit systems.)
+.PP
+An error return value while performing \fBwrite\fP()  using direct I/O does not
+mean the entire write has failed. Partial data may be written and the data
+at the file offset on which the \fBwrite\fP()  was attempted should be
+considered inconsistent.
+.SH バグ
+POSIX.1\-2008/SUSv4 セクション XSI 2.9.7 ("Thread Interactions with Regular File
+Operations") によると、
+.PP
+.RS 4
+以下のすべての関数では、 通常ファイルもしくはシンボリックリンクに対する操作では POSIX.1\-2008
+で規定された効果が互いにアトミックに行われなければならない: ...
+.RE
+.PP
+.\" http://thread.gmane.org/gmane.linux.kernel/1649458
+.\"    From: Michael Kerrisk (man-pages <mtk.manpages <at> gmail.com>
+.\"    Subject: Update of file offset on write() etc. is non-atomic with I/O
+.\"    Date: 2014-02-17 15:41:37 GMT
+.\"    Newsgroups: gmane.linux.kernel, gmane.linux.file-systems
+.\" commit 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4
+.\"    Author: Linus Torvalds <torvalds@linux-foundation.org>
+.\"    Date:   Mon Mar 3 09:36:58 2014 -0800
+.\"
+.\"        vfs: atomic f_pos accesses as per POSIX
+この後に書かれている API の中に \fBwrite\fP() と \fBwritev\fP(2) である。 スレッド(やプロセス)
+間でアトミックに適用することが求められる効果の一つとして、 ファイルオフセットの更新がある。 しかしながら、 バージョン 3.14 より前の Linux
+では、 この限りではない。 オープンファイル記述 (open file description) を共有する 2 つのプロセスが同時に
+\fBwrite\fP() (や \fBwritev\fP(2)) を実行した場合、 この I/O 操作ではファイルオフセットの更新に関してはアトミックではなく、
+2 つのプロセスから出力されるデータブロックが (間違って) 重なる可能性がある。 この問題は Linux 3.14 で修正された。
+.SH 関連項目
+\fBclose\fP(2), \fBfcntl\fP(2), \fBfsync\fP(2), \fBioctl\fP(2), \fBlseek\fP(2), \fBopen\fP(2),
+\fBpwrite\fP(2), \fBread\fP(2), \fBselect\fP(2), \fBwritev\fP(2), \fBfwrite\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/asprintf.3 b/manual/LDP_man-pages/draft/man3/asprintf.3
new file mode 100644 (file)
index 0000000..64bff7f
--- /dev/null
@@ -0,0 +1,76 @@
+.\" Copyright (C) 2001 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
+.\"
+.\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
+.\" Translated Mon 14 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH ASPRINTF 3 2019\-03\-06 GNU "Linux Programmer's Manual"
+.SH 名前
+asprintf, vasprintf \- 文字列を割り当ててそれに出力する
+.SH 書式
+\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
+.br
+\fB#include <stdio.h>\fP
+.PP
+\fBint asprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, ...);\fP
+.PP
+\fBint vasprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, va_list
+\fP\fIap\fP\fB);\fP
+.SH 説明
+\fBasprintf\fP()  関数と \fBvasprintf\fP()  関数とは、それぞれ \fBsprintf\fP(3)  関数と
+\fBvsprintf\fP(3)  関数とに似ているが、 出力文字列を (終端のヌルバイト (\(aq\e0\(aq) も含めて)
+保持するのに十分な大きさのメモリーを確保し、 最初の引数にその文字列へのポインターを返す。 このポインターは、不要になったら \fBfree\fP(3)
+に渡し、割り当てられた記憶領域を解放すべきである。
+.SH 返り値
+成功すると、これらの関数は出力されたバイト数を (\fBsprintf\fP(3)  のように) 返す。 メモリーの割り当てができなかったり、
+その他エラーが生じると、 これらの関数は \-1 を返し、 \fIstrp\fP の内容は未定義となる。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw23 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBasprintf\fP(),
+\fBvasprintf\fP()
+T}     Thread safety   MT\-Safe locale
+.TE
+.sp 1
+.SH 準拠
+これらの関数は GNU の拡張であり、C や POSIX のものではない。 これらは *BSD でも利用できる。 FreeBSD
+の実装では、エラーの際には \fIstrp\fP を NULL にセットする。
+.SH 関連項目
+\fBfree\fP(3), \fBmalloc\fP(3), \fBprintf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/cabs.3 b/manual/LDP_man-pages/draft/man3/cabs.3
new file mode 100644 (file)
index 0000000..3aa4d6b
--- /dev/null
@@ -0,0 +1,56 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Wed Jul 23 05:04:09 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CABS 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+cabs, cabsf, cabsl \- 複素数の絶対値
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble cabs(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat cabsf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double cabsl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の絶対値を返す。 結果は実数である。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcabs\fP(),
+\fBcabsf\fP(),
+\fBcabsl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 注意
+実際には、この関数は \fIhypot(a,\ b)\fP (\fIsqrt(a*a\ +\ b*b)\fP と等価) へのエイリアスになっている。
+.SH 関連項目
+\fBabs\fP(3), \fBcimag\fP(3), \fBhypot\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/cacos.3 b/manual/LDP_man-pages/draft/man3/cacos.3
new file mode 100644 (file)
index 0000000..bf84083
--- /dev/null
@@ -0,0 +1,94 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Wed Jul 23 05:24:21 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CACOS 3 2020\-06\-09 "" "Linux Programmer's Manual"
+.SH 名前
+cacos, cacosf, cacosl \- 複素数の逆余弦 (arc cosine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex cacos(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex cacosf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex cacosl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆余弦 (arc cosine) を計算する。 \fIy\ =\ cacos(z)\fP ならば、 \fIz\ =\ ccos(y)\fP が成立する。 \fIy\fP の実部の値は区間 [0,pi] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    cacos(z) = \-i * clog(z + i * csqrt(1 \- z * z))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw28 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcacos\fP(),
+\fBcacosf\fP(),
+\fBcacosl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 例
+.EX
+/* "\-lm" でリンクする */
+
+#include <complex.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+    double complex z, c, f;
+    double complex i = I;
+
+    if (argc != 3) {
+        fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    z = atof(argv[1]) + atof(argv[2]) * I;
+
+    c = cacos(z);
+
+    printf("cacos() = %6.3f %6.3f*i\en", creal(c), cimag(c));
+
+    f = \-i * clog(z + i * csqrt(1 \- z * z));
+
+    printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
+
+    exit(EXIT_SUCCESS);
+}
+.EE
+.SH 関連項目
+\fBccos\fP(3), \fBclog\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/cacosh.3 b/manual/LDP_man-pages/draft/man3/cacosh.3
new file mode 100644 (file)
index 0000000..8200d86
--- /dev/null
@@ -0,0 +1,93 @@
+.\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
+.\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:26:52 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CACOSH 3 2020\-06\-09 "" "Linux Programmer's Manual"
+.SH 名前
+cacosh, cacoshf, cacoshl \- 複素数の逆双曲線余弦 (arc hyperbolic cosine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex cacosh(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex cacoshf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex cacoshl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆双曲線余弦 (arc hyperbolic cosine) を計算する。 \fIy\ =\ cacosh(z)\fP
+ならば、 \fIz\ =\ ccosh(y)\fP が成立する。 \fIy\fP の虚部の値は区間 [\-pi,pi] から選択され、 \fIy\fP
+の実部の値は非負の値が選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw30 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcacosh\fP(),
+\fBcacoshf\fP(),
+\fBcacoshl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 例
+.EX
+/* "\-lm" でリンクする */
+
+#include <complex.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+    double complex z, c, f;
+
+    if (argc != 3) {
+        fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    z = atof(argv[1]) + atof(argv[2]) * I;
+
+    c = cacosh(z);
+    printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
+
+    f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
+    printf("formula  = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
+
+    exit(EXIT_SUCCESS);
+}
+.EE
+.SH 関連項目
+\fBacosh\fP(3), \fBcabs\fP(3), \fBccosh\fP(3), \fBcimag\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/carg.3 b/manual/LDP_man-pages/draft/man3/carg.3
new file mode 100644 (file)
index 0000000..92dbcf5
--- /dev/null
@@ -0,0 +1,79 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-07-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-10-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CARG 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+carg, cargf, cargl \- 複素数の偏角を計算する
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble carg(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat cargf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double cargl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、 \fIz\fP の複素引数 (位相角とも呼ばれる) を計算する。実軸の負の部分に沿って分枝切断 (branch cut) がある)。
+.PP
+複素数は 2つの実数値からなる座標で表すことができる。 直交座標を使うと、以下のように書くことができる。
+.PP
+.nf
+    z = x + I * y
+.fi
+.PP
+ここで、\fIx\ =\ creal(z)\fP, \fIy\ =\ cimag(z)\fP である。
+.PP
+また、極座標を使うと、以下のように書くことができる。
+.PP
+.nf
+    z = r * cexp(I * a)
+.fi
+.PP
+ここで、 \fIr\ =\ cabs(z)\fP は「半径」、「係数」であり、 \fIz\fP の絶対値である。 \fIa\ =\ carg(z)\fP
+は「位相角」であり、 \fIz\fP の偏角である。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    tan(carg(z)) = cimag(z) / creal(z)
+.fi
+.SH 返り値
+返り値は [\-pi,pi] の範囲である。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcarg\fP(),
+\fBcargf\fP(),
+\fBcargl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/casin.3 b/manual/LDP_man-pages/draft/man3/casin.3
new file mode 100644 (file)
index 0000000..93e93f7
--- /dev/null
@@ -0,0 +1,60 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:07:40 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CASIN 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+casin, casinf, casinl \- 複素数の逆正弦 (arc sine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex casin(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex casinf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex casinl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆正弦 (arg sine) を計算する。 \fIy\ =\ casin(z)\fP ならば、 \fIz\ =\ csin(y)\fP が成立する。 \fIy\fP の実部の値は区間 [\-pi/2,pi/2] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    casin(z) = \-i clog(iz + csqrt(1 \- z * z))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw28 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcasin\fP(),
+\fBcasinf\fP(),
+\fBcasinl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBclog\fP(3), \fBcsin\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/casinh.3 b/manual/LDP_man-pages/draft/man3/casinh.3
new file mode 100644 (file)
index 0000000..bb9d8c6
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:41:13 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CASINH 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+casinh, casinhf, casinhl \- 複素数の逆双曲線正弦 (arc sine hyperbolic)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex casinh(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex casinhf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex casinhl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆双曲線正弦 (arc hyperbolic sine) を計算する。 \fIy\ =\ casinh(z)\fP ならば、
+\fIz\ =\ csinh(y)\fP が成立する。 \fIy\fP の虚部の値は区間 [\-pi/2,pi/2] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    casinh(z) = clog(z + csqrt(z * z + 1))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw30 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcasinh\fP(),
+\fBcasinhf\fP(),
+\fBcasinhl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBasinh\fP(3), \fBcabs\fP(3), \fBcimag\fP(3), \fBcsinh\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/catan.3 b/manual/LDP_man-pages/draft/man3/catan.3
new file mode 100644 (file)
index 0000000..80f5549
--- /dev/null
@@ -0,0 +1,93 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:22:25 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CATAN 3 2020\-06\-09 "" "Linux Programmer's Manual"
+.SH 名前
+catan, catanf, catanl \- 複素数の逆正接 (arc tangent)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex catan(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex catanf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex catanl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆正接 (arc tangent) を計算する。 \fIy = catan(z)\fP ならば、 \fIz =
+ctan(y)\fP が成立する。 \fIy\fP の実部の値は区間 [\-pi/2,pi/2] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcatan\fP(),
+\fBcatanf\fP(),
+\fBcatanl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 例
+.EX
+/* "\-lm" でリンクする */
+
+#include <complex.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+    double complex z, c, f;
+    double complex i = I;
+
+    if (argc != 3) {
+        fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    z = atof(argv[1]) + atof(argv[2]) * I;
+
+    c = catan(z);
+    printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
+
+    f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
+    printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
+
+    exit(EXIT_SUCCESS);
+}
+.EE
+.SH 関連項目
+\fBccos\fP(3), \fBclog\fP(3), \fBctan\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/catanh.3 b/manual/LDP_man-pages/draft/man3/catanh.3
new file mode 100644 (file)
index 0000000..24c603e
--- /dev/null
@@ -0,0 +1,92 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:43:35 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CATANH 3 2020\-06\-09 "" "Linux Programmer's Manual"
+.SH 名前
+catanh, catanhf, catanhl \- 複素数の逆双曲線正接 (arc tangents hyperbolic)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex catanh(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex catanhf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex catanhl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の逆双曲線正弦 (arc hyperbolic tangent) を計算する。 \fIy = catanh(z)\fP
+ならば、 \fIz = ctanh(y)\fP が成立する。 \fIy\fP の虚部の値は区間 [\-pi/2,pi/2] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw30 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcatanh\fP(),
+\fBcatanhf\fP(),
+\fBcatanhl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 例
+.EX
+/* "\-lm" でリンクする */
+
+#include <complex.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+    double complex z, c, f;
+
+    if (argc != 3) {
+        fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    z = atof(argv[1]) + atof(argv[2]) * I;
+
+    c = catanh(z);
+    printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
+
+    f = 0.5 * (clog(1 + z) \- clog(1 \- z));
+    printf("formula  = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
+
+    exit(EXIT_SUCCESS);
+}
+.EE
+.SH 関連項目
+\fBatanh\fP(3), \fBcabs\fP(3), \fBcimag\fP(3), \fBctanh\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/ccos.3 b/manual/LDP_man-pages/draft/man3/ccos.3
new file mode 100644 (file)
index 0000000..6f3599c
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Wed Jul 23 05:24:15 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CCOS 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+ccos, ccosf, ccosl \- 複素数の余弦 (cosine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex ccos(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex ccosf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex ccosl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、複素数 \fIz\fP の余弦 (cosine) を計算する。
+.PP
+複素数の余弦 (cosine) 関数 ccos(z) は以下のように定義される。
+.PP
+.nf
+    ccos(z) = (exp(i * z) + exp(\-i * z)) / 2
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBccos\fP(),
+\fBccosf\fP(),
+\fBccosl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcacos\fP(3), \fBcsin\fP(3), \fBctan\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index d7585d5..d22c7ab 100644 (file)
@@ -29,7 +29,7 @@ ccosh, ccoshf, ccoshl \- 複素数の双曲線余弦 (hyperbolic cosine)
 .PP
 \fI\-lm\fP でリンクする。
 .SH 説明
-These functions calculate the complex hyperbolic cosine of \fIz\fP.
+これらの関数は、複素数 \fIz\fP の双曲線余弦 (hyperbolic cosine) を計算する。
 .PP
 複素数の双曲線余弦 (hyperbolic cosine) 関数 ccosh(z) は 以下のように定義される。
 .PP
diff --git a/manual/LDP_man-pages/draft/man3/cexp.3 b/manual/LDP_man-pages/draft/man3/cexp.3
new file mode 100644 (file)
index 0000000..0d2eb2e
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 02:05:20 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CEXP 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+cexp, cexpf, cexpl \- 複素数の指数関数
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex cexp(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex cexpf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex cexpl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は e (2.71828..., 自然対数の底) の \fIz\fP 乗を計算する。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    cexp(I * z) = ccos(z) + I * csin(z)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcexp\fP(),
+\fBcexpf\fP(),
+\fBcexpl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcexp2\fP(3), \fBclog\fP(3), \fBcpow\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index 0d09a99..4ebfc9c 100644 (file)
@@ -34,7 +34,7 @@ cexp2, cexp2f, cexp2l \- 複素数の 2 の累乗
 これらの関数名は C99 で今後使用するために予約されている。
 .PP
 .\" But reserved in NAMESPACE.
-As at version 2.31, these functions are not provided in glibc.
+バージョン 2.31 の時点では、これらの関数は glibc では提供されていない。
 .SH 関連項目
 \fBcabs\fP(3), \fBcexp\fP(3), \fBclog10\fP(3), \fBcomplex\fP(7)
 .SH この文書について
diff --git a/manual/LDP_man-pages/draft/man3/cimag.3 b/manual/LDP_man-pages/draft/man3/cimag.3
new file mode 100644 (file)
index 0000000..528c9f1
--- /dev/null
@@ -0,0 +1,62 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 01:37:31 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CIMAG 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+cimag, cimagf, cimagl \- 複素数の虚部を取得する
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble cimag(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat cimagf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double cimagl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の虚部を返す。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    z = creal(z) + I * cimag(z)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcimag\fP(),
+\fBcimagf\fP(),
+\fBcimagl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 注意
+gcc では __imag__ を使うこともできるが、 これは GNU による拡張である。
+.SH 関連項目
+\fBcabs\fP(3), \fBcreal\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/clog.3 b/manual/LDP_man-pages/draft/man3/clog.3
new file mode 100644 (file)
index 0000000..fccc414
--- /dev/null
@@ -0,0 +1,65 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 01:47:42 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CLOG 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+clog, clogf, clogl \- 複素数の自然対数
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex clog(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex clogf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex clogl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、複素数 \fIz\fP の自然対数を計算する。実軸の負の部分に沿って分枝切断 (branch cut) がある。
+.PP
+対数 \fBclog\fP()  は指数関数 \fBcexp\fP()  の逆関数である。 したがって、 \fIy = clog(z)\fP ならば、 \fIz =
+cexp(y)\fP が成立する。 \fIy\fP の虚数部の値は区間 [\-pi,pi] から選択される。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    clog(z) = log(cabs(z)) + I * carg(z)
+.fi
+.PP
+\fIz\fP として 0 に近い値を入れると、オーバーフローを起こすため、 注意が必要である。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBclog\fP(),
+\fBclogf\fP(),
+\fBclogl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcexp\fP(3), \fBclog10\fP(3), \fBclog2\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/clog10.3 b/manual/LDP_man-pages/draft/man3/clog10.3
new file mode 100644 (file)
index 0000000..6c8d996
--- /dev/null
@@ -0,0 +1,67 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-07-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2007-01-05, Akihiro MOTOKI, catch up to LDP v2.43
+.\"
+.TH CLOG10 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+clog10, clog10f, clog10l \- 底が 10 の複素数の対数
+.SH 書式
+\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
+.br
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex clog10(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex clog10f(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex clog10l(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+\fIclog10(z)\fP の呼び出しは以下と等価である。
+.PP
+    clog(z)/log(10)
+.PP
+また、以下とも等価である。
+.PP
+    log10(cabs(c)) + I * carg(c) / log(10)
+.PP
+他の関数は同じ機能を持つ \fIfloat\fP 版と \fIlong double\fP 版である。
+.PP
+\fIz\fP として 0 に近い値を入れると、オーバーフローを起こすため、 注意が必要である。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw30 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBclog10\fP(),
+\fBclog10f\fP(),
+\fBclog10l\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+これらの関数は GNU による拡張である。これらの名前は C99 と C11 で今後のために予約されている。
+.SH 関連項目
+\fBcabs\fP(3), \fBcexp\fP(3), \fBclog\fP(3), \fBclog2\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/conj.3 b/manual/LDP_man-pages/draft/man3/conj.3
new file mode 100644 (file)
index 0000000..bb147b2
--- /dev/null
@@ -0,0 +1,60 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 02:38:18 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CONJ 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+conj, conjf, conjl \- 複素共役を計算する
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex conj(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex conjf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex conjl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は \fIz\fP の複素共役を返す。 その値は虚部の符号を反転して得られる。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    cabs(z) = csqrt(z * conj(z))
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBconj\fP(),
+\fBconjf\fP(),
+\fBconjl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcsqrt\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/cpow.3 b/manual/LDP_man-pages/draft/man3/cpow.3
new file mode 100644 (file)
index 0000000..f9fb3c2
--- /dev/null
@@ -0,0 +1,54 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-09-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CPOW 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+cpow, cpowf, cpowl \- 複素数の累乗関数
+.SH 書式
+.nf
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex cpow(double complex \fP\fIx\fP\fB, complex double \fP\fIz\fP\fB);\fP
+\fBfloat complex cpowf(float complex \fP\fIx\fP\fB, complex float \fP\fIz\fP\fB);\fP
+\fBlong double complex cpowl(long double complex \fP\fIx\fP\fB,\fP
+\fB                          complex long double \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.fi
+.SH 説明
+これらの関数は \fIx\fP の \fIz\fP 乗を計算する (実軸の負の部分に沿って \fIx\fP の分枝切断 (branch cut) がある)。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcpow\fP(),
+\fBcpowf\fP(),
+\fBcpowl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBpow\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/cproj.3 b/manual/LDP_man-pages/draft/man3/cproj.3
new file mode 100644 (file)
index 0000000..50fe888
--- /dev/null
@@ -0,0 +1,59 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-07-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-02-21, Akihiro MOTOKI
+.\"
+.TH CPROJ 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+cproj, cprojf, cprojl \- リーマン球面への射影
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex cproj(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex cprojf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex cprojl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、平面上の点をリーマン球の表面に射影する、つまり 複素平面の一つの軸へのコンパクト化 (one\-point
+compactification) を行う。 有限な点 \fIz\fP はいずれも \fIz\fP 自身へ射影される。
+無限の値を持つ全ての複素数は、一つの無限値に射影される。 もっと詳しく言うと、実数軸の正の無限大に射影される。
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcproj\fP(),
+\fBcprojf\fP(),
+\fBcprojl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 注意
+.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=10401
+バージョン 2.11 以前の glibc の実装は違った動作 (リーマン球面への「立体」写像) を行う。
+.SH 関連項目
+\fBcabs\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/creal.3 b/manual/LDP_man-pages/draft/man3/creal.3
new file mode 100644 (file)
index 0000000..8cdb49d
--- /dev/null
@@ -0,0 +1,62 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 01:33:13 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CREAL 3 2015\-04\-19 "" "Linux Programmer's Manual"
+.SH 名前
+creal, crealf, creall \- 複素数の実部を取得する
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble creal(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat crealf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double creall(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の実部を返す。
+.PP
+次の関係が成立する:
+.PP
+.nf
+    z = creal(z) + I * cimag(z)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcreal\fP(),
+\fBcrealf\fP(),
+\fBcreall\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 注意
+gcc では __real__ を使うこともできるが、 これは GNU による拡張である。
+.SH 関連項目
+\fBcabs\fP(3), \fBcimag\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/csin.3 b/manual/LDP_man-pages/draft/man3/csin.3
new file mode 100644 (file)
index 0000000..a79fc27
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Wed Jul 23 05:24:36 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CSIN 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+csin, csinf, csinl \- 複素数の正弦 (sine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex csin(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex csinf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex csinl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は複素数 \fIz\fP の正弦を計算する。
+.PP
+複素数の正弦 (sine) 関数 csin(z) は以下のように定義される。
+.PP
+.nf
+    csin(z) = (exp(i * z) \- exp(\-i * z)) / (2 * i)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcsin\fP(),
+\fBcsinf\fP(),
+\fBcsinl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcasin\fP(3), \fBccos\fP(3), \fBctan\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/csinh.3 b/manual/LDP_man-pages/draft/man3/csinh.3
new file mode 100644 (file)
index 0000000..3deb7aa
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Wed Jul 23 05:54:24 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CSINH 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+csinh, csinhf, csinhl \- 複素数の双曲線正弦 (hyperbolic sine)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex csinh(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex csinhf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex csinhl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、 複素数 \fIz\fP の双曲線正弦 (hyperbolic sine) を計算する。
+.PP
+複素数の双曲線正弦 (hyperbolic sine) 関数 sinh(z) は以下のように定義される。
+.PP
+.nf
+    csinh(z) = (exp(z)\-exp(\-z))/2
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcsinh\fP(),
+\fBcsinhf\fP(),
+\fBcsinhl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcasinh\fP(3), \fBccosh\fP(3), \fBctanh\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/csqrt.3 b/manual/LDP_man-pages/draft/man3/csqrt.3
new file mode 100644 (file)
index 0000000..0984629
--- /dev/null
@@ -0,0 +1,57 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Thu Jul 24 00:47:23 JST 2003
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH CSQRT 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+csqrt, csqrtf, csqrtl \- 複素数の平方根
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex csqrt(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex csqrtf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex csqrtl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、複素数 \fIz\fP の平方根を計算する。実軸の負の部分に沿って分枝切断 (branch cut) がある。 (つまり、 \fIeps\fP
+を小さな正の実数とした場合、 \fIcsqrt(\-1+eps*I)\fP が I に近付いていき、 一方 \fIcsqrt(\-1\-eps*I)\fP は \-I
+に近付いていく、 ということである。)
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBcsqrt\fP(),
+\fBcsqrtf\fP(),
+\fBcsqrtl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcexp\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/ctan.3 b/manual/LDP_man-pages/draft/man3/ctan.3
new file mode 100644 (file)
index 0000000..6076f34
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-07-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-02-21, Akihiro MOTOKI
+.\"
+.TH CTAN 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+ctan, ctanf, ctanl \- 複素数の正接 (tangent) 関数
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex ctan(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex ctanf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex ctanl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、複素数 \fIz\fP の正接 (tangent) を返す。
+.PP
+複素数の正接 (tangent) 関数 ctan(z) は以下のように定義される。
+.PP
+.nf
+    ctan(z) = csin(z) / ccos(z)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBctan\fP(),
+\fBctanf\fP(),
+\fBctanl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcatan\fP(3), \fBccos\fP(3), \fBcsin\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/ctanh.3 b/manual/LDP_man-pages/draft/man3/ctanh.3
new file mode 100644 (file)
index 0000000..9b5cb04
--- /dev/null
@@ -0,0 +1,61 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under GPL
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2003-07-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-02-21, Akihiro MOTOKI
+.\"
+.TH CTANH 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+ctanh, ctanhf, ctanhl \- 複素数の双曲線正接 (hyperbolic tangent)
+.SH 書式
+\fB#include <complex.h>\fP
+.PP
+\fBdouble complex ctanh(double complex \fP\fIz\fP\fB);\fP
+.br
+\fBfloat complex ctanhf(float complex \fP\fIz\fP\fB);\fP
+.br
+\fBlong double complex ctanhl(long double complex \fP\fIz\fP\fB);\fP
+.PP
+\fI\-lm\fP でリンクする。
+.SH 説明
+これらの関数は、複素数 \fIz\fP の双曲線正接 (hyperbolic tangent) を計算する。
+.PP
+複素数の双曲線正接 (hyperbolic tangent) 関数は以下のように定義される。
+.PP
+.nf
+    ctanh(z) = csinh(z) / ccosh(z)
+.fi
+.SH バージョン
+これらの関数は glibc バージョン 2.1 で初めて登場した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBctanh\fP(),
+\fBctanhf\fP(),
+\fBctanhl\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C99, POSIX.1\-2001, POSIX.1\-2008.
+.SH 関連項目
+\fBcabs\fP(3), \fBcatanh\fP(3), \fBccosh\fP(3), \fBcsinh\fP(3), \fBcomplex\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/ctermid.3 b/manual/LDP_man-pages/draft/man3/ctermid.3
new file mode 100644 (file)
index 0000000..a742eda
--- /dev/null
@@ -0,0 +1,83 @@
+.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\"
+.\" %%%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 Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya
+.\"         all rights reserved.
+.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
+.\"
+.TH CTERMID 3 2019\-03\-06 GNU "Linux Programmer's Manual"
+.SH 名前
+ctermid \- 制御端末名の取得
+.SH 書式
+.nf
+.\" POSIX also requires this function to be declared in <unistd.h>,
+.\" and glibc does so if suitable feature test macros are defined.
+\fB#include <stdio.h>\fP
+.PP
+\fBchar *ctermid(char *\fP\fIs\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBctermid\fP(): _POSIX_C_SOURCE
+.SH 説明
+\fBctermid\fP()  はプロセスの現在の制御端末のパス名を返す。 \fIs\fP が NULL の場合、静的なバッファーを用いる。それ以外の場合、
+\fIs\fP は端末パス名を保持するのに使用されるバッファーへのポインターとなる。 シンボル定数 \fBL_ctermid\fP
+は返されるパス名の最大文字数である。
+.SH 返り値
+パス名へのポインター。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBctermid\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, Svr4.
+.SH バグ
+The returned pathname may not uniquely identify the controlling terminal; it
+may, for example, be \fI/dev/tty\fP.
+.PP
+.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
+.\" if ctermid() was given an argument; fixed in 2.4.
+プログラムが端末をオープンできることは保証されていない。
+.SH 関連項目
+\fBttyname\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fclose.3 b/manual/LDP_man-pages/draft/man3/fclose.3
new file mode 100644 (file)
index 0000000..40ac495
--- /dev/null
@@ -0,0 +1,108 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)fclose.3   6.7 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu
+.\"
+.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
+.\"       all rights reserved.
+.\" Translated Mon Jan 20 18:30:47 JST 1997
+.\"       by Takashi Yoshino <tyoshino@eng.toyo.ac.jp>
+.\" Updated Mon Sep 25 01:58:44 JST 2000
+.\"       by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated & Modified Tue Apr  3 20:49:00 JST 2001
+.\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
+.\" Updated & Modified Mon Jan 10 08:08:29 JST 2005
+.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
+.\"
+.TH FCLOSE 3 2016\-12\-12 GNU "Linux Programmer's Manual"
+.SH 名前
+fclose \- ストリームを閉じる
+.SH 書式
+\fB#include <stdio.h>\fP
+.PP
+\fBint fclose(FILE *\fP\fIstream\fP\fB);\fP
+.SH 説明
+\fBfclose\fP() 関数は、 \fIstream\fP が指すストリームを (バッファーリングされて
+いた全ての出力データを \fBfflush\fP(3) を用いて書き込んで) フラッシュし、
+対応するファイルディスクリプターをクローズする。
+.SH 返り値
+関数が正常に終了すると 0 が返される。 正常に終了しなかった場合には \fBEOF\fP が返され、 \fIerrno\fP がエラーを示すために設定される。
+どちらの場合も、そのストリームに対する (\fBfclose\fP()  へのさらなる呼び出しを含む) それ以上のアクセスは 未定義の動作を生じさせる。
+.SH エラー
+.TP 
+\fBEBADF\fP
+.\"  This error cannot occur unless you are mixing ANSI C stdio operations and
+.\"  low-level file operations on the same stream. If you do get this error,
+.\"  you must have closed the stream's low-level file descriptor using
+.\"  something like close(fileno(stream)).
+\fIstream\fP の基となるファイルディスクリプターが不正である。
+.PP
+\fBfclose\fP()  関数はこれ以外にも \fBclose\fP(2), \fBwrite\fP(2), \fBfflush\fP(3)
+のルーチンで失敗することがある。その場合は \fIerrno\fP が、失敗したルーチンで設定された値に設定される。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfclose\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.SH 注意
+\fBfclose\fP()  は C ライブラリで提供されたユーザー空間バッファーだけをフラッシュする点に注意すること。
+データを確実に物理的にディスクに記録するためには カーネルバッファーも (\fBsync\fP(2)  や \fBfsync\fP(2)  を用いて)
+フラッシュしなければならない。
+.SH 関連項目
+\fBclose\fP(2), \fBfcloseall\fP(3), \fBfflush\fP(3), \fBfileno\fP(3), \fBfopen\fP(3),
+\fBsetbuf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fcloseall.3 b/manual/LDP_man-pages/draft/man3/fcloseall.3
new file mode 100644 (file)
index 0000000..96f19a7
--- /dev/null
@@ -0,0 +1,72 @@
+.\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%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.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2000 Yuichi SATO
+.\"         all rights reserved.
+.\" Translated 2000-06-24, Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
+.\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.46
+.\"
+.TH FCLOSEALL 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+fcloseall \- 開いているすべてのストリームを閉じる
+.SH 書式
+.nf
+\fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
+\fB#include <stdio.h>\fP
+.PP
+\fBint fcloseall(void);\fP
+.fi
+.SH 説明
+\fBfcloseall\fP()  関数は、呼び出し元プロセスが開いているすべてのストリームを閉じる。 ストリームを閉じる前に、 (\fBfflush\fP(3)
+と同じように) 各ストリームのバッファーに溜っている出力データは書き出される。 入力バッファー内のデータは破棄される。
+.PP
+標準入出力 \fIstdin\fP, \fIstdout\fP, \fIstderr\fP も閉じられる。
+.SH 返り値
+この関数は、すべてのファイルが正常に閉じられた場合 0 を返す。 エラーの場合、 \fBEOF\fP を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfcloseall\fP()
+T}     Thread safety   MT\-Unsafe race:streams
+.TE
+.PP
+\fBfcloseall\fP() 関数はストリームのロックを行わない。そのため、スレッドセーフではない。
+.SH 準拠
+この関数は GNU 拡張である。
+.SH 関連項目
+\fBclose\fP(2), \fBfclose\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBsetbuf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/ferror.3 b/manual/LDP_man-pages/draft/man3/ferror.3
new file mode 100644 (file)
index 0000000..4e74276
--- /dev/null
@@ -0,0 +1,119 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)ferror.3   6.8 (Berkeley) 6/29/91
+.\"
+.\"
+.\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu
+.\" Added remark on EBADF for fileno, aeb, 2001-03-22
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
+.\"    all rights reserved.
+.\" Translated Fri Dec 26 10:49:26 JST 1997
+.\"    by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
+.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Fri Nov  2 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH FERROR 3 2019\-03\-06 "" "Linux Programmer's Manual"
+.SH 名前
+clearerr, feof, ferror, fileno \- ストリームステータスのチェックとリセット
+.SH 書式
+\fB#include <stdio.h>\fP
+.PP
+\fBvoid clearerr(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint feof(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint ferror(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint fileno(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBfileno\fP(): _POSIX_C_SOURCE
+.SH 説明
+関数 \fBclearerr\fP()  は \fIstream\fP で示されるストリームの EOF(end\-of\-file) 指示子とエラー指示子をクリアする。
+.PP
+関数 \fBfeof\fP()  は \fIstream\fP で示されるストリームの EOF 指示子をテストし、 セットされていれば 0 以外の数を返す。 EOF
+指示子は、関数 \fBclearerr\fP()  によってのみクリアすることができる。
+.PP
+関数 \fBferror\fP()  は \fIstream\fP で示されるストリームのエラー指示子をテストし、 セットされていれば 0 以外の数を返す。
+エラー指示子は、関数 \fBclearerr\fP()  によってのみリセットすることができる。
+.PP
+The function \fBfileno\fP()  examines the argument \fIstream\fP and returns the
+integer file descriptor used to implement this stream.  The file descriptor
+is still owned by \fIstream\fP and will be closed when \fBfclose\fP(3)  is
+called.  Duplicate the file descriptor with \fBdup\fP(2)  before passing it to
+code that might close it.
+.PP
+これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH エラー
+これらの関数は失敗すべきではなく、また、外部変数 \fIerrno\fP に値をセットしない。 (しかし、 \fBfileno\fP()
+関数の場合で、引数が有効なストリームでなかった場合、 関数は \-1 を返し、 \fIerrno\fP に \fBEBADF\fP を設定しなければならない。)
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw19 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBclearerr\fP(),
+\fBfeof\fP(),
+.br
+\fBferror\fP(),
+\fBfileno\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+関数 \fBclearerr\fP(), \fBfeof\fP(), \fBferror\fP()  は C89, C99, POSIX.1\-2001,
+POSIX.1\-2008 に準拠している。
+.PP
+関数 \fBfileno\fP() は POSIX.1\-2001 と POSIX.1\-2008 に準拠している。
+.SH 関連項目
+\fBopen\fP(2), \fBfdopen\fP(3), \fBstdio\fP(3), \fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fflush.3 b/manual/LDP_man-pages/draft/man3/fflush.3
new file mode 100644 (file)
index 0000000..fc32831
--- /dev/null
@@ -0,0 +1,113 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)fflush.3   5.4 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\"
+.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
+.\" Modified 2001-10-16 by John Levon <moz@compsoc.man.ac.uk>
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997-2000 YOSHINO Takashi and NAKANO Takeo
+.\"       all rights reserved.
+.\" Translated 1997-02-13,YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
+.\" Update & Modified 1999-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Update & Modified 2000-09-21, NAKANO Takeo
+.\" Updated 2001-11-02, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
+.\"
+.TH FFLUSH 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+fflush \- ストリームの内容を強制的に出力(フラッシュ)する
+.SH 書式
+\fB#include <stdio.h>\fP
+.PP
+\fBint fflush(FILE *\fP\fIstream\fP\fB);\fP
+.SH 説明
+出力ストリームに関しては、 \fBfflush\fP()  は、ユーザー空間でバッファーリングされているすべてのデータを 指定された出力に書き出す
+(フラッシュする)、 もしくはストリーム \fIstream\fP の下位にある書き込み関数を用いてこのストリームを更新する。
+.PP
+seek 可能なファイルに関連付けられた入力ストリーム (ディスクファイルは seek 可能だが、 パイプや端末は seek できない) に関しては、
+\fBfflush\fP()  は、対応するファイルから取得されたが、アプリケーションからは 読み出されていないバッファーデータを全て破棄する。
+.PP
+ストリームは開いた状態のままであり、 この関数によって何の影響も受けない。
+.PP
+.\" mtk: POSIX specifies that only output streams are flushed for this case.
+.\" Also verified for glibc by experiment.
+\fIstream\fP 引数が NULL ならば、 \fBfflush\fP()  は開いている\fIすべての\fP出力ストリームをフラッシュする。
+.PP
+これらの処理をロックせずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH 返り値
+成功すると 0 が返される。 その他の場合には \fBEOF\fP が返され、 \fIerrno\fP が、エラーに対応した値に設定される。
+.SH エラー
+.TP 
+\fBEBADF\fP
+\fIstream\fP は開いているストリームではない。 あるいはストリームは書き込み用ではない。
+.PP
+\fBfflush\fP()  関数は \fBwrite\fP(2)  に関して規定されているエラーで失敗することもある。 この場合 \fIerrno\fP
+もその値に設定される。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfflush\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+C89, C99, POSIX.1\-2001, POSIX.1\-2008.
+.PP
+POSIX.1\-2001 では入力ストリームのフラッシュの動作は規定されていなかったが、 POSIX.1\-2008 では規定されている。
+.SH 注意
+\fBfflush\fP()  は、 C ライブラリが与えているユーザー空間のバッファーしかフラッシュしない。
+データが物理的にディスクに保存されることを保証したければ、 カーネルバッファーもフラッシュしなければならない。 これには例えば \fBsync\fP(2)
+や \fBfsync\fP(2)  を用いる。
+.SH 関連項目
+\fBfsync\fP(2), \fBsync\fP(2), \fBwrite\fP(2), \fBfclose\fP(3), \fBfileno\fP(3),
+\fBfopen\fP(3), \fBsetbuf\fP(3), \fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fgetc.3 b/manual/LDP_man-pages/draft/man3/fgetc.3
new file mode 100644 (file)
index 0000000..27beb45
--- /dev/null
@@ -0,0 +1,103 @@
+.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\"
+.\" %%%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 Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu)
+.\" Modified Fri Sep  8 15:48:13 1995 by Andries Brouwer (aeb@cwi.nl)
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH FGETC 3 2020\-12\-21 GNU "Linux Programmer's Manual"
+.SH 名前
+fgetc, fgets, getc, getchar, ungetc \- 文字と文字列の入力
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint fgetc(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBchar *fgets(char *\fP\fIs\fP\fB, int \fP\fIsize\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint getc(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint getchar(void);\fP
+.PP
+\fBint ungetc(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.SH 説明
+\fBfgetc\fP()  は、 \fIstream\fP から次の文字を \fIunsigned char\fP として読み、 \fIint\fP
+にキャストして返す。ファイルの終わりやエラーとなった場合は \fBEOF\fP を返す。
+.PP
+\fBgetc\fP()  は \fBfgetc\fP()  と同様だが、 \fIstream\fP を複数回評価するマクロとして実装されているかもしれない。
+.PP
+\fBgetchar\fP()  は \fBgetc(\fP\fIstdin\fP\fB)\fP と同じである。
+.PP
+\fBfgets\fP()  は \fIstream\fP から最大で \fIsize\fP \- 1 個の文字を読み込み、 \fIs\fP
+が指すバッファーに格納する。読み込みは \fBEOF\fP または改行文字を読み込んだ後で停止する。 読み込まれた改行文字はバッファーに格納される。
+終端のヌルバイト (\(aq\e0\(aq)  が一つバッファーの中の最後の文字の後に書き込まれる。
+.PP
+\fBungetc\fP()  は、後の read 操作で読めるように、 \fIc\fP を \fIunsigned char\fP にキャストして \fIstream\fP
+に書き戻す。 書き戻された文字は逆順に戻される; 書き戻しとして保証されているのは、一文字だけである。
+.PP
+ここで述べた関数や \fIstdio\fP ライブラリの入力関数を同じ入力ストリームに対して互いに混ぜて使うことができる。
+.PP
+これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH 返り値
+\fBfgetc\fP(), \fBgetc\fP(), \fBgetchar\fP()  は、文字を \fIunsigned char\fP として読んで \fIint\fP
+にキャストして返す。ファイルの終わりやエラーの場合は \fBEOF\fP を返す。
+.PP
+\fBfgets\fP() は、成功すると \fIs\fP を返し、エラーや 1 文字も読み込んでいないのにファイルの終わりになった 場合に NULL を返す。
+.PP
+\fBungetc\fP()  は成功すると \fIc\fP を返し、エラーの場合は \fBEOF\fP を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw25 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfgetc\fP(),
+\fBfgets\fP(),
+\fBgetc\fP(),
+.br
+\fBgetchar\fP(),
+\fBungetc\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.PP
+入力ストリームのファイルディスクリプターに対して、 \fIstdio\fP ライブラリの入力関数と、低レベル呼び出しの \fBread\fP(2)
+を混ぜて呼び出す事は勧められない。 結果がどうなるかは分からず、おそらくあなたの 望んでいる結果にはならないだろう。
+.SH 関連項目
+\fBread\fP(2), \fBwrite\fP(2), \fBferror\fP(3), \fBfgetwc\fP(3), \fBfgetws\fP(3),
+\fBfopen\fP(3), \fBfread\fP(3), \fBfseek\fP(3), \fBgetline\fP(3), \fBgets\fP(3),
+\fBgetwchar\fP(3), \fBputs\fP(3), \fBscanf\fP(3), \fBungetwc\fP(3),
+\fBunlocked_stdio\fP(3), \fBfeature_test_macros\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fgetwc.3 b/manual/LDP_man-pages/draft/man3/fgetwc.3
new file mode 100644 (file)
index 0000000..4fcfd90
--- /dev/null
@@ -0,0 +1,80 @@
+.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
+.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
+.\" 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.
+.\" %%%LICENSE_END
+.\"
+.\" References consulted:
+.\"   GNU glibc-2 source code and manual
+.\"   Dinkumware C library reference http://www.dinkumware.com/
+.\"   OpenGroup's Single UNIX specification
+.\"      http://www.UNIX-systems.org/online.html
+.\"   ISO/IEC 9899:1999
+.\"
+.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Translated Sun Aug 29 15:03:27 JST 1999
+.\"           by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
+.\" Updated Sun Dec 26 JST 1999 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Fri Nov  2 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH FGETWC 3 2015\-08\-08 GNU "Linux Programmer's Manual"
+.SH 名前
+fgetwc, getwc \- ワイド文字を FILE ストリームから読み込む
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+\fB#include <wchar.h>\fP
+.PP
+\fBwint_t fgetwc(FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t getwc(FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.SH 説明
+\fBfgetwc\fP()  関数は、 \fBfgetc\fP(3)  に対応するワイド文字関数である。 この関数は \fIstream\fP からワイド文字を 1
+文字読み込み、これを返す。 ストリームの終端に達するか、\fIferror(stream)\fP が真になった場合には、 この関数は \fBWEOF\fP を返す。
+ワイド文字変換でエラーが発生した場合は、 \fIerrno\fP に \fBEILSEQ\fP をセットし、 \fBWEOF\fP を返す。
+.PP
+\fBgetwc\fP()  関数あるいはマクロは、 \fBfgetwc\fP()  と全く同じ動作をする。
+この関数はマクロとして実装されるかもしれないので、引き数が複数回評価さ れるかもしれない。この関数を使う理由はもはや存在しない。
+.PP
+これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH 返り値
+\fBfgetwc\fP()  関数はストリームの次のワイド文字か、あるいは \fBWEOF\fP を返す。 エラーが起こった場合、 \fIerrno\fP
+にエラーの原因を示す値が設定される。
+.SH エラー
+通常のエラーに加えて、以下のエラーがある:
+.TP 
+\fBEILSEQ\fP
+入力ストリームから取得したデータが、正しい文字でない。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw17 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfgetwc\fP(),
+\fBgetwc\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C99.
+.SH 注意
+\fBfgetwc\fP()  の動作は、現在のロケールの \fBLC_CTYPE\fP カテゴリーに依存する。
+.PP
+\fBfopen\fP(3)  システムコールに渡す追加情報がない場合には、 \fBfgetwc\fP()  が実際
+にはマルチバイトシーケンスをストリームから読み込み、これをワイド文字に 変換すると期待することは適切である。
+.SH 関連項目
+\fBfgetws\fP(3), \fBfputwc\fP(3), \fBungetwc\fP(3), \fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/flockfile.3 b/manual/LDP_man-pages/draft/man3/flockfile.3
new file mode 100644 (file)
index 0000000..6fc5d38
--- /dev/null
@@ -0,0 +1,109 @@
+.\" Copyright (C) 2001 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
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2001 Yuichi SATO
+.\"         all rights reserved.
+.\" Translated Sun Nov  4 14:09:45 2001
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH FLOCKFILE 3 2020\-06\-09 "" "Linux Programmer's Manual"
+.SH 名前
+flockfile, ftrylockfile, funlockfile \- 標準入出力 FILE のロックを行う
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBvoid flockfile(FILE *\fP\fIfilehandle\fP\fB);\fP
+\fBint ftrylockfile(FILE *\fP\fIfilehandle\fP\fB);\fP
+\fBvoid funlockfile(FILE *\fP\fIfilehandle\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.ad l
+.PP
+上記の全ての関数:
+.RS 4
+/* Since glibc 2.24: */ _POSIX_C_SOURCE\ >=\ 199309L
+    || /* Glibc versions <= 2.23: */ _POSIX_C_SOURCE
+    || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+標準入出力関数はスレッドセーフである。これは、各 \fIFILE\fP オブジェクトに対し、ロック数 (lockcount) と (ロック数が 0
+でない場合は) 所有者スレッド (owner thread)  を管理することで実現される。 ライブラリの呼び出しが行われる毎に、標準入出力関数は
+\fIFILE\fP オブジェクトが他のスレッドによってロックされていない状態になるまで待ち、 \fIFILE\fP
+オブジェクトをロックし、要求されて入出力を行い、 オブジェクトのロックを解除する。
+.PP
+(注: このロックは、 \fBflock\fP(2)  や \fBlockf\fP(3)  といった関数が行うロックとは全く無関係である。)
+.PP
+これらのことはすべて C プログラマには見えない部分で行われるが、 より細かい制御ができた方がよい理由が2つあるだろう。一つは、一つのスレッドが
+行う一連の入出力動作は一緒に行われ、他のスレッドの入出力によって中断されない 方がよいということであろう。もう一つは、効率を大きく上げるためには
+ロックのオーバヘッドを避ける必要があるということであろう。
+.PP
+この目的を実現するために、 \fIFILE\fP オブジェクトのロック、一連の入出力動作の実行、 ロックの解除をスレッドが明示的に指示することができる。
+これにより、他のスレッドが途中で入出力を行うのを防止する。 このようなことを行う理由が効率の向上であるならば、
+ロックを行わないバージョンの標準入出力関数を使うこともできる。 例えば、 \fBgetc\fP(3)  や \fBputc\fP(3)  の代わりに
+\fBgetc_unlocked\fP(3)  や \fBputc_unlocked\fP(3)  を使用する。
+.PP
+\fBflockfile\fP()  関数は、\fI*filehandle\fP が他のスレッドにロックされていな い状態になるまで待ったのち、現在のスレッドを
+\fI*filehandle\fP のオーナに設 定し、ロック数を加算する。
+.PP
+\fBfunlockfile\fP()  関数は、ロック数を減算する。
+.PP
+\fBftrylockfile\fP()  関数は \fBflockfile\fP()  のブロッキングを行わない バージョンである。他のスレッドが
+\fI*filehandle\fP をロックしている時は 何も行わず、そうでない場合は \fI*filehandle\fP の所有権を獲得し、 ロック数を加算する。
+.SH 返り値
+\fBftrylockfile\fP()  関数はロックに成功すると 0 を返し、 失敗した場合は 0 以外の値を返す。
+.SH エラー
+なし。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw29 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBflockfile\fP(),
+\fBftrylockfile\fP(),
+\fBfunlockfile\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008.
+.PP
+\fB_POSIX_THREAD_SAFE_FUNCTIONS\fP が定義されているときにこれらの関数を使用することができる。
+.SH 関連項目
+\fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index d63f681..9424720 100644 (file)
@@ -158,12 +158,12 @@ severity\-keyword 部は \fBfmtmsg\fP()  に使用されないが、存在しな
 .SH バージョン
 \fBfmtmsg\fP()  は、バージョン 2.1 以降の glibc で提供されている。
 .SH 属性
-For an explanation of the terms used in this section, see \fBattributes\fP(7).
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
 .TS
 allbox;
 lb lb lbw23
 l l l.
-Interface      Attribute       Value
+インターフェース       属性  値
 T{
 \fBfmtmsg\fP()
 T}     Thread safety   T{
@@ -186,7 +186,7 @@ described in POSIX.1\-2001 and POSIX.1\-2008.
 .SH 注意
 System V と UnixWare の man ページには、 「これらの関数は "pfmt() と addsev()" または "pfmt(),
 vpfmt(), lfmt(), vlfmt()" で置き換えられており、 将来は削除される予定である」と書かれている。
-.SH EXAMPLES
+.SH 
 .EX
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/manual/LDP_man-pages/draft/man3/fopen.3 b/manual/LDP_man-pages/draft/man3/fopen.3
new file mode 100644 (file)
index 0000000..1b40492
--- /dev/null
@@ -0,0 +1,276 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)fopen.3    6.8 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\" Modified, aeb, 960421, 970806
+.\" Modified, joey, aeb, 2002-01-03
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
+.\"       all rights reserved.
+.\" Translated Thu Feb 13 12:10:38 JST 1997
+.\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
+.\" Updated & Modified Mon Mar 1 1999
+.\"       by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Updated 1999-12-08, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2001-12-13, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-03-23, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2005-10-15, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2012-05-08, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-03-26, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH FOPEN 3 2020\-12\-21 GNU "Linux Programmer's Manual"
+.SH 名前
+fopen, fdopen, freopen \- ストリームを開く関数
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBFILE *fopen(const char *\fP\fIpathname\fP\fB, const char *\fP\fImode\fP\fB);\fP
+.PP
+\fBFILE *fdopen(int \fP\fIfd\fP\fB, const char *\fP\fImode\fP\fB);\fP
+.PP
+\fBFILE *freopen(const char *\fP\fIpathname\fP\fB, const char *\fP\fImode\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBfdopen\fP(): _POSIX_C_SOURCE
+.SH 説明
+\fBfopen\fP()  関数は、 \fIpathname\fP で指定された名前のファイルを開き、ストリームと結びつける。
+.PP
+引数 \fImode\fP は、以下に続く文字のひとつから始まる文字列へのポインターであ
+る (以下の述べる、追加の文字が後に続くこともある):
+.TP 
+\fBr\fP
+テキストファイルを読み出すために開く。 ストリームはファイルの先頭に位置される。
+.TP 
+\fBr+\fP
+読み出しおよび書き込みするために開く。 ストリームはファイルの先頭に位置される。
+.TP 
+\fBw\fP
+ファイルを書き込みのために開く。 ファイルが既に存在する場合には長さゼロに切り詰める。 ファイルがなかった場合には新たに作成する。
+ストリームはファイルの先頭に位置される。
+.TP 
+\fBw+\fP
+読み出しおよび書き込みのために開く。 ファイルが存在していない場合には新たに作成する。 存在している場合には長さゼロに切り詰められる。
+ストリームはファイルの先頭に位置される。
+.TP 
+\fBa\fP
+追加 (ファイルの最後に書き込む) のために開く。 ファイルが存在していない場合には新たに作成する。 ストリームはファイルの最後に位置される。
+.TP 
+\fBa+\fP
+Open for reading and appending (writing at end of file).  The file is
+created if it does not exist.  Output is always appended to the end of the
+file.  POSIX is silent on what the initial read position is when using this
+mode.  For glibc, the initial file position for reading is at the beginning
+of the file, but for Android/BSD/MacOS, the initial file position for
+reading is at the end of the file.
+.PP
+\fImode\fP 文字列には文字 \(aqb\(aq を追加指定することができ、 \fImode\fP 文字列の最後の文字として指定する。 上記のうち 2
+文字のモードの場合には 2 つの文字の間に指定することもできる。 これは C89 との互換性のためだけに用意された
+ものであり、関数の実行に対してはいかなる影響も持たない。 すなわち、Linux を含む全ての POSIX 準拠システムでは、 この \(aqb\(aq
+は無視される。 (その他のシステムではテキストファイルとバイナリファイルを別々に扱うものもあるので、 もしバイナリファイルの入出力を行い、
+そのプログラムが非 UNIX 環境へ移植されると予測するなら、 \(aqb\(aqを付けておくのは良い考えである)
+.PP
+\fImode\fP の glibc による拡張の詳細については下記の「注意」を参照。
+.PP
+すべての生成されたファイルは、 \fBS_IRUSR\fP | \fBS_IWUSR\fP | \fBS_IRGRP\fP | \fBS_IWGRP\fP |
+\fBS_IROTH\fP | \fBS_IWOTH\fP (0666) のモードを そのプロセスの umask 値によって修正したモードを持つ
+(\fBumask\fP(2)  を見よ)。
+.PP
+読み出し/書き込みストリームに対しては任意の順序で読み書きを行うことができる。 ただし ANSI C では、
+(入力操作がファイルの末尾に到達した場合を除いて)  出力と入力の間にはファイルの位置決め関数を 挟まなければならないことになっていることに注意されたい
+(この条件を満足しない場合には、読み込み操作は、 最後に書き込まれたものでなく、以前に書き込まれた 値を返すことを許されている)。
+したがって、このようなストリームでの読み書き操作の間には \fBfseek\fP(3)  または \fBfgetpos\fP(3)  操作を挟んでおくと良いだろう
+(Linux では本当に必要となることもときどきある)。 この操作は見かけ上何もしない操作 (no\-op) でも良い (例えば \fIfseek(...,
+0L, SEEK_CUR)\fP を その副次的効果である同期のためだけに呼べば良い)。
+.PP
+ファイルを追加モード (\fImode\fP の最初の文字を \fBa\fP にする) で開くと、
+このストリームに対する書き込み操作は全て (先に以下の呼び出しを行った
+かのように) ファイルの末尾で行われる。
+.PP
+.in +4n
+.EX
+fseek(stream, 0, SEEK_END);
+.EE
+.in
+.PP
+The file descriptor associated with the stream is opened as if by a call to
+\fBopen\fP(2)  with the following flags:
+.RS
+.TS
+allbox;
+lb lb
+c l.
+fopen() モード      open() フラグ
+\fIr\fP        O_RDONLY
+\fIw\fP        O_WRONLY | O_CREAT | O_TRUNC
+\fIa\fP        O_WRONLY | O_CREAT | O_APPEND
+\fIr+\fP       O_RDWR
+\fIw+\fP       O_RDWR | O_CREAT | O_TRUNC
+\fIa+\fP       O_RDWR | O_CREAT | O_APPEND
+.TE
+.RE
+.\"
+.SS fdopen()
+.\"
+\fBfdopen\fP()  関数は、既存のファイルディスクリプター \fIfd\fP にストリームを結びつける。 ストリームの \fImode\fP ("r",
+"r+", "w", "w+", "a", "a+" のいずれか) は ファイルディスクリプターのモードと互換のものでなければならない。
+新しいストリームのファイル位置指示子は \fIfd\fP に属している値に設定される。 error と end\-of\-file の各指示子はクリアされる。
+"w" および "w+" モードでのファイルの切り詰めは行われない。 ファイルディスクリプターの複製は行なわれない。 \fBfdopen\fP()
+で作成されたストリームが閉じられたときにファイルディスクリプターも 閉じられる。 共有メモリーのオブジェクトへ \fBfdopen\fP()
+を行ったときの結果は定義されていない。
+.SS freopen()
+The \fBfreopen\fP()  function opens the file whose name is the string pointed
+to by \fIpathname\fP and associates the stream pointed to by \fIstream\fP with
+it.  The original stream (if it exists) is closed.  The \fImode\fP argument is
+used just as in the \fBfopen\fP()  function.
+.PP
+If the \fIpathname\fP argument is a null pointer, \fBfreopen\fP()  changes the
+mode of the stream to that specified in \fImode\fP; that is, \fBfreopen\fP()
+reopens the pathname that is associated with the stream.  The specification
+for this behavior was added in the C99 standard, which says:
+.PP
+.RS
+In this case, the file descriptor associated with the stream need not be
+closed if the call to \fBfreopen\fP()  succeeds.  It is implementation\-defined
+which changes of mode are permitted (if any), and under what circumstances.
+.RE
+.PP
+The primary use of the \fBfreopen\fP()  function is to change the file
+associated with a standard text stream (\fIstderr\fP, \fIstdin\fP, or \fIstdout\fP).
+.SH 返り値
+Upon successful completion \fBfopen\fP(), \fBfdopen\fP(), and \fBfreopen\fP()  return
+a \fIFILE\fP pointer.  Otherwise, NULL is returned and \fIerrno\fP is set to
+indicate the error.
+.SH エラー
+.TP 
+\fBEINVAL\fP
+\fBfopen\fP(), \fBfdopen\fP(), \fBfreopen\fP()  で与えられた \fImode\fP が不適切である。
+.PP
+The \fBfopen\fP(), \fBfdopen\fP(), and \fBfreopen\fP()  functions may also fail and
+set \fIerrno\fP for any of the errors specified for the routine \fBmalloc\fP(3).
+.PP
+\fBfopen\fP()  関数は \fBopen\fP(2)  ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に \fIerrno\fP
+をセットする。
+.PP
+\fBfdopen\fP()  関数は \fBfcntl\fP(2)  ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に
+\fIerrno\fP をセットする。
+.PP
+\fBfreopen\fP()  関数は \fBopen\fP(2), \fBfclose\fP(3), \fBfflush\fP(3)
+各ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に \fIerrno\fP をセットする。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw28 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfopen\fP(),
+\fBfdopen\fP(),
+\fBfreopen\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+\fBfopen\fP(), \fBfreopen\fP(): POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.PP
+\fBfdopen\fP(): POSIX.1\-2001, POSIX.1\-2008.
+.SH 注意
+.SS "glibc での注意"
+GNU C ライブラリでは、 \fImode\fP に指定できる文字列として、以下の拡張が行われている:
+.TP 
+\fBc\fP (glibc 2.3.3 以降)
+open 操作、それに続く read/write 操作の、 スレッドの取り消しポイント
+(cancellation points) を作成しない。
+このフラグは \fBfdopen\fP() では無視される。
+.TP 
+\fBe\fP (glibc 2.7 以降)
+\fBO_CLOEXEC\fP フラグを有効にしてファイルをオープンする。詳細は
+\fBopen\fP(2) を参照。このフラグは \fBfdopen\fP() では無視される。
+.TP 
+\fBm\fP (glibc 2.3 以降)
+.\" As at glibc 2.4:
+I/O システムコール (\fBread\fP(2), \fBwrite\fP(2))  ではなく、 \fBmmap\fP(2)
+を使ってファイルにアクセスしようとする。 \fBmmap\fP(2)  を使おうとするのは、読み出し用にオープンするファイルについてだけである。
+.TP 
+\fBx\fP
+.\" Since glibc 2.0?
+.\" FIXME . C11 specifies this flag
+ファイルを排他的にオープンする (\fBopen\fP(2)  の \fBO_EXCL\fP フラグと同様)。 ファイルがすでに存在する場合、 \fBfopen\fP()
+は失敗し、 \fIerrno\fP に \fBEEXIST\fP がセットされる。 このフラグは \fBfdopen\fP()  では無視される。
+.PP
+上記の文字に加えて、
+\fBfopen\fP() と \fBfreopen\fP() では \fImode\fP に
+以下の書式を 指定することができる。
+.PP
+\fB ,ccs=\fP\fIstring\fP
+.PP
+指定された \fIstring\fP は、符号化文字集合の名前と解釈され、
+ストリームではワイド文字のストリームとして扱われる。
+内部変換関数で入出力時に文字集合 \fIstring\fP との変換が行われる。
+書式 \fB,ccs=\fP\fIstring\fP が指定されない場合は、
+ストリームをワイド文字のストリームとして扱うかは
+最初のファイル操作時に決定される。
+最初のファイル操作がワイド文字操作であった場合は、
+そのストリームはワイド文字のストリームとして扱われ、
+符号化文字集合との変換を行う関数が読み込まれる。
+.SH バグ
+.\" FIXME . http://sourceware.org/bugzilla/show_bug.cgi?id=12685
+\fImode\fP の個々のフラグ文字 ("ccs" 指定の前の文字) を解釈する際に、
+glibc の \fBfopen\fP() と \fBfreopen\fP() の実装では、
+\fImode\fP の確認を最大 7 文字しか行わないという制限がある
+(バージョン 2.14 より前の glibc では最大 6 文字だが、
+6 文字では "rb+cmxe" などの指定を行うには不十分であった)。
+\fBfdopen\fP() の現在の実装では最大 5 文字の \fImode\fP しか解釈されない。
+.SH 関連項目
+\fBopen\fP(2), \fBfclose\fP(3), \fBfileno\fP(3), \fBfmemopen\fP(3), \fBfopencookie\fP(3),
+\fBopen_memstream\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index 86c582a..fb27665 100644 (file)
@@ -144,19 +144,19 @@ typedef struct {
 .\" It's not clear if errno ever gets set...
 成功すると \fBfopencookie\fP() は新しいストリームへのポインターを返す。 エラーの場合、 NULL が返される。
 .SH 属性
-For an explanation of the terms used in this section, see \fBattributes\fP(7).
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
 .TS
 allbox;
 lb lb lb
 l l l.
-Interface      Attribute       Value
+インターフェース       属性  値
 T{
 \fBfopencookie\fP()
 T}     Thread safety   MT\-Safe
 .TE
 .SH 準拠
 この関数は非標準の GNU 拡張である。
-.SH EXAMPLES
+.SH 
 以下のプログラムは、 \fBfmemopen\fP(3) で利用できるのと似た (同じではない) 機能を持つ独自のストリームを実装している。
 データがメモリーバッファーに格納されるストリームを実装している。 このプログラムは、 コマンドライン引き数をストリームに書き込み、
 それからストリームをたどって 5 文字ごとに 2 文字を読み出して、 それを標準出力に書き込む。 以下のシェルセッションはこのプログラムの使用例である。
diff --git a/manual/LDP_man-pages/draft/man3/fpurge.3 b/manual/LDP_man-pages/draft/man3/fpurge.3
new file mode 100644 (file)
index 0000000..7fecd0c
--- /dev/null
@@ -0,0 +1,84 @@
+.\" Copyright (C) 2001 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
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
+.\" Translated Sat 12 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH FPURGE 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+fpurge, __fpurge \- ストリームを一掃 (purge) する
+.SH 書式
+.nf
+/* unsupported */
+\fB#include <stdio.h>\fP
+.PP
+\fBint fpurge(FILE *\fP\fIstream\fP\fB);\fP
+
+/* supported */
+\fB#include <stdio.h>\fP
+\fB#include <stdio_ext.h>\fP
+.PP
+\fBvoid  __fpurge(FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.SH 説明
+\fBfpurge\fP()  関数は、与えられたストリームのバッファーをクリアする。 出力ストリームでこれを行うと、書き出されていない出力は捨てられる。
+入力ストリームでこれを行うと、 下層にあるオブジェクトから読み込まれ \fBgetc\fP(3)  による取得を待っている入力が、すべて捨てられる。 これには
+\fBungetc\fP(3)  によって戻されたテキストも含まれる。 \fBfflush\fP(3)  も参照のこと。
+.PP
+\fB__fpurge\fP()  関数も全く同じことを行うが、ただし返り値を返さない。
+.SH 返り値
+成功すると \fBfpurge\fP()  は 0 を返す。 エラーが起こると \-1 を返し、 \fIerrno\fP を適切な値に設定する。
+.SH エラー
+.TP 
+\fBEBADF\fP
+\fIstream\fP がオープンされていない。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fB__fpurge\fP()
+T}     Thread safety   MT\-Safe race:stream
+.TE
+.sp 1
+.SH 準拠
+これらの関数は標準ではなく、よって移植性もない。 \fBfpurge\fP()  関数は 4.4BSD で導入されたが、Linux では利用できない。
+\fB__fpurge\fP()  関数は Solaris で導入され、glibc 2.1.95 以降には存在している。
+.SH 注意
+通常は入力バッファーを捨てようとするのは間違っている。
+.SH 関連項目
+.\" .BR fclean (3),
+\fBfflush\fP(3), \fBsetbuf\fP(3), \fBstdio_ext\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fputwc.3 b/manual/LDP_man-pages/draft/man3/fputwc.3
new file mode 100644 (file)
index 0000000..9a7ec13
--- /dev/null
@@ -0,0 +1,80 @@
+.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
+.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
+.\" 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.
+.\" %%%LICENSE_END
+.\"
+.\" References consulted:
+.\"   GNU glibc-2 source code and manual
+.\"   Dinkumware C library reference http://www.dinkumware.com/
+.\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
+.\"   ISO/IEC 9899:1999
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Translated Sun Aug 29 15:03:11 JST 1999
+.\"           by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
+.\" Updated Sat Jan  8 JST 2000 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Fri Nov  2 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH FPUTWC 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+fputwc, putwc \- ワイド文字を FILE ストリームに書き込む
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+\fB#include <wchar.h>\fP
+.PP
+\fBwint_t fputwc(wchar_t \fP\fIwc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t putwc(wchar_t \fP\fIwc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.SH 説明
+\fBfputwc\fP()  関数は、 \fBfputc\fP(3)  に対応するワイド文字関数である。この 関数は、ワイド文字 \fIwc\fP を
+\fIstream\fP に書き込む。 \fIferror(stream)\fP が真になると、この関数は \fBWEOF\fP を返す。
+ワイド文字変換でエラーが発生した場合は、 \fIerrno\fP に \fBEILSEQ\fP をセットし、 \fBWEOF\fP を返す。
+それ以外の場合では、この関数は \fIwc\fP を返す。
+.PP
+\fBputwc\fP()  関数あるいはマクロは、 \fBfputwc\fP()  と全く同じ動作をする。
+この関数はマクロとして実装されるかもしれないので、引き数が複数回評価さ れるかもしれない。この関数を使う理由はもはや存在しない。
+.PP
+これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH 返り値
+\fBfputwc\fP()  関数は、エラーが起きなければ \fIwc\fP を返す。エラーの場合には \fBWEOF\fP が返り、 \fIerrno\fP
+にエラーの原因を示す値が設定される。
+.SH エラー
+通常のエラーに加えて、以下のエラーがある:
+.TP 
+\fBEILSEQ\fP
+\fIwc\fP からストリームの符号への変換に失敗した。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw17 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfputwc\fP(),
+\fBputwc\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C99.
+.SH 注意
+\fBfputwc\fP()  の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリーに依存する。
+.PP
+\fBfopen\fP(3)  システムコールに渡す追加情報がない場合には、 \fBfputwc\fP()  は 実際にはワイド文字 \fIwc\fP
+に対応するマルチバイトシーケンスを書き込むと 期待してよい。
+.SH 関連項目
+\fBfgetwc\fP(3), \fBfputws\fP(3), \fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fseek.3 b/manual/LDP_man-pages/draft/man3/fseek.3
new file mode 100644 (file)
index 0000000..8bb0262
--- /dev/null
@@ -0,0 +1,130 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)fseek.3    6.11 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Mon Apr 27 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH FSEEK 3 2018\-04\-30 GNU "Linux Programmer's Manual"
+.SH 名前
+fgetpos, fseek, fsetpos, ftell, rewind \- ストリームの位置を変更する
+.SH 書式
+\fB#include <stdio.h>\fP
+.PP
+\fBint fseek(FILE *\fP\fIstream\fP\fB, long \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
+.PP
+\fBlong ftell(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBvoid rewind(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint fgetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP
+.PP
+\fBint fsetpos(FILE *\fP\fIstream\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP
+.SH 説明
+\fBfseek\fP()  関数は \fIstream\fP によって指定されたストリームにおいて、ファイル位置表示子 (file position
+indicator) をセットする。新たな位置 (バイト単位)  は \fIwhence\fP で指定された位置に \fIoffset\fP
+バイトを加えることによって与えられる。 \fIwhence\fP が \fBSEEK_SET\fP, \fBSEEK_CUR\fP, \fBSEEK_END\fP
+のどれかになっている場合は、それぞれファイルの先頭、現在の位置表示子、 ファイルの末尾からのオフセットが取られる。 \fBfseek\fP()
+関数の呼び出しが成功すると、ストリームの end\-of\-file 表示子は クリアされ、それまでに \fBungetc\fP(3)
+関数で戻したデータはなかったことになる。
+.PP
+\fBftell\fP()  関数は \fIstream\fP によって指定されたストリームにおける、ファイル位置表示子 の現時点での値を与える。
+.PP
+\fBrewind\fP()  関数は \fIstream\fP によって指定されたストリームにおいて、ファイル位置表示子
+をファイルの先頭にセットする。この関数は以下と等価である。
+.PP
+.RS
+(void) fseek(stream, 0L, SEEK_SET)
+.RE
+.PP
+ただし \fBrewind\fP()  ではストリームに対するエラー表示子 (error indicator) も同時に クリアされる (
+\fBclearerr\fP(3)  を見よ)。
+.PP
+\fBfgetpos\fP()  関数と \fBfsetpos\fP()  関数は、それぞれ \fBftell\fP()  と \fBfseek\fP()  で
+\fIwhence\fP に \fBSEEK_SET\fP を指定した場合と同様の機能を、異なるインターフェースで提供する。 \fBfgetpos\fP()
+はファイルオフセットの現在の値を \fIpos\fP が参照するオブジェクトに保存し、 \fBfsetpos\fP()  はファイルオフセットを \fIpos\fP
+に設定する。 UNIX 以外のシステムにおいては、 \fIfpos_t\fP が構造体などの複雑なオブジェクトになっていて、これらのルーチンがテキス
+トストリームでファイル位置を変更する方法のうち、移植性のある唯一のもの になっている場合もある。
+.SH 返り値
+\fBrewind\fP()  は返り値を持たない。 \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP()  は成功すると 0
+を返す。 \fBftell\fP()  は現在のオフセットを返す。失敗した場合は返り値は \-1 となり、 \fIerrno\fP にエラーを示す値がセットされる。
+.SH エラー
+.TP 
+\fBEINVAL\fP
+\fBfseek\fP()  関数に対して与えた \fIwhence\fP 引数が \fBSEEK_SET\fP, \fBSEEK_END\fP, \fBSEEK_CUR\fP
+以外の値であった。 または、更新後のファイルオフセットが負になってしまう。
+.TP 
+\fBESPIPE\fP
+The file descriptor underlying \fIstream\fP is not seekable (e.g., it refers to
+a pipe, FIFO, or socket).
+.PP
+\fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP(), \fBftell\fP()  は、それぞれ \fBfflush\fP(3),
+\fBfstat\fP(2), \fBlseek\fP(2), \fBmalloc\fP(3)  などのルーチンを呼び出す際に失敗する可能性がある。この場合は
+それぞれ対応した \fIerrno\fP が設定される。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw27 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfseek\fP(),
+\fBftell\fP(),
+\fBrewind\fP(),
+.br
+\fBfgetpos\fP(),
+\fBfsetpos\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.SH 関連項目
+\fBlseek\fP(2), \fBfseeko\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/fseeko.3 b/manual/LDP_man-pages/draft/man3/fseeko.3
new file mode 100644 (file)
index 0000000..ac0fede
--- /dev/null
@@ -0,0 +1,94 @@
+.\" Copyright 2001 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
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
+.\" Translated 2002-01-06, NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Updated 2006-01-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH FSEEKO 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+fseeko, ftello \- ファイル位置を探す/報告する
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint fseeko(FILE *\fP\fIstream\fP\fB, off_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
+.PP
+\fBoff_t ftello(FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBfseeko\fP(), \fBftello\fP():
+.br
+.RS 4
+.ad l
+_FILE_OFFSET_BITS\ ==\ 64 || _POSIX_C_SOURCE\ >=\ 200112L
+.br
+(廃止予定のマクロ _LARGEFILE_SOURCE を指定しても動作する)
+.RE
+.ad
+.SH 説明
+\fBfseeko\fP()  関数および \fBftello\fP()  関数は、 それぞれ \fBfseek\fP(3)  および \fBftell\fP(3)
+と同一の機能を持つ (\fBfseek\fP(3)  を見よ) が、ただし \fBfseeko\fP()  関数の \fIoffset\fP 引数と
+\fBftello\fP()  の返り値が、 \fIlong\fP ではなく \fIoff_t\fP になっている。
+.PP
+いくつかのアーキテクチャーでは、 \fIoff_t\fP と \fIlong\fP の両方が 32 ビット型だが、
+(「どの」ヘッダーファイルをインクルードするよりも前に) \fB_FILE_OFFSET_BITS\fP を値 64 で定義すると、 \fIoff_t\fP が
+64 ビット型になる。
+.SH 返り値
+成功した場合、 \fBfseeko\fP()  は 0 を、 \fBftello\fP()  は現在のオフセットを返す。 失敗した場合、\-1 を返し、
+\fIerrno\fP にエラーを示す値をセットする。
+.SH エラー
+\fBfseek\fP(3)  の「エラー」の節を参照。
+.SH バージョン
+これらの関数はバージョン 2.1 以降の glibc で利用可能である。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw18 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfseeko\fP(),
+\fBftello\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, SUSv2.
+.SH 関連項目
+\fBfseek\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/getline.3 b/manual/LDP_man-pages/draft/man3/getline.3
new file mode 100644 (file)
index 0000000..e06816e
--- /dev/null
@@ -0,0 +1,155 @@
+.\" Copyright (c) 2001 John Levon <moz@compsoc.man.ac.uk>
+.\" Based in part on GNU libc documentation
+.\"
+.\" %%%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.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2001 Yuichi SATO
+.\"         all rights reserved.
+.\" Translated 2001-11-09, Yuichi SATO <ysato@h4.dion.ne.jp>
+.\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.34
+.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24
+.\" Updated 2013-07-22, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH GETLINE 3 2020\-11\-01 GNU "Linux Programmer's Manual"
+.SH 名前
+getline, getdelim \- 区切り文字までの文字列入力を読み込む
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBssize_t getline(char **\fP\fIlineptr\fP\fB, size_t *\fP\fIn\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBssize_t getdelim(char **\fP\fIlineptr\fP\fB, size_t *\fP\fIn\fP\fB, int \fP\fIdelim\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+.ad l
+\fBgetline\fP(), \fBgetdelim\fP():
+.PD 0
+.RS 4
+.TP  4
+glibc 2.10 以降:
+_POSIX_C_SOURCE\ >=\ 200809L
+.TP 
+glibc 2.10 より前:
+_GNU_SOURCE
+.RE
+.PD
+.ad
+.SH 説明
+\fBgetline\fP()  は \fIstream\fP から 1 行全てを読み込み、テキストが含まれているバッファーのアドレスを \fI*lineptr\fP
+に格納する。 バッファーはヌル文字 (\e0) で終端される。 改行文字が見つかった場合は、改行文字もバッファーに格納される。
+.PP
+\fI*lineptr\fP が NULL にセットされ、 \fI*n\fP が呼び出し前に 0 にセットされた場合、 \fBgetline\fP()
+は行の内容を格納するためのバッファーを確保する。 このバッファーは、 \fBgetline\fP()
+が失敗した場合であっても、ユーザーのプログラムで解放すべきである。
+.PP
+別の方法として、 \fBgetline\fP()  を呼び出す際に、 \fI*lineptr\fP に \fBmalloc\fP(3)  で確保した大きさ \fI*n\fP
+バイトのバッファーへのポインターを入れて渡すこともできる。 読み込んだ行を保持するのに十分なバッファーがない場合、 \fBgetline\fP()  は
+\fBrealloc\fP(3)  を使ってバッファーのサイズを変更し、必要に応じて \fI*lineptr\fP と \fI*n\fP を更新する。
+.PP
+どちらの場合でも、呼び出しに成功したときには、 \fI*lineptr\fP と \fI*n\fP
+がバッファーのアドレスと割り当てたサイズを反映した値に更新される。
+.PP
+\fBgetdelim\fP()  は \fBgetline\fP()  と同じように動作するが、改行文字以外の区切り文字を引き数 \fIdelim\fP
+に指定することができる。 \fBgetline\fP()  と同様に、ファイル終端に達するまでに入力行に区切り文字が見付からない場合は、
+区切り文字をバッファーに追加しない。
+.SH 返り値
+成功した場合、 \fBgetline\fP()  と \fBgetdelim\fP()  は読み込んだ文字数を返す。
+文字数には区切り文字は含まれるが、終端に使うヌルバイト (\(aq\e0\(aq) は含まれない。
+この値によって、読み込んだ行に含まれるヌルバイトを操作することができる。
+.PP
+どちらの関数も、行の読み込みに失敗した場合には \-1 を返す (ファイルの終端に達した場合にも \-1 を返す)。 エラーが発生した場合には、
+\fIerrno\fP にエラーの原因を示す値が設定される。
+.SH エラー
+.TP 
+\fBEINVAL\fP
+引き数が不正である (\fIn\fP または \fIlineptr\fP が NULL である。 もしくは \fIstream\fP が有効でない)。
+.TP 
+\fBENOMEM\fP
+Allocation or reallocation of the line buffer failed.
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw21 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBgetline\fP(),
+\fBgetdelim\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+\fBgetline\fP()  と \fBgetdelim\fP()  は、どちらも元は GNU による拡張であったが、 POSIX.1\-2008
+で標準化された。
+.SH 例
+.EX
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+    FILE *stream;
+    char *line = NULL;
+    size_t len = 0;
+    ssize_t nread;
+
+    if (argc != 2) {
+        fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    stream = fopen(argv[1], "r");
+    if (stream == NULL) {
+        perror("fopen");
+        exit(EXIT_FAILURE);
+    }
+
+    while ((nread = getline(&line, &len, stream)) != \-1) {
+        printf("Retrieved line of length %zd:\en", nread);
+        fwrite(line, nread, 1, stdout);
+    }
+
+    free(line);
+    fclose(stream);
+    exit(EXIT_SUCCESS);
+}
+.EE
+.SH 関連項目
+\fBread\fP(2), \fBfgets\fP(3), \fBfopen\fP(3), \fBfread\fP(3), \fBscanf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/gets.3 b/manual/LDP_man-pages/draft/man3/gets.3
new file mode 100644 (file)
index 0000000..1a322a3
--- /dev/null
@@ -0,0 +1,96 @@
+.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\"
+.\" %%%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 Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu)
+.\" Modified Fri Sep  8 15:48:13 1995 by Andries Brouwer (aeb@cwi.nl)
+.\" Modified 2013-12-31, David Malcolm <dmalcolm@redhat.com>
+.\"     Split gets(3) into its own page; fgetc() et al. move to fgetc(3)
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka
+.\"         all rights reserved.
+.\" Translated 1997-02-14, IMAMURA Nobutaka <imamura@spp.hpc.fujitsu.co.jp>
+.\" Updated 1999-08-29, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2001-11-02, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH GETS 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+gets \- 標準入力からの文字列を取得する (非推奨)
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBchar *gets(char *\fP\fIs\fP\fB);\fP
+.fi
+.SH 説明
+\fIこの関数は使用しないこと\fP。
+.PP
+\fBgets\fP()  は、改行文字か \fBEOF\fP までの 1行を \fIstdin\fP から読み込み \fIs\fP が指すバッファーに格納する
+(末尾の改行文字や \fBEOF\fP はヌルバイト (\(aq\e0\(aq) に置き換えられる)。 バッファーオーバーランのチェックは行われない
+(下記の「バグ」を参照)。
+.SH 返り値
+\fBgets\fP() は、成功すると \fIs\fP を返し、エラーや 1 文字も読み込んでいないのにファイルの終わりになった 場合に NULL を返す。
+しかし、バッファーの行き過ぎのチェックが行われないため、この関数が返るという保証はない。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBgets\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+C89, C99, POSIX.1\-2001.
+.PP
+LSB は \fBgets\fP() を非推奨としている。
+POSIX.1\-2008 では \fBgets\fP() に廃止予定の印が付けられている。
+ISO C11 では \fBgets\fP)() の規定が C 言語から削除されている。
+glibc バージョン 2.16 以降では、機能検査マクロ \fB_ISOC11_SOURCE\fP が定義された
+場合、glibc ヘッダーファイルでは \fBgets\fP)() の宣言が公開されない。
+.SH バグ
+\fBgets\fP()  は絶対に使用してはならない。 前もってデータを知ることなしに \fBgets\fP()  が何文字読むかを知ることはできず、
+\fBgets\fP()  がバッファーの終わりを越えて書き込み続けるため、 \fBgets\fP()  を使うのは極めて危険である。
+これを利用してコンピュータのセキュリティが破られてきた。 代わりに \fBfgets\fP()  を使うこと。
+.PP
+詳しい情報については、CWE\-242 (別名 "Use of Inherently Dangerous Function"
+(「本質的に危険な関数を使う」)) を参照。 http://cwe.mitre.org/data/definitions/242.html
+で参照できる。
+.SH 関連項目
+\fBread\fP(2), \fBwrite\fP(2), \fBferror\fP(3), \fBfgetc\fP(3), \fBfgets\fP(3),
+\fBfgetwc\fP(3), \fBfgetws\fP(3), \fBfopen\fP(3), \fBfread\fP(3), \fBfseek\fP(3),
+\fBgetline\fP(3), \fBgetwchar\fP(3), \fBputs\fP(3), \fBscanf\fP(3), \fBungetwc\fP(3),
+\fBunlocked_stdio\fP(3), \fBfeature_test_macros\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/getw.3 b/manual/LDP_man-pages/draft/man3/getw.3
new file mode 100644 (file)
index 0000000..23c32ec
--- /dev/null
@@ -0,0 +1,98 @@
+.\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
+.\"
+.\" %%%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.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
+.\"    all rights reserved.
+.\" Translated Wed Dec 24 12:33:19 JST 1997
+.\"    by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
+.\" Updated Sun Jun 18 16:38:02 JST 2000
+.\"    by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH GETW 3 2016\-03\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+getw, putw \- ワード(int)の入出力
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint getw(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint putw(int \fP\fIw\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBgetw\fP(), \fBputw\fP():
+.ad l
+.PD 0
+.RS 4
+.TP  4
+glibc 2.3.3 以降:
+_XOPEN_SOURCE && ! (_POSIX_C_SOURCE\ >=\ 200112L)
+    || /* Glibc since 2.19: */ _DEFAULT_SOURCE
+    || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
+.TP 
+glibc 2.3.3 より前:
+_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
+.RE
+.PD
+.ad
+.SH 説明
+\fBgetw\fP()  は \fIstream\fP からワード (\fIint\fP型) を読み込む。 この関数は、SVr4 との互換性のために提供されている。
+この関数の代わりに \fBfread\fP(3)  を使用することを勧める。
+.PP
+\fBputw\fP()  は \fIstream\fP にワード \fIw\fP (\fIint\fP型) を書き込む。 この関数は SVr4
+との互換性のために提供されているが、この関数の代わりに \fBfwrite\fP(3)  を使用することを勧める。
+.SH 返り値
+通常、 \fBgetw\fP()  は読み込んだワードを返し、 \fBputw\fP()  は 0 を返す。 エラーが発生した場合、これらの関数は \fBEOF\fP
+を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw14 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBgetw\fP(),
+\fBputw\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+SVr4, SUSv2.  POSIX.1 には存在しない。
+.SH バグ
+エラーの時に返される値は、正しいデータとして返されることもある。 \fBferror\fP(3)  を用いると、この二つの場合を区別することが出来る。
+.SH 関連項目
+\fBferror\fP(3), \fBfread\fP(3), \fBfwrite\fP(3), \fBgetc\fP(3), \fBputc\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/open_memstream.3 b/manual/LDP_man-pages/draft/man3/open_memstream.3
new file mode 100644 (file)
index 0000000..9cdd177
--- /dev/null
@@ -0,0 +1,106 @@
+.\" Copyright 2005, 2012, 2016 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
+.\" Distributed under the GPL.
+.\" %%%LICENSE_END
+.\"
+.\" 2008-12-04, Petr Baudis <pasky@suse.cz>: Document open_wmemstream()
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH OPEN_MEMSTREAM 3 2020\-06\-09 GNU "Linux Programmer's Manual"
+.SH 名前
+open_memstream, open_wmemstream \- open a dynamic memory buffer stream
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBFILE *open_memstream(char **\fP\fIptr\fP\fB, size_t *\fP\fIsizeloc\fP\fB);\fP
+
+\fB#include <wchar.h>\fP
+.PP
+\fBFILE *open_wmemstream(wchar_t **\fP\fIptr\fP\fB, size_t *\fP\fIsizeloc\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBopen_memstream\fP(), \fBopen_wmemstream\fP():
+.PD 0
+.ad l
+.RS 4
+.TP  4
+glibc 2.10 以降:
+_POSIX_C_SOURCE\ >=\ 200809L
+.TP 
+glibc 2.10 より前:
+_GNU_SOURCE
+.RE
+.ad
+.PD
+.SH 説明
+The \fBopen_memstream\fP()  function opens a stream for writing to a memory
+buffer.  The function dynamically allocates the buffer, and the buffer
+automatically grows as needed.  Initially, the buffer has a size of zero.
+After closing the stream, the caller should \fBfree\fP(3)  this buffer.
+.PP
+The locations pointed to by \fIptr\fP and \fIsizeloc\fP are used to report,
+respectively, the current location and the size of the buffer.  The
+locations referred to by these pointers are updated each time the stream is
+flushed (\fBfflush\fP(3))  and when the stream is closed (\fBfclose\fP(3)).  These
+values remain valid only as long as the caller performs no further output on
+the stream.  If further output is performed, then the stream must again be
+flushed before trying to access these values.
+.PP
+バッファー末尾のヌルバイトは保持される。 このヌルバイトは \fIsizeloc\fP に格納されるサイズには「含まれない」。
+.PP
+The stream maintains the notion of a current position, which is initially
+zero (the start of the buffer).  Each write operation implicitly adjusts the
+buffer position.  The stream's buffer position can be explicitly changed
+with \fBfseek\fP(3)  or \fBfseeko\fP(3).  Moving the buffer position past the end
+of the data already written fills the intervening space with null
+characters.
+.PP
+\fBopen_wmemstream\fP()  は \fBopen_memstream\fP()
+と同様だが、バイトではなくワイド文字に対して操作を行う点が異なる。
+.SH 返り値
+Upon successful completion, \fBopen_memstream\fP()  and \fBopen_wmemstream\fP()
+return a \fIFILE\fP pointer.  Otherwise, NULL is returned and \fIerrno\fP is set
+to indicate the error.
+.SH バージョン
+\fBopen_memstream\fP()  was already available in glibc 1.0.x.
+\fBopen_wmemstream\fP()  is available since glibc 2.4.
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBopen_memstream\fP(),
+.br
+\fBopen_wmemstream\fP
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2008.  これらの関数は POSIX.1\-2001 では規定れていないが、 Linux 以外のシステムで広く利用可能である。
+.SH 注意
+これらの関数が返すファイルストリームに対応するファイル ディスクリプターはない (つまり、返されたストリームに対して \fBfileno\fP(3)
+を呼び出すとエラーが返ることになる)。
+.SH バグ
+.\" http://sourceware.org/bugzilla/show_bug.cgi?id=1996
+バージョン 2.7 より前の glibc では、 \fBopen_memstream\fP()
+で作成されたストリームの末尾より先にファイル位置を動かしても、 バッファーが伸長されず、 \fBfseek\fP(3)  が失敗し \-1 が返る。
+.SH 例
+\fBfmemopen\fP(3) 参照。
+.SH 関連項目
+\fBfmemopen\fP(3), \fBfopen\fP(3), \fBsetbuf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/popen.3 b/manual/LDP_man-pages/draft/man3/popen.3
new file mode 100644 (file)
index 0000000..30ea2a8
--- /dev/null
@@ -0,0 +1,161 @@
+.\" Copyright 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)popen.3    6.4 (Berkeley) 4/30/91
+.\"
+.\" Converted for Linux, Mon Nov 29 14:45:38 1993, faith@cs.unc.edu
+.\" Modified Sat May 18 20:37:44 1996 by Martin Schulze (joey@linux.de)
+.\" Modified 7 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk)
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 Takashi Yoshino
+.\"       all rights reserved.
+.\" Translated 1997-01-21, Takashi Yoshino <tyoshino@eng.toyo.ac.jp>
+.\" Modified 2007-05-03, Akihiro MOTOKI
+.\" Modified 2008-11-09, Akihiro MOTOKI, LDP v3.13
+.\"
+.TH POPEN 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+popen, pclose \- プロセスとの入力/出力用のパイプストリーム
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBFILE *popen(const char *\fP\fIcommand\fP\fB, const char *\fP\fItype\fP\fB);\fP
+.PP
+\fBint pclose(FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.ad l
+.RE
+.PP
+\fBpopen\fP(), \fBpclose\fP():
+.RS 4
+_POSIX_C_SOURCE\ >=\ 2
+    || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+\fBpopen\fP()  関数は、プロセスをオープンする。具体的には、 パイプを生成し、フォークを行い、シェルを起動する。
+定義から分かるように、パイプは一方向なので、 \fItype\fP 引き数には読み込みか書き込みのどちらか一方だけを指定できる (両方は指定できない)。
+生成されるストリームは、この指定に対応して、読み取り専用または 書き込み専用のいずれかとなる。
+.PP
+The \fIcommand\fP argument is a pointer to a null\-terminated string containing
+a shell command line.  This command is passed to \fI/bin/sh\fP using the \fB\-c\fP
+flag; interpretation, if any, is performed by the shell.
+.PP
+The \fItype\fP argument is a pointer to a null\-terminated string which must
+contain either the letter \(aqr\(aq for reading or the letter \(aqw\(aq for
+writing.  Since glibc 2.9, this argument can additionally include the letter
+\(aqe\(aq, which causes the close\-on\-exec flag (\fBFD_CLOEXEC\fP)  to be set on
+the underlying file descriptor; see the description of the \fBO_CLOEXEC\fP flag
+in \fBopen\fP(2)  for reasons why this may be useful.
+.PP
+\fBpopen\fP()  からの返り値は、通常の標準 I/O ストリームと同じであるが、 \fBfclose\fP(3)  ではなく \fBpclose\fP()
+で閉じなくてはならないことだけが異なる。 このストリームへ書き込んだ結果はコマンドの標準入力に書き込まれる。 そして、コマンドの標準出力は、
+コマンドそのものが置き換わってしまわない限り、 \fBpopen\fP()  を呼んだプロセスの標準出力と同じことになる。 逆に、
+ストリームからの読み込みは、 そのコマンドの標準出力を読み込むことになる。 そして、そのコマンドの標準入力は \fBpopen\fP()
+を呼んだプロセスの標準入力と同一である。
+.PP
+Note that output \fBpopen\fP()  streams are block buffered by default.
+.PP
+\fBpclose\fP()  関数は、(パイプに) 関連づけられたプロセスが終了するのを待ち、 \fBwait4\fP(2)
+によって返されたコマンドの終了状態を返す。
+.SH 返り値
+\fBpopen\fP(): on success, returns a pointer to an open stream that can be used
+to read or write to the pipe; if the \fBfork\fP(2)  or \fBpipe\fP(2)  calls fail,
+or if the function cannot allocate memory, NULL is returned.
+.PP
+.\" These conditions actually give undefined results, so I commented
+.\" them out.
+.\" .I stream
+.\" is not associated with a "popen()ed" command, if
+.\".I stream
+.\" already "pclose()d", or if
+\fBpclose\fP(): on success, returns the exit status of the command; if
+\fBwait4\fP(2)  returns an error, or some other error is detected, \-1 is
+returned.
+.PP
+Both functions set \fIerrno\fP to an appropriate value in the case of an error.
+.SH エラー
+\fBpopen\fP()  関数は、メモリーアロケーションに失敗しても \fIerrno\fP をセットしない。 \fBpopen\fP()  が中で呼び出す
+\fBfork\fP(2)  や \fBpipe\fP(2)  が失敗した場合には、 \fIerrno\fP が適切にセットされる。 引き数 \fItype\fP
+が無効であり、この状態が検知された場合には、 \fIerrno\fP が \fBEINVAL\fP にセットされる。
+.PP
+\fBpclose\fP()  が、子プロセスの状態を取得できなかった場合、 \fIerrno\fP が \fBECHILD\fP にセットされる。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw17 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBpopen\fP(),
+\fBpclose\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008.
+.PP
+\fItype\fP に指定できる \(aqe\(aq は Linux での拡張である。
+.SH 注意
+\fBNote\fP: carefully read Caveats in \fBsystem\fP(3).
+.SH バグ
+読み込みのために開かれたコマンドの標準入力は \fBpopen\fP(), を呼んだプロセスと一緒に、その読み取り位置を共有する。
+そのため、もとのプロセスがバッファーリングされた読み取りを終了したら、 そのコマンドの入力位置は予想されたものには なっていないかもしれない。
+同様に、書き込みのために開かれたコマンドからの出力は、 もとのプロセスの出力と混ざり合うことになるかもしれない。 後者は \fBpopen\fP()  の前に
+\fBfflush\fP(3)  を呼び出すことによって回避可能である。
+.PP
+.\" .SH HISTORY
+.\" A
+.\" .BR popen ()
+.\" and a
+.\" .BR pclose ()
+.\" function appeared in Version 7 AT&T UNIX.
+シェルの実行の失敗は、 シェルがコマンドの実行に失敗したことや、 コマンドがすぐに終了してしまったことと、区別がつかない。 唯一のヒントは終了状態が
+127 になることである。
+.SH 関連項目
+\fBsh\fP(1), \fBfork\fP(2), \fBpipe\fP(2), \fBwait4\fP(2), \fBfclose\fP(3), \fBfflush\fP(3),
+\fBfopen\fP(3), \fBstdio\fP(3), \fBsystem\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/printf.3 b/manual/LDP_man-pages/draft/man3/printf.3
new file mode 100644 (file)
index 0000000..a127873
--- /dev/null
@@ -0,0 +1,614 @@
+.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl)
+.\"
+.\" Earlier versions of this page influenced the present text.
+.\" It was derived from a Berkeley page with version
+.\"       @(#)printf.3    6.14 (Berkeley) 7/30/91
+.\" converted for Linux by faith@cs.unc.edu, updated by
+.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible.
+.\"
+.\" %%%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
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
+.\"
+.\" 1999-11-25 aeb - Rewritten, using SUSv2 and C99.
+.\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes
+.\" 2000-10-16 jsm28@hermes.cam.ac.uk - more fixes
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi all rights reserved.
+.\" Translated 1998-02-17, YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
+.\" Updated 2000-10-02, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2001-01-29, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-01-03, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-10-17, Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2005-03-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
+.\" Updated 2009-03-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.19
+.\" Updated 2012-05-29, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-07-22, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH PRINTF 3 2020\-11\-01 GNU "Linux Programmer's Manual"
+.SH 名前
+printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf, vdprintf,
+vsprintf, vsnprintf \- 指定された書式に変換して出力を行う
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint printf(const char *\fP\fIformat\fP\fB, ...);\fP
+\fBint fprintf(FILE *\fP\fIstream\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP
+\fBint dprintf(int \fP\fIfd\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP
+\fBint sprintf(char *\fP\fIstr\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP
+\fBint snprintf(char *\fP\fIstr\fP\fB, size_t \fP\fIsize\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP
+
+\fB#include <stdarg.h>\fP
+.PP
+\fBint vprintf(const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP
+\fBint vfprintf(FILE *\fP\fIstream\fP\fB, const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP
+\fBint vdprintf(int \fP\fIfd\fP\fB, const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP
+\fBint vsprintf(char *\fP\fIstr\fP\fB, const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP
+\fBint vsnprintf(char *\fP\fIstr\fP\fB, size_t \fP\fIsize\fP\fB, const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+.ad l
+\fBsnprintf\fP(), \fBvsnprintf\fP():
+.RS 4
+_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE ||
+    || /* Glibc versions <= 2.19: */ _BSD_SOURCE
+.RE
+.PP
+\fBdprintf\fP(), \fBvdprintf\fP():
+.PD 0
+.RS 4
+.TP  4
+glibc 2.10 以降:
+_POSIX_C_SOURCE\ >=\ 200809L
+.TP 
+glibc 2.10 より前:
+_GNU_SOURCE
+.RE
+.ad
+.PD
+.SH 説明
+\fBprintf\fP()  関数グループは、以下で述べるように、 \fIformat\fP に従って出力を生成するものである。 \fBprintf\fP()  と
+\fBvprintf\fP()  は出力を \fIstdout\fP (標準出力ストリーム) に書き出す。 \fBfprintf\fP()  と
+\fBvfprintf\fP()  は出力を指定された出力 \fIstream\fP に書き出す。 \fBsprintf\fP(), \fBsnprintf\fP(),
+\fBvsprintf\fP(), \fBvsnprintf\fP()  は出力を文字列 \fIstr\fP に書き込む。
+.PP
+\fBdprintf\fP() 関数は \fBfprintf\fP(3) 関数と同じだが、 この関数は \fIstdio\fP ストリームではなくファイルディスクリプター
+\fIfd\fP に対して出力を行う点が異なる。
+.PP
+\fBsnprintf\fP()  と \fBvsnprintf\fP()  は最大で \fIsize\fP バイトを \fIstr\fP に書き込む (\fIsize\fP
+には文字列を終端するヌルバイト (\(aq\e0\(aq) もを含まれる)。
+.PP
+\fBvprintf\fP(), \fBvfprintf\fP(), \fBvdprintf\fP(), \fBvsprintf\fP(), \fBvsnprintf\fP()
+の各関数はそれぞれ \fBprintf\fP(), \fBfprintf\fP(), \fBdprintf\fP(), \fBsprintf\fP(),
+\fBsnprintf\fP(), の各関数と等価であり、可変数引き数の代わりに \fIva_list\fP を引き数として呼び出される点だけが異なる。
+これらの関数では \fIva_end\fP マクロは呼び出されない。 これらの関数は \fIva_arg\fP を呼び出すので、呼び出し後の \fIap\fP
+の値は未定義である。 \fBstdarg\fP(3)  を参照のこと。
+.PP
+これらの関数はすべて \fIformat\fP 文字列の制御に従って出力を書き出す。 \fIformat\fP 文字列は、これに続く引き数 (または
+\fBstdarg\fP(3)  の可変長引き数機構を使ってアクセスできる引き数)  をどのように変換して出力するかを指定する。
+.PP
+C99 と POSIX.1\-2001 では、 \fBsprintf\fP(), \fBsnprintf\fP(), \fBvsprintf\fP(),
+\fBvsnprintf\fP()  の呼び出しで、範囲が重複するオブジェクト間でコピーが発生する場合の 結果は不定であると規定されている
+(例えば、出力先の文字列と入力された 引き数の一つが同じバッファーを参照している場合などである)。 「注意」の節を参照。
+.SS フォーマット文字列のフォーマット
+フォーマット文字列は文字の列で、 (もしあるなら) 初期シフト状態で始まり、初期シフト状態で終わる。 フォーマット用の文字列は 0 個以上の命令
+(directives) によって構成される。 命令には、通常文字と変換指定 (conversion specifications) がある。
+通常文字は \fB%\fP 以外の文字で、出力ストリームにそのままコピーされる。 変換指定は、それぞれが 0 個以上の引き数を取る。 各変換指定は文字
+\fB%\fP で始まり、 \fI変換指定子 (conversion specifier)\fP で終わる。 \fB%\fP と変換指定子の間には、0 個以上の
+\fIフラグ 、\fP 最小 \fIフィールド幅 、\fP \fI精度 、\fP \fI長さ修飾子\fP を (この順序で) 置くことができる。
+.PP
+The arguments must correspond properly (after type promotion) with the
+conversion specifier.  By default, the arguments are used in the order
+given, where each \(aq*\(aq (see \fIField width\fP and \fIPrecision\fP below) and
+each conversion specifier asks for the next argument (and it is an error if
+insufficiently many arguments are given).  One can also specify explicitly
+which argument is taken, at each place where an argument is required, by
+writing "%m$" instead of \(aq%\(aq and "*m$" instead of \(aq*\(aq, where the
+decimal integer \fIm\fP denotes the position in the argument list of the
+desired argument, indexed starting from 1.  Thus,
+.PP
+.in +4n
+.EX
+printf("%*d", width, num);
+.EE
+.in
+.PP
+と
+.PP
+.in +4n
+.EX
+printf("%2$*1$d", width, num);
+.EE
+.in
+.PP
+は等価である。 二番目の書き方では同じ引き数を繰り返し参照することができる。 C99 標準には、 Single UNIX Specification
+由来の \(aq$\(aq を使った書き方は含まれていない。 \(aq$\(aq を使ったスタイルを使うと、引き数を取る変換及び幅と精度の引き数を
+全てこのスタイルで指定しなければならないが、 引き数を消費しない "%%" フォーマットと混ざっているかもしれない。 \(aq$\(aq
+で指定される引き数の番号に空きがあってはならない。 例えば、もし引き数 1 と 3 が指定されると、引き数 2 もフォーマット文字列のどこかで
+指定されなければならない。
+.PP
+数値変換には小数点や 1000 単位の区切り文字を使うものもある。 実際にどの文字を使うかはロケールの \fBLC_NUMERIC\fP による
+(\fBsetlocale\fP(3) 参照)。 POSIX ロケールでは小数点に \(aq.\(aq を用い、 区切り文字は使わない。 従って、
+.PP
+.in +4n
+.EX
+printf("%\(aq.2f", 1234567.89);
+.EE
+.in
+.PP
+は、 POSIX ロケールでは "1234567.89" 、 nl_NL ロケールでは "1234567,89"、 da_DK ロケールでは
+"1.234.567,89" となる。
+.SS "Flag characters"
+% 文字の後ろには 0 個以上のフラグ文字が続く。
+.TP 
+\fB#\fP
+値は「別の形式」に変換される。 \fBo\fP 変換の場合、(先頭文字が 0 になっていない場合に先頭に 0 を追加することで)  出力文字列の最初の文字を
+0 にする。 \fBx\fP と \fBX\fP 変換の場合、数値が 0 でないときには文字列 "0x" (\fBX\fP 変換の場合には "0X") が前に付与される。
+\fBa\fP, \fBA\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, \fBg\fP, \fBG\fP 変換では、 小数点に続く数字がなくても、
+出力には常に小数点が含まれる (通常は、小数点の後に数字が続く場合にのみ、 小数点が表示される)。 \fBg\fP と \fBG\fP
+変換の場合、他の変換とは異なり、末尾のゼロが変換結果から削除されない。 その他の変換では、結果は未定義である。
+.TP 
+\fB\&0\fP
+値をゼロで埋める。 \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP, \fBa\fP, \fBA\fP, \fBe\fP, \fBE\fP, \fBf\fP,
+\fBF\fP, \fBg\fP, \fBG\fP 変換では、変換した値の左側を空白文字の代わりにゼロで埋める。 \fB\&0\fP と \fB\-\fP が両方とも指定された場合は、
+\fB\&0\fP フラグは無視される。 精度が数値変換 (\fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP)
+と同時に指定された場合には、 \fB\&0\fP フラグは無視される。 その他の変換では、動作は未定義である。
+.TP 
+\fB\-\fP
+変換値をフィールド境界で左揃えにする (デフォルトは右揃えである)。 変換された値は 左側ではなく右側を空白文字やゼロで埋められる。 \fB\-\fP と
+\fB\&0\fP の両方が指定された場合には、 \fB\-\fP が優先される。
+.TP 
+\&\fB' '\fP
+(1個の半角スペース)  符号付き変換で生成された正の数字の前に空白 (または空文字列) が置かれる。
+.TP 
+\fB+\fP
+符号付き変換によって出力される数字の前に、常に符号 (+ か \-) が置かれる。 デフォルトでは、符号は負の数字の場合のみ付与される。 \fB+\fP
+と半角スペースの 両方が使われている場合には、 \fB+\fP が優先される。
+.PP
+上記の 5 つのフラグは C99 標準で定義されている。 Single UNIX Specified では、さらにもう一つフラグ文字が規定されている。
+.TP 
+\fB\(aq\fP
+10進数変換 (\fBi\fP, \fBd\fP, \fBu\fP, \fBf\fP, \fBF\fP, \fBg\fP, \fBG\fP)  において、ロケール情報に指定があれば 1000
+単位の区切り文字を出力する (\fBsetlocale\fP(3) 参照)。 \fBgcc\fP(1)
+の多くのバージョンは、このオプションを解釈することができず、 警告を出力することに注意せよ。 (\fI%\(aqF\fP は SUSv2
+には含まれていなかったが、 SUSv3 で追加された。
+.PP
+glibc 2.2 では、さらに一つフラグ文字が追加されている。
+.TP 
+\fBI\fP
+.\" outdigits keyword in locale file
+10進整数変換 (\fBi\fP, \fBd\fP, \fBu\fP)  において、ロケールの代替出力数字があれば、それを用いて出力する。 例えば、 glibc
+2.2.3 以降では、ペルシア ("fa_IR") ロケールで アラビア数字 (Arabic\-Indic digits) を出力できる。
+.SS フィールド幅
+最小のフィールド幅を指定する 10進数の数値文字列 (文字列の最初の文字は ゼロ以外)。本項目はオプションである。
+変換された値の文字数がフィールド長よりも少ない場合、 フィールドの左側をスペースで埋める (左揃えのフラグがある場合は右側を埋める)。
+10進数の文字列の代わりに "*" や "*m$" (\fIm\fP は 10進整数) を書くこともできる。 "*" と "*m$" はそれぞれ、次の引き数と
+\fIm\fP 番目の引き数をフィールド幅として 使うことを指定する (これらの引き数は \fIint\fP 型でなければならない)。
+フィールド幅に負の数が指定された場合は、 \(aq\-\(aq フラグと正の数のフィールド幅として扱われる。
+フィールド幅が小さかったり指定がなかったりしても、フィールドが切り詰められる ことはない。もし変換結果がフィールド幅よりも広かった場合、
+フィールドは変換結果が入る幅に広げられる。
+.SS 精度
+オプションである精度は、ピリオド (\(aq.\(aq) とそれに続く10進数という 形式で指定する (10進数はオプション) 。
+10進数の文字列の代わりに "*" や "*m$" (\fIm\fP は 10 進整数)を書くこともできる。 "*" と "*m$" はそれぞれ、次の引き数と
+\fIm\fP 番目の引き数を精度として 使うことを指定する (これらの引き数は \fIint\fP 型でなければならない)。 精度として \(aq.\(aq
+だけが指定された場合、 精度はゼロとみなされる。 精度が負の数だった場合、 精度は指定されなかったものとみなされる。 \fBd\fP, \fBi\fP, \fBo\fP,
+\fBu\fP, \fBx\fP, \fBX\fP 変換では、表示される最小の桁数を指定する。 \fBa\fP, \fBA\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP
+変換では、小数点以下に表示される数字の桁数を指定する。 \fBg\fP と \fBG\fP 変換では、有効数字の最大桁数を指定する。 \fBs\fP と \fBS\fP
+変換では、文字列から出力される最大文字数を指定する。
+.SS 長さ修飾子
+「整数変換」とは、 \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP 変換のことである。
+.TP 
+\fBhh\fP
+整数変換に対応する引き数が \fIsigned char\fP か \fIunsigned char\fP で、 \fBn\fP 変換に対応する引き数が \fIsigned
+char\fP へのポインターであることを示す。
+.TP 
+\fBh\fP
+整数変換に対応する引き数が \fIshort\fP か \fIunsigned short\fP で、 \fBn\fP 変換に対応する引き数が \fIshort\fP
+へのポインターであることを示す。
+.TP 
+\fBl\fP
+各変換に対応する引き数が、 整数変換では \fIlong\fPか \fIunsigned long\fP、 \fBn\fP 変換では \fIlong\fP へのポインター、
+\fBc\fP 変換では \fIwint_t\fP、 \fBs\fP 変換では \fIwchar_t\fP へのポインターであることを示す。
+.TP 
+\fBll\fP (エルエル)
+整数変換に対応する引き数が \fIlong long\fP か \fIunsigned long long\fP で、 \fBn\fP 変換に対応する引き数が
+\fIlong long\fP へのポインターであることを示す。
+.TP 
+\fBq\fP
+A synonym for \fBll\fP.  This is a nonstandard extension, derived from BSD;
+avoid its use in new code.
+.TP 
+\fBL\fP
+\fBa\fP, \fBA\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP, \fBg\fP, \fBG\fP 変換に対応する引き数が \fIlong double\fP
+であることを示す。 (C99 では %LF を使うことを認めているが、SUSv2 では認められていない。)
+.TP 
+\fBj\fP
+整数変換に対応する引き数が \fIintmax_t\fP か \fIuintmax_t\fP で、 \fBn\fP 変換に対応する引き数が \fIintmax_t\fP
+へのポインターであることを示す。
+.TP 
+\fBz\fP
+整数変換に対応する引き数が \fIsize_t\fP か \fIssize_t\fP で、 \fBn\fP 変換に対応する引き数が \fIsize_t\fP
+へのポインターであることを示す。
+.TP 
+\fBZ\fP
+A nonstandard synonym for \fBz\fP that predates the appearance of \fBz\fP.  Do not
+use in new code.
+.TP 
+\fBt\fP
+整数変換に対応する引き数が \fIptrdiff_t\fP で、 \fBn\fP 変換に対応する引き数が \fIptrdiff_t\fP へのポインターであることを示す。
+.PP
+SUSv3 specifies all of the above, except for those modifiers explicitly
+noted as being nonstandard extensions.  SUSv2 specified only the length
+modifiers \fBh\fP (in \fBhd\fP, \fBhi\fP, \fBho\fP, \fBhx\fP, \fBhX\fP, \fBhn\fP)  and \fBl\fP (in
+\fBld\fP, \fBli\fP, \fBlo\fP, \fBlx\fP, \fBlX\fP, \fBln\fP, \fBlc\fP, \fBls\fP)  and \fBL\fP (in \fBLe\fP,
+\fBLE\fP, \fBLf\fP, \fBLg\fP, \fBLG\fP).
+.PP
+.\"
+As a nonstandard extension, the GNU implementations treats \fBll\fP and \fBL\fP as
+synonyms, so that one can, for example, write \fBllg\fP (as a synonym for the
+standards\-compliant \fBLg\fP)  and \fBLd\fP (as a synonym for the standards
+compliant \fBlld\fP).  Such usage is nonportable.
+.SS 変換指定子
+適用される変換の型を指定する文字。 変換指定子とその意味は以下の通りである。
+.TP 
+\fBd\fP, \fBi\fP
+\fIint\fP 引き数を符号付き 10 進表記に変換する。 精度指定があれば、精度で指定した桁数は必ず出力される。変換後の値が
+指定された桁数に足りない場合は、左側が 0 で埋められる。 デフォルトの精度は 1 である。 0 を表示しようとした時に、明示的に精度として 0
+が指定されていると、 出力は空文字列となる。
+.TP 
+\fBo\fP, \fBu\fP, \fBx\fP, \fBX\fP
+\fIunsigned int\fP 引き数を、 符号なし8進数 (\fBo\fP), 符号なし10進数 (\fBu\fP), 符号なし16進数 (\fBx\fP と
+\fBX\fP)  に変換する。 \fBx\fP 変換では \fBabcdef\fP が使用され、 \fBX\fP 変換では \fBABCDEF\fP が使用される。
+精度指定があれば、精度で指定した桁数は必ず出力される。変換後の値が 指定された桁数に足りない場合は、左側が 0 で埋められる。
+.TP 
+\fBe\fP, \fBE\fP
+The \fIdouble\fP argument is rounded and converted in the style
+[\-]d\fB\&.\fPddd\fBe\fP\(+-dd where there is one digit (which is nonzero if the
+argument is nonzero)  before the decimal\-point character and the number of
+digits after it is equal to the precision; if the precision is missing, it
+is taken as 6; if the precision is zero, no decimal\-point character
+appears.  An \fBE\fP conversion uses the letter \fBE\fP (rather than \fBe\fP)  to
+introduce the exponent.  The exponent always contains at least two digits;
+if the value is zero, the exponent is 00.
+.TP 
+\fBf\fP, \fBF\fP
+\fIdouble\fP 引き数を丸めて [\-]ddd\fB\&.\fPddd の形の10進表現に変換する。 小数点の後の桁数は、精度で指定された値となる。
+精度が指定されていない場合には 6 として扱われる。 精度として明示的に 0 が指定されたときには、小数点以下は表示されない。
+小数点を表示する際には、小数点の前に少なくとも一桁は数字が表示される。
+.IP
+(SUSv2 では、\fBF\fP は規定されておらず、無限や NaN に関する文字列表現を行ってもよいことになっている。 SUSv3 では \fBF\fP
+の規定が追加された。 C99 標準では、\fBf\fP 変換では、無限は "[\-]inf" か "[\-]infinity" と表示し、 NaN
+は文字列の先頭に `nan' をつけて表示するように規定されている。 \fBF\fP 変換の場合は "[\-]INF", "[\-]INFINITY",
+"NAN" と表示される。)
+.TP 
+\fBg\fP, \fBG\fP
+\fIdouble\fP 引き数を \fBf\fP か \fBe\fP (\fBG\fP 変換の場合は \fBF\fP か \fBE\fP)  の形式に変換する。
+精度は表示する桁数を指定する。 精度が指定されない場合は、6桁とみなされる。 精度が 0 の場合は、1桁とみなされる。 変換される値の指数が、 \-4
+より小さいか、精度以上の場合に、 \fBe\fP 形式が使用される。 変換された結果の小数部分の末尾の 0 は削除される。小数点が表示されるのは、
+小数点以下に数字が少なくとも一つある場合にだけである。
+.TP 
+\fBa\fP, \fBA\fP
+(C99; not in SUSv2, but added in SUSv3)  For \fBa\fP conversion, the \fIdouble\fP
+argument is converted to hexadecimal notation (using the letters abcdef)  in
+the style [\-]\fB0x\fPh\fB\&.\fPhhhh\fBp\fP\(+-d; for \fBA\fP conversion the prefix
+\fB0X\fP, the letters ABCDEF, and the exponent separator \fBP\fP is used.  There
+is one hexadecimal digit before the decimal point, and the number of digits
+after it is equal to the precision.  The default precision suffices for an
+exact representation of the value if an exact representation in base 2
+exists and otherwise is sufficiently large to distinguish values of type
+\fIdouble\fP.  The digit before the decimal point is unspecified for
+nonnormalized numbers, and nonzero but otherwise unspecified for normalized
+numbers.  The exponent always contains at least one digit; if the value is
+zero, the exponent is 0.
+.TP 
+\fBc\fP
+\fBl\fP 修飾子がなければ、 \fIint\fP 引き数を \fIunsigned char\fP に変換して、その結果に対応する文字を出力する。 \fBl\fP
+修飾子があれば、 \fIwint_t\fP (ワイド文字) 引き数を、 \fBwcrtomb\fP(3)
+関数を初期シフト状態で呼び出してマルチバイト文字列に変換し、 変換されたマルチバイト文字列を出力する。
+.TP 
+\fBs\fP
+\fBl\fP 修飾子がない場合、 引き数は \fIconst char\ *\fP 型で文字型の配列へのポインター (文字列へのポインター) であることが
+期待されている。配列中の文字は、終端の ヌルバイト (\(aq\e0\(aq)  が出てくるまで出力される (終端文字は出力されない)。
+精度が指定されていると、指定された字数以上は出力されない。 精度が指定された場合には、終端バイトが存在する必要はない。
+精度が指定されていなかったり、精度の値が配列の大きさより大きい場合には、 配列は終端のヌルバイトを含んでいなければならない。
+.IP
+\fBl\fP 修飾子が指定されている場合、 引き数は \fIconst wchar_t\ *\fP 型でワイド文字の配列へのポインターであることが期待されている。
+配列中のワイド文字は (1文字毎に \fBwcrtomb\fP(3)  を呼び出して) マルチバイト文字に変換される (最初のワイド文字の変換の前に
+\fBwcrtomb\fP()  のシフト状態を初期状態に戻してから変換は行われる)。 マルチバイト文字への変換は、文字列を終端するヌルワイド文字が
+出てくるまで行われ、終端ヌルワイド文字も含めて変換される。 結果のマルチバイト文字列は、終端のヌルバイトが出てくるまで 出力される
+(終端のヌルバイトは出力されない)。 精度が指定された場合、指定されたバイト数以上には出力されない。
+但し、マルチバイト文字の一部分だけが出力されることはない。 精度は「バイト」数を指定するものであり、「ワイド文字」数や
+「画面での位置」を指定するものではないことに注意。 精度が指定されていて、さらに出力が配列の末尾に達する前に出力バイト数が
+精度の値を超える場合だけは、配列はヌルワイド文字で終端されていなくてもよい。 それ以外の場合は、必ず配列はヌルワイド文字で終端されていなければならない。
+.TP 
+\fBC\fP
+(C99, C11 にはないが SUSv2, SUSv3, SUSv4 にはある)  \fBlc\fP と同じ。使ってはならない。
+.TP 
+\fBS\fP
+(C99, C11 にはないが SUSv2, SUSv3, SUSv4 にはある)  \fBls\fP と同じ。使ってはならない。
+.TP 
+\fBp\fP
+\fIvoid\ *\fP ポインター引き数を (\fB%#x\fP や \fB%#lx\fP のような) 16 進数で出力する。
+.TP 
+\fBn\fP
+The number of characters written so far is stored into the integer pointed
+to by the corresponding argument.  That argument shall be an \fIint\ *\fP, or
+variant whose size matches the (optionally)  supplied integer length
+modifier.  No argument is converted.  (This specifier is not supported by
+the bionic C library.)  The behavior is undefined if the conversion
+specification includes any flags, a field width, or a precision.
+.TP 
+\fBm\fP
+(glibc での拡張; uClibc と musl で対応)  \fIstrerror(errno)\fP の出力を表示する。引き数は必要ない。
+.TP 
+\fB%\fP
+\(aq%\(aq 文字を出力する。変換される引き数は無い。 変換指定全体を書くと "%%" となる。
+.SH 返り値
+成功時には、上記の関数は書き込まれた文字数を返す (文字列の最後を示すために使用するヌルバイトは数に含まれない)。
+.PP
+\fBsnprintf\fP()  と \fBvsnprintf\fP()  は、 \fIsize\fP バイトを越える文字数を書き込まない (\fIsize\fP
+には文字列を終端するヌルバイト (\(aq\e0\(aq) も含まれる)。 この制限によって出力が切り詰められた場合には、
+もし十分なスペースがあれば書き込まれたであろう文字の個数 (文字列を終端するヌルバイトを除く) を返す。 従って、返り値が \fIsize\fP
+以上だった場合、出力が切り詰められたことを意味する (後述の注意も参照のこと)。
+.PP
+エラーが発生した場合は、負の数を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw23 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBprintf\fP(),
+\fBfprintf\fP(),
+.br
+\fBsprintf\fP(),
+\fBsnprintf\fP(),
+.br
+\fBvprintf\fP(),
+\fBvfprintf\fP(),
+.br
+\fBvsprintf\fP(),
+\fBvsnprintf\fP()
+T}     Thread safety   MT\-Safe locale
+.TE
+.sp 1
+.SH 準拠
+\fBfprintf\fP(), \fBprintf\fP(), \fBsprintf\fP(), \fBvprintf\fP(), \fBvfprintf\fP(),
+\fBvsprintf\fP(): POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.PP
+\fBsnprintf\fP(), \fBvsnprintf\fP(): POSIX.1\-2001, POSIX.1\-2008, C99.
+.PP
+\fBdprintf\fP()  と \fBvdprintf\fP()  は、どちらも元は GNU による拡張であったが、 POSIX.1\-2008
+で標準化された。
+.PP
+.\" .PP
+.\" Linux libc4 knows about the five C standard flags.
+.\" It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP,
+.\" and the conversions
+.\" \fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP,
+.\" \fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP,
+.\" \fBs\fP, \fBu\fP, \fBx\fP, and \fBX\fP,
+.\" where \fBF\fP is a synonym for \fBf\fP.
+.\" Additionally, it accepts \fBD\fP, \fBO\fP, and \fBU\fP as synonyms
+.\" for \fBld\fP, \fBlo\fP, and \fBlu\fP.
+.\" (This is bad, and caused serious bugs later, when
+.\" support for \fB%D\fP disappeared.)
+.\" No locale-dependent radix character,
+.\" no thousands' separator, no NaN or infinity, no "%m$" and "*m$".
+.\" .PP
+.\" Linux libc5 knows about the five C standard flags and the \(aq flag,
+.\" locale, "%m$" and "*m$".
+.\" It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP,
+.\" \fBZ\fP, and \fBq\fP, but accepts \fBL\fP and \fBq\fP
+.\" both for \fIlong double\fP and for \fIlong long\fP (this is a bug).
+.\" It no longer recognizes \fBF\fP, \fBD\fP, \fBO\fP, and \fBU\fP,
+.\" but adds the conversion character
+.\" .BR m ,
+.\" which outputs
+.\" .IR strerror(errno) .
+.\" .PP
+.\" glibc 2.0 adds conversion characters \fBC\fP and \fBS\fP.
+\fBsnprintf\fP()  の返り値を見ると、 SUSv2 と C99 標準は互いに矛盾している。 SUSv2 では、 \fBsnprintf\fP()
+が \fIsize\fP=0 で呼び出された場合、 1 未満の値を何か返り値とするように規定している。 一方 C99 では、このような場合 \fIstr\fP を
+NULL とし、返り値として (通常通り) 出力バッファーが十分な大きさが あった場合に出力されるであろう文字数を返す。 POSIX.1\-2001
+やそれ以降では C99 の \fBsnprintf\fP() の規定にあわせたものとなっている。
+.PP
+glibc 2.1 では、長さ修飾子 \fBhh\fP, \fBj\fP, \fBt\fP, \fBz\fP と変換文字 \fBa\fP, \fBA\fP が追加された。
+.PP
+glibc 2.2 では、 C99 で規定された意味での変換文字 \fBF\fP と フラグ文字 \fBI\fP が追加された。
+.SH 注意
+テキストを \fIbuf\fP に追加するのに、軽率にも次のようなコードを使っているプログラムがある。
+.PP
+    sprintf(buf, "%s some further text", buf);
+.PP
+.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7075
+しかしながら、標準規格では、 \fBsprintf\fP(), \fBsnprintf\fP(), \fBvsprintf\fP(), \fBvsnprintf\fP()
+の呼び出しにおいて、コピー元とコピー先のバッファーが重なっていた場合の 結果は不定である、と明記されている。 使用する \fBgcc\fP(1)
+のバージョンや指定したコンパイラのオプション次第では、 上記のような呼び出しで、期待した結果が得られ「ない」ことがある。
+.PP
+.\" .SH HISTORY
+.\" UNIX V7 defines the three routines
+.\" .BR printf (),
+.\" .BR fprintf (),
+.\" .BR sprintf (),
+.\" and has the flag \-, the width or precision *, the length modifier l,
+.\" and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
+.\" This is still true for 2.9.1BSD, but 2.10BSD has the flags
+.\" #, + and <space> and no longer mentions D,O,U,X.
+.\" 2.11BSD has
+.\" .BR vprintf (),
+.\" .BR vfprintf (),
+.\" .BR vsprintf (),
+.\" and warns not to use D,O,U,X.
+.\" 4.3BSD Reno has the flag 0, the length modifiers h and L,
+.\" and the conversions n, p, E, G, X (with current meaning)
+.\" and deprecates D,O,U.
+.\" 4.4BSD introduces the functions
+.\" .BR snprintf ()
+.\" and
+.\" .BR vsnprintf (),
+.\" and the length modifier q.
+.\" FreeBSD also has functions
+.\" .BR asprintf ()
+.\" and
+.\" .BR vasprintf (),
+.\" that allocate a buffer large enough for
+.\" .BR sprintf ().
+.\" In glibc there are functions
+.\" .BR dprintf ()
+.\" and
+.\" .BR vdprintf ()
+.\" that print to a file descriptor instead of a stream.
+glibc の \fBsnprintf\fP()  と \fBvsnprintf\fP()  の実装は、バージョン 2.1 以降は C99 標準に準拠しており、
+上記の通りの動作をする。 glibc 2.0.6 までは、出力が切り詰められた場合は \-1 を返す。
+.SH バグ
+.\" .PP
+.\" Linux libc4.[45] does not have a
+.\" .BR snprintf (),
+.\" but provides a libbsd that contains an
+.\" .BR snprintf ()
+.\" equivalent to
+.\" .BR sprintf (),
+.\" that is, one that ignores the
+.\" .I size
+.\" argument.
+.\" Thus, the use of
+.\" .BR snprintf ()
+.\" with early libc4 leads to serious security problems.
+\fBsprintf\fP()  と \fBvsprintf\fP()  は勝手に十分に長い文字列領域があると仮定するので、呼び出し側は
+実際の領域からあふれないように注意しなければならない。 しかし、これを保証することが不可能な場合が多い。
+生成される文字列の長さはロケール依存であり、予測が難しいことに注意。 代わりに \fBsnprintf\fP()  と \fBvsnprintf\fP()
+(または \fBasprintf\fP(3)  と \fBvasprintf\fP(3))  を使うこと。
+.PP
+.\" .PP
+.\" Some floating-point conversions under early libc4
+.\" caused memory leaks.
+\fBprintf(\fP\fIfoo\fP\fB);\fP のようなコードはしばしばバグを引き起こす。 なぜなら \fIfoo\fP に %
+文字が含まれてるかもしれないからである。 \fIfoo\fP が信頼できないユーザー入力から作られている場合には、 その中に \fB%n\fP
+が含まれていることがあり、 \fBprintf\fP()  呼び出し時にメモリーへの書き込みが起こり、 セキュリティーホールを作ることになるかもしれない。
+.SH 例
+\fIPi\fP を 5 桁で出力する。
+.PP
+.in +4n
+.EX
+#include <math.h>
+#include <stdio.h>
+fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0));
+.EE
+.in
+.PP
+日付と時間を "Sunday, July 3, 10:02" の形式で出力する。 (\fIweekday\fP と \fImonth\fP
+は文字列へのポインターである)
+.PP
+.in +4n
+.EX
+#include <stdio.h>
+fprintf(stdout, "%s, %s %d, %.2d:%.2d\en",
+       weekday, month, day, hour, min);
+.EE
+.in
+.PP
+日 \- 月 \- 年 の順序で表示を行う国も多い。 従って、国際版では書式で指定された順番で 引き数を表示できなければならない。
+.PP
+.in +4n
+.EX
+#include <stdio.h>
+fprintf(stdout, format,
+       weekday, month, day, hour, min);
+.EE
+.in
+.PP
+\fIformat\fP はロケールに依存しており、引き数の順番を変えることもできる。 \fIformat\fP が
+.PP
+.in +4n
+.EX
+"%1$s, %3$d. %2$s, %4$d:%5$.2d\en"
+.EE
+.in
+.PP
+であれば、 "Sonntag, 3. Juli, 10:02" という結果になる。
+.PP
+十分に大きな文字列領域を確保して、そこにメッセージを格納するには (glibc 2.0 と glibc 2.1 の両方で正しく動作するコード):
+.PP
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+char *
+make_message(const char *fmt, ...)
+{
+    int n = 0;
+    size_t size = 0;
+    char *p = NULL;
+    va_list ap;
+
+    /* Determine required size */
+
+    va_start(ap, fmt);
+    n = vsnprintf(p, size, fmt, ap);
+    va_end(ap);
+
+    if (n < 0)
+        return NULL;
+
+    /* One extra byte for \(aq\e0\(aq */
+
+    size = (size_t) n + 1;
+    p = malloc(size);
+    if (p == NULL)
+        return NULL;
+
+    va_start(ap, fmt);
+    n = vsnprintf(p, size, fmt, ap);
+    va_end(ap);
+
+    if (n < 0) {
+        free(p);
+        return NULL;
+    }
+
+    return p;
+}
+.EE
+.PP
+バージョン 2.0.6 より前の glibc で切り詰めが起こった場合、切り詰めは適切に処理されず、エラーとして扱われる。
+.SH 関連項目
+\fBprintf\fP(1), \fBasprintf\fP(3), \fBputs\fP(3), \fBscanf\fP(3), \fBsetlocale\fP(3),
+\fBstrfromd\fP(3), \fBwcrtomb\fP(3), \fBwprintf\fP(3), \fBlocale\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/puts.3 b/manual/LDP_man-pages/draft/man3/puts.3
new file mode 100644 (file)
index 0000000..dec6f21
--- /dev/null
@@ -0,0 +1,102 @@
+.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\"
+.\" %%%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 Sat Jul 24 18:42:59 1993 by Rik Faith (faith@cs.unc.edu)
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
+.\"    all rights reserved.
+.\" Translated Wed Dec 24 12:33:40 JST 1997
+.\"    by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
+.\" Updated Fri Nov  2 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH PUTS 3 2020\-12\-21 GNU "Linux Programmer's Manual"
+.SH 名前
+fputc, fputs, putc, putchar, puts \- 文字と文字列の出力
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint fputc(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint fputs(const char *\fP\fIs\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint putc(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint putchar(int \fP\fIc\fP\fB);\fP
+.PP
+\fBint puts(const char *\fP\fIs\fP\fB);\fP
+.fi
+.SH 説明
+\fBfputc\fP()  は、キャラクター \fIc\fP を \fIunsigned char\fP にキャストし、 \fIstream\fP に書き込む。
+.PP
+\fBfputs\fP()  は、文字列 \fIs\fP を \fIstream\fP に書き込む。 文字列終端のヌルバイト (\(aq\e0\(aq) は出力しない。
+.PP
+\fBputc\fP()  は、 \fIstream\fP を一度以上評価するマクロとして実装されているかも知れないという点を除き、 \fBfputc\fP()
+と同じである。
+.PP
+\fBputchar(\fP\fIc\fP\fB)\fP は、 \fBputc(\fP\fIc\fP\fB,\fP\fIstdout\fP\fB)\fP と同じである。
+.PP
+\fBputs\fP()  は、文字列 \fIs\fP と改行を \fIstdout\fP に書き込む。
+.PP
+ここで説明された関数はお互いに混在して使用することができ、また、 \fIstdio\fP ライブラリに含まれる他の出力関数を同じ出力ストリームに対して
+呼び出す事が出来る。
+.PP
+これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
+.SH 返り値
+\fBfputc\fP(), \fBputc\fP(), \fBputchar\fP()  は \fIunsigned char\fP として書き込まれた文字を \fIint\fP
+にキャストして返す。 エラーが発生した場合は \fBEOF\fP を返す。
+.PP
+\fBputs\fP()  と \fBfputs\fP()  は、成功すると負ではない数を、エラーが発生した場合は \fBEOF\fP を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw25 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBfputc\fP(),
+\fBfputs\fP(),
+\fBputc\fP(),
+\fBputchar\fP(),
+\fBputs\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C89, C99.
+.SH バグ
+\fIstdio\fP ライブラリに含まれる出力関数と、同じ出力ストリームに結びつけられた ファイルディスクリプターに対する \fBwrite\fP(2)
+の低レベル呼び出しを混在して 使用することは賢明ではない。 その結果は定義されておらず、望む結果が得られない可能性が高い。
+.SH 関連項目
+\fBwrite\fP(2), \fBferror\fP(3), \fBfgets\fP(3), \fBfopen\fP(3), \fBfputwc\fP(3),
+\fBfputws\fP(3), \fBfseek\fP(3), \fBfwrite\fP(3), \fBputwchar\fP(3), \fBscanf\fP(3),
+\fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/remove.3 b/manual/LDP_man-pages/draft/man3/remove.3
new file mode 100644 (file)
index 0000000..d6bad35
--- /dev/null
@@ -0,0 +1,94 @@
+.\" This file is derived from unlink.2, which has the following copyright:
+.\"
+.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
+.\"             and Copyright (C) 1993 Ian Jackson.
+.\"
+.\" Edited into remove.3 shape by:
+.\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994
+.\"
+.\" %%%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.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1998 Ueyama Rui
+.\"         all rights reserved.
+.\" Translated Wed Feb 20 15:01:46 JST 1998
+.\"         by Ueyama Rui <rui@linux.or.jp>
+.\" Updated Sat Dec 11 JST 1999 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated Mon Feb 17 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
+.\"
+.TH REMOVE 3 2017\-09\-15 GNU "Linux Programmer's Manual"
+.SH 名前
+remove \- ファイルやディレクトリを削除する
+.SH 書式
+\fB#include <stdio.h>\fP
+.PP
+\fBint remove(const char *\fP\fIpathname\fP\fB);\fP
+.SH 説明
+\fBremove\fP()  はファイルシステムからファイル名を削除する。 ファイルに対しては \fBunlink\fP(2)  を、ディレクトリに対しては
+\fBrmdir\fP(2)  を呼び出す。
+.PP
+もしその名前が ファイルへの最後のリンクで、かつ、どのプロセスもそのファイルを 開いていないなら、ファイルも削除する。ファイルの占めていた
+領域は他で使うことができるようになる。
+.PP
+名前がファイルへの最後のリンクであっても、どこかのプロセスが そのファイルを開いているなら、ファイルの最後のファイルディスクリプター (file
+descriptor) が閉じられるまでファイルは存在し続ける。
+.PP
+名前が指しているのがシンボリックリンクなら、そのリンクを削除する。
+.PP
+名前が指しているのがソケット、FIFO、デバイスの場合、名前は削除されるが、 そのソケットなどを開いているプロセスはそのまま使い続けることができる。
+.SH 返り値
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+発生するエラーは \fBunlink\fP(2)  および \fBrmdir\fP(2)  と同じものである。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBremove\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+.\" .SH NOTES
+.\" Under libc4 and libc5,
+.\" .BR remove ()
+.\" was an alias for
+.\" .BR unlink (2)
+.\" (and hence would not remove directories).
+POSIX.1\-2001, POSIX.1\-2008, C89, C99, 4.3BSD.
+.SH バグ
+NFS プロトコルに内在する問題により、まだ使用中のファイルが想定外に消えてしまうことがありえる。
+.SH 関連項目
+\fBrm\fP(1), \fBunlink\fP(1), \fBlink\fP(2), \fBmknod\fP(2), \fBopen\fP(2), \fBrename\fP(2),
+\fBrmdir\fP(2), \fBunlink\fP(2), \fBmkfifo\fP(3), \fBsymlink\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index 116f852..50e6760 100644 (file)
@@ -345,12 +345,12 @@ error.
 \fBERANGE\fP
 整数変換の結果が、対応する整数型に格納できるサイズを越えてしまう。
 .SH 属性
-For an explanation of the terms used in this section, see \fBattributes\fP(7).
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
 .TS
 allbox;
 lbw20 lb lb
 l l l.
-Interface      Attribute       Value
+インターフェース       属性  値
 T{
 \fBscanf\fP(),
 \fBfscanf\fP(),
@@ -411,7 +411,7 @@ Linux 上でははっきりと定義された振る舞いをするかもしれ
 と組み合わせる場合には、 \fBL\fP の代わりに \fBq\fP を使用した方が良い。
 .PP
 \fBq\fP の使用方法は 4.4BSD と同じではない。 4.4BSD では \fBq\fP は \fBL\fP と同等に浮動小数の変換に使用される。
-.SH EXAMPLES
+.SH 
 動的割り当て変換指定子を使用するには、長さ修飾子として \fBm\fP を指定する (つまり、全体としては \fB%ms\fP や
 \fB%m[\fP\fIrange\fP\fB]\fP となる)。以下の例にあるように、呼び出し側は返された文字列を \fBfree\fP(3) しなければならない。
 .PP
diff --git a/manual/LDP_man-pages/draft/man3/setbuf.3 b/manual/LDP_man-pages/draft/man3/setbuf.3
new file mode 100644 (file)
index 0000000..8761469
--- /dev/null
@@ -0,0 +1,186 @@
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the American National Standards Committee X3, on Information
+.\" Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"     @(#)setbuf.3   6.10 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 14:55:24 1993, faith@cs.unc.edu
+.\" Added section to BUGS, Sun Mar 12 22:28:33 MET 1995,
+.\"                   Thomas.Koenig@ciw.uni-karlsruhe.de
+.\" Correction,  Sun, 11 Apr 1999 15:55:18,
+.\"     Martin Vicente <martin@netadmin.dgac.fr>
+.\" Correction,  2000-03-03, Andreas Jaeger <aj@suse.de>
+.\" Added return value for setvbuf, aeb,
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1999 ishikawa, keisuke
+.\"         all rights reserved.
+.\" Translated Thu Jan  7 00:03:12 JST 1999
+.\"         by ishikawa, keisuke <ishikawa@sgk.gr.jp>
+.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated & Modified Sun Jul  1 15:48:32 JST 2001
+.\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
+.\"
+.TH SETBUF 3 2019\-03\-06 Linux "Linux Programmer's Manual"
+.SH 名前
+setbuf, setbuffer, setlinebuf, setvbuf \- ストリームのバッファーリングの操作
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBvoid setbuf(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB);\fP
+.PP
+\fBvoid setbuffer(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIsize\fP\fB);\fP
+.PP
+\fBvoid setlinebuf(FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBint setvbuf(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB, int \fP\fImode\fP\fB, size_t \fP\fIsize\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBsetbuffer\fP(),
+\fBsetlinebuf\fP():
+    Since glibc 2.19:
+        _DEFAULT_SOURCE
+    Glibc 2.19 and earlier:
+        _BSD_SOURCE
+.SH 説明
+The three types of buffering available are unbuffered, block buffered, and
+line buffered.  When an output stream is unbuffered, information appears on
+the destination file or terminal as soon as written; when it is block
+buffered many characters are saved up and written as a block; when it is
+line buffered characters are saved up until a newline is output or input is
+read from any stream attached to a terminal device (typically \fIstdin\fP).
+The function \fBfflush\fP(3)  may be used to force the block out early.  (See
+\fBfclose\fP(3).)
+.PP
+Normally all files are block buffered.  If a stream refers to a terminal (as
+\fIstdout\fP normally does), it is line buffered.  The standard error stream
+\fIstderr\fP is always unbuffered by default.
+.PP
+\fBsetvbuf\fP()  関数は、オープンしている任意のストリームに対してバッファーを変更できる。 引き数 \fImode\fP は、次の 3
+つのマクロのうちいずれかである:
+.RS
+.TP 
+\fB_IONBF\fP
+unbuffered
+.TP 
+\fB_IOLBF\fP
+line buffered
+.TP 
+\fB_IOFBF\fP
+fully buffered
+.RE
+.PP
+unbuffered のファイルを除き、 \fIbuf\fP 引数は \fIsize\fP
+バイト以上の大きさのバッファーを指していなければならない。このバッファーは現在の バッファーの代わりに用いられる。もし、引数 \fIbuf\fP が NULL
+ならば、モードだけが変更される。 新しいバッファーは次に読み書きした際に割り当てられる。 \fBsetvbuf\fP()
+関数は、ストリームをオープンした後、 そのストリームに対して何らかの操作をする前にのみ使用できる。
+.PP
+他の 3 つの関数は \fBsetvbuf\fP()  の呼び出しに単純に置き換えることができる。 \fBsetbuf\fP()  関数は、
+.PP
+.in +4n
+setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
+.in
+.PP
+と全く同等だし、 \fBsetbuffer\fP()  関数は、バッファーサイズがデフォルト値 \fBBUFSIZ\fP
+ではなく引数で与えられる点以外は同じである。 \fBsetlinebuf\fP()  関数は以下と同じである。
+.PP
+.in +4n
+setvbuf(stream, NULL, _IOLBF, 0);
+.in
+.SH 返り値
+\fBsetvbuf\fP()  関数は、成功した場合 0 を返す。 失敗した場合、0 以外の値を返す (失敗とは、 \fImode\fP
+が不正な場合またはリクエストが条件を満たさない場合である)。 \fBsetvbuf\fP()  関数が失敗した場合は \fIerrno\fP を設定することもある。
+.PP
+その他の関数は値を返さない。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw23 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBsetbuf\fP(),
+\fBsetbuffer\fP(),
+.br
+\fBsetlinebuf\fP(),
+\fBsetvbuf\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+\fBsetbuf\fP()  関数および \fBsetvbuf\fP()  関数は C89 と C99 に準拠している。
+.SH バグ
+.\" The
+.\" .BR setbuffer ()
+.\" and
+.\" .BR setlinebuf ()
+.\" functions are not portable to versions of BSD before 4.2BSD, and
+.\" are available under Linux since libc 4.5.21.
+.\" On 4.2BSD and 4.3BSD systems,
+.\" .BR setbuf ()
+.\" always uses a suboptimal buffer size and should be avoided.
+.\".PP
+\fIstream\fP を閉じる時 (プログラムを終了する際にもこれは起きる) には、 \fIbuf\fP
+が指し示す空間とが存在していることを保証しなければならない。 例えば、次のような使い方は許されない:
+.PP
+.EX
+#include <stdio.h>
+
+int
+main(void)
+{
+    char buf[BUFSIZ];
+    setbuf(stdin, buf);
+    printf("Hello, world!\en");
+    return 0;
+}
+.EE
+.SH 関連項目
+\fBstdbuf\fP(1), \fBfclose\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBfread\fP(3),
+\fBmalloc\fP(3), \fBprintf\fP(3), \fBputs\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index 5baedc2..0b82cb1 100644 (file)
@@ -88,12 +88,12 @@ d)
 \fBENOMEM\fP
 保存領域の割り当てに失敗した。
 .SH 属性
-For an explanation of the terms used in this section, see \fBattributes\fP(7).
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
 .TS
 allbox;
 lb lb lb
 l l l.
-Interface      Attribute       Value
+インターフェース       属性  値
 T{
 \fBtempnam\fP()
 T}     Thread safety   MT\-Safe env
@@ -119,8 +119,7 @@ SUSv2 では \fBTMPDIR\fP に付いて言及されていない。 glibc は、
 .PP
 \fBtempnam\fP()  は最大で \fIpfx\fP の先頭 5 バイトを使用する。
 .PP
-The glibc implementation of \fBtempnam\fP()  fails with the error \fBEEXIST\fP
-upon failure to find a unique name.
+他と重ならない名前が見つけられなかった場合、glibc の \fBtempnam\fP()  の実装はエラー \fBEEXIST\fP で失敗する。
 .SH バグ
 「適切」という言葉の正確な意味は定義されていない。 ディレクトリに対してどの程度のアクセス権限が必要なのかは指定されていない。
 .SH 関連項目
diff --git a/manual/LDP_man-pages/draft/man3/tmpfile.3 b/manual/LDP_man-pages/draft/man3/tmpfile.3
new file mode 100644 (file)
index 0000000..670fe69
--- /dev/null
@@ -0,0 +1,104 @@
+.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
+.\"
+.\" %%%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
+.\"
+.\" References consulted:
+.\"     Linux libc source code
+.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
+.\"     386BSD man pages
+.\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
+.\" Modified 2001-11-17, aeb
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori
+.\"       all rights reserved.
+.\" Translated Sat Jan 18 16:51:59 JST 1997
+.\"     by Tenkou N. Hattori <tnh@alpsmap.co.jp>
+.\" Updated & Modified Sun Dec  9 15:25:20 JST 2001
+.\"     by Yuichi SATO <ysato@h4.dion.ne.jp>
+.\"
+.TH TMPFILE 3 2016\-03\-15 "" "Linux Programmer's Manual"
+.SH 名前
+tmpfile \- テンポラリファイルを作成する
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBFILE *tmpfile(void);\fP
+.fi
+.SH 説明
+\fBtmpfile\fP()  関数はユニークなテンポラリファイルを バイナリリードライトモード (w+b) でオープンする。
+このファイルはクローズ時またはプログラムの終了時に自動的に削除される。
+.SH 返り値
+\fBtmpfile\fP()  関数はファイルポインターを返すか、 ユニークなファイルが作れなかったかオープンできなかった場合は NULL を返す。
+後者の場合、エラーを表す \fIerrno\fP を設定する。
+.SH エラー
+.TP 
+\fBEACCES\fP
+ファイルのあるディレクトリにサーチのアクセス権 (search permission) がない。
+.TP 
+\fBEEXIST\fP
+ユニークなファイル名が作成できなかった。
+.TP 
+\fBEINTR\fP
+呼び出しがシグナルにより割り込まれた。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEMFILE\fP
+The per\-process limit on the number of open file descriptors has been
+reached.
+.TP 
+\fBENFILE\fP
+オープンされているファイルの総数がシステム全体の制限に達している。
+.TP 
+\fBENOSPC\fP
+ディレクトリに新しいファイルを追加するための空き領域がない。
+.TP 
+\fBEROFS\fP
+読みだし専用ファイルシステムである。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBtmpfile\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C89, C99, SVr4, 4.3BSD, SUSv2.
+.SH 注意
+POSIX.1\-2001 では、 ストリームをオープンできなかった場合、 \fIstdout\fP にエラーメッセージが書き出される、と規定されている。
+.PP
+規格では \fBtmpfile\fP()  が使うディレクトリは指定されていない。 glibc では \fI<stdio.h>\fP
+で定義されている \fIP_tmpdir\fP をパスの先頭に使おうとする。 これが失敗した場合は、ディレクトリ \fI/tmp\fP を使う。
+.SH 関連項目
+\fBexit\fP(3), \fBmkstemp\fP(3), \fBmktemp\fP(3), \fBtempnam\fP(3), \fBtmpnam\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/tmpnam.3 b/manual/LDP_man-pages/draft/man3/tmpnam.3
new file mode 100644 (file)
index 0000000..6d84761
--- /dev/null
@@ -0,0 +1,127 @@
+.\" 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
+.\"
+.\" 2003-11-15, aeb, added tmpnam_r
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright 1997 Tenkou N. Hattori <tnh@alpsmap.co.jp>
+.\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori
+.\"       all rights reserved.
+.\" Translated 1997-01-18, Tenkou N. Hattori <tnh@alpsmap.co.jp>
+.\" Updated 2000-03-15, Kentaro Shirakata <argrath@yo.rim.or.jp>
+.\" Updated 2005-03-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2006-07-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
+.\"
+.TH TMPNAM 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+tmpnam, tmpnam_r \- 一時ファイルの名前を作成する
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBchar *tmpnam(char *\fP\fIs\fP\fB);\fP
+\fBchar *tmpnam_r(char *\fP\fIs\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+\fBtmpnam_r\fP()
+.PD 0
+.ad l
+.RS 4
+.TP  4
+glibc 2.19 以降:
+_DEFAULT_SOURCE
+.TP 
+Up to and including glibc 2.19:
+_BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad
+.PD
+.SH 説明
+\fB注意:\fP これらの関数の使用は避けること。代わりに \fBmkstemp\fP(3) か \fBtmpfile\fP(3) を使うこと。
+.PP
+\fBtmpnam\fP()  関数は、ファイル名に使える文字列へのポインターを返す。
+ある時点では同じ名前を持つファイルが存在しないファイル名が返されるので、 幼稚なプログラマはこの文字列が一時ファイルのファイル名として
+適していると考えるかもしれない。 引き数 \fIs\fP が NULL なら、この名前は内部の静的バッファーに作成され、 次に \fBtmpnam\fP()
+関数が呼び出された時に上書きされる。 \fIs\fP が NULL でなければ、ファイル名は \fIs\fP が指す (少なくとも \fIL_tmpnam\fP
+の長さを持つ) 文字配列にコピーされ、 成功した場合は \fIs\fP が返される。
+.PP
+The created pathname has a directory prefix \fIP_tmpdir\fP.  (Both \fIL_tmpnam\fP
+and \fIP_tmpdir\fP are defined in \fI<stdio.h>\fP, just like the
+\fBTMP_MAX\fP mentioned below.)
+.PP
+The \fBtmpnam_r\fP()  function performs the same task as \fBtmpnam\fP(), but
+returns NULL (to indicate an error) if \fIs\fP is NULL.
+.SH 返り値
+これらの関数は一意な一時ファイル名へのポインターを返す。 一意なファイル名が作成できなかった場合は NULL を返す。
+.SH エラー
+エラーは定義されていない。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lb lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBtmpnam\fP()
+T}     Thread safety   MT\-Unsafe race:tmpnam/!s
+T{
+\fBtmpnam_r\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.SH 準拠
+\fBtmpnam\fP(): SVr4, 4.3BSD, C89, C99, POSIX.1\-2001.  POSIX.1\-2008 は
+\fBtmpnam\fP()  を廃止予定としている。
+.PP
+.\" Appears to be on Solaris
+\fBtmpnam_r\fP()  is a nonstandard extension that is also available on a few
+other systems.
+.SH 注意
+\fBtmpnam\fP()  関数は最大 \fBTMP_MAX\fP 回まで、呼び出される度に異なる文字列を作成する。 \fBTMP_MAX\fP
+回以上呼び出された場合、その動作は実装依存である。
+.PP
+これらの関数は推測が難しい名前を生成するが、それにもかかわらず、パス名が返されてから、プログラムがそのファイルをオープンするまでの間に、別のプログラムが同じパス名で、ファイルを
+\fBopen\fP(2)  で作成したり、シンボリックリンクを作成したりする可能性がある。 これはセキュリティホールにつながる可能性がある。
+そのような可能性を回避するためには、 \fBopen\fP(2)  の \fBO_EXCL\fP フラグを使ってパス名をオープンすればよい。 もっといいのは、
+\fBmkstemp\fP(3)  や \fBtmpfile\fP(3)  を使うことである。
+.PP
+移植性が必要な、スレッドを使ったアプリケーションでは、 \fB_POSIX_THREADS\fP か
+\fB_POSIX_THREAD_SAFE_FUNCTIONS\fP が定義されている場合に、 \fBtmpnam\fP()  関数を NULL
+引き数で呼び出してはならない。
+.SH バグ
+決してこれらの関数を使用しないこと。代わりに \fBmkstemp\fP(3)  か \fBtmpfile\fP(3) を使うこと。
+.SH 関連項目
+\fBmkstemp\fP(3), \fBmktemp\fP(3), \fBtempnam\fP(3), \fBtmpfile\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/unlocked_stdio.3 b/manual/LDP_man-pages/draft/man3/unlocked_stdio.3
new file mode 100644 (file)
index 0000000..2a0e2ad
--- /dev/null
@@ -0,0 +1,170 @@
+.\" Copyright (C) 2001 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
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 2001 Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated Fri Nov 2 23:08:42 2001
+.\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"
+.TH UNLOCKED_STDIO 3 2017\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked \-
+ロックを行わずに標準入出力を行う関数群
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.PP
+\fBint getc_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint getchar_unlocked(void);\fP
+\fBint putc_unlocked(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBint putchar_unlocked(int \fP\fIc\fP\fB);\fP
+.PP
+\fBvoid clearerr_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint feof_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint ferror_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint fileno_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint fflush_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint fgetc_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBint fputc_unlocked(int \fP\fIc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBsize_t fread_unlocked(void *\fP\fIptr\fP\fB, size_t \fP\fIsize\fP\fB, size_t \fP\fIn\fP\fB,\fP
+\fB                      FILE *\fP\fIstream\fP\fB);\fP
+\fBsize_t fwrite_unlocked(const void *\fP\fIptr\fP\fB, size_t \fP\fIsize\fP\fB, size_t \fP\fIn\fP\fB,\fP
+\fB                      FILE *\fP\fIstream\fP\fB);\fP
+.PP
+\fBchar *fgets_unlocked(char *\fP\fIs\fP\fB, int \fP\fIn\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBint fputs_unlocked(const char *\fP\fIs\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+
+\fB#include <wchar.h>\fP
+.PP
+\fBwint_t getwc_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t getwchar_unlocked(void);\fP
+\fBwint_t fgetwc_unlocked(FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t fputwc_unlocked(wchar_t \fP\fIwc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t putwc_unlocked(wchar_t \fP\fIwc\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBwint_t putwchar_unlocked(wchar_t \fP\fIwc\fP\fB);\fP
+\fBwchar_t *fgetws_unlocked(wchar_t *\fP\fIws\fP\fB, int \fP\fIn\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+\fBint fputws_unlocked(const wchar_t *\fP\fIws\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.ad l
+.RE
+.PP
+\fBgetc_unlocked\fP(), \fBgetchar_unlocked\fP(), \fBputc_unlocked\fP(),
+\fBputchar_unlocked\fP():
+.RS 4
+/* Since glibc 2.24: */ _POSIX_C_SOURCE\ >=\ 199309L
+    || /* Glibc versions <= 2.23: */ _POSIX_C_SOURCE
+    || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
+.RE
+.PP
+\fBclearerr_unlocked\fP(), \fBfeof_unlocked\fP(), \fBferror_unlocked\fP(),
+\fBfileno_unlocked\fP(), \fBfflush_unlocked\fP(), \fBfgetc_unlocked\fP(),
+\fBfputc_unlocked\fP(), \fBfread_unlocked\fP(), \fBfwrite_unlocked\fP():
+.RS 4
+/* Glibc since 2.19: */ _DEFAULT_SOURCE
+    || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
+.RE
+.PP
+\fBfgets_unlocked\fP(), \fBfputs_unlocked\fP(), \fBgetwc_unlocked\fP(),
+\fBgetwchar_unlocked\fP(), \fBfgetwc_unlocked\fP(), \fBfputwc_unlocked\fP(),
+\fBputwchar_unlocked\fP(), \fBfgetws_unlocked\fP(), \fBfputws_unlocked\fP():
+.RS 4
+_GNU_SOURCE
+.RE
+.ad b
+.SH 説明
+これらの関数は、末尾に "_unlocked" がついていない関数と同じ動作をするが、
+ファイルのロックを使用しない点が異なる。(これらの関数自身はファイルのロック をセットせず、他の関数によってロックがセットされているかどうかのチェックも
+行わない) それゆえ、スレッド(thread)で安全に使用することができない。 \fBflockfile\fP(3)  を参照のこと。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.ad l
+.TS
+allbox;
+lbw20 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBgetc_unlocked\fP(),
+\fBputc_unlocked\fP(),
+\fBclearerr_unlocked\fP(),
+\fBfflush_unlocked\fP(),
+\fBfgetc_unlocked\fP(),
+\fBfputc_unlocked\fP(),
+\fBfread_unlocked\fP(),
+\fBfwrite_unlocked\fP(),
+\fBfgets_unlocked\fP(),
+\fBfputs_unlocked\fP(),
+\fBgetwc_unlocked\fP(),
+\fBfgetwc_unlocked\fP(),
+\fBfputwc_unlocked\fP(),
+\fBputwc_unlocked\fP(),
+\fBfgetws_unlocked\fP(),
+\fBfputws_unlocked\fP()
+T}     Thread safety   MT\-Safe race:stream
+T{
+\fBgetchar_unlocked\fP(),
+\fBgetwchar_unlocked\fP()
+T}     Thread safety   MT\-Unsafe race:stdin
+T{
+\fBputchar_unlocked\fP(),
+\fBputwchar_unlocked\fP()
+T}     Thread safety   MT\-Unsafe race:stdout
+T{
+\fBfeof_unlocked\fP(),
+\fBferror_unlocked\fP(),
+\fBfileno_unlocked\fP()
+T}     Thread safety   MT\-Safe
+.TE
+.ad
+.SH 準拠
+\fBgetc_unlocked\fP(), \fBgetchar_unlocked\fP(), \fBputc_unlocked\fP(),
+\fBputchar_unlocked\fP()  の 4 つの関数は POSIX.1\-2001 と POSIX.1\-2008 に規定されている。
+.PP
+.\" E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
+.\" moved to a compatibility library.
+.\" Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
+.\" feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
+.\" fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
+.\" fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
+.\" ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
+.\" getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
+.\" putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
+.\" putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
+.\" ungetc_unlocked, ungetwc_unlocked.
+非標準の \fB*_unlocked\fP()  の仲間は 2、3 の UNIX システムで定義されており、 最近の glibc では使用可能であるが、
+これらの関数は使わない方がよいだろう。
+.SH 関連項目
+\fBflockfile\fP(3), \fBstdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/manual/LDP_man-pages/draft/man3/wprintf.3 b/manual/LDP_man-pages/draft/man3/wprintf.3
new file mode 100644 (file)
index 0000000..5777e33
--- /dev/null
@@ -0,0 +1,149 @@
+.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
+.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
+.\" 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.
+.\" %%%LICENSE_END
+.\"
+.\" References consulted:
+.\"   GNU glibc-2 source code and manual
+.\"   Dinkumware C library reference http://www.dinkumware.com/
+.\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
+.\"   ISO/IEC 9899:1999
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated Tue Jan 11 00:55:36 JST 2000
+.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\"
+.TH WPRINTF 3 2019\-03\-06 GNU "Linux Programmer's Manual"
+.SH 名前
+wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- ワイド文字を
+フォーマットして出力する
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+\fB#include <wchar.h>\fP
+.PP
+\fBint wprintf(const wchar_t *\fP\fIformat\fP\fB, ...);\fP
+\fBint fwprintf(FILE *\fP\fIstream\fP\fB, const wchar_t *\fP\fIformat\fP\fB, ...);\fP
+\fBint swprintf(wchar_t *\fP\fIwcs\fP\fB, size_t \fP\fImaxlen\fP\fB,\fP
+\fB             const wchar_t *\fP\fIformat\fP\fB, ...);\fP
+.PP
+\fBint vwprintf(const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
+\fBint vfwprintf(FILE *\fP\fIstream\fP\fB, const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
+\fBint vswprintf(wchar_t *\fP\fIwcs\fP\fB, size_t \fP\fImaxlen\fP\fB,\fP
+\fB              const wchar_t *\fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP
+.fi
+.PP
+.RS -4
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.RE
+.PP
+.ad l
+上記の全ての関数:
+.RS 4
+.\" .BR wprintf (),
+.\" .BR fwprintf (),
+.\" .BR swprintf (),
+.\" .BR vwprintf (),
+.\" .BR vfwprintf (),
+.\" .BR vswprintf ():
+_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE ||
+.br
+_POSIX_C_SOURCE\ >=\ 200112L
+.RE
+.ad
+.SH 説明
+\fBwprintf\fP()  ファミリーの関数は \fBprintf\fP(3)  ファミリーの関数の
+ワイド文字版である。これらはワイド文字をフォーマットして出力する。
+.PP
+\fBwprintf\fP()  と \fBvwprintf\fP()  関数は \fIstdout\fP に出力を行なう。 \fIstdout\fP
+がバイト単位入出力であってはいけない。より詳しい説明は \fBfwide\fP(3)  を参照すること。
+.PP
+\fBfwprintf\fP()  と \fBvfwprintf\fP()  関数は \fIstream\fP にワイド文字出力 を行なう。 \fIstream\fP
+がバイト単位入出力であってはいけない。 より詳しい説明は \fBfwide\fP(3)  を参照すること。
+.PP
+\fBswprintf\fP()  と \fBvswprintf\fP()  関数はワイド文字の配列に ワイド文字出力を行なう。プログラマーは \fIwcs\fP
+に最低でも \fImaxlen\fP 文字のワイド文字を出力できる空きがあることを保証しなければ ならない。
+.PP
+これらの関数は \fBprintf\fP(3), \fBvprintf\fP(3), \fBfprintf\fP(3), \fBvfprintf\fP(3),
+\fBsprintf\fP(3), \fBvsprintf\fP(3)  関数に似ているが以下の 点で異っている。
+.TP 
+\fB\(bu\fP
+\fIformat\fP がワイド文字列で与えられる。
+.TP 
+\fB\(bu\fP
+出力がバイトではなくワイド文字で構成される。
+.TP 
+\fB\(bu\fP
+\fBswprintf\fP()  と \fBvswprintf\fP()  は \fImaxlen\fP 引き数を取るが、 \fBsprintf\fP()  と
+\fBvsprintf\fP()  は取らない (\fBsnprintf\fP()  と \fBvsnprintf\fP()  は \fImaxlen\fP 引き数を取るが
+これらの関数が Linux では、バッファーが溢れた場合でも \-1 を返さない)。
+.PP
+\fBc\fP と \fBs\fP 変換文字の扱いが異っている:
+.TP 
+\fBc\fP
+もし \fBl\fP 修飾子が存在しない場合は \fIint\fP 引き数は \fBbtowc\fP(3)
+関数によってワイド文字に変換される。そして結果のワイド文字が出力される。 \fBl\fP 修飾子が存在する場合は \fIwint_t\fP
+(ワイド文字)引き数が出力される。
+.TP 
+\fBs\fP
+もし \fBl\fP 修飾子が存在しない場合、 \fIconst\ char\ *\fP 引き数は初期状態より始まるマルチバイト文字列を含んだ char
+型の配列へのポインター(文字列へのポインター)とみなされる。 配列の文字は(最初のバイト前に初期状態で変換を開始し、それぞれの文字を
+\fBmbrtowc\fP(3)  関数によって)ワイド文字へと変換される。結果のワイド文字は終端の ナルワイド文字 (L\(aq\e0\(aq)
+の手前までが書き込まれる。精度(precision)が指定された 場合、指定された数字を超えるワイド文字は書き込まれない。精度は 書き込まれる
+\fIバイト\fP 数や \fI画面上の位置\fP ではなく \fIワイド文字\fP の数を指定することに注意すること。 精度がない場合には配列の終端にナルバイト
+(\(aq\e0\(aq) を含む必要がある。 精度を指定する場合には、配列の最後に到着する前に変換されたワイド文字の
+数がそれに到達するよう、精度は十分に小さな数でなければならない。 もし \fBl\fP 修飾子が存在する場合、 \fIconst\ wchar_t\ *\fP
+引き数はワイド文字の配列へのポインターとみなされる。 配列のワイド文字列は終端のナルワイド文字の手間まで出力される。
+もし精度が指定された場合には指定された精度以上の文字は出力されない。 精度を指定しない場合には終端のナルワイド文字を含む必要がある。
+精度を指定する場合にはそれはワイド文字の配列の大きさよりも小さくな ければならない。
+.SH 返り値
+これらの関数は書き込まれたワイド文字の文字数を返す。 \fBswprintf\fP()  と \fBvswprintf\fP()  関数の場合は
+終端のナルワイド文字は含まない。エラーが起こった場合は \-1 を返す。
+.SH 属性
+この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
+.TS
+allbox;
+lbw24 lb lb
+l l l.
+インターフェース       属性  値
+T{
+\fBwprintf\fP(),
+\fBfwprintf\fP(),
+.br
+\fBswprintf\fP(),
+\fBvwprintf\fP(),
+.br
+\fBvfwprintf\fP(),
+\fBvswprintf\fP()
+T}     Thread safety   MT\-Safe locale
+.TE
+.sp 1
+.SH 準拠
+POSIX.1\-2001, POSIX.1\-2008, C99.
+.SH 注意
+\fBwprintf\fP()  等の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリーに依存している。
+.PP
+\fIformat\fP 文字列が ASCII 以外のワイド文字を含んでいる場合、 実行時のロケールの \fBLC_CTYPE\fP カテゴリーがコンパイル時の
+\fBLC_CTYPE\fP カテゴリーと 一致している場合にのみプログラムは正常に動作する。これは \fIwchar_t\fP
+の表現がロケールやプラットホームに依存していることに原因がある。 (glibc ではワイド文字として Unicode (ISO\-10646)
+のコードポイントを 使用している。他のプラットホームではそうではない。同様に ISO C99 の \eunnnn
+形式の汎用文字名称はこの問題を解決しない。)  このため国際化されたプログラムでは \fIformat\fP 文字列を ASCII ワイド
+文字のみにするか、実行時に国際化された方法で構成する必要がある (例えば \fBgettext\fP()  と \fBiconv\fP()  や
+\fBmbstowcs\fP()  を組み合わて使用する)。
+.SH 関連項目
+.\" .BR wscanf (3)
+\fBfprintf\fP(3), \fBfputwc\fP(3), \fBfwide\fP(3), \fBprintf\fP(3), \fBsnprintf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。
index 0f120a6..c3812cc 100644 (file)
 .SH 名前
 bootparam \- Linux カーネル起動時パラメーターの解説
 .SH 説明
-The Linux kernel accepts certain 'command\-line options' or 'boot time
-parameters' at the moment it is started.  In general, this is used to supply
-the kernel with information about hardware parameters that the kernel would
-not be able to determine on its own, or to avoid/override the values that
-the kernel would otherwise detect.
+Linux カーネルは起動するときに「コマンドラインオプション」あるいは 「起動時パラメーター」を受け付ける。 これは一般に、
+カーネルには決定できないハードウェアのパラメーターをカーネルに渡したい場合や、
+カーネルが検出するであろう値を意図的に無効にしたり変更したりする場合に用いる。
 .PP
 When the kernel is booted directly by the BIOS, you have no opportunity to
 specify any parameters.  So, in order to take advantage of this possibility
index d34d502..bff1565 100644 (file)
@@ -37,7 +37,7 @@ r*exp(i*phi) = r*(cos(phi)+i*sin(phi))  の関係が成り立つ。
 \fB除法: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i\fP
 .PP
 ほとんど全ての数学関数に関して複素数版があるが、 複素数専用の関数も幾つかある。
-.SH EXAMPLES
+.SH 
 使用する C コンパイラが C99 標準をサポートしていれば複素数を使うことができる。
 \fI\-lm\fP をつけてリンクすること。虚数単位は I で表現される。
 .PP
diff --git a/manual/LDP_man-pages/draft/man7/symlink.7 b/manual/LDP_man-pages/draft/man7/symlink.7
new file mode 100644 (file)
index 0000000..08d9eb9
--- /dev/null
@@ -0,0 +1,284 @@
+.\" Copyright (c) 1992, 1993, 1994
+.\"    The Regents of the University of California.  All rights reserved.
+.\" and Copyright (C) 2008, 2014 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" %%%LICENSE_START(BSD_3_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\"    @(#)symlink.7   8.3 (Berkeley) 3/31/94
+.\" $FreeBSD: src/bin/ln/symlink.7,v 1.30 2005/02/13 22:25:09 ru Exp $
+.\"
+.\" 2008-06-11, mtk, Taken from FreeBSD 6.2 and heavily edited for
+.\"     specific Linux details, improved readability, and man-pages style.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH SYMLINK 7 2020\-06\-09 Linux "Linux Programmer's Manual"
+.SH 名前
+symlink \- シンボリックリンクの取り扱い
+.SH 説明
+シンボリックリンクは他のファイルへのポインターとして振る舞うファイルである。
+その挙動を理解するには、まずハードリンクがどのように機能するかを理解しておかなければならない。
+.PP
+あるファイルへのハードリンクは、 元々のファイルと区別することができない。 なぜなら、
+ハードリンクは元々のファイル名の裏にあるオブジェクトへの参照だからである。 (より正確には、 あるファイルへのハードリンクはそれぞれ同じ \fIinode
+番号\fP への参照である。 inode 番号は inode テーブルへのインデックスで、 inode
+テーブルはファイルシステム上のすべてのファイルについてのメタデータを保持している。 \fBstat\fP(2) 参照。)
+ファイルへの変更は、ファイルの参照に使用された名前とは独立に行われる。 ハードリンクはディレクトリを参照することはできない
+(これはファイルシステムツリー内でループが発生する可能性を防止するためであり、 ループが発生すると、 多くのプログラムが混乱してしまうことだろう)。
+また、 ハードリンクは異なるファイルシステム上のファイルを参照することもできない (inode
+番号はファイルシステムをまたがると一意ではないからである)。
+.PP
+シンボリックリンクは特別な種類のファイルで、 ファイルの内容はそのリンクの参照先の別のファイルのパス名を示す文字列である (シンボリックリンクの内容は
+\fBreadlink\fP(2) を使って読むことができる)。 言い換えると、 シンボリックリンクは別の名前へのポインターであり、
+ファイルの裏にあるオブジェクトへのポインターではない。 この理由から、
+シンボリックリンクではディレクトリへの参照やファイルシステム境界を越える参照を行うことができる。
+.PP
+シンボリックリンクが参照する先のパス名が存在しないといけないという要件はない。 存在しないパス名を参照するシンボリックリンクは「壊れた
+(dangling) リンク」と呼ばれる。
+.PP
+.\"
+シンボリックリンクとその参照先のオブジェクトは一つのファイルシステムの名前空間内に共存するので、
+リンクそのものと参照先のオブジェクトの間で混乱が生じる可能性がある。 かなり昔からあるシステムでは、
+コマンドやシステムコールはいくらかアドホックな方法の独自のリンクの辿り方の決まり事を採用している。 ここでは、 Linux
+や他のシステムで実装されている、 もっと広く使われている方法のルールについて概要を説明する。 サイト固有のアプリケーションもこれらのルールに準拠し、
+可能な限りユーザーインターフェースが一貫したものになるようにすることが重要である。
+.SS "Magic links"
+There is a special class of symbolic\-link\-like objects known as "magic
+links", which can be found in certain pseudofilesystems such as \fBproc\fP(5)
+(examples include \fI/proc/[pid]/exe\fP and \fI/proc/[pid]/fd/*\fP).  Unlike
+normal symbolic links, magic links are not resolved through
+pathname\-expansion, but instead act as direct references to the kernel's own
+representation of a file handle.  As such, these magic links allow users to
+access files which cannot be referenced with normal paths (such as unlinked
+files still referenced by a running program ).
+.PP
+.\"
+Because they can bypass ordinary \fBmount_namespaces\fP(7)\-based restrictions,
+magic links have been used as attack vectors in various exploits.
+.SS シンボリックリンクの所有権、アクセス許可、タイムスタンプ
+既存のシンボリックリンクの所有者とグループは \fBlchown\fP(2) を使って変更することができる。 シンボリックリンクの所有権が問題となる場面は、
+スティッキービット (\fBstat\fP(2) 参照) がセットされたディレクトリで、 そのリンクの削除や名前の変更を行おうとしている場合だけである。
+.PP
+シンボリックリンクの最終アクセス時刻と最終修正時刻は \fButimensat\fP(2) や \fBlutimes\fP(3) で変更できる。
+.PP
+.\" Linux does not currently implement an lchmod(2).
+On Linux, the permissions of an ordinary symbolic link are not used in any
+operations; the permissions are always 0777 (read, write, and execute for
+all user categories), and can't be changed.
+.PP
+However, magic links do not follow this rule.  They can have a non\-0777
+mode, though this mode is not currently used in any permission checks.
+
+.\"
+.\" The
+.\" 4.4BSD
+.\" system differs from historical
+.\" 4BSD
+.\" systems in that the system call
+.\" .BR chown (2)
+.\" has been changed to follow symbolic links.
+.\" The
+.\" .BR lchown (2)
+.\" system call was added later when the limitations of the new
+.\" .BR chown (2)
+.\" became apparent.
+.SS シンボリックリンクを参照するファイルディスクリプターを取得する
+\fBopen\fP(2) に \fBO_PATH\fP と \fBO_NOFOLLOW\fP
+の両方のフラグを指定すると、ファイルディスクリプターが得られる。このファイルディスクリプターは \fBfstatat\fP(2),
+\fBfchownat\fP(2), \fBfchmodat\fP(2), \fBlinkat\fP (2), \fBreadlinkat\fP(2) などのシステムコールの
+\fIdirfd\fP 引き数として渡して、 (シンボリックリンクが参照するファイルではなく) シンボリックリンク自身に対する操作を行うことができる。
+.PP
+デフォルトでは (すなわち \fBAT_SYMLINK_FOLLOW\fP フラグが指定されなかった場合)、 \fBname_to_handle_at\fP(2)
+がシンボリックリンクに適用された場合、 (シンボリックリンクが参照するファイルではなく) シンボリックリンクへのハンドルが返される。 それ以降の
+\fBopen_by_handle_at\fP(2) で \fBO_PATH\fP フラグを指定することで、 (シンボリックリンクが参照するファイルではなく)
+シンボリックリンクに対するファイルディスクリプターを得ることができる。 繰り返しになるが、 このファイルディスクリプターを上述のシステムコールで使用し、
+シンボリックリンク自身に操作を行うことができる。
+.SS システムコールやコマンドによるシンボリックリンクの取り扱い
+シンボリックリンクは、 リンク自身に対する操作か、 リンクが参照するオブジェクトに対する操作のいずれかとして扱われる。 後者の場合、
+アプリケーションやシステムコールはリンクを\fI辿る (follow)\fPと呼ばれる。 シンボリックリンクは他のシンボリックリンクを参照することもできる。
+この場合、 シンボリックリンクでないオブジェクトが見つかるか、 存在しないファイルを参照するシンボリックリンクが見つかるか、 ループが検出されるまで、
+リンクの展開が行われる。 (ループの検出は辿ることができるリンクの数に上限を設けることで行われる。 この上限を超過した場合はエラーとなる。)
+.PP
+3 つの領域に分けて議論する必要がある。以下の 3 つである。
+.IP 1. 3
+システムコールのファイル名引き数としてシンボリックリンクが使用される場合。
+.IP 2.
+ファイルツリーを辿っていないユーティリティーのコマンドライン引き数としてシンボリックリンクが指定される場合。
+.IP 3.
+ファイルツリーを辿っているユーティリティーがシンボリックリンクを見つけた場合 (コマンドラインで指定される場合もあれば、
+ファイル階層を辿っている途中で遭遇する場合もある)。
+.PP
+.\"
+Before describing the treatment of symbolic links by system calls and
+commands, we require some terminology.  Given a pathname of the form
+\fIa/b/c\fP, the part preceding the final slash (i.e., \fIa/b\fP)  is called the
+\fIdirname\fP component, and the part following the final slash (i.e., \fIc\fP)
+is called the \fIbasename\fP component.
+.SS "Treatment of symbolic links in system calls"
+最初の領域は、システムコールのファイル名引き数としてシンボリックリンクが使用される場合である。
+.PP
+The treatment of symbolic links within a pathname passed to a system call is
+as follows:
+.IP 1. 3
+Within the dirname component of a pathname, symbolic links are always
+followed in nearly every system call.  (This is also true for commands.)
+The one exception is \fBopenat2\fP(2), which provides flags that can be used to
+explicitly prevent following of symbolic links in the dirname component.
+.IP 2.
+Except as noted below, all system calls follow symbolic links in the
+basename component of a pathname.  For example, if there were a symbolic
+link \fIslink\fP which pointed to a file named \fIafile\fP, the system call
+\fIopen("slink" ...\&)\fP would return a file descriptor referring to the file
+\fIafile\fP.
+.PP
+Various system calls do not follow links in the basename component of a
+pathname, and operate on the symbolic link itself.  They are: \fBlchown\fP(2),
+\fBlgetxattr\fP(2), \fBllistxattr\fP(2), \fBlremovexattr\fP(2), \fBlsetxattr\fP(2),
+\fBlstat\fP(2), \fBreadlink\fP(2), \fBrename\fP(2), \fBrmdir\fP(2), and \fBunlink\fP(2).
+.PP
+.\" Maybe one day: .BR fchownat (2)
+Certain other system calls optionally follow symbolic links in the basename
+component of a pathname.  They are: \fBfaccessat\fP(2), \fBfchownat\fP(2),
+\fBfstatat\fP(2), \fBlinkat\fP(2), \fBname_to_handle_at\fP(2), \fBopen\fP(2),
+\fBopenat\fP(2), \fBopen_by_handle_at\fP(2), and \fButimensat\fP(2); see their manual
+pages for details.  Because \fBremove\fP(3)  is an alias for \fBunlink\fP(2), that
+library function also does not follow symbolic links.  When \fBrmdir\fP(2)  is
+applied to a symbolic link, it fails with the error \fBENOTDIR\fP.
+.PP
+\fBlink\fP(2)  warrants special discussion.  POSIX.1\-2001 specifies that
+\fBlink\fP(2)  should dereference \fIoldpath\fP if it is a symbolic link.
+However, Linux does not do this.  (By default, Solaris is the same, but the
+POSIX.1\-2001 specified behavior can be obtained with suitable compiler
+options.)  POSIX.1\-2008 changed the specification to allow either behavior
+in an implementation.
+.SS ファイルツリーを辿らないコマンド
+二つ目の領域は、 ファイルツリーを辿らないコマンドの、 コマンドライン引き数のファイル名としてシンボリックリンクが指定される場合である。
+.PP
+以下に述べる場合を除くと、 コマンドはコマンドライン引き数で指定された名前のシンボリックリンクを辿る。 例えば、 \fIafile\fP
+という名前のファイルを指しているシンボリックリンク \fIslink\fP があったとすると、 コマンド \fIcat slink\fP は \fIafile\fP
+の内容を表示することになる。
+.PP
+大事な点として意識しておくべきなのは、 このルールが適用されるコマンドの中には、
+オプション次第ではファイルツリーを辿る場合があるコマンドもあるということである。  例えば、 コマンド \fIchown file\fP
+はこのルールに含まれるが、 コマンド \fIchown\ \-R file\fP はツリーを辿る動作をするのであてはまらない (後者の場合は、3
+つ目の領域に該当する)。
+.PP
+If it is explicitly intended that the command operate on the symbolic link
+instead of following the symbolic link\(emfor example, it is desired that
+\fIchown slink\fP change the ownership of the file that \fIslink\fP is, whether it
+is a symbolic link or not\(emthen the \fI\-h\fP option should be used.  In the
+above example, \fIchown root slink\fP would change the ownership of the file
+referred to by \fIslink\fP, while \fIchown\ \-h root slink\fP would change the
+ownership of \fIslink\fP itself.
+.PP
+このルールにはいくつかの例外がある。
+.IP * 2
+コマンド \fBmv\fP(1) と \fBrm\fP(1) は引き数で指定された名前のシンボリックリンクを辿らないが、
+それぞれシンボリックリンク自身の名前変更と削除を行おうとする。 (シンボリックリンクが相対パスでファイルを参照している場合、
+そのシンボリックリンクを別のディレクトリに移動すると、動かなくなることが非常によくある。 移動の結果、 パスが正しくないものになってしまうからである。)
+.IP *
+\fBls\fP(1) コマンドもこのルールの例外である。 昔からあるシステムとの互換性のため (\fBls\fP(1) がツリーを辿らない場合、つまり \fI\-R\fP
+オプションが指定されなかった場合)、 \fBls\fP(1) コマンドはオプション \fI\-H\fP か \fI\-L\fP が指定された場合、もしくはオプション
+\fI\-F\fP, \fI\-d\fP, \fI\-l\fP が指定されなかった場合、 引き数として指定されたシンボリックリンクを辿る。 (\fBls\fP(1) コマンドは、
+ファイルツリーを辿らない場合であっても、 オプション \fI\-H\fP と \fI\-L\fP がその動作に影響を与える唯一のコマンドである。)
+.IP *
+.\"
+.\"The 4.4BSD system differs from historical 4BSD systems in that the
+.\".BR chown (1)
+.\"and
+.\".BR chgrp (1)
+.\"commands follow symbolic links specified on the command line.
+\fBfile\fP(1) コマンドもこのルールの例外である。 \fBfile\fP(1) コマンドは、
+デフォルトでは引き数で指定されたシンボリックリンクを辿らない。 \fBfile\fP(1) コマンドは、 \fI\-L\fP オプションが指定された場合、
+引き数で指定されたシンボリックリンクを辿る。
+.SS ファイルツリーを辿るコマンド
+次のコマンドは指定された場合もしくは常にファイルツリーを辿る: \fBchgrp\fP(1), \fBchmod\fP(1), \fBchown\fP(1),
+\fBcp\fP(1), \fBdu\fP(1), \fBfind\fP(1), \fBls\fP(1), \fBpax\fP(1), \fBrm\fP(1), \fBtar\fP(1)。
+.PP
+重要なのは、 ファイルツリーを辿っている際に見つかったシンボリックリンクにも、 コマンドライン引き数として渡されたシンボリックリンクにも、
+以下のルールが等しく適用される点である。
+.PP
+「1 つ目のルール」は、 ディレクトリ以外のファイルを参照するシンボリックリンクに適用される。
+シンボリックリンクに適用される操作はシンボリックリンク自身に行われるが、 そうでない場合はリンクは無視される。
+.PP
+コマンド \fIrm\ \-r slink directory\fP は \fIslink\fP を削除するとともに、
+ファイルツリーを辿る途中で見つけたシンボリックリンクも削除する。 シンボリックリンクは削除できるからである。 \fBrm\fP(1) が \fIslink\fP
+が参照するファイルに影響をおよぼすことはない。
+.PP
+The \fIsecond rule\fP applies to symbolic links that refer to directories.
+Symbolic links that refer to directories are never followed by default.
+This is often referred to as a "physical" walk, as opposed to a "logical"
+walk (where symbolic links that refer to directories are followed).
+.PP
+一貫性を持たせるため、ファイルツリーを辿るコマンドが可能な限り従っている慣習がいくつかある。
+.IP * 2
+\fI\-H\fP ("half\-logical") フラグを指定すると、 参照先のファイル種別に関わらず、
+コマンドにコマンドラインで指定されたシンボリックリンクを辿らせることができる。 このフラグは、
+コマンドラインの名前空間を論理的な名前空間のように見せるためのものである。 (常にファイルツリーを辿るわけではないコマンドでは、 \fI\-R\fP
+フラグを一緒に指定しない限り、 \fI\-H\fP フラグは無視される点に注意。)
+.IP
+例えば、 コマンド \fIchown\ \-HR user slink\fP は \fIslink\fP が指すファイルを頂点とするファイル階層を辿る。 \fI\-H\fP
+は上記で説明した \fI\-h\fP フラグとは同じではないことに注意。 \fI\-H\fP フラグを指定すると、 アクションを実行する場合でも、
+ツリーを辿る場合でも、 コマンドラインで指定されたシンボリックリンクの解決 (dereference) を行う。
+ユーザーがシンボリックリンクが指すファイル名を指定したのと同じように見える。
+.IP *
+\fI\-L\fP ("logical") フラグを指定すると、 参照先のファイル種別に関わらず、 コマンドが、
+コマンドラインで指定された名前のシンボリックリンクも、 ファイルツリーを辿る際に見つけたシンボリックリンクも辿るようになる。 このフラグは、
+名前空間全体を論理的な名前空間のように見せるためのものである。 (常にファイルツリーを辿るわけではないコマンドでは、 \fI\-R\fP
+フラグを一緒に指定しない限り、 \fI\-L\fP フラグは無視される点に注意。)
+.IP
+例えば、 コマンド \fIchown\ \-LR user slink\fP は \fIslink\fP が参照するファイルの所有者を変更する。
+\fIslink\fP がディレクトリを参照する場合、 \fBchown\fP はそのシンボリックリンクが参照するディレクトリを頂点とするファイル階層を辿る。
+また、 \fBchown\fP が辿るファイルツリー内でシンボリックリンクが見つかった場合、 \fIslink\fP と同じように処理される。
+.IP *
+\fI\-P\fP ("physical") フラグを指定すると、 コマンドはデフォルトの動作をするようになる。
+このフラグは名前空間全体を物理的な名前空間のように見せるためのものである。
+.PP
+デフォルトでファイルツリーを辿らないコマンドでは、 \fI\-R\fP フラグが同時に指定されなかった場合、 フラグ \fI\-H\fP, \fI\-L\fP, \fI\-P\fP
+は無視される。 また、 \fI\-H\fP, \fI\-L\fP, \fI\-P\fP は複数回同時に指定できるが、 最後に指定されたオプションでコマンドの動作が決定される。
+この動作は、 コマンドのエイリアスにある動作を指定しておいて、 コマンドラインでその動作を上書きできるようにするためである。
+.PP
+コマンド \fBls\fP(1) と \fBrm\fP(1) には、 これらのルールに対する例外がある。
+.IP * 2
+\fBrm\fP(1) コマンドは、 参照先のファイルではなく、シンボリックリンクに対して操作を行う。 したがって、 シンボリックリンクを辿ることはない。
+\fBrm\fP(1) コマンドはオプション \fI\-H\fP, \fI\-L\fP, \fI\-P\fP をサポートしていない。
+.IP *
+古いシステムとの互換性を持たせるため、 \fBls\fP(1) コマンドは少し違った動作をする。 オプション \fI\-F\fP, \fI\-d\fP, \fI\-l\fP
+を指定した場合、 \fBls\fP(1) はコマンドラインで指定されたシンボリックリンクを辿る。 \fI\-L\fP フラグが指定された場合、
+コマンドラインで指定された場合でも、 ファイルツリーを辿る際に見つかった場合でも、 ファイル種別に関わらず、 \fBls\fP(1)
+はすべてのシンボリックリンクを辿る。
+.SH 関連項目
+\fBchgrp\fP(1), \fBchmod\fP(1), \fBfind\fP(1), \fBln\fP(1), \fBls\fP(1), \fBmv\fP(1),
+\fBnamei\fP(1), \fBrm\fP(1), \fBlchown\fP(2), \fBlink\fP(2), \fBlstat\fP(2),
+\fBreadlink\fP(2), \fBrename\fP(2), \fBsymlink\fP(2), \fBunlink\fP(2), \fButimensat\fP(2),
+\fBlutimes\fP(3), \fBpath_resolution\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
+\%https://www.kernel.org/doc/man\-pages/ に書かれている。