\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, not just 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 以降)
-By default, \fBlinkat\fP(), does not dereference \fIoldpath\fP if it is a symbolic
-link (like \fBlink\fP()). The flag \fBAT_SYMLINK_FOLLOW\fP can be specified in
-\fIflags\fP to cause \fIoldpath\fP to be dereferenced if it is a symbolic link.
-If procfs is mounted, this can be used as an alternative to
-\fBAT_EMPTY_PATH\fP, like this:
+\fBlinkat\fP() は (\fBlink\fP() 同様) デフォルトでは \fIoldpath\fP がシンボリックリンクの場合リンクの展開を行わない。
+フラグ \fBAT_SYMLINK_FOLLOW\fP を \fIflags\fP に指定することができ、指定した場合 \fIoldpath\fP
+がシンボリックリンクの場合リンクの展開が行われる。 procfs がマウントされている場合、これは \fBAT_EMPTY_PATH\fP
+の代替として以下のように使うことができる。
.nf
.in +4n
\fBopen\fP(2) 参照。
.TP
\fBENOENT\fP
-\fIoldpath\fP is a relative pathname and \fIolddirfd\fP refers to a directory that
-has been deleted, or \fInewpath\fP is a relative pathname and \fInewdirfd\fP
-refers to a directory that has been deleted.
+\fIoldpath\fP が相対パス名で、 \fIolddirfd\fP が削除されたディレクトリを参照している。 または、 \fInewpath\fP
+が相対パス名で、 \fInewdirfd\fP が削除されたディレクトリを参照している。
.TP
\fBENOTDIR\fP
\fIoldpath\fP が相対パスで、 \fIolddirfd\fP がディレクトリ以外のファイルを参照している。または \fInewpath\fP と
がシンボリックリンクの場合にシンボリックリンクの参照を 解決するかどうかは実装依存となった。
リンク作成時のシンボリックリンクの扱いについての詳細な制御を行う場合には \fBlinkat\fP(2) を使用すること。
.SS "glibc での注意"
-On older kernels where \fBlinkat\fP() is unavailable, the glibc wrapper
-function falls back to the use of \fBlink\fP(), unless the \fBAT_SYMLINK_FOLLOW\fP
-is specified. When \fIoldpath\fP and \fInewpath\fP are relative pathnames, glibc
-constructs pathnames based on the symbolic links in \fI/proc/self/fd\fP that
-correspond to the \fIolddirfd\fP and \fInewdirfd\fP arguments.
+\fBlinkat\fP() が利用できない古いカーネルでは、 \fBAT_SYMLINK_FOLLOW\fP が指定されていない場合、 glibc ラッパー関数は
+\fBlink\fP() を使用するモードにフォールバックする。 \fIoldpath\fP と \fInewpath\fP が相対パスの場合、 glibc は
+\fIolddirfd\fP と \fInewdirfd\fP 引き数に対応する \fI/proc/self/fd\fP
+のシンボリックリンクに基づいてそれぞれパス名を構成する。
.SH バグ
NFS ファイルシステムでは、NFS サーバーがリンクを作成した後に、 それを伝える前に死んだ場合には返り値が不正な場合がある。
リンクが作成できたかどうか見つけるためには \fBstat\fP(2) を使用すること。