]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/sysfs.2
mknod.2: tfix
[thirdparty/man-pages.git] / man2 / sysfs.2
CommitLineData
fea681da
MK
1.\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
c13182ef 12.\"
fea681da
MK
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.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" Created Wed Aug 9 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu>
26.\"
4b8c67d9 27.TH SYSFS 2 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da 28.SH NAME
9ee4a2b6 29sysfs \- get filesystem type information
fea681da
MK
30.SH SYNOPSIS
31.BI "int sysfs(int " option ", const char *" fsname );
dbfe9c70 32.PP
fea681da 33.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
dbfe9c70 34.PP
fea681da
MK
35.BI "int sysfs(int " option );
36.SH DESCRIPTION
13752de1
MK
37.BR "Note" :
38if you are looking for information about the
39.B sysfs
40filesystem that is normally mounted at
41.IR /sys ,
42see
43.BR sysfs (5).
44.PP
4a19240d 45The (obsolete)
e511ffb6 46.BR sysfs ()
4a19240d
MK
47system call returns information about the filesystem types
48currently present in the kernel.
c13182ef 49The specific form of the
e511ffb6 50.BR sysfs ()
fea681da
MK
51call and the information returned depends on the
52.I option
53in effect:
d1b4e37d 54.TP 3
fea681da 55.B 1
9ee4a2b6 56Translate the filesystem identifier string
fea681da 57.I fsname
9ee4a2b6 58into a filesystem type index.
fea681da
MK
59.TP
60.B 2
9ee4a2b6 61Translate the filesystem type index
fea681da 62.I fs_index
9ee4a2b6 63into a null-terminated filesystem identifier string.
c13182ef 64This string will
fea681da
MK
65be written to the buffer pointed to by
66.IR buf .
67Make sure that
68.I buf
69has enough space to accept the string.
70.TP
71.B 3
9ee4a2b6 72Return the total number of filesystem types currently present in the
fea681da 73kernel.
fea681da 74.PP
9ee4a2b6 75The numbering of the filesystem type indexes begins with zero.
47297adb 76.SH RETURN VALUE
fea681da 77On success,
e511ffb6 78.BR sysfs ()
9ee4a2b6 79returns the filesystem index for option
fea681da
MK
80.BR 1 ,
81zero for option
82.BR 2 ,
9ee4a2b6 83and the number of currently configured filesystems for option
fea681da
MK
84.BR 3 .
85On error, \-1 is returned, and
86.I errno
87is set appropriately.
88.SH ERRORS
89.TP
90.B EFAULT
91.RI "Either " fsname " or " buf
92is outside your accessible address space.
93.TP
94.B EINVAL
95.I fsname
9ee4a2b6 96is not a valid filesystem type identifier;
fea681da
MK
97.I fs_index
98is out-of-bounds;
99.I option
100is invalid.
47297adb 101.SH CONFORMING TO
fea681da 102SVr4.
19c98696 103.SH NOTES
d1d721be
MK
104This System-V derived system call is obsolete; don't use it.
105On systems with
fea681da 106.IR /proc ,
e8fd5077 107the same information can be obtained via
d1d721be
MK
108.IR /proc/filesystems ;
109use that interface instead.
fea681da
MK
110.SH BUGS
111There is no libc or glibc support.
112There is no way to guess how large \fIbuf\fP should be.