.\" .\" Extended attributes system calls manual pages .\" .\" Copyright (C) Andreas Gruenbacher, February 2001 .\" Copyright (C) Silicon Graphics Inc, September 2001 .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI .\" all rights reserved. .\" Translated Tue Jul 8 04:17:12 JST 2003 .\" by Akihiro MOTOKI .\" .\"WORD: extended attributes 拡張属性 .\"WORD: namespace 名前空間 .\" .TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .\"O listxattr, llistxattr, flistxattr \- list extended attribute names .SH 名前 listxattr, llistxattr, flistxattr \- 拡張属性の名前リストを得る .\"O .SH SYNOPSIS .SH 書式 .fam C .nf .B #include .B #include .sp .BI "ssize_t listxattr(const char\ *" path ", char\ *" list \ ", size_t " size ); .BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \ ", size_t " size ); .BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size ); .fi .fam T .\"O .SH DESCRIPTION .SH 説明 .\"O Extended attributes are name:value .\"O pairs associated with inodes (files, directories, symbolic links, etc.). .\"O They are extensions to the normal attributes which are associated .\"O with all inodes in the system (i.e., the .\"O .BR stat (2) .\"O data). .\"O A complete overview of extended attributes concepts can be found in .\"O .BR attr (5). 拡張属性は、inode (ファイル、ディレクトリ、シンボリックリンク等) に 関連付けられた .IR name :\c .I value の対である。 これらは、システム上のすべての inode に関連付けられた通常の属性 .RB ( stat (2) が返すデータ) を拡張するものである。 拡張属性のコンセプトは .BR attr (5) に書かれている。 .PP .\"O .BR listxattr () .\"O retrieves the .\"O .I list .\"O of extended attribute names associated with the given .\"O .I path .\"O in the file system. .\"O The list is the set of (null-terminated) names, one after the other. .\"O Names of extended attributes to which the calling process does not .\"O have access may be omitted from the list. .\"O The length of the attribute name .\"O .I list .\"O is returned. .BR listxattr () は、ファイルシステム内の指定された .I path に対応する拡張属性の名前リストを取得する。 リストは名前の集合で、 NULL 終端された文字列が連続して並んでいる。 呼び出したプロセスがアクセスする権限のない拡張属性の名前は、 リストに含まれない。拡張属性の名前の .I list の長さが返される。 .PP .\"O .BR llistxattr () .\"O is identical to .\"O .BR listxattr (), .\"O except in the case of a symbolic link, where the list of names of .\"O extended attributes associated with the link itself is retrieved, .\"O not the file that it refers to. .BR llistxattr () は .BR listxattr () と同じだが、シンボリックリンクの場合に、リンクが参照しているファイル ではなく、リンクそのものの拡張属性の名前リストを取得する点だけが異なる。 .PP .\"O .BR flistxattr () .\"O is identical to .\"O .BR listxattr (), .\"O only the open file referred to by .\"O .I fd .\"O (as returned by .\"O .BR open (2)) .\"O is interrogated in place of .\"O .IR path . .BR flistxattr () は .BR listxattr () と同じだが、 .I path の代わりに .I fd で参照されたオープン済みファイルの情報だけを取得する点が異なる .RI ( filedes は .BR open (2) によって返される)。 .PP .\"O A single extended attribute .\"O .I name .\"O is a simple null-terminated string. .\"O The name includes a namespace prefix; there may be several, disjoint .\"O namespaces associated with an individual inode. 個々の拡張属性の .I name は普通の NULL 終端された文字列である。 名前には、名前空間を表す接頭辞 (prefix) が含まれる; 個々の inode に対して、互いに独立な名前空間が複数あってもよい。 .PP .\"O An empty buffer of .\"O .I size .\"O zero can be passed into these calls to return the current size of the .\"O list of extended attribute names, which can be used to estimate the .\"O size of a buffer which is sufficiently large to hold the list of names. .I size に 0 を指定して空のバッファをこれらのシステムコールに渡すことができ、 この場合には拡張属性の名前リストの現在のサイズが返される。 この方法は名前リストを保持するのに十分な大きさのバッファ・サイズを 見積もるのに使うことができる、 .\"O .SS Example .SS 例 .\"O The .\"O .I list .\"O of names is returned as an unordered array of null-terminated character .\"O strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this: 返される名前の .I list は、 NULL 終端された文字列の配列 (属性名は NULL バイト (\(aq\\0\(aq) で区切られている) で、各要素は整列されている訳ではない。 以下に例を示す: .fam C .RS .nf user.name1\\0system.name1\\0user.name2\\0 .fi .RE .fam T .P .\"O Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using .\"O extended attributes, might return a .\"O .I list .\"O like this: 拡張属性を使って POSIX ACL を実装している ext2、ext3、XFS のようなファイル システムでは、返される .I list は以下のようになることだろう: .fam C .RS .nf system.posix_acl_access\\0system.posix_acl_default\\0 .fi .RE .fam T .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, a positive number is returned indicating the size of the .\"O extended attribute name list. .\"O On failure, \-1 is returned and .\"O .I errno .\"O is set appropriately. 成功した場合、拡張属性の名前リストの長さを表す正の数が返される。 失敗した場合、 \-1 が返され、 .I errno に適切な値がセットされる。 .PP .\"O If the .\"O .I size .\"O of the .\"O .I list .\"O buffer is too small to hold the result, .\"O .I errno .\"O is set to .\"O .BR ERANGE . .I list バッファの大きさ .I size が結果を保持するのに十分な大きさでない場合、 .I errno に .B ERANGE がセットされる。 .PP .\"O If extended attributes are not supported by the file system, or are disabled, .\"O .I errno .\"O is set to .\"O .BR ENOTSUP . 拡張属性がそのファイルシステムでサポートされていない場合、 もしくは無効になっている場合、 .I errno に .B ENOTSUP がセットされる。 .PP .\"O The errors documented for the .\"O .BR stat (2) .\"O system call are also applicable here. .BR stat (2) システムコールの説明に書かれているエラーは これらのシステムコールにも適用される。 .\"O .SH VERSIONS .SH バージョン .\"O These system calls have been available on Linux since kernel 2.4; .\"O glibc support is provided since version 2.3. これらのシステムコールはカーネル 2.4 以降の Linux で利用できる。 glibc でのサポートはバージョン 2.3 以降で行われている。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O These system calls are Linux-specific. これらのシステムコールは Linux 独自である。 .\"O .\" .SH AUTHORS .\" .SH 著者 .\"O .\" Andreas Gruenbacher, .\"O .\" .RI < a.gruenbacher@computer.org > .\"O .\" and the SGI XFS development team, .\"O .\" .RI < linux-xfs@oss.sgi.com >. .\"O .\" Please send any bug reports or comments to these addresses. .\" Andreas Gruenbacher, .\" .RI < a.gruenbacher@computer.org > .\" と the SGI XFS development team, .\" .RI < linux-xfs@oss.sgi.com >。 .\" バグレポートやコメントは上記のアドレスまで送って下さい。 .\"O .SH SEE ALSO .SH 関連項目 .BR getfattr (1), .BR setfattr (1), .BR getxattr (2), .BR open (2), .BR removexattr (2), .BR setxattr (2), .BR stat (2), .BR attr (5), .BR symlink (7)