]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/sysfs.2
Automated addition of parentheses by add_parens_for_own_funcs.sh
[thirdparty/man-pages.git] / 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 .\" FIXME -- I can't find this in SVr4!
26 .TH SYSFS 2 1995-08-09 "Linux 1.3.16" "Linux Programmer's Manual"
27 .SH NAME
28 sysfs \- get file system type information
29 .SH SYNOPSIS
30 .BI "int sysfs(int " option ", const char *" fsname );
31
32 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
33
34 .BI "int sysfs(int " option );
35 .SH DESCRIPTION
36 .BR sysfs ()
37 returns information about the file system types currently present in
38 the kernel. The specific form of the
39 .BR sysfs ()
40 call and the information returned depends on the
41 .I option
42 in effect:
43
44 .TP
45 .B 1
46 Translate the file-system identifier string
47 .I fsname
48 into a file-system type index.
49 .TP
50 .B 2
51 Translate the file-system type index
52 .I fs_index
53 into a NUL-terminated file-system identifier string. 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
64 .PP
65 The numbering of the file-system type indexes begins with zero.
66 .SH "RETURN VALUE"
67 On success,
68 .BR sysfs ()
69 returns the file-system index for option
70 .BR 1 ,
71 zero for option
72 .BR 2 ,
73 and the number of currently configured file systems for option
74 .BR 3 .
75 On error, \-1 is returned, and
76 .I errno
77 is set appropriately.
78 .SH ERRORS
79 .TP
80 .B EFAULT
81 .RI "Either " fsname " or " buf
82 is outside your accessible address space.
83 .TP
84 .B EINVAL
85 .I fsname
86 is not a valid file-system type identifier;
87 .I fs_index
88 is out-of-bounds;
89 .I option
90 is invalid.
91 .PP
92 .SH "CONFORMING TO"
93 SVr4.
94 .SH NOTE
95 On Linux with the
96 .I proc
97 filesystem mounted on
98 .IR /proc ,
99 the same information can be derived from
100 .IR /proc/filesystems .
101 .SH BUGS
102 There is no libc or glibc support.
103 There is no way to guess how large \fIbuf\fP should be.