OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man2 / setxattr.2
1 .\" Copyright (C) Andreas Gruenbacher, February 2001
2 .\" Copyright (C) Silicon Graphics Inc, September 2001
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH SETXATTR 2 2013\-01\-19 Linux "Linux Programmer's Manual"
31 .SH 名前
32 setxattr, lsetxattr, fsetxattr \- 拡張属性の値を設定する
33 .SH 書式
34 .fam C
35 .nf
36 \fB#include <sys/types.h>\fP
37 \fB#include <attr/xattr.h>\fP
38 .sp
39 \fBint setxattr(const char\ *\fP\fIpath\fP\fB, const char\ *\fP\fIname\fP\fB,\fP
40 \fB              const void\ *\fP\fIvalue\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIflags\fP\fB);\fP
41 \fBint lsetxattr(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 fsetxattr(int \fP\fIfd\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 .fi
46 .fam T
47 .SH 説明
48 拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた \fIname\fP:\fIvalue\fP の対である。
49 これらは、システム上のすべての inode に関連付けられた通常の属性 (\fBstat\fP(2)  が返すデータ) を拡張するものである。
50 拡張属性のコンセプトは \fBattr\fP(5)  に書かれている。
51 .PP
52 \fBsetxattr\fP()  は、ファイルシステム内の指定された \fIpath\fP に対応する、名前 \fIname\fP の拡張属性の値 \fIvalue\fP
53 を設定する。 \fIvalue\fP の \fIsize\fP は必ず指定しなければならない。
54 .PP
55 \fBlsetxattr\fP()  は \fBsetxattr\fP()  と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル
56 ではなく、リンクそのものの拡張属性を設定する点だけが異なる。
57 .PP
58 \fBfsetxattr\fP()  は \fBsetxattr\fP()  と同じだが、 \fIpath\fP の代わりに \fIfd\fP
59 で参照されたオープン済みファイルの情報だけを設定する点が異なる (\fIfiledes\fP は \fBopen\fP(2)  によって返される)。
60 .PP
61 拡張属性の名前 は普通の NULL 終端された文字列である。 \fIname\fP には、名前空間を表す接頭辞 (prefix) が含まれる。 個々の
62 inode に対して、互いに独立な名前空間が複数あってもよい。 拡張属性の値 \fIvalue\fP は、ある一定の長さの任意のテキスト・データまたは
63 バイナリ・データの集合である。
64 .PP
65 操作の意味を明確にするために \fIflags\fP 引き数を使用することができる。 \fBXATTR_CREATE\fP は属性の作成だけを行うことを指定する。
66 指定された名前の属性がすでに存在する場合は失敗する。 \fBXATTR_REPLACE\fP は属性の置換だけを行うことを指定する。
67 指定された名前の属性がまだ存在しない場合は失敗する。 デフォルトでは (フラグを指定しない場合)、拡張属性は必要な場合は作成され、
68 属性がすでに存在する場合は属性値の置換を行う。
69 .SH 返り値
70 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
71 .SH エラー
72 .TP 
73 \fBEDQUOT\fP
74 Disk quota limits meant that there is insufficient space remaining to store
75 the extended attribute.
76 .TP 
77 \fBEEXIST\fP
78 \fBXATTR_CREATE\fP was specified, and the attribute exists already.
79 .TP 
80 \fBENOATTR\fP
81 \fBXATTR_REPLACE\fP was specified, and the attribute does not exist.
82 (\fBENOATTR\fP is defined to be a synonym for \fBENODATA\fP in
83 \fI<attr/xattr.h>\fP.)
84 .TP 
85 \fBENOSPC\fP
86 拡張属性を記憶するのに十分なスペースが残っていない。
87 .TP 
88 \fBENOTSUP\fP
89 拡張属性がそのファイルシステムでサポートされていない、もしくは無効になっている。
90 \fIerrno\fP に \fBENOTSUP\fP がセットされる。
91 .PP
92 上記に加えて、 \fBstat\fP(2) に書かれているエラーが発生する場合もある。
93 .SH バージョン
94 これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。
95 .SH 準拠
96 .\" .SH AUTHORS
97 .\" Andreas Gruenbacher,
98 .\" .RI < a.gruenbacher@computer.org >
99 .\" and the SGI XFS development team,
100 .\" .RI < linux-xfs@oss.sgi.com >.
101 .\" Please send any bug reports or comments to these addresses.
102 これらのシステムコールは Linux 独自である。
103 .SH 関連項目
104 \fBgetfattr\fP(1), \fBsetfattr\fP(1), \fBgetxattr\fP(2), \fBlistxattr\fP(2), \fBopen\fP(2),
105 \fBremovexattr\fP(2), \fBstat\fP(2), \fBattr\fP(5), \fBsymlink\fP(7)
106 .SH この文書について
107 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
108 である。プロジェクトの説明とバグ報告に関する情報は
109 http://www.kernel.org/doc/man\-pages/ に書かれている。