Debian Codegraph @

upstream/debian-trixie/man2/sysfs.2

raw
1 .\" Copyright (C) 1995, Thomas K. Dyas <[email protected]>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Created Wed Aug 9 1995 Thomas K. Dyas <[email protected]>
6 .\"
7 .TH sysfs 2 2024-05-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 sysfs \- get filesystem type information
10 .SH SYNOPSIS
11 .nf
12 .BI "[[deprecated]] int sysfs(int " option ", const char *" fsname );
13 .BI "[[deprecated]] int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
14 .BI "[[deprecated]] 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 .P
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 .P
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 None.
83 .SH HISTORY
84 SVr4.
85 .P
86 This System-V derived system call is obsolete; 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 \fIbuf\fP should be.
95 .SH SEE ALSO
96 .BR proc (5),
97 .BR sysfs (5)