]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/sysfs.2
7ae1a921a72af90314af73d28105d22dd881c633
[thirdparty/man-pages.git] / 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 2017-09-15 "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 .PP
33 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
34 .PP
35 .BI "int sysfs(int " option );
36 .SH DESCRIPTION
37 .BR "Note" :
38 if you are looking for information about the
39 .B sysfs
40 filesystem that is normally mounted at
41 .IR /sys ,
42 see
43 .BR sysfs (5).
44 .PP
45 The (obsolete)
46 .BR sysfs ()
47 system call returns information about the filesystem types
48 currently present in the kernel.
49 The specific form of the
50 .BR sysfs ()
51 call and the information returned depends on the
52 .I option
53 in effect:
54 .TP 3
55 .B 1
56 Translate the filesystem identifier string
57 .I fsname
58 into a filesystem type index.
59 .TP
60 .B 2
61 Translate the filesystem type index
62 .I fs_index
63 into a null-terminated filesystem identifier string.
64 This string will
65 be written to the buffer pointed to by
66 .IR buf .
67 Make sure that
68 .I buf
69 has enough space to accept the string.
70 .TP
71 .B 3
72 Return the total number of filesystem types currently present in the
73 kernel.
74 .PP
75 The numbering of the filesystem type indexes begins with zero.
76 .SH RETURN VALUE
77 On success,
78 .BR sysfs ()
79 returns the filesystem index for option
80 .BR 1 ,
81 zero for option
82 .BR 2 ,
83 and the number of currently configured filesystems for option
84 .BR 3 .
85 On error, \-1 is returned, and
86 .I errno
87 is set appropriately.
88 .SH ERRORS
89 .TP
90 .B EFAULT
91 .RI "Either " fsname " or " buf
92 is outside your accessible address space.
93 .TP
94 .B EINVAL
95 .I fsname
96 is not a valid filesystem type identifier;
97 .I fs_index
98 is out-of-bounds;
99 .I option
100 is invalid.
101 .SH CONFORMING TO
102 SVr4.
103 .SH NOTES
104 This System-V derived system call is obsolete; don't use it.
105 On systems with
106 .IR /proc ,
107 the same information can be obtained via
108 .IR /proc/filesystems ;
109 use that interface instead.
110 .SH BUGS
111 There is no libc or glibc support.
112 There is no way to guess how large \fIbuf\fP should be.