Blame man2/sysfs.2

Packit 7cfc04
.\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(VERBATIM)
Packit 7cfc04
.\" Permission is granted to make and distribute verbatim copies of this
Packit 7cfc04
.\" manual provided the copyright notice and this permission notice are
Packit 7cfc04
.\" preserved on all copies.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Permission is granted to copy and distribute modified versions of this
Packit 7cfc04
.\" manual under the conditions for verbatim copying, provided that the
Packit 7cfc04
.\" entire resulting derived work is distributed under the terms of a
Packit 7cfc04
.\" permission notice identical to this one.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Since the Linux kernel and libraries are constantly changing, this
Packit 7cfc04
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
Packit 7cfc04
.\" responsibility for errors or omissions, or for damages resulting from
Packit 7cfc04
.\" the use of the information contained herein.  The author(s) may not
Packit 7cfc04
.\" have taken the same level of care in the production of this manual,
Packit 7cfc04
.\" which is licensed free of charge, as they might when working
Packit 7cfc04
.\" professionally.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Formatted or processed versions of this manual, if unaccompanied by
Packit 7cfc04
.\" the source, must acknowledge the copyright and authors of this work.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" Created   Wed Aug  9 1995     Thomas K. Dyas <tdyas@eden.rutgers.edu>
Packit 7cfc04
.\"
Packit 7cfc04
.TH SYSFS 2 2017-09-15 "Linux" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
sysfs \- get filesystem type information
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.BI "int sysfs(int " option ", const char *" fsname );
Packit 7cfc04
.PP
Packit 7cfc04
.BI "int sysfs(int " option ", unsigned int " fs_index ", char *" buf );
Packit 7cfc04
.PP
Packit 7cfc04
.BI "int sysfs(int " option );
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
.BR "Note" :
Packit 7cfc04
if you are looking for information about the
Packit 7cfc04
.B sysfs
Packit 7cfc04
filesystem that is normally mounted at
Packit 7cfc04
.IR /sys ,
Packit 7cfc04
see
Packit 7cfc04
.BR sysfs (5).
Packit 7cfc04
.PP
Packit 7cfc04
The (obsolete)
Packit 7cfc04
.BR sysfs ()
Packit 7cfc04
system call returns information about the filesystem types
Packit 7cfc04
currently present in the kernel.
Packit 7cfc04
The specific form of the
Packit 7cfc04
.BR sysfs ()
Packit 7cfc04
call and the information returned depends on the
Packit 7cfc04
.I option
Packit 7cfc04
in effect:
Packit 7cfc04
.TP 3
Packit 7cfc04
.B 1
Packit 7cfc04
Translate the filesystem identifier string
Packit 7cfc04
.I fsname
Packit 7cfc04
into a filesystem type index.
Packit 7cfc04
.TP
Packit 7cfc04
.B 2
Packit 7cfc04
Translate the filesystem type index
Packit 7cfc04
.I fs_index
Packit 7cfc04
into a null-terminated filesystem identifier string.
Packit 7cfc04
This string will
Packit 7cfc04
be written to the buffer pointed to by
Packit 7cfc04
.IR buf .
Packit 7cfc04
Make sure that
Packit 7cfc04
.I buf
Packit 7cfc04
has enough space to accept the string.
Packit 7cfc04
.TP
Packit 7cfc04
.B 3
Packit 7cfc04
Return the total number of filesystem types currently present in the
Packit 7cfc04
kernel.
Packit 7cfc04
.PP
Packit 7cfc04
The numbering of the filesystem type indexes begins with zero.
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
On success,
Packit 7cfc04
.BR sysfs ()
Packit 7cfc04
returns the filesystem index for option
Packit 7cfc04
.BR 1 ,
Packit 7cfc04
zero for option
Packit 7cfc04
.BR 2 ,
Packit 7cfc04
and the number of currently configured filesystems for option
Packit 7cfc04
.BR 3 .
Packit 7cfc04
On error, \-1 is returned, and
Packit 7cfc04
.I errno
Packit 7cfc04
is set appropriately.
Packit 7cfc04
.SH ERRORS
Packit 7cfc04
.TP
Packit 7cfc04
.B EFAULT
Packit 7cfc04
.RI "Either " fsname " or " buf
Packit 7cfc04
is outside your accessible address space.
Packit 7cfc04
.TP
Packit 7cfc04
.B EINVAL
Packit 7cfc04
.I fsname
Packit 7cfc04
is not a valid filesystem type identifier;
Packit 7cfc04
.I fs_index
Packit 7cfc04
is out-of-bounds;
Packit 7cfc04
.I option
Packit 7cfc04
is invalid.
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
SVr4.
Packit 7cfc04
.SH NOTES
Packit 7cfc04
This System-V derived system call is obsolete; don't use it.
Packit 7cfc04
On systems with
Packit 7cfc04
.IR /proc ,
Packit 7cfc04
the same information can be obtained via
Packit 7cfc04
.IR /proc/filesystems ;
Packit 7cfc04
use that interface instead.
Packit 7cfc04
.SH BUGS
Packit 7cfc04
There is no libc or glibc support.
Packit 7cfc04
There is no way to guess how large \fIbuf\fP should be.
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.