OSDN Git Service

(split) LDP: Release pages from LDP v3.53
[linuxjm/LDP_man-pages.git] / release / man2 / readlinkat.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 .\"
31 .\" Japanese Version Copyright (c) 2006 Yuichi SATO
32 .\"         all rights reserved.
33 .\" Translated 2006-09-27 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
34 .\" Updated 2013-08-21, Akihiro MOTOKI <amotoki@gmail.com>
35 .\"
36 .TH READLINKAT 2 2013\-07\-31 Linux "Linux Programmer's Manual"
37 .SH 名前
38 readlinkat \- ディレクトリファイルディスクリプタから相対的な位置にある シンボリックリンクの値を読む
39 .SH 書式
40 .nf
41 \fB#include <fcntl.h> /* AT_* 定数の定義 */\fP
42 \fB#include <unistd.h>\fP
43 .sp
44 \fBint readlinkat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB,\fP
45 \fB               char *\fP\fIbuf\fP\fB, size_t \fP\fIbufsiz\fP\fB);\fP
46 .fi
47 .sp
48 .in -4n
49 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
50 .in
51 .sp
52 \fBreadlinkat\fP():
53 .PD 0
54 .ad l
55 .RS 4
56 .TP  4
57 glibc 2.10 以降:
58 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
59 .TP 
60 glibc 2.10 より前:
61 _ATFILE_SOURCE
62 .RE
63 .ad
64 .PD
65 .SH 説明
66 \fBreadlinkat\fP()  システムコールは、この man ページで説明している違いがある以外は、 \fBreadlink\fP(2)
67 と全く同じように動作する。
68
69 \fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP
70 で参照されるディレクトリからの相対パス名として解釈される (\fBreadlink\fP(2)  では、相対パスは呼び出し元プロセスの
71 カレントワーキングディレクトリからの相対パスとなる)。
72
73 \fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は
74 (\fBreadlink\fP(2)  と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。
75
76 \fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。
77
78 .\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d
79 Linux 2.6.39 以降では、 \fIpathname\fP に空の文字列を指定することができる。 この場合、 \fBreadlinkat\fP()
80 の呼び出しは \fIdirfd\fP が参照するファイルに対する操作となる (\fIdirfd\fP は \fBopen\fP(2) の \fBO_PATH\fP
81 フラグを使って取得することができる)。 空の文字列を指定した場合、 \fIdirfd\fP は、
82 ディレクトリだけでなく、任意の種類のファイルを参照することができる。
83
84 .SH 返り値
85 成功した場合、 \fBreadlinkat\fP()  は \fIbuf\fP に格納されたバイト数を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP
86 にはエラーを示す値が設定される。
87 .SH エラー
88 \fBreadlink\fP(2)  と同じエラーが \fBreadlinkat\fP()  でも起こる。 \fBreadlinkat\fP()
89 では、その他に以下のエラーが起こる:
90 .TP 
91 \fBEBADF\fP
92 \fIdirfd\fP が有効なファイルディスクリプタでない。
93 .TP 
94 \fBENOTDIR\fP
95 \fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。
96 .SH バージョン
97 \fBreadlinkat\fP()  は Linux カーネル 2.6.16 で追加された。
98 ライブラリによるサポートは glibc バージョン 2.4 で追加された。
99 .SH 準拠
100 POSIX.1\-2008.
101 .SH 注意
102 \fBreadlinkat\fP()  が必要な理由については、 \fBopenat\fP(2)  を参照すること。
103 .SH 関連項目
104 \fBopenat\fP(2), \fBreadlink\fP(2), \fBpath_resolution\fP(7)
105 .SH この文書について
106 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
107 である。プロジェクトの説明とバグ報告に関する情報は
108 http://www.kernel.org/doc/man\-pages/ に書かれている。