OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / release / man2 / linkat.2
1 .\" This manpage is Copyright (C) 2006, Michael Kerrisk
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH LINKAT 2 2013\-07\-21 Linux "Linux Programmer's Manual"
31 .SH 名前
32 linkat \- ディレクトリファイルディスクリプタから相対的な位置にファイルリンクを作成する
33 .SH 書式
34 .nf
35 \fB#include <fcntl.h> /* AT_* 定数の定義 */\fP
36 \fB#include <unistd.h>\fP
37 .sp
38 \fBint linkat(int \fP\fIolddirfd\fP\fB, const char *\fP\fIoldpath\fP\fB,\fP
39 \fB           int \fP\fInewdirfd\fP\fB, const char *\fP\fInewpath\fP\fB, int \fP\fIflags\fP\fB);\fP
40 .fi
41 .sp
42 .in -4n
43 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
44 .in
45 .sp
46 \fBlinkat\fP():
47 .PD 0
48 .ad l
49 .RS 4
50 .TP  4
51 glibc 2.10 以降:
52 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
53 .TP 
54 glibc 2.10 より前:
55 _ATFILE_SOURCE
56 .RE
57 .ad
58 .PD
59 .SH 説明
60 \fBlinkat\fP()  システムコールは、この man ページで説明する違い以外は、 \fBlink\fP(2)  と全く同じように動作する。
61
62 \fIoldpath\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIolddirfd\fP
63 で参照されるディレクトリからの相対パス名として解釈される (\fBlink\fP(2)  では、相対パスは呼び出し元プロセスの
64 カレントワーキングディレクトリからの相対パスとなる)。
65
66 \fIoldpath\fP が相対パスであり、かつ \fIolddirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIoldpath\fP は
67 (\fBlink\fP(2)  と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。
68
69 \fIoldpath\fP が絶対パスである場合、 \fIolddirfd\fP は無視される。
70
71 \fInewpath\fP の解釈は \fIoldpath\fP と同様であるが、 相対パス名はファイルディスクリプタ \fInewdirfd\fP
72 で参照されるディレクトリからの相対パス名として解釈される。
73
74 The following values can be biwise ORed in \fIflags\fP:
75 .TP 
76 \fBAT_EMPTY_PATH\fP (since Linux 2.6.39)
77 .\" commit 11a7b371b64ef39fc5fb1b6f2218eef7c4d035e3
78 If \fIoldpath\fP is an empty string, create a link to the file referenced by
79 \fIolddirfd\fP (which may have been obtained using the \fBopen\fP(2)  \fBO_PATH\fP
80 flag).  In this case, \fIolddirfd\fP can refer to any type of file, not just a
81 directory.  The caller must have the \fBCAP_DAC_READ_SEARCH\fP capability in
82 order to use this flag; this prevents arbitrary users from creating hard
83 links using file descriptors received via a UNIX domain socket (see the
84 discussion of \fBSCM_RIGHTS\fP in \fBunix\fP(7)).
85 .TP 
86 \fBAT_SYMLINK_FOLLOW\fP (since Linux 2.6.18)
87 By default, \fBlinkat\fP(), does not dereference \fIoldpath\fP if it is a symbolic
88 link (like \fBlink\fP(2)).  The flag \fBAT_SYMLINK_FOLLOW\fP can be specified in
89 \fIflags\fP to cause \fIoldpath\fP to be dereferenced if it is a symbolic link.
90 .PP
91 Before kernel 2.6.18, the \fIflags\fP argument was unused, and had to be
92 specified as 0.
93 .SH 返り値
94 成功した場合、 \fBlinkat\fP()  は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。
95 .SH エラー
96 \fBlink\fP(2)  と同じエラーが \fBlinkat\fP()  でも起こる。 \fBlinkat\fP()  では、その他に以下のエラーが起こる:
97 .TP 
98 \fBEBADF\fP
99 \fIolddirfd\fP または \fInewdirfd\fP が有効なファイルディスクリプタでない。
100 .TP 
101 \fBENOENT\fP
102 \fBAT_EMPTY_PATH\fP was specified in \fIflags\fP, but the caller did not have the
103 \fBCAP_DAC_READ_SEARCH\fP capability.
104 .TP 
105 \fBENOTDIR\fP
106 .TP 
107 \fBENOTDIR\fP
108 \fIoldpath\fP が相対パスで、かつ \fIolddirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 または
109 \fInewpath\fP と \fInewdirfd\fP について、同様のことが起きている。
110 .SH バージョン
111 \fBlinkat\fP()  は Linux カーネル 2.6.16 で追加された。
112 ライブラリによるサポートは glibc バージョン 2.4 で追加された。
113 .SH 準拠
114 POSIX.1\-2008.
115 .SH 注意
116 \fBlinkat\fP()  が必要な理由については、 \fBopenat\fP(2)  を参照すること。
117 .SH 関連項目
118 \fBlink\fP(2), \fBopenat\fP(2), \fBpath_resolution\fP(7), \fBsymlink\fP(7)
119 .SH この文書について
120 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
121 である。プロジェクトの説明とバグ報告に関する情報は
122 http://www.kernel.org/doc/man\-pages/ に書かれている。