OSDN Git Service

df7b7fe2c8ae4b4243855c44acd1d0eb74582810
[linuxjm/LDP_man-pages.git] / draft / man2 / listxattr.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 04:17:12 JST 2003
30 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
31 .\"
32 .\"WORD:        extended attributes     拡張属性
33 .\"WORD:        namespace               名前空間
34 .\"
35 .TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .\"O listxattr, llistxattr, flistxattr \- list extended attribute names
38 .SH 名前
39 listxattr, llistxattr, flistxattr \- 拡張属性の名前リストを得る
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 listxattr(const char\ *" path ", char\ *" list \
48 ", size_t " size );
49 .BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \
50 ", size_t " size );
51 .BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size );
52 .fi
53 .fam T
54 .\"O .SH DESCRIPTION
55 .SH 説明
56 .\"O Extended attributes are name:value
57 .\"O pairs associated with inodes (files, directories, symbolic links, etc.).
58 .\"O They are extensions to the normal attributes which are associated
59 .\"O with all inodes in the system (i.e., the
60 .\"O .BR stat (2)
61 .\"O data).
62 .\"O A complete overview of extended attributes concepts can be found in
63 .\"O .BR attr (5).
64 拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に
65 関連付けられた
66 .IR name :\c
67 .I value
68 の対である。
69 これらは、システム上のすべての inode に関連付けられた通常の属性
70 .RB ( stat (2)
71 が返すデータ) を拡張するものである。
72 拡張属性のコンセプトは
73 .BR attr (5)
74 に書かれている。
75 .PP
76 .\"O .BR listxattr ()
77 .\"O retrieves the
78 .\"O .I list
79 .\"O of extended attribute names associated with the given
80 .\"O .I path
81 .\"O in the file system.
82 .\"O The list is the set of (null-terminated) names, one after the other.
83 .\"O Names of extended attributes to which the calling process does not
84 .\"O have access may be omitted from the list.
85 .\"O The length of the attribute name
86 .\"O .I list
87 .\"O is returned.
88 .BR listxattr ()
89 は、ファイルシステム内の指定された
90 .I path
91 に対応する拡張属性の名前リストを取得する。
92 リストは名前の集合で、 NULL 終端された文字列が連続して並んでいる。
93 呼び出したプロセスがアクセスする権限のない拡張属性の名前は、
94 リストに含まれない。拡張属性の名前の
95 .I list
96 の長さが返される。
97 .PP
98 .\"O .BR llistxattr ()
99 .\"O is identical to
100 .\"O .BR listxattr (),
101 .\"O except in the case of a symbolic link, where the list of names of
102 .\"O extended attributes associated with the link itself is retrieved,
103 .\"O not the file that it refers to.
104 .BR llistxattr ()
105
106 .BR listxattr ()
107 と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル
108 ではなく、リンクそのものの拡張属性の名前リストを取得する点だけが異なる。
109 .PP
110 .\"O .BR flistxattr ()
111 .\"O is identical to
112 .\"O .BR listxattr (),
113 .\"O only the open file referred to by
114 .\"O .I fd
115 .\"O (as returned by
116 .\"O .BR open (2))
117 .\"O is interrogated in place of
118 .\"O .IR path .
119 .BR flistxattr ()
120
121 .BR listxattr ()
122 と同じだが、
123 .I path
124 の代わりに
125 .I fd
126 で参照されたオープン済みファイルの情報だけを取得する点が異なる
127 .RI ( filedes
128
129 .BR open (2)
130 によって返される)。
131 .PP
132 .\"O A single extended attribute
133 .\"O .I name
134 .\"O is a simple null-terminated string.
135 .\"O The name includes a namespace prefix; there may be several, disjoint
136 .\"O namespaces associated with an individual inode.
137 個々の拡張属性の
138 .I name
139 は普通の NULL 終端された文字列である。
140 名前には、名前空間を表す接頭辞 (prefix) が含まれる;
141 個々の inode に対して、互いに独立な名前空間が複数あってもよい。
142 .PP
143 .\"O An empty buffer of
144 .\"O .I size
145 .\"O zero can be passed into these calls to return the current size of the
146 .\"O list of extended attribute names, which can be used to estimate the
147 .\"O size of a buffer which is sufficiently large to hold the list of names.
148 .I size
149 に 0 を指定して空のバッファをこれらのシステムコールに渡すことができ、
150 この場合には拡張属性の名前リストの現在のサイズが返される。
151 この方法は名前リストを保持するのに十分な大きさのバッファ・サイズを
152 見積もるのに使うことができる、
153 .\"O .SS Example
154 .SS 例
155 .\"O The
156 .\"O .I list
157 .\"O of names is returned as an unordered array of null-terminated character
158 .\"O strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this:
159 返される名前の
160 .I list
161 は、 NULL 終端された文字列の配列 (属性名は NULL バイト (\(aq\\0\(aq)
162 で区切られている) で、各要素は整列されている訳ではない。
163 以下に例を示す:
164 .fam C
165 .RS
166 .nf
167
168 user.name1\\0system.name1\\0user.name2\\0
169 .fi
170 .RE
171 .fam T
172 .P
173 .\"O Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using
174 .\"O extended attributes, might return a
175 .\"O .I list
176 .\"O like this:
177 拡張属性を使って POSIX ACL を実装している ext2、ext3、XFS のようなファイル
178 システムでは、返される
179 .I list
180 は以下のようになることだろう:
181 .fam C
182 .RS
183 .nf
184
185 system.posix_acl_access\\0system.posix_acl_default\\0
186 .fi
187 .RE
188 .fam T
189 .\"O .SH RETURN VALUE
190 .SH 返り値
191 .\"O On success, a positive number is returned indicating the size of the
192 .\"O extended attribute name list.
193 .\"O On failure, \-1 is returned and
194 .\"O .I errno
195 .\"O is set appropriately.
196 成功した場合、拡張属性の名前リストの長さを表す正の数が返される。
197 失敗した場合、 \-1 が返され、
198 .I errno
199 に適切な値がセットされる。
200 .PP
201 .\"O If the
202 .\"O .I size
203 .\"O of the
204 .\"O .I list
205 .\"O buffer is too small to hold the result,
206 .\"O .I errno
207 .\"O is set to
208 .\"O .BR ERANGE .
209 .I list
210 バッファの大きさ
211 .I size
212 が結果を保持するのに十分な大きさでない場合、
213 .I errno
214
215 .B ERANGE
216 がセットされる。
217 .PP
218 .\"O If extended attributes are not supported by the file system, or are disabled,
219 .\"O .I errno
220 .\"O is set to
221 .\"O .BR ENOTSUP .
222 拡張属性がそのファイルシステムでサポートされていない場合、
223 もしくは無効になっている場合、
224 .I errno
225
226 .B ENOTSUP
227 がセットされる。
228 .PP
229 .\"O The errors documented for the
230 .\"O .BR stat (2)
231 .\"O system call are also applicable here.
232 .BR stat (2)
233 システムコールの説明に書かれているエラーは
234 これらのシステムコールにも適用される。
235 .\"O .SH VERSIONS
236 .SH バージョン
237 .\"O These system calls have been available on Linux since kernel 2.4;
238 .\"O glibc support is provided since version 2.3.
239 これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。
240 glibc でのサポートはバージョン 2.3 以降で行われている。
241 .\"O .SH "CONFORMING TO"
242 .SH 準拠
243 .\"O These system calls are Linux-specific.
244 これらのシステムコールは Linux 独自である。
245 .\"O .\" .SH AUTHORS
246 .\" .SH 著者
247 .\"O .\" Andreas Gruenbacher,
248 .\"O .\" .RI < a.gruenbacher@computer.org >
249 .\"O .\" and the SGI XFS development team,
250 .\"O .\" .RI < linux-xfs@oss.sgi.com >.
251 .\"O .\" Please send any bug reports or comments to these addresses.
252 .\" Andreas Gruenbacher,
253 .\" .RI < a.gruenbacher@computer.org >
254 .\" と the SGI XFS development team,
255 .\" .RI < linux-xfs@oss.sgi.com >。
256 .\" バグレポートやコメントは上記のアドレスまで送って下さい。
257 .\"O .SH SEE ALSO
258 .SH 関連項目
259 .BR getfattr (1),
260 .BR setfattr (1),
261 .BR getxattr (2),
262 .BR open (2),
263 .BR removexattr (2),
264 .BR setxattr (2),
265 .BR stat (2),
266 .BR attr (5),
267 .BR symlink (7)