]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/sysfs.2
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man2 / sysfs.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Created Wed Aug 9 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu>
6 .\"
7 .TH SYSFS 2 2021-03-22 "Linux man-pages (unreleased)"
8 .SH NAME
9 sysfs \- get filesystem type information
10 .SH SYNOPSIS
11 .nf
12 .BI "int sysfs(int " option ", const char *" fsname );
13 .BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
14 .BI "int sysfs(int " option );
15 .fi
16 .SH DESCRIPTION
17 .BR "Note" :
18 if you are looking for information about the
19 .B sysfs
20 filesystem that is normally mounted at
21 .IR /sys ,
22 see
23 .BR sysfs (5).
24 .PP
25 The (obsolete)
26 .BR sysfs ()
27 system call returns information about the filesystem types
28 currently present in the kernel.
29 The specific form of the
30 .BR sysfs ()
31 call and the information returned depends on the
32 .I option
33 in effect:
34 .TP 3
35 .B 1
36 Translate the filesystem identifier string
37 .I fsname
38 into a filesystem type index.
39 .TP
40 .B 2
41 Translate the filesystem type index
42 .I fs_index
43 into a null-terminated filesystem identifier string.
44 This string will
45 be written to the buffer pointed to by
46 .IR buf .
47 Make sure that
48 .I buf
49 has enough space to accept the string.
50 .TP
51 .B 3
52 Return the total number of filesystem types currently present in the
53 kernel.
54 .PP
55 The numbering of the filesystem type indexes begins with zero.
56 .SH RETURN VALUE
57 On success,
58 .BR sysfs ()
59 returns the filesystem index for option
60 .BR 1 ,
61 zero for option
62 .BR 2 ,
63 and the number of currently configured filesystems for option
64 .BR 3 .
65 On error, \-1 is returned, and
66 .I errno
67 is set to indicate the error.
68 .SH ERRORS
69 .TP
70 .B EFAULT
71 .RI "Either " fsname " or " buf
72 is outside your accessible address space.
73 .TP
74 .B EINVAL
75 .I fsname
76 is not a valid filesystem type identifier;
77 .I fs_index
78 is out-of-bounds;
79 .I option
80 is invalid.
81 .SH STANDARDS
82 SVr4.
83 .SH NOTES
84 This System-V derived system call is obsolete; don't use it.
85 On systems with
86 .IR /proc ,
87 the same information can be obtained via
88 .IR /proc ;
89 use that interface instead.
90 .SH BUGS
91 There is no libc or glibc support.
92 There is no way to guess how large \fIbuf\fP should be.
93 .SH SEE ALSO
94 .BR proc (5),
95 .BR sysfs (5)