OSDN Git Service

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