OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / 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 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .TH GETXATTR 2 2001\-12\-01 Linux "Linux Programmer's Manual"
33 .SH 名前
34 getxattr, lgetxattr, fgetxattr \- 拡張属性の値を取得する
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 getxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
42 \fB                 void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB);\fP
43 \fBssize_t lgetxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
44 \fB                 void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB);\fP
45 \fBssize_t fgetxattr(int \fP\fIfd\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
46 \fB                 void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB);\fP
47 .fi
48 .fam T
49 .SH 説明
50 拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた \fIname\fP:\fIvalue\fP の対である。
51 これらは、システム上のすべての inode に関連付けられた通常の属性 (\fBstat\fP(2)  が返すデータ) を拡張するものである。
52 拡張属性のコンセプトは \fBattr\fP(5)  に書かれている。
53 .PP
54 \fBgetxattr\fP()  は、ファイルシステム内の指定された \fIpath\fP に対応する、名前 \fIname\fP の拡張属性の \fIvalue\fP
55 (値) を取得する。 属性 \fIvalue\fP の長さが返される。
56 .PP
57 \fBlgetxattr\fP()  は \fBgetxattr\fP()  と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル
58 ではなく、リンクそのものの情報を取得する点だけが異なる。
59 .PP
60 \fBfgetxattr\fP()  は \fBgetxattr\fP()  と同じだが、 \fIpath\fP の代わりに \fIfd\fP
61 で参照されたオープン済みファイルの情報だけを取得する点が異なる (\fIfd\fP は \fBopen\fP(2)  によって返される)。
62 .PP
63 拡張属性の名前 \fIname\fP は普通の NULL 終端された文字列である。 名前には、名前空間を表す接頭辞 (prefix) が含まれる; 個々の
64 inode に対して、互いに独立な名前空間が複数あってもよい。 拡張属性の値は、ある一定の長さの任意のテキスト・データまたは
65 バイナリ・データの集合である。
66 .PP
67 \fIsize\fP に 0 を指定して空のバッファをこれらのシステムコールに渡すことができ、 この場合には指定された名前の拡張属性の現在のサイズが返される。
68 この方法は、拡張属性の値を保持するのに十分な大きさのバッファ・サイズを 見積もるのに使うことができる、
69 .PP
70 このシステムコール・インタフェースは、初期バッファのサイズの推測をしたり、 与えられたバッファが小さすぎたことを返り値で知らせることでバッファを大きく
71 したりできるように設計されている。
72 .SH 返り値
73 成功した場合、拡張属性の値の長さを表す正の数が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
74 .PP
75 指定された名前の属性が存在しない場合、またはプロセスがその属性にアクセス する権限がない場合、 \fIerrno\fP に \fBENOATTR\fP
76 がセットされる。
77 .PP
78 \fIvalue\fP バッファの大きさ \fIsize\fP が結果を保持するのに十分な大きさでない場合、 \fIerrno\fP に \fBERANGE\fP
79 がセットされる。
80 .PP
81 拡張属性がそのファイルシステムでサポートされていない場合、 もしくは無効になっている場合、 \fIerrno\fP に \fBENOTSUP\fP がセットされる。
82 .PP
83 \fBstat\fP(2)  システムコールの説明に書かれているエラーは これらのシステムコールにも適用される。
84 .SH バージョン
85 これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。
86 .SH 準拠
87 .\" .SH AUTHORS
88 .\" Andreas Gruenbacher,
89 .\" .RI < a.gruenbacher@computer.org >
90 .\" and the SGI XFS development team,
91 .\" .RI < linux-xfs@oss.sgi.com >.
92 .\" Please send any bug reports or comments to these addresses.
93 これらのシステムコールは Linux 独自である。
94 .SH 関連項目
95 \fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBlistxattr\fP(2), \fBopen\fP(2),
96 \fBremovexattr\fP(2), \fBsetxattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7)