sysfs
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
sysfs - ファイルシステム (file system) の情報を取得する
書式
[[deprecated]] int sysfs(int option, const char *fsname);
[[deprecated]] int sysfs(int option, unsigned int fs_index, char *buf);
[[deprecated]] int sysfs(int option);
説明
Note: if you are looking for information about the sysfs filesystem
that is normally mounted at /sys, see sysfs(5).
(廃止予定の) sysfs() システムコールは、現在カーネル (kernel) に存在しているファイルシステムの型 (type) 情報を返す。
それぞれの sysfs() コールの形式と返される情報は option に依存しており、それは:
- 1
-
ファイルシステム識別文字列 (identifier string) fsname をファイルシステムの型インデックス (type index)
に翻訳する。
- 2
-
ファイルシステムの型インデックス fs_index をヌル終端されたファイルシステム識別文字列に翻訳する。 この文字列は buf
で指定されたバッファーへ書き込まれる。 buf に文字列を入れるだけの十分な容量があることを確かめること。
- 3
-
現在カーネルに存在するファイルシステム型の数の合計を返す。
ファイルシステムの型インデックスの数はゼロから始まる。
返り値
On success, sysfs() returns the filesystem index for option 1, zero
for option 2, and the number of currently configured filesystems for
option 3. On error, -1 is returned, and errno is set to indicate the
error.
エラー
- EFAULT
-
fsname と buf のどちらかがアクセス可能なアドレス空間の外にある。
- EINVAL
-
fsname が正しいファイルシステムの型識別子ではない; fs_index が範囲の外にある; option が正しくない。
標準規格
なし。
歴史
SVr4.
この System-V 由来のシステムコールは廃止予定 (obsolete) であり、 使用しないこと。 /proc
が利用できるシステムでは、同じ情報が /proc 経由で取得でき、このインターフェースを使用すること。
バグ
libc または glibc のサポートは存在しない。 buf の大きさがどれだけ必要かを推測する方法がない。
関連項目
proc(5), sysfs(5)
Index
- 名前
-
- 書式
-
- 説明
-
- 返り値
-
- エラー
-
- 標準規格
-
- 歴史
-
- バグ
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.