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
22              daddr_t f_tfree;                /* Total free blocks */
23              ino_t   f_tinode;               /* Number of free inodes */
24              char    f_fname[6];             /* Filsys name */
25              char    f_fpack[6];             /* Filsys pack name */
26
27       The last two fields, f_fname and f_fpack, are not implemented and  will
28       always be filled with null bytes ('\0').
29

RETURN VALUE

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

ERRORS

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

CONFORMING TO

44       SVr4.
45

NOTES

47       ustat() is deprecated and has only  been  provided  for  compatibility.
48       All new programs should use statfs(2) instead.
49

HP-UX NOTES

51       The  HP-UX  version  of  the  ustat  structure has an additional field,
52       f_blksize, that is unknown elsewhere.  HP-UX warns: For some file  sys‐
53       tems,  the  number  of  free inodes does not change.  Such file systems
54       will return -1 in the field f_tinode.  For some  file  systems,  inodes
55       are  dynamically  allocated.  Such file systems will return the current
56       number of free inodes.
57

SEE ALSO

59       stat(2), statfs(2)
60
61
62
63Linux 2.4                         2003-08-04                          USTAT(2)
Impressum