OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / readlink.2
1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)readlink.2  6.8 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Sat Jul 24 00:10:21 1993 by Rik Faith <faith@cs.unc.edu>
35 .\" Modified Tue Jul  9 23:55:17 1996 by aeb
36 .\" Modified Fri Jan 24 00:26:00 1997 by aeb
37 .\"
38 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
39 .\"         all rights reserved.
40 .\" Translated 1997-12-12, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Updated 2005-02-10, Yuichi SATO <ysato444@yahoo.co.jp>
42 .\" Updated 2006-07-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
43 .\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05
44 .\"
45 .\"WORD:        symbolic link           シンボリック・リンク
46 .\"WORD:        buffer                  バッファー
47 .\"WORD:        NUL                     ヌル文字
48 .\"WORD:        global variable         グローバル変数
49 .\"WORD:        directory               ディレクトリ
50 .\"
51 .TH READLINK 2 2010-09-20 "Linux" "Linux Programmer's Manual"
52 .\"O .SH NAME
53 .SH 名前
54 .\"O readlink \- read value of a symbolic link
55 readlink \- シンボリック・リンクの値を読む
56 .\"O .SH SYNOPSIS
57 .SH 書式
58 .B #include <unistd.h>
59 .sp
60 .BI "ssize_t readlink(const char *" path ", char *" buf ", size_t " bufsiz );
61 .sp
62 .in -4n
63 .\"O Feature Test Macro Requirements for glibc (see
64 .\"O .BR feature_test_macros (7)):
65 glibc 向けの機能検査マクロの要件
66 .RB ( feature_test_macros (7)
67 参照):
68 .in
69 .sp
70 .ad l
71 .BR readlink ():
72 .RS 4
73 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
74 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\ >=\ 200112L
75 .RE
76 .ad b
77 .\"O .SH DESCRIPTION
78 .SH 説明
79 .\"O .BR readlink ()
80 .\"O places the contents of the symbolic link
81 .\"O .I path
82 .\"O in the buffer
83 .\"O .IR buf ,
84 .\"O which has size
85 .\"O .IR bufsiz .
86 .BR readlink ()
87
88 .I path
89 で与えられたシンボリック・リンクの内容を
90 .I buf
91 バッファーへ格納する、
92 .I buf
93 のサイズは
94 .I bufsiz
95 である。
96 .\"O .BR readlink ()
97 .\"O does not append a null byte to
98 .\"O .IR buf .
99 .BR readlink ()
100 は NULL バイトを
101 .I buf
102 に追加しない。
103 .\"O It will truncate the contents (to a length of
104 .\"O .I bufsiz
105 .\"O characters), in case the buffer is too small to hold all of the contents.
106 その内容全てを格納するのにバッファーが小さ過ぎる場合は、
107 .RI ( bufsiz
108 バイトの長さに) 内容を切り詰める。
109 .\"O .SH "RETURN VALUE"
110 .SH 返り値
111 .\"O On success,
112 .\"O .BR readlink ()
113 .\"O returns the number of bytes placed in
114 .\"O .IR buf .
115 .\"O On error, \-1 is returned and
116 .\"O .I errno
117 .\"O is set to indicate the error.
118 成功すると、
119 .BR readlink ()
120
121 .I buf
122 に格納されたバイト数を返す。
123 エラーの場合、\-1 を返し、
124 .I errno
125 にエラーを示す値を設定する。
126 .\"O .SH ERRORS
127 .SH エラー
128 .TP
129 .B EACCES
130 .\"O Search permission is denied for a component of the path prefix.
131 .\"O (See also
132 .\"O .BR path_resolution (7).)
133 パスのディレクトリ部分に検索許可が与えられていない
134 .RB ( path_resolution (7)
135 も参照すること)。
136 .TP
137 .B EFAULT
138 .\"O .I buf
139 .\"O extends outside the process's allocated address space.
140 .I buf
141 がプロセスに割り当てられたアドレス空間の外を指している。
142 .TP
143 .B EINVAL
144 .\"O .I bufsiz
145 .\"O is not positive.
146 .I bufsiz
147 が正でない。
148 .\" At the glibc level, bufsiz is unsigned, so this error can only occur
149 .\" if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
150 .\" and this error can also occur if bufsiz < 0.
151 .\" See: http://thread.gmane.org/gmane.linux.man/380
152 .\" Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
153 .TP
154 .B EINVAL
155 .\"O The named file is not a symbolic link.
156 指定したファイルがシンボリック・リンクでない。
157 .TP
158 .B EIO
159 .\"O An I/O error occurred while reading from the file system.
160 ファイル・システムの読み込み中に I/O エラーが起こった。
161 .TP
162 .B ELOOP
163 .\"O Too many symbolic links were encountered in translating the pathname.
164 パス名にシンボリック・リンクが多すぎる。
165 .TP
166 .B ENAMETOOLONG
167 .\"O A pathname, or a component of a pathname, was too long.
168 パス名かパス名の一部分が長過ぎる。
169 .TP
170 .B ENOENT
171 .\"O The named file does not exist.
172 その名前のファイルが存在しない。
173 .TP
174 .B ENOMEM
175 .\"O Insufficient kernel memory was available.
176 カーネルに十分なメモリがない。
177 .TP
178 .B ENOTDIR
179 .\"O A component of the path prefix is not a directory.
180 パスのディレクトリ部分がディレクトリでない。
181 .\"O .SH "CONFORMING TO"
182 .SH 準拠
183 .\"O 4.4BSD
184 .\"O .RB ( readlink ()
185 .\"O first appeared in 4.2BSD),
186 .\"O POSIX.1-2001.
187 4.4BSD
188 .RB ( readlink ()
189 は 4.2BSD で初めて登場した), POSIX.1-2001.
190 .\"O .SH NOTES
191 .SH 注意
192 .\"O In versions of glibc up to and including glibc 2.4, the return type of
193 .\"O .BR readlink ()
194 .\"O was declared as
195 .\"O .IR int .
196 .\"O Nowadays, the return type is declared as
197 .\"O .IR ssize_t ,
198 .\"O as (newly) required in POSIX.1-2001.
199 バージョン 2.4 以前の glibc (バージョン 2.4 を含む) では、
200 .BR readlink ()
201 の返り値の型は
202 .I int
203 で宣言されていた。現在では、返り値の型は
204 .I ssize_t
205 である (返り値
206 .I ssize_t
207 は POSIX.1-2001 で (新たに) 必須となった)。
208 .\"O .SH "SEE ALSO"
209 .SH 関連項目
210 .BR lstat (2),
211 .BR readlinkat (2),
212 .BR stat (2),
213 .BR symlink (2),
214 .BR path_resolution (7),
215 .BR symlink (7)