]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/sysfs.2
sock_diag.7: Tweaks to Dmitry Levin's page
[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.\"
d1d721be 27.TH SYSFS 2 2010-06-27 "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 );
32
33.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
34
35.BI "int sysfs(int " option );
36.SH DESCRIPTION
e511ffb6 37.BR sysfs ()
9ee4a2b6 38returns information about the filesystem types currently present in
c13182ef
MK
39the kernel.
40The specific form of the
e511ffb6 41.BR sysfs ()
fea681da
MK
42call and the information returned depends on the
43.I option
44in effect:
d1b4e37d 45.TP 3
fea681da 46.B 1
9ee4a2b6 47Translate the filesystem identifier string
fea681da 48.I fsname
9ee4a2b6 49into a filesystem type index.
fea681da
MK
50.TP
51.B 2
9ee4a2b6 52Translate the filesystem type index
fea681da 53.I fs_index
9ee4a2b6 54into a null-terminated filesystem identifier string.
c13182ef 55This string will
fea681da
MK
56be written to the buffer pointed to by
57.IR buf .
58Make sure that
59.I buf
60has enough space to accept the string.
61.TP
62.B 3
9ee4a2b6 63Return the total number of filesystem types currently present in the
fea681da 64kernel.
fea681da 65.PP
9ee4a2b6 66The numbering of the filesystem type indexes begins with zero.
47297adb 67.SH RETURN VALUE
fea681da 68On success,
e511ffb6 69.BR sysfs ()
9ee4a2b6 70returns the filesystem index for option
fea681da
MK
71.BR 1 ,
72zero for option
73.BR 2 ,
9ee4a2b6 74and the number of currently configured filesystems for option
fea681da
MK
75.BR 3 .
76On error, \-1 is returned, and
77.I errno
78is set appropriately.
79.SH ERRORS
80.TP
81.B EFAULT
82.RI "Either " fsname " or " buf
83is outside your accessible address space.
84.TP
85.B EINVAL
86.I fsname
9ee4a2b6 87is not a valid filesystem type identifier;
fea681da
MK
88.I fs_index
89is out-of-bounds;
90.I option
91is invalid.
47297adb 92.SH CONFORMING TO
fea681da 93SVr4.
19c98696 94.SH NOTES
d1d721be
MK
95This System-V derived system call is obsolete; don't use it.
96On systems with
fea681da 97.IR /proc ,
e8fd5077 98the same information can be obtained via
d1d721be
MK
99.IR /proc/filesystems ;
100use that interface instead.
fea681da
MK
101.SH BUGS
102There is no libc or glibc support.
103There is no way to guess how large \fIbuf\fP should be.