OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man2 / ustat.2
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.
11 .\"
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.
19 .\"
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 .\"
28 .TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual"
29 .SH NAME
30 ustat \- 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 );
40 .fi
41 .SH DESCRIPTION
42 .BR ustat ()
43 returns information about a mounted file system.
44 .I dev
45 is a device number identifying a device containing
46 a mounted file system.
47 .I ubuf
48 is a pointer to a \fIustat\fP structure that contains the following
49 members:
50 .in +4n
51 .nf
52
53 daddr_t f_tfree;      /* Total free blocks */
54 ino_t   f_tinode;     /* Number of free inodes */
55 char    f_fname[6];   /* Filsys name */
56 char    f_fpack[6];   /* Filsys pack name */
57 .fi
58 .in
59 .PP
60 The last two fields,
61 .I f_fname
62 and
63 .IR f_fpack ,
64 are not implemented and will
65 always be filled with null bytes (\(aq\\0\(aq).
66 .SH "RETURN VALUE"
67 On success, zero is returned and the
68 .I ustat
69 structure pointed to by
70 .I ubuf
71 will be filled in.
72 On error, \-1 is returned, and
73 .I errno
74 is set appropriately.
75 .SH ERRORS
76 .TP
77 .B EFAULT
78 .I ubuf
79 points outside of your accessible address space.
80 .TP
81 .B EINVAL
82 .I dev
83 does not refer to a device containing a mounted file system.
84 .TP
85 .B ENOSYS
86 The mounted file system referenced by
87 .I dev
88 does not support this operation, or any version of Linux before
89 1.3.16.
90 .SH "CONFORMING TO"
91 SVr4.
92 .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
93 .\" but has no ENOSYS condition.
94 .SH NOTES
95 .BR ustat ()
96 is deprecated and has only been provided for compatibility.
97 All new programs should use
98 .BR statfs (2)
99 instead.
100 .SS "HP-UX Notes"
101 The HP-UX version of the
102 .I ustat
103 structure has an additional field,
104 .IR f_blksize ,
105 that is unknown elsewhere.
106 HP-UX warns:
107 For some file systems, the number of free inodes does not change.
108 Such file systems will return \-1 in the field
109 .IR f_tinode .
110 .\" Some software tries to use this in order to test whether the
111 .\" underlying file system is NFS.
112 For some file systems, inodes are dynamically allocated.
113 Such file systems will return the current number of free inodes.
114 .SH "SEE ALSO"
115 .BR stat (2),
116 .BR statfs (2)