OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / 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 2007-07-26 "Linux" "Linux Programmer's Manual"
52 .SH Ì¾Á°
53 readlink \- ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÃͤòÆɤà
54 .SH ½ñ¼°
55 .B #include <unistd.h>
56 .sp
57 .BI "ssize_t readlink(const char *" path ", char *" buf ", size_t " bufsiz );
58 .sp
59 .in -4n
60 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
61 .RB ( feature_test_macros (7)
62 »²¾È):
63 .in
64 .sp
65 .ad l
66 .BR readlink ():
67 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L
68 .ad b
69 .SH ÀâÌÀ
70 .BR readlink ()
71 ¤Ï
72 .I path
73 ¤ÇÍ¿¤¨¤é¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ÎÆâÍƤò
74 .I buf
75 ¥Ð¥Ã¥Õ¥¡¡¼¤Ø³ÊǼ¤¹¤ë¡¢
76 .I buf
77 ¤Î¥µ¥¤¥º¤Ï
78 .I bufsiz
79 ¤Ç¤¢¤ë¡£
80 .BR readlink ()
81 ¤Ï NULL ¥Ð¥¤¥È¤ò
82 .I buf
83 ¤ËÄɲ䷤ʤ¤¡£
84 ¤½¤ÎÆâÍÆÁ´¤Æ¤ò³ÊǼ¤¹¤ë¤Î¤Ë¥Ð¥Ã¥Õ¥¡¡¼¤¬¾®¤µ²á¤®¤ë¾ì¹ç¤Ï¡¢
85 .RI ( bufsiz
86 ¥Ð¥¤¥È¤ÎŤµ¤Ë) ÆâÍƤòÀÚ¤êµÍ¤á¤ë¡£
87 .SH ÊÖ¤êÃÍ
88 À®¸ù¤¹¤ë¤È¡¢
89 .BR readlink ()
90 ¤Ï
91 .I buf
92 ¤Ë³ÊǼ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
93 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
94 .I errno
95 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
96 .SH ¥¨¥é¡¼
97 .TP
98 .B EACCES
99 ¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Ë¸¡º÷µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤
100 .RB ( path_resolution (7)
101 ¤â»²¾È¤¹¤ë¤³¤È)¡£
102 .TP
103 .B EFAULT
104 .I buf
105 ¤¬¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
106 .TP
107 .B EINVAL
108 .I bufsiz
109 ¤¬Àµ¤Ç¤Ê¤¤¡£
110 .\" At the glibc level, bufsiz is unsigned, so this error can only occur
111 .\" if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
112 .\" and this error can also occur if bufsiz < 0.
113 .\" See: http://thread.gmane.org/gmane.linux.man/380
114 .\" Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
115 .TP
116 .B EINVAL
117 »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤Ê¤¤¡£
118 .TP
119 .B EIO
120 ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ÎÆɤ߹þ¤ßÃæ¤Ë I/O ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
121 .TP
122 .B ELOOP
123 ¥Ñ¥¹Ì¾¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿¤¹¤®¤ë¡£
124 .TP
125 .B ENAMETOOLONG
126 ¥Ñ¥¹Ì¾¤«¥Ñ¥¹Ì¾¤Î°ìÉôʬ¤¬Ä¹²á¤®¤ë¡£
127 .TP
128 .B ENOENT
129 ¤½¤Î̾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
130 .TP
131 .B ENOMEM
132 ¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
133 .TP
134 .B ENOTDIR
135 ¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
136 .SH ½àµò
137 4.4BSD
138 .RB ( readlink ()
139 ´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤Ç¸½¤ï¤ì¤¿), POSIX.1-2001.
140 .SH Ãí°Õ
141 ¥Ð¡¼¥¸¥ç¥ó 2.4 °ÊÁ°¤Î glibc (¥Ð¡¼¥¸¥ç¥ó 2.4 ¤ò´Þ¤à) ¤Ç¤Ï¡¢
142 .BR readlink ()
143 ¤ÎÊÖ¤êÃͤη¿¤Ï
144 .I int
145 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤¿¡£¸½ºß¤Ç¤Ï¡¢ÊÖ¤êÃͤη¿¤Ï
146 .I ssize_t
147 ¤Ç¤¢¤ë (ÊÖ¤êÃÍ
148 .I ssize_t
149 ¤Ï POSIX.1-2001 ¤Ç (¿·¤¿¤Ë) É¬¿Ü¤È¤Ê¤Ã¤¿)¡£
150 .SH ´ØÏ¢¹àÌÜ
151 .BR lstat (2),
152 .BR readlinkat (2),
153 .BR stat (2),
154 .BR symlink (2),
155 .BR path_resolution (7),
156 .BR symlink (7)