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

    This function is OpenVMS Alpha and Integrity servers only.

    Format

      #include  <statvfs.h>

      int fstatvfs  (int filedes, struct statvfs *buffer);

1  –  Arguments

 filedes

    File descriptor obtained from a successful open or fcntl function
    call.

 buffer

    Pointer to a statvfs structure to hold the returned information.

2  –  Description

    The fstatvfs 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 file (inode) count.

       fsfilcnt_t f_ffree - Free file (inode) count. For OpenVMS
       systems, this value is calculated as freeblocks/clustersize.

       fsfilcnt_t f_favail - Free file (inode) count nonprivileged.
       Set to f_ffree.

       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, fstatvfs returns 0 (zero). Otherwise,
    it returns -1 and sets errno to indicate the error.

    See also statvfs.

3  –  Return Value

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

                       o  EBADF - The file descriptor parameter
                          contains an invalid value.

                       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.
Close Help