OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / setxattr.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 SETXATTR 2 2001\-12\-31 Linux "Linux Programmer's Manual"
33 .SH 名前
34 setxattr, lsetxattr, fsetxattr \- 拡張属性の値を設定する
35 .SH 書式
36 .fam C
37 .nf
38 \fB#include <sys/types.h>\fP
39 \fB#include <attr/xattr.h>\fP
40 .sp
41 \fBint setxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
42 \fB              const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP
43 \fBint lsetxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
44 \fB              const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP
45 \fBint fsetxattr(int \fP\fIfd\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
46 \fB              const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\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 \fBsetxattr\fP()  は、ファイルシステム内の指定された \fIpath\fP に対応する、名前 \fIname\fP の拡張属性の値 \fIvalue\fP
55 を設定する。 \fIvalue\fP の \fIsize\fP は必ず指定しなければならない。
56 .PP
57 \fBlsetxattr\fP()  は \fBsetxattr\fP()  と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル
58 ではなく、リンクそのものの拡張属性を設定する点だけが異なる。
59 .PP
60 \fBfsetxattr\fP()  は \fBsetxattr\fP()  と同じだが、 \fIpath\fP の代わりに \fIfd\fP
61 で参照されたオープン済みファイルの情報だけを設定する点が異なる (\fIfiledes\fP は \fBopen\fP(2)  によって返される)。
62 .PP
63 拡張属性の名前 は普通の NULL 終端された文字列である。 \fIname\fP には、名前空間を表す接頭辞 (prefix) が含まれる。 個々の
64 inode に対して、互いに独立な名前空間が複数あってもよい。 拡張属性の値 \fIvalue\fP は、ある一定の長さの任意のテキスト・データまたは
65 バイナリ・データの集合である。
66 .PP
67 操作の意味を明確にするために \fIflags\fP 引き数を使用することができる。 \fBXATTR_CREATE\fP は属性の作成だけを行うことを指定する。
68 指定された名前の属性がすでに存在する場合は失敗する。 \fBXATTR_REPLACE\fP は属性の置換だけを行うことを指定する。
69 指定された名前の属性がまだ存在しない場合は失敗する。 デフォルトでは (フラグを指定しない場合)、拡張属性は必要な場合は作成され、
70 属性がすでに存在する場合は属性値の置換を行う。
71 .SH 返り値
72 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
73 .PP
74 \fBXATTR_CREATE\fP が指定され、かつ属性がすでに存在する場合、 \fIerrno\fP に \fBEEXIST\fP がセットされる。
75 \fBXATTR_REPLACE\fP が指定され、属性がまだ存在しない場合、 \fIerrno\fP に \fBENOATTR\fP がセットされる。
76 .PP
77 拡張属性を記憶するのに十分なスペースが残っていない場合、 \fIerrno\fP に \fBENOSPC\fP または \fBEDQUOT\fP (quota
78 による制限が原因の場合) がセットされる。
79 .PP
80 拡張属性がそのファイルシステムでサポートされていない場合、 もしくは無効になっている場合、 \fIerrno\fP に \fBENOTSUP\fP がセットされる。
81 .PP
82 \fBstat\fP(2)  システムコールの説明に書かれているエラーは これらのシステムコールにも適用される。
83 .SH バージョン
84 これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。
85 .SH 準拠
86 .\" .SH AUTHORS
87 .\" Andreas Gruenbacher,
88 .\" .RI < a.gruenbacher@computer.org >
89 .\" and the SGI XFS development team,
90 .\" .RI < linux-xfs@oss.sgi.com >.
91 .\" Please send any bug reports or comments to these addresses.
92 これらのシステムコールは Linux 独自である。
93 .SH 関連項目
94 \fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBgetxattr\fP(2), \fBlistxattr\fP(2), \fBopen\fP(2),
95 \fBremovexattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7)