184 lines
4.0 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ustat - get filesystem statistics
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/sys/types.h">sys/types.h</A>></B>
|
|
<B>#include <<A HREF="file:///usr/include/unistd.h">unistd.h</A>></B> /* libc[45] */
|
|
<B>#include <<A HREF="file:///usr/include/ustat.h">ustat.h</A>></B> /* glibc2 */
|
|
|
|
<B>int ustat(dev_t </B><I>dev</I><B>, struct ustat *</B><I>ubuf</I><B>);</B>
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </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"> </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"> </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"> </A>
|
|
<H2>VERSIONS</H2>
|
|
|
|
Since version 2.28, glibc no longer provides a wrapper for this system call.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
SVr4.
|
|
|
|
|
|
<A NAME="lbAI"> </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"> </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"> </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"> </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"> </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>
|