OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / sysfs.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Created   Wed Aug  9 1995     Thomas K. Dyas <tdyas@eden.rutgers.edu>
24 .\"
25 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
26 .\"         all rights reserved.
27 .\" Translated Tue Mar  4 00:03:08 JST 1997
28 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
29 .\" Updated & Modified Sat Jun  2 20:46:34 JST 2001
30 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
31 .\"
32 .\"WORD:        file system             ファイル・システム
33 .\"WORD:        kernel                  カーネル
34 .\"WORD:        identifier string       識別文字列
35 .\"WORD:        type index              型インデックス
36 .\"
37 .TH SYSFS 2 2010-06-27 "Linux" "Linux Programmer's Manual"
38 .SH 名前
39 sysfs \- ファイル・システム (file system) の情報を取得する
40 .SH 書式
41 .BI "int sysfs(int " option ", const char *" fsname );
42
43 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
44
45 .BI "int sysfs(int " option );
46 .SH 説明
47 .BR sysfs ()
48 は現在カーネル (kernel) に存在しているファイル・システムの型 (type) 情報を返す。
49 それぞれの
50 .BR sysfs ()
51 コールの形式と返される情報は
52 .I option
53 に依存しており、それは:
54 .TP 3
55 .B 1
56 ファイル・システム識別文字列 (identifier string)
57 .I fsname
58 をファイル・システムの型インデックス (type index) に翻訳する。
59 .TP
60 .B 2
61 ファイル・システムの型インデックス
62 .I fs_index
63 を NULL 終端されたファイル・システム識別文字列に翻訳する。
64 この文字列は
65 .I buf
66 で指定されたバッファーへ書き込まれる。
67 .I buf
68 に文字列を入れるだけの十分な容量があることを確かめること。
69 .TP
70 .B 3
71 現在カーネルに存在するファイル・システム型の数の合計を返す。
72 .PP
73 ファイル・システムの型インデックスの数はゼロから始まる。
74 .SH 返り値
75 成功した場合
76 .BR sysfs ()
77 は、
78 オプション
79 .B 1
80 では
81 ファイル・システムのインデックスを返す。
82 オプション
83 .B 2
84 ではゼロを返す。
85 オプション
86 .B 3
87 は現在設定されているファイル・システムの数を返す。
88 エラーの場合は、\-1 が返され、
89 .I errno
90 が適切に設定される。
91 .SH エラー
92 .TP
93 .B EFAULT
94 .RI  fsname " と " buf
95 のどちらかがアクセス可能なアドレス空間の外にある。
96 .TP
97 .B EINVAL
98 .I fsname
99 が正しいファイル・システムの型識別子ではない;
100 .I fs_index
101 が範囲の外にある;
102 .I option
103 が正しくない。
104 .SH 準拠
105 SVr4.
106 .SH 注意
107 この System-V 由来のシステムコールは廃止予定 (obsolete) であり、
108 使用しないこと。
109 .I /proc
110 が利用できるシステムでは、同じ情報が
111 .I /proc/filesystems
112 経由で取得でき、このインタフェースを使用すること。
113 .SH バグ
114 libc または glibc のサポートは存在しない。
115 \fIbuf\fP の大きさがどれだけ必要かを推測する方法がない。