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

NAME

6       ustat - get file system statistics
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <ustat.h>
11
12       int ustat(dev_t dev, struct ustat *buf);
13
14

DESCRIPTION

16       The  ustat()  function returns information about a mounted file system.
17       The dev argument is a device number identifying a device  containing  a
18       mounted file system (see makedev(3C)). The buf argument is a pointer to
19       a ustat structure that includes the following members:
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
27
28       The f_fname and f_fpack members may not contain significant information
29       on all systems; in this case, these members will contain the null char‐
30       acter as the first character.
31

RETURN VALUES

33       Upon successful completion, 0 is returned. Otherwise,  −1  is  returned
34       and errno is set to indicate the error.
35

ERRORS

37       The ustat() function will fail if:
38
39       ECOMM        The  dev  argument  is on a remote machine and the link to
40                    that machine is no longer active.
41
42
43       EFAULT       The buf argument points to an illegal address.
44
45
46       EINTR        A signal was caught during the execution  of  the  ustat()
47                    function.
48
49
50       EINVAL       The dev argument is not the device number of a device con‐
51                    taining a mounted file system.
52
53
54       ENOLINK      The dev argument refers to a device on  a  remote  machine
55                    and the link  to that machine is no longer active.
56
57
58       EOVERFLOW    One  of  the  values returned cannot be represented in the
59                    structure pointed to by buf.
60
61

USAGE

63       The statvfs(2) function should be used in favor of ustat().
64

SEE ALSO

66       stat(2), statvfs(2), makedev(3C), lfcompile(5)
67

BUGS

69       The NFS revision 2 protocol does not permit the number of free files to
70       be  provided to the client; therefore, when ustat() has completed on an
71       NFS file system, f_tinode is always −1.
72
73
74
75SunOS 5.11                        23 Jul 2001                         ustat(2)
Impressum