OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / getxattr.2
1 .\"
2 .\" Extended attributes system calls manual pages
3 .\"
4 .\" Copyright (C) Andreas Gruenbacher, February 2001
5 .\" Copyright (C) Silicon Graphics Inc, September 2001
6 .\"
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
11 .\"
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
16 .\"
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 .\" GNU General Public License for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" USA.
26 .\"
27 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
28 .\"         all rights reserved.
29 .\" Translated Tue Jul  8 02:47:19 JST 2003
30 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
31 .\"
32 .\"WORD:        extended attributes     ³Èĥ°À­
33 .\"WORD:        namespace               Ì¾Á°¶õ´Ö
34 .\"
35 .TH GETXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .\"O getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value
38 .SH Ì¾Á°
39 getxattr, lgetxattr, fgetxattr \- ³Èĥ°À­¤ÎÃͤò¼èÆÀ¤¹¤ë
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .fam C
43 .nf
44 .B #include <sys/types.h>
45 .B #include <attr/xattr.h>
46 .sp
47 .BI "ssize_t getxattr(const char\ *" path ", const char\ *" name ,
48 .BI "                 void\ *" value ", size_t " size );
49 .BI "ssize_t lgetxattr(const char\ *" path ", const char\ *" name ,
50 .BI "                 void\ *" value ", size_t " size );
51 .BI "ssize_t fgetxattr(int " fd ", const char\ *" name ,
52 .BI "                 void\ *" value ", size_t " size );
53 .fi
54 .fam T
55 .\"O .SH DESCRIPTION
56 .SH ÀâÌÀ
57 .\"O Extended attributes are
58 .\"O .IR name :\c
59 .\"O .I value
60 .\"O pairs associated with inodes (files, directories, symbolic links, etc.).
61 .\"O They are extensions to the normal attributes which are associated
62 .\"O with all inodes in the system (i.e., the
63 .\"O .BR stat (2)
64 .\"O data).
65 .\"O A complete overview of extended attributes concepts can be found in
66 .\"O .BR attr (5).
67 ³Èĥ°À­¤Ï¡¢inode (¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Åù) ¤Ë
68 ´ØÏ¢ÉÕ¤±¤é¤ì¤¿
69 .IR name :\c
70 .I value
71 ¤ÎÂФǤ¢¤ë¡£
72 ¤³¤ì¤é¤Ï¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î inode ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ä̾ï¤Î°À­
73 .RB ( stat (2)
74 ¤¬ÊÖ¤¹¥Ç¡¼¥¿) ¤ò³ÈÄ¥¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
75 ³Èĥ°À­¤Î¥³¥ó¥»¥×¥È¤Ï
76 .BR attr (5)
77 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£
78 .PP
79 .\"O .BR getxattr ()
80 .\"O retrieves the
81 .\"O .I value
82 .\"O of the extended attribute identified by
83 .\"O .I name
84 .\"O and associated with the given
85 .\"O .I path
86 .\"O in the file system.
87 .\"O The length of the attribute
88 .\"O .I value
89 .\"O is returned.
90 .BR getxattr ()
91 ¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î»ØÄꤵ¤ì¤¿
92 .I path
93 ¤ËÂбþ¤¹¤ë¡¢Ì¾Á°
94 .I name
95 ¤Î³Èĥ°À­¤Î
96 .I value
97 (ÃÍ) ¤ò¼èÆÀ¤¹¤ë¡£
98 °À­
99 .I value
100 ¤ÎŤµ¤¬ÊÖ¤µ¤ì¤ë¡£
101 .PP
102 .\"O .BR lgetxattr ()
103 .\"O is identical to
104 .\"O .BR getxattr (),
105 .\"O except in the case of a symbolic link, where the link itself is
106 .\"O interrogated, not the file that it refers to.
107 .BR lgetxattr ()
108 ¤Ï
109 .BR getxattr ()
110 ¤ÈƱ¤¸¤À¤¬¡¢¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¡¢¥ê¥ó¥¯¤¬»²¾È¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë
111 ¤Ç¤Ï¤Ê¤¯¡¢¥ê¥ó¥¯¤½¤Î¤â¤Î¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ëÅÀ¤À¤±¤¬°Û¤Ê¤ë¡£
112 .PP
113 .\"O .BR fgetxattr ()
114 .\"O is identical to
115 .\"O .BR getxattr (),
116 .\"O only the open file referred to by
117 .\"O .I fd
118 .\"O (as returned by
119 .\"O .BR open (2))
120 .\"O is interrogated in place of
121 .\"O .IR path .
122 .BR fgetxattr ()
123 ¤Ï
124 .BR getxattr ()
125 ¤ÈƱ¤¸¤À¤¬¡¢
126 .I path
127 ¤ÎÂå¤ï¤ê¤Ë
128 .I fd
129 ¤Ç»²¾È¤µ¤ì¤¿¥ª¡¼¥×¥óºÑ¤ß¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤À¤±¤ò¼èÆÀ¤¹¤ëÅÀ¤¬°Û¤Ê¤ë
130 .RI ( fd
131 ¤Ï
132 .BR open (2)
133 ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë)¡£
134 .PP
135 .\"O An extended attribute
136 .\"O .I name
137 .\"O is a simple null-terminated string.
138 .\"O The name includes a namespace prefix; there may be several, disjoint
139 .\"O namespaces associated with an individual inode.
140 .\"O The value of an extended attribute is a chunk of arbitrary textual or
141 .\"O binary data of specified length.
142 ³Èĥ°À­¤Î̾Á°
143 .I name
144 ¤ÏÉáÄ̤ΠNULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¢¤ë¡£
145 ̾Á°¤Ë¤Ï¡¢Ì¾Á°¶õ´Ö¤òɽ¤¹ÀÜƬ¼­ (prefix) ¤¬´Þ¤Þ¤ì¤ë;
146 ¸Ä¡¹¤Î inode ¤ËÂФ·¤Æ¡¢¸ß¤¤¤ËÆÈΩ¤Ê̾Á°¶õ´Ö¤¬Ê£¿ô¤¢¤Ã¤Æ¤â¤è¤¤¡£
147 ³Èĥ°À­¤ÎÃͤϡ¢¤¢¤ë°ìÄê¤ÎŤµ¤ÎǤ°Õ¤Î¥Æ¥­¥¹¥È¡¦¥Ç¡¼¥¿¤Þ¤¿¤Ï
148 ¥Ð¥¤¥Ê¥ê¡¦¥Ç¡¼¥¿¤Î½¸¹ç¤Ç¤¢¤ë¡£
149 .PP
150 .\"O An empty buffer of
151 .\"O .I size
152 .\"O zero can be passed into these calls to return the current size of the
153 .\"O named extended attribute, which can be used to estimate the size of a
154 .\"O buffer which is sufficiently large to hold the value associated with
155 .\"O the extended attribute.
156 .I size
157 ¤Ë 0 ¤ò»ØÄꤷ¤Æ¶õ¤Î¥Ð¥Ã¥Õ¥¡¤ò¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¡¢
158 ¤³¤Î¾ì¹ç¤Ë¤Ï»ØÄꤵ¤ì¤¿Ì¾Á°¤Î³Èĥ°À­¤Î¸½ºß¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£
159 ¤³¤ÎÊýË¡¤Ï¡¢³Èĥ°À­¤ÎÃͤòÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤ò
160 ¸«ÀѤâ¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡¢
161 .PP
162 .\"O The interface is designed to allow guessing of initial buffer
163 .\"O sizes, and to enlarge buffers when the return value indicates
164 .\"O that the buffer provided was too small.
165 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï¡¢½é´ü¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Î¿ä¬¤ò¤·¤¿¤ê¡¢
166 Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¤³¤È¤òÊÖ¤êÃͤÇÃΤ餻¤ë¤³¤È¤Ç¥Ð¥Ã¥Õ¥¡¤òÂ礭¤¯
167 ¤·¤¿¤ê¤Ç¤­¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£
168 .\"O .SH RETURN VALUE
169 .SH ÊÖ¤êÃÍ
170 .\"O On success, a positive number is returned indicating the size of the
171 .\"O extended attribute value.
172 .\"O On failure, \-1 is returned and
173 .\"O .I errno
174 .\"O is set appropriately.
175 À®¸ù¤·¤¿¾ì¹ç¡¢³Èĥ°À­¤ÎÃͤÎŤµ¤òɽ¤¹Àµ¤Î¿ô¤¬ÊÖ¤µ¤ì¤ë¡£
176 ¼ºÇÔ¤·¤¿¾ì¹ç¡¢ \-1 ¤¬ÊÖ¤µ¤ì¡¢
177 .I errno
178 ¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£
179 .PP
180 .\"O If the named attribute does not exist, or the process has no access to
181 .\"O this attribute,
182 .\"O .I errno
183 .\"O is set to
184 .\"O .BR ENOATTR .
185 »ØÄꤵ¤ì¤¿Ì¾Á°¤Î°À­¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤¬¤½¤Î°À­¤Ë¥¢¥¯¥»¥¹
186 ¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¡¢
187 .I errno
188 ¤Ë
189 .B ENOATTR
190 ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
191 .PP
192 .\"O If the
193 .\"O .I size
194 .\"O of the
195 .\"O .I value
196 .\"O buffer is too small to hold the result,
197 .\"O .I errno
198 .\"O is set to
199 .\"O .B ERANGE .
200 .I value
201 ¥Ð¥Ã¥Õ¥¡¤ÎÂ礭¤µ
202 .I size
203 ¤¬·ë²Ì¤òÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Ç¤Ê¤¤¾ì¹ç¡¢
204 .I errno
205 ¤Ë
206 .B ERANGE
207 ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
208 .PP
209 .\"O If extended attributes are not supported by the file system, or are disabled,
210 .\"O .I errno
211 .\"O is set to
212 .\"O .B ENOTSUP .
213 ³Èĥ°À­¤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
214 ¤â¤·¤¯¤Ï̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
215 .I errno
216 ¤Ë
217 .B ENOTSUP
218 ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
219 .PP
220 .\"O The errors documented for the
221 .\"O .BR stat (2)
222 .\"O system call are also applicable here.
223 .BR stat (2)
224 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÀâÌÀ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¨¥é¡¼¤Ï
225 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤âŬÍѤµ¤ì¤ë¡£
226 .\"O .SH VERSIONS
227 .SH ¥Ð¡¼¥¸¥ç¥ó
228 .\"O These system calls have been available on Linux since kernel 2.4;
229 .\"O glibc support is provided since version 2.3.
230 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.4 °Ê¹ß¤Î Linux ¤ÇÍøÍѤǤ­¤ë¡£
231 glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.3 °Ê¹ß¤Ç¹Ô¤ï¤ì¤Æ¤¤¤ë¡£
232 .\"O .SH "CONFORMING TO"
233 .SH ½àµò
234 .\"O These system calls are Linux-specific.
235 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£
236 .\"O .\" .SH AUTHORS
237 .\" .SH Ãø¼Ô
238 .\"O .\" Andreas Gruenbacher,
239 .\"O .\" .RI < a.gruenbacher@computer.org >
240 .\"O .\" and the SGI XFS development team,
241 .\"O .\" .RI < linux-xfs@oss.sgi.com >.
242 .\"O .\" Please send any bug reports or comments to these addresses.
243 .\" Andreas Gruenbacher,
244 .\" .RI < a.gruenbacher@computer.org >
245 .\" ¤È SGI XFS ³«È¯¥Á¡¼¥à,
246 .\" .RI < linux-xfs@oss.sgi.com >¡£
247 .\" ¥Ð¥°¥ì¥Ý¡¼¥È¤ä¥³¥á¥ó¥È¤Ï¾åµ­¤Î¥¢¥É¥ì¥¹¤Þ¤ÇÁ÷¤Ã¤Æ²¼¤µ¤¤¡£
248 .\"O .SH SEE ALSO
249 .SH ´ØÏ¢¹àÌÜ
250 .BR getfattr (1),
251 .BR setfattr (1),
252 .BR listxattr (2),
253 .BR open (2),
254 .BR removexattr (2),
255 .BR setxattr (2),
256 .BR stat (2),
257 .BR attr (5),
258 .BR symlink (7)