OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[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 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .TH LISTXATTR 2 2001\-12\-01 Linux "Linux Programmer's Manual"
33 .SH 名前
34 listxattr, llistxattr, flistxattr \- 拡張属性の名前リストを得る
35 .SH 書式
36 .fam C
37 .nf
38 \fB#include <sys/types.h>\fP
39 \fB#include <attr/xattr.h>\fP
40 .sp
41 \fBssize_t listxattr(const char\ *\fP\fIpath\fP\fB, char\ *\fP\fIlist\fP\fB, size_t \fP\fIsize\fP\fB);\fP
42 \fBssize_t llistxattr(const char\ *\fP\fIpath\fP\fB, char\ *\fP\fIlist\fP\fB, size_t \fP\fIsize\fP\fB);\fP
43 \fBssize_t flistxattr(int \fP\fIfd\fP\fB, char\ *\fP\fIlist\fP\fB, size_t \fP\fIsize\fP\fB);\fP
44 .fi
45 .fam T
46 .SH 説明
47 拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた \fIname\fP:\fIvalue\fP の対である。
48 これらは、システム上のすべての inode に関連付けられた通常の属性 (\fBstat\fP(2)  が返すデータ) を拡張するものである。
49 拡張属性のコンセプトは \fBattr\fP(5)  に書かれている。
50 .PP
51 \fBlistxattr\fP()  は、ファイルシステム内の指定された \fIpath\fP に対応する拡張属性の名前リストを取得する。 リストは名前の集合で、
52 NULL 終端された文字列が連続して並んでいる。 呼び出したプロセスがアクセスする権限のない拡張属性の名前は、 リストに含まれない。拡張属性の名前の
53 \fIlist\fP の長さが返される。
54 .PP
55 \fBllistxattr\fP()  は \fBlistxattr\fP()  と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル
56 ではなく、リンクそのものの拡張属性の名前リストを取得する点だけが異なる。
57 .PP
58 \fBflistxattr\fP()  は \fBlistxattr\fP()  と同じだが、 \fIpath\fP の代わりに \fIfd\fP
59 で参照されたオープン済みファイルの情報だけを取得する点が異なる (\fIfiledes\fP は \fBopen\fP(2)  によって返される)。
60 .PP
61 個々の拡張属性の \fIname\fP は普通の NULL 終端された文字列である。 名前には、名前空間を表す接頭辞 (prefix) が含まれる; 個々の
62 inode に対して、互いに独立な名前空間が複数あってもよい。
63 .PP
64 \fIsize\fP に 0 を指定して空のバッファをこれらのシステムコールに渡すことができ、 この場合には拡張属性の名前リストの現在のサイズが返される。
65 この方法は名前リストを保持するのに十分な大きさのバッファ・サイズを 見積もるのに使うことができる、
66 .SS Example
67 返される名前の \fIlist\fP は、 NULL 終端された文字列の配列 (属性名は NULL バイト (\(aq\e0\(aq)  で区切られている)
68 で、各要素は整列されている訳ではない。 以下に例を示す:
69 .fam C
70 .RS
71 .nf
72
73 user.name1\e0system.name1\e0user.name2\e0
74 .fi
75 .RE
76 .fam T
77 .P
78 拡張属性を使って POSIX ACL を実装している ext2、ext3、XFS のようなファイル システムでは、返される \fIlist\fP
79 は以下のようになることだろう:
80 .fam C
81 .RS
82 .nf
83
84 system.posix_acl_access\e0system.posix_acl_default\e0
85 .fi
86 .RE
87 .fam T
88 .SH 返り値
89 成功した場合、拡張属性の名前リストの長さを表す正の数が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
90 .PP
91 \fIlist\fP バッファの大きさ \fIsize\fP が結果を保持するのに十分な大きさでない場合、 \fIerrno\fP に \fBERANGE\fP
92 がセットされる。
93 .PP
94 拡張属性がそのファイルシステムでサポートされていない場合、 もしくは無効になっている場合、 \fIerrno\fP に \fBENOTSUP\fP がセットされる。
95 .PP
96 \fBstat\fP(2)  システムコールの説明に書かれているエラーは これらのシステムコールにも適用される。
97 .SH バージョン
98 これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。
99 .SH 準拠
100 .\" .SH AUTHORS
101 .\" Andreas Gruenbacher,
102 .\" .RI < a.gruenbacher@computer.org >
103 .\" and the SGI XFS development team,
104 .\" .RI < linux-xfs@oss.sgi.com >.
105 .\" Please send any bug reports or comments to these addresses.
106 これらのシステムコールは Linux 独自である。
107 .SH 関連項目
108 \fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBgetxattr\fP(2), \fBopen\fP(2),
109 \fBremovexattr\fP(2), \fBsetxattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7)