1USTAT(2)                   Linux Programmer's Manual                  USTAT(2)
2
3
4

NAME

6       ustat - get file system statistics
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <unistd.h>    /* libc[45] */
11       #include <ustat.h>     /* glibc2 */
12
13       int ustat(dev_t dev, struct ustat *ubuf);
14

DESCRIPTION

16       ustat()  returns  information  about  a  mounted file system.  dev is a
17       device number identifying a device containing a  mounted  file  system.
18       ubuf is a pointer to a ustat structure that contains the following mem‐
19       bers:
20
21           daddr_t f_tfree;      /* Total free blocks */
22           ino_t   f_tinode;     /* Number of free inodes */
23           char    f_fname[6];   /* Filsys name */
24           char    f_fpack[6];   /* Filsys pack name */
25
26       The last two fields, f_fname and f_fpack, are not implemented and  will
27       always be filled with null bytes ('\0').
28

RETURN VALUE

30       On success, zero is returned and the ustat structure pointed to by ubuf
31       will be filled in.  On error, -1 is returned, and errno is  set  appro‐
32       priately.
33

ERRORS

35       EFAULT ubuf points outside of your accessible address space.
36
37       EINVAL dev does not refer to a device containing a mounted file system.
38
39       ENOSYS The  mounted file system referenced by dev does not support this
40              operation, or any version of Linux before 1.3.16.
41

CONFORMING TO

43       SVr4.
44

NOTES

46       ustat() is deprecated and has been  provided  only  for  compatibility.
47       All new programs should use statfs(2) instead.
48
49   HP-UX notes
50       The  HP-UX  version  of  the  ustat  structure has an additional field,
51       f_blksize, that is unknown elsewhere.  HP-UX warns: For some file  sys‐
52       tems,  the  number  of  free inodes does not change.  Such file systems
53       will return -1 in the field f_tinode.  For some  file  systems,  inodes
54       are  dynamically  allocated.  Such file systems will return the current
55       number of free inodes.
56

SEE ALSO

58       stat(2), statfs(2)
59

COLOPHON

61       This page is part of release 3.53 of the Linux  man-pages  project.   A
62       description  of  the project, and information about reporting bugs, can
63       be found at http://www.kernel.org/doc/man-pages/.
64
65
66
67Linux                             2003-08-04                          USTAT(2)
Impressum