.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and
.\" O_TTYINIT. Eventually these may need to be documented. --mtk
.\" FIXME Linux 2.6.33 has O_DSYNC, and a hidden __O_SYNC.
-.\" FIXME: Linux 2.6.39 added O_PATH
.\"
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH OPEN 2 2013\-02\-18 Linux "Linux Programmer's Manual"
+.TH OPEN 2 2013\-07\-21 Linux "Linux Programmer's Manual"
.SH 名前
open, creat \- ファイルやデバイスのオープン、作成を行う
.SH 書式
.\" 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 がディレクトリでなければオープンは失敗する。 このフラグは Linux 特有であり、 \fBopendir\fP(3) が FIFO
-やテープデバイスに対してコールされた場合の サービス不能 (denial\-of\-service) 攻撃を避けるために カーネル 2.1.126
-で追加された。 しかしこれは \fBopendir\fP(3) の実装以外では使用するべきではない。
+If \fIpathname\fP is not a directory, cause the open to fail. This flag is
+Linux\-specific, and was added in kernel version 2.1.126, to avoid
+denial\-of\-service problems if \fBopendir\fP(3) is called on a FIFO or tape
+device.
.TP
\fBO_EXCL\fP
この呼び出しでファイルが作成されることを保証する。このフラグが \fBO_CREAT\fP と
.\" 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.
-\fIpathname\fP がシンボリックリンクだった場合、オープンは失敗する。 これは FreeBSD の拡張で、Linux には 2.1.126
-より追加された。 pathname の前のコンポーネント (earlier component; 訳註: 最後のディレクトリセパレータより前の部分) が
-シンボリックリンクである場合には、それが指す先が参照される。
+If \fIpathname\fP is a symbolic link, then the open fails. This is a FreeBSD
+extension, which was added to Linux in version 2.1.126. Symbolic links in
+earlier components of the pathname will still be followed. See also
+\fBO_NOPATH\fP below.
.TP
\fBO_NONBLOCK\fP または \fBO_NDELAY\fP
可能ならば、ファイルは非停止 (nonblocking) モードでオープンされる。
ルリース (file lease) と組み合わせた場合の、 \fBO_NONBLOCK\fP の効果についての
議論は、 \fBfcntl\fP(2) を参照すること。
.TP
+\fBO_PATH\fP (since 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
+.\"
+Obtain a file descriptor that can be used for two purposes: to indicate a
+location in the file\-system tree and to perform operations that act purely
+at the file descriptor level. The file itself is not opened, and other file
+operations (e.g., \fBread\fP(2), \fBwrite\fP(2), \fBfchmod\fP(2), \fBfchown\fP(2),
+\fBfgetxattr\fP(2)) fail with the error \fBEBADF\fP.
+
+The following operations \fIcan\fP be performed on the resulting file
+descriptor:
+.RS
+.IP * 3
+.\" commit 332a2e1244bd08b9e3ecd378028513396a004a24
+.\" fstat(): commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2
+\fBclose\fP(2); \fBfchdir\fP(2) (since Linux 3.5); \fBfstat\fP(2) (since Linux
+3.6).
+.IP *
+Duplicating the file descriptor (\fBdup\fP(2), \fBfcntl\fP(2) \fBF_DUPFD\fP, etc.).
+.IP *
+Getting and setting file descriptor flags (\fBfcntl\fP(2) \fBF_GETFD\fP and
+\fBF_SETFD\fP).
+.IP *
+Retrieving open file status flags using the \fBfcntl\fP(2) \fBF_GETFL\fP
+operation: the returned flags will include the bit \fBO_PATH\fP.
+
+.IP *
+Passing the file descriptor as the \fIdirfd\fP argument of \fBopenat\fP(2) and
+the other "*at()" system calls.
+.IP *
+Passing the file descriptor to another process via a UNIX domain socket (see
+\fBSCM_RIGHTS\fP in \fBunix\fP(7)).
+.RE
+.IP
+When \fBO_PATH\fP is specified in \fIflags\fP, flag bits other than \fBO_DIRECTORY\fP
+and \fBO_NOFOLLOW\fP are ignored.
+
+If the \fBO_NOFOLLOW\fP flag is also specified, then the call returns a file
+descriptor referring to the symbolic link. This file descriptor can be used
+as the \fIdirfd\fP argument in calls to \fBfchownat\fP(2), \fBfstatat\fP(2),
+\fBlinkat\fP(2), and \fBreadlinkat\fP(2) with an empty pathname to have the calls
+operate on the symbolic link.
+.TP
\fBO_SYNC\fP
ファイルは同期 (synchronous) I/O モードでオープンされる。 \fBopen\fP() が返したファイルディスクリプタに対して
\fBwrite\fP(2) を行うと、必ず呼び出したプロセスをブロックし、 該当ハードウェアに物理的に書き込まれるまで返らない。
\fBEWOULDBLOCK\fP
\fBO_NONBLOCK\fP フラグが指定されたが、そのファイルには矛盾するリースが設定されていた (\fBfcntl\fP(2) 参照)。
.SH 準拠
-SVr4, 4.3BSD, POSIX.1\-2001. フラグ \fBO_DIRECTORY\fP, \fBO_NOATIME\fP, \fBO_NOFOLLOW\fP
-は Linux 特有のものであり、 これらのフラグの定義を得るためには、 (「どの」ヘッダファイルをインクルードするよりも前に)
-\fB_GNU_SOURCE\fP を定義する必要があるかもしれない。
+SVr4, 4.3BSD, POSIX.1\-2001. The \fBO_DIRECTORY\fP, \fBO_NOATIME\fP,
+\fBO_NOFOLLOW\fP, and \fBO_PATH\fP flags are Linux\-specific, and one may need to
+define \fB_GNU_SOURCE\fP (before including \fIany\fP header files) to obtain
+their definitions.
\fBO_CLOEXEC\fP フラグは POSIX.1\-2001 では規定されていないが、 POSIX.1\-2008 で規定されている。
\fBsocket\fP(2), \fBstat\fP(2), \fBumask\fP(2), \fBunlink\fP(2), \fBwrite\fP(2),
\fBfopen\fP(3), \fBfifo\fP(7), \fBpath_resolution\fP(7), \fBsymlink\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。