Debian Codegraph @

upstream/debian-unstable/man2/sysfs.2

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