OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / 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 .TH SYSFS 2 1995-08-09 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 sysfs \- get file system type information
28 .SH SYNOPSIS
29 .BI "int sysfs(int " option ", const char *" fsname );
30
31 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
32
33 .BI "int sysfs(int " option );
34 .SH DESCRIPTION
35 .BR sysfs ()
36 returns information about the file system types currently present in
37 the kernel.
38 The specific form of the
39 .BR sysfs ()
40 call and the information returned depends on the
41 .I option
42 in effect:
43 .TP 3
44 .B 1
45 Translate the file-system identifier string
46 .I fsname
47 into a file-system type index.
48 .TP
49 .B 2
50 Translate the file-system type index
51 .I fs_index
52 into a null-terminated file-system identifier string.
53 This string will
54 be written to the buffer pointed to by
55 .IR buf .
56 Make sure that
57 .I buf
58 has enough space to accept the string.
59 .TP
60 .B 3
61 Return the total number of file system types currently present in the
62 kernel.
63 .PP
64 The numbering of the file-system type indexes begins with zero.
65 .SH "RETURN VALUE"
66 On success,
67 .BR sysfs ()
68 returns the file-system index for option
69 .BR 1 ,
70 zero for option
71 .BR 2 ,
72 and the number of currently configured file systems for option
73 .BR 3 .
74 On error, \-1 is returned, and
75 .I errno
76 is set appropriately.
77 .SH ERRORS
78 .TP
79 .B EFAULT
80 .RI "Either " fsname " or " buf
81 is outside your accessible address space.
82 .TP
83 .B EINVAL
84 .I fsname
85 is not a valid file-system type identifier;
86 .I fs_index
87 is out-of-bounds;
88 .I option
89 is invalid.
90 .SH "CONFORMING TO"
91 SVr4.
92 .SH NOTES
93 On Linux with the
94 .I proc
95 file system mounted on
96 .IR /proc ,
97 the same information can be derived from
98 .IR /proc/filesystems .
99 .SH BUGS
100 There is no libc or glibc support.
101 There is no way to guess how large \fIbuf\fP should be.