1ustat(2)                      System Calls Manual                     ustat(2)
2
3
4

NAME

6       ustat - get filesystem statistics
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

STANDARDS

45       None.
46

HISTORY

48       SVr4.  Removed in glibc 2.28.
49
50       ustat()  is  deprecated  and  has been provided only for compatibility.
51       All new programs should use statfs(2) instead.
52
53   HP-UX notes
54       The HP-UX version of the  ustat  structure  has  an  additional  field,
55       f_blksize,  that  is unknown elsewhere.  HP-UX warns: For some filesys‐
56       tems, the number of free inodes does not change.  Such filesystems will
57       return  -1 in the field f_tinode.  For some filesystems, inodes are dy‐
58       namically allocated.  Such filesystems will return the  current  number
59       of free inodes.
60

SEE ALSO

62       stat(2), statfs(2)
63
64
65
66Linux man-pages 6.05              2023-03-30                          ustat(2)
Impressum