VMS Help  —  CRTL  statvfs
    Gets information about a device containing the specified file.

    This function is supported on OpenVMS Integrity servers and
    Alpha only.

    Format

      #include  <statvfs.h>

      int statvfs  (const char *restrict path, struct statvfs
                   *restrict buffer);

1  –  Arguments

 path

    Any file on a mounted device.

 buffer

    Pointer to a statvfs structure to hold the returned information.

2  –  Description

    The statvfs function returns descriptive information about the
    device containing the specified file. Read, write, or execute
    permission of the specified file is not required. The returned
    information is in the format of a statvfs structure, which is
    defined in the <statvfs.h> header file and contains the following
    members:

       unsigned long f_bsize - Preferred block size.

       unsigned long f_frsize - Fundamental block size.

       fsblkcnt_t f_blocks - Total number of blocks in units of f_
       frsize.

       fsblkcnt_t f_bfree - Total number of free blocks. If f_bfree
       would assume a meaningless value due to the misreporting of
       free block count by $GETDVI for a DFS disk, then f_bfree is
       set to the maximum block count.

       fsblkcnt_t f_bavail - Number of free blocks available. Set to
       the unused portion of the caller's disk quota.

       fsfilcnt_t f_files - Total number of file serial numbers (for
       example, inodes).

       fsfilcnt_t f_ffree - Total number of free file serial
       numbers. For OpenVMS systems, this value is calculated as
       freeblocks/clustersize.

       fsfilcnt_t f_favail - Number of file serial numbers available
       to a non-privileged process (0 for OpenVMS systems).

       unsigned long f_fsid - File system identifier. This identifier
       is based on the allocation-class device name. This gives a
       unique value based on device, as long as the device is locally
       mounted.

       unsigned long f_flag - Bit mask representing one or more of
       the following flags:

          ST_RONLY - The volume is read-only.
          ST_NOSUID - The volume has protected subsystems enabled.

       unsigned long f_namemax - Maximum length of a filename.
       char f_basetype[64] - Device-type name.
       char f_fstr[64] - Logical volume name.
       char __reserved[64] - Media type name.

    Upon successful completion, statvfs returns 0 (zero). Otherwise,
    it returns -1 and sets errno to indicate the error.

    See also fstatvfs.

3  –  Return Value

    0                  Successful completion.
    -1                 Indicates an error. errno is set to one of the
                       following:

                       o  EACCES - Search permission is denied for a
                          component of the path prefix.

                       o  EIO - An I/O error occurred while reading
                          the device.

                       o  EINTR - A signal was intercepted during
                          execution of the function.

                       o  EOVERFLOW - One of the values to be
                          returned cannot be represented correctly
                          in the structure pointed to by buffer.

                       o  ENAMETOOLONG - The length of a component
                          of the path parameter exceeds NAME_MAX, or
                          the length of the path parameter exceeds
                          PATH_MAX.

                       o  ENOENT - A component of path does not
                          name an existing file, or path is an empty
                          string.

                       o  ENOTDIR - A component of the path prefix of
                          the path parameter is not a directory.
Close Help