man-pages/man2/sysfs.2.html
2021-03-31 01:06:50 +01:00

182 lines
3.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SYSFS</TITLE>
</HEAD><BODY>
<H1>SYSFS</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sysfs - get filesystem type information
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>int sysfs(int </B><I>option</I><B>, const char *</B><I>fsname</I><B>);</B>
<P>
<B>int sysfs(int </B><I>option</I><B>, unsigned int </B><I>fs_index</I><B>, char *</B><I>buf</I><B>);</B>
<P>
<B>int sysfs(int </B><I>option</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>Note</B>:
if you are looking for information about the
<B>sysfs</B>
filesystem that is normally mounted at
<I>/sys</I>,
see
<B><A HREF="/cgi-bin/man/man2html?5+sysfs">sysfs</A></B>(5).
<P>
The (obsolete)
<B>sysfs</B>()
system call returns information about the filesystem types
currently present in the kernel.
The specific form of the
<B>sysfs</B>()
call and the information returned depends on the
<I>option</I>
in effect:
<DL COMPACT>
<DT id="1"><B>1</B>
<DD>
Translate the filesystem identifier string
<I>fsname</I>
into a filesystem type index.
<DT id="2"><B>2</B>
<DD>
Translate the filesystem type index
<I>fs_index</I>
into a null-terminated filesystem identifier string.
This string will
be written to the buffer pointed to by
<I>buf</I>.
Make sure that
<I>buf</I>
has enough space to accept the string.
<DT id="3"><B>3</B>
<DD>
Return the total number of filesystem types currently present in the
kernel.
</DL>
<P>
The numbering of the filesystem type indexes begins with zero.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success,
<B>sysfs</B>()
returns the filesystem index for option
<B>1</B>,
zero for option
<B>2</B>,
and the number of currently configured filesystems for option
<B>3</B>.
On error, -1 is returned, and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="4"><B>EFAULT</B>
<DD>
Either <I>fsname</I> or <I>buf</I>
is outside your accessible address space.
<DT id="5"><B>EINVAL</B>
<DD>
<I>fsname</I>
is not a valid filesystem type identifier;
<I>fs_index</I>
is out-of-bounds;
<I>option</I>
is invalid.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>CONFORMING TO</H2>
SVr4.
<A NAME="lbAH">&nbsp;</A>
<H2>NOTES</H2>
This System-V derived system call is obsolete; don't use it.
On systems with
<I>/proc</I>,
the same information can be obtained via
<I>/proc/filesystems</I>;
use that interface instead.
<A NAME="lbAI">&nbsp;</A>
<H2>BUGS</H2>
There is no libc or glibc support.
There is no way to guess how large <I>buf</I> should be.
<A NAME="lbAJ">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="10"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="11"><A HREF="#lbAG">CONFORMING TO</A><DD>
<DT id="12"><A HREF="#lbAH">NOTES</A><DD>
<DT id="13"><A HREF="#lbAI">BUGS</A><DD>
<DT id="14"><A HREF="#lbAJ">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:35 GMT, March 31, 2021
</BODY>
</HTML>