.\" Copyright (C) 1995, Thomas K. Dyas .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Created Wed Aug 9 1995 Thomas K. Dyas .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Tue Mar 4 00:03:08 JST 1997 .\" by HANATAKA Shinya .\" Updated & Modified Sat Jun 2 20:46:34 JST 2001 .\" by Yuichi SATO .\" .\"WORD: file system ファイル・システム .\"WORD: kernel カーネル .\"WORD: identifier string 識別文字列 .\"WORD: type index 型インデックス .\" .TH SYSFS 2 2010-06-27 "Linux" "Linux Programmer's Manual" .SH 名前 sysfs \- ファイル・システム (file system) の情報を取得する .SH 書式 .BI "int sysfs(int " option ", const char *" fsname ); .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf ); .BI "int sysfs(int " option ); .SH 説明 .BR sysfs () は現在カーネル (kernel) に存在しているファイル・システムの型 (type) 情報を返す。 それぞれの .BR sysfs () コールの形式と返される情報は .I option に依存しており、それは: .TP 3 .B 1 ファイル・システム識別文字列 (identifier string) .I fsname をファイル・システムの型インデックス (type index) に翻訳する。 .TP .B 2 ファイル・システムの型インデックス .I fs_index を NULL 終端されたファイル・システム識別文字列に翻訳する。 この文字列は .I buf で指定されたバッファーへ書き込まれる。 .I buf に文字列を入れるだけの十分な容量があることを確かめること。 .TP .B 3 現在カーネルに存在するファイル・システム型の数の合計を返す。 .PP ファイル・システムの型インデックスの数はゼロから始まる。 .SH 返り値 成功した場合 .BR sysfs () は、 オプション .B 1 では ファイル・システムのインデックスを返す。 オプション .B 2 ではゼロを返す。 オプション .B 3 は現在設定されているファイル・システムの数を返す。 エラーの場合は、\-1 が返され、 .I errno が適切に設定される。 .SH エラー .TP .B EFAULT .RI fsname " と " buf のどちらかがアクセス可能なアドレス空間の外にある。 .TP .B EINVAL .I fsname が正しいファイル・システムの型識別子ではない; .I fs_index が範囲の外にある; .I option が正しくない。 .SH 準拠 SVr4. .SH 注意 この System-V 由来のシステムコールは廃止予定 (obsolete) であり、 使用しないこと。 .I /proc が利用できるシステムでは、同じ情報が .I /proc/filesystems 経由で取得でき、このインタフェースを使用すること。 .SH バグ libc または glibc のサポートは存在しない。 \fIbuf\fP の大きさがどれだけ必要かを推測する方法がない。