OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / sysfs.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Created   Wed Aug  9 1995     Thomas K. Dyas <tdyas@eden.rutgers.edu>
26 .\"
27 .TH SYSFS 2 2010-06-27 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 sysfs \- get filesystem type information
30 .SH SYNOPSIS
31 .BI "int sysfs(int " option ", const char *" fsname );
32
33 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
34
35 .BI "int sysfs(int " option );
36 .SH DESCRIPTION
37 .BR sysfs ()
38 returns information about the filesystem types currently present in
39 the kernel.
40 The specific form of the
41 .BR sysfs ()
42 call and the information returned depends on the
43 .I option
44 in effect:
45 .TP 3
46 .B 1
47 Translate the filesystem identifier string
48 .I fsname
49 into a filesystem type index.
50 .TP
51 .B 2
52 Translate the filesystem type index
53 .I fs_index
54 into a null-terminated filesystem identifier string.
55 This string will
56 be written to the buffer pointed to by
57 .IR buf .
58 Make sure that
59 .I buf
60 has enough space to accept the string.
61 .TP
62 .B 3
63 Return the total number of filesystem types currently present in the
64 kernel.
65 .PP
66 The numbering of the filesystem type indexes begins with zero.
67 .SH RETURN VALUE
68 On success,
69 .BR sysfs ()
70 returns the filesystem index for option
71 .BR 1 ,
72 zero for option
73 .BR 2 ,
74 and the number of currently configured filesystems for option
75 .BR 3 .
76 On error, \-1 is returned, and
77 .I errno
78 is set appropriately.
79 .SH ERRORS
80 .TP
81 .B EFAULT
82 .RI "Either " fsname " or " buf
83 is outside your accessible address space.
84 .TP
85 .B EINVAL
86 .I fsname
87 is not a valid filesystem type identifier;
88 .I fs_index
89 is out-of-bounds;
90 .I option
91 is invalid.
92 .SH CONFORMING TO
93 SVr4.
94 .SH NOTES
95 This System-V derived system call is obsolete; don't use it.
96 On systems with
97 .IR /proc ,
98 the same information can be obtained via
99 .IR /proc/filesystems ;
100 use that interface instead.
101 .SH BUGS
102 There is no libc or glibc support.
103 There is no way to guess how large \fIbuf\fP should be.
104 .SH COLOPHON
105 This page is part of release 3.79 of the Linux
106 .I man-pages
107 project.
108 A description of the project,
109 information about reporting bugs,
110 and the latest version of this page,
111 can be found at
112 \%http://www.kernel.org/doc/man\-pages/.