]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/ustat.2
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man2 / ustat.2
CommitLineData
fea681da
MK
1.\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
c13182ef 11.\"
fea681da
MK
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
c13182ef 19.\"
fea681da
MK
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
23.\" Created 1995-08-09 Thomas K. Dyas <tdyas@eden.rutgers.edu>
24.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25.\" Modified 2001-03-22 by aeb
26.\" Modified 2003-08-04 by aeb
27.\"
d9343c5c 28.TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual"
fea681da
MK
29.SH NAME
30ustat \- get file system statistics
31.SH SYNOPSIS
32.nf
33.B #include <sys/types.h>
34.br
35.BR "#include <unistd.h>" " /* libc[45] */"
36.br
37.BR "#include <ustat.h>" " /* glibc2 */"
38.sp
39.BI "int ustat(dev_t " dev ", struct ustat *" ubuf );
c8250206 40.fi
fea681da 41.SH DESCRIPTION
e511ffb6 42.BR ustat ()
fea681da
MK
43returns information about a mounted file system.
44.I dev
45is a device number identifying a device containing
46a mounted file system.
47.I ubuf
cf0a9ace 48is a pointer to a \fIustat\fP structure that contains the following
fea681da 49members:
c8250206 50.in +4n
fea681da 51.nf
cf0a9ace
MK
52
53daddr_t f_tfree; /* Total free blocks */
54ino_t f_tinode; /* Number of free inodes */
55char f_fname[6]; /* Filsys name */
56char f_fpack[6]; /* Filsys pack name */
fea681da 57.fi
c8250206 58.in
fea681da 59.PP
3b5dffbc
MK
60The last two fields,
61.I f_fname
62and
63.IR f_fpack ,
64are not implemented and will
f81fb444 65always be filled with null bytes (\(aq\\0\(aq).
47297adb 66.SH RETURN VALUE
3b5dffbc
MK
67On success, zero is returned and the
68.I ustat
69structure pointed to by
fea681da 70.I ubuf
c13182ef
MK
71will be filled in.
72On error, \-1 is returned, and
fea681da
MK
73.I errno
74is set appropriately.
75.SH ERRORS
76.TP
77.B EFAULT
78.I ubuf
79points outside of your accessible address space.
80.TP
81.B EINVAL
82.I dev
83does not refer to a device containing a mounted file system.
84.TP
85.B ENOSYS
86The mounted file system referenced by
87.I dev
88does not support this operation, or any version of Linux before
891.3.16.
47297adb 90.SH CONFORMING TO
c13182ef 91SVr4.
97c1eac8
MK
92.\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
93.\" but has no ENOSYS condition.
fea681da 94.SH NOTES
e511ffb6 95.BR ustat ()
fea681da
MK
96is deprecated and has only been provided for compatibility.
97All new programs should use
98.BR statfs (2)
99instead.
c634028a 100.SS "HP-UX notes"
97c1eac8 101The HP-UX version of the
c13182ef 102.I ustat
97c1eac8
MK
103structure has an additional field,
104.IR f_blksize ,
c13182ef 105that is unknown elsewhere.
97c1eac8 106HP-UX warns:
fea681da 107For some file systems, the number of free inodes does not change.
8729177b 108Such file systems will return \-1 in the field
fea681da
MK
109.IR f_tinode .
110.\" Some software tries to use this in order to test whether the
24d01c53 111.\" underlying file system is NFS.
fea681da
MK
112For some file systems, inodes are dynamically allocated.
113Such file systems will return the current number of free inodes.
47297adb 114.SH SEE ALSO
fea681da
MK
115.BR stat (2),
116.BR statfs (2)