Blame man2/ustat.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  1995-08-09 Thomas K. Dyas <tdyas@eden.rutgers.edu>
Packit 7cfc04
.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
Packit 7cfc04
.\" Modified 2001-03-22 by aeb
Packit 7cfc04
.\" Modified 2003-08-04 by aeb
Packit 7cfc04
.\"
Packit 7cfc04
.TH USTAT 2 2017-09-15 "Linux" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
ustat \- get filesystem statistics
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <sys/types.h>
Packit 7cfc04
.BR "#include <unistd.h>" "    /* libc[45] */"
Packit 7cfc04
.BR "#include <ustat.h>" "     /* glibc2 */"
Packit 7cfc04
.PP
Packit 7cfc04
.BI "int ustat(dev_t " dev ", struct ustat *" ubuf );
Packit 7cfc04
.fi
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
.BR ustat ()
Packit 7cfc04
returns information about a mounted filesystem.
Packit 7cfc04
.I dev
Packit 7cfc04
is a device number identifying a device containing
Packit 7cfc04
a mounted filesystem.
Packit 7cfc04
.I ubuf
Packit 7cfc04
is a pointer to a
Packit 7cfc04
.I ustat
Packit 7cfc04
structure that contains the following
Packit 7cfc04
members:
Packit 7cfc04
.PP
Packit 7cfc04
.in +4n
Packit 7cfc04
.EX
Packit 7cfc04
daddr_t f_tfree;      /* Total free blocks */
Packit 7cfc04
ino_t   f_tinode;     /* Number of free inodes */
Packit 7cfc04
char    f_fname[6];   /* Filsys name */
Packit 7cfc04
char    f_fpack[6];   /* Filsys pack name */
Packit 7cfc04
.EE
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
The last two fields,
Packit 7cfc04
.I f_fname
Packit 7cfc04
and
Packit 7cfc04
.IR f_fpack ,
Packit 7cfc04
are not implemented and will
Packit 7cfc04
always be filled with null bytes (\(aq\\0\(aq).
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
On success, zero is returned and the
Packit 7cfc04
.I ustat
Packit 7cfc04
structure pointed to by
Packit 7cfc04
.I ubuf
Packit 7cfc04
will be filled in.
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
.I ubuf
Packit 7cfc04
points outside of your accessible address space.
Packit 7cfc04
.TP
Packit 7cfc04
.B EINVAL
Packit 7cfc04
.I dev
Packit 7cfc04
does not refer to a device containing a mounted filesystem.
Packit 7cfc04
.TP
Packit 7cfc04
.B ENOSYS
Packit 7cfc04
The mounted filesystem referenced by
Packit 7cfc04
.I dev
Packit 7cfc04
does not support this operation, or any version of Linux before
Packit 7cfc04
1.3.16.
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
SVr4.
Packit 7cfc04
.\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
Packit 7cfc04
.\" but has no ENOSYS condition.
Packit 7cfc04
.SH NOTES
Packit 7cfc04
.BR ustat ()
Packit 7cfc04
is deprecated and has been provided only for compatibility.
Packit 7cfc04
All new programs should use
Packit 7cfc04
.BR statfs (2)
Packit 7cfc04
instead.
Packit 7cfc04
.SS HP-UX notes
Packit 7cfc04
The HP-UX version of the
Packit 7cfc04
.I ustat
Packit 7cfc04
structure has an additional field,
Packit 7cfc04
.IR f_blksize ,
Packit 7cfc04
that is unknown elsewhere.
Packit 7cfc04
HP-UX warns:
Packit 7cfc04
For some filesystems, the number of free inodes does not change.
Packit 7cfc04
Such filesystems will return \-1 in the field
Packit 7cfc04
.IR f_tinode .
Packit 7cfc04
.\" Some software tries to use this in order to test whether the
Packit 7cfc04
.\" underlying filesystem is NFS.
Packit 7cfc04
For some filesystems, inodes are dynamically allocated.
Packit 7cfc04
Such filesystems will return the current number of free inodes.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR stat (2),
Packit 7cfc04
.BR statfs (2)
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/.