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