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

184 lines
4.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of USTAT</TITLE>
</HEAD><BODY>
<H1>USTAT</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2019-03-06<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>
ustat - get filesystem statistics
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/sys/types.h">sys/types.h</A>&gt;</B>
<B>#include &lt;<A HREF="file:///usr/include/unistd.h">unistd.h</A>&gt;</B> /* libc[45] */
<B>#include &lt;<A HREF="file:///usr/include/ustat.h">ustat.h</A>&gt;</B> /* glibc2 */
<B>int ustat(dev_t </B><I>dev</I><B>, struct ustat *</B><I>ubuf</I><B>);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>ustat</B>()
returns information about a mounted filesystem.
<I>dev</I>
is a device number identifying a device containing
a mounted filesystem.
<I>ubuf</I>
is a pointer to a
<I>ustat</I>
structure that contains the following
members:
<P>
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free inodes */
char f_fname[6]; /* Filsys name */
char f_fpack[6]; /* Filsys pack name */
<P>
The last two fields,
<I>f_fname</I>
and
<I>f_fpack</I>,
are not implemented and will
always be filled with null bytes ('\0').
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success, zero is returned and the
<I>ustat</I>
structure pointed to by
<I>ubuf</I>
will be filled in.
On error, -1 is returned, and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EFAULT</B>
<DD>
<I>ubuf</I>
points outside of your accessible address space.
<DT id="2"><B>EINVAL</B>
<DD>
<I>dev</I>
does not refer to a device containing a mounted filesystem.
<DT id="3"><B>ENOSYS</B>
<DD>
The mounted filesystem referenced by
<I>dev</I>
does not support this operation, or any version of Linux before
1.3.16.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>VERSIONS</H2>
Since version 2.28, glibc no longer provides a wrapper for this system call.
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
SVr4.
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
<B>ustat</B>()
is deprecated and has been provided only for compatibility.
All new programs should use
<B><A HREF="/cgi-bin/man/man2html?2+statfs">statfs</A></B>(2)
instead.
<A NAME="lbAJ">&nbsp;</A>
<H3>HP-UX notes</H3>
The HP-UX version of the
<I>ustat</I>
structure has an additional field,
<I>f_blksize</I>,
that is unknown elsewhere.
HP-UX warns:
For some filesystems, the number of free inodes does not change.
Such filesystems will return -1 in the field
<I>f_tinode</I>.
For some filesystems, inodes are dynamically allocated.
Such filesystems will return the current number of free inodes.
<A NAME="lbAK">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?2+stat">stat</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+statfs">statfs</A></B>(2)
<A NAME="lbAL">&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="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="8"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="9"><A HREF="#lbAG">VERSIONS</A><DD>
<DT id="10"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="11"><A HREF="#lbAI">NOTES</A><DD>
<DL>
<DT id="12"><A HREF="#lbAJ">HP-UX notes</A><DD>
</DL>
<DT id="13"><A HREF="#lbAK">SEE ALSO</A><DD>
<DT id="14"><A HREF="#lbAL">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>