home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / cat2 / statfs.0 < prev    next >
Text File  |  1993-12-07  |  4KB  |  133 lines

  1.  
  2. STATFS(2)                  UNIX Programmer's Manual                  STATFS(2)
  3.  
  4. NNAAMMEE
  5.      ssttaattffss - get file system statistics
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//mmoouunntt..hh>>
  10.  
  11.      _i_n_t
  12.      ssttaattffss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f)
  13.  
  14.      _i_n_t
  15.      ffssttaattffss(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f)
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      SSttaattffss() returns information about a mounted file system.  _P_a_t_h is the
  19.      path name of any file within the mounted filesystem.  _B_u_f is a pointer to
  20.      a ssttaattffss() structure defined as follows:
  21.  
  22.      typedef quad fsid_t;
  23.  
  24.      #define MNAMELEN 32     /* length of buffer for returned name */
  25.  
  26.      struct statfs {
  27.      short   f_type;           /* type of filesystem (see below) */
  28.      short   f_flags;          /* copy of mount flags */
  29.      long    f_fsize;          /* fundamental file system block size */
  30.      long    f_bsize;          /* optimal transfer block size */
  31.      long    f_blocks;         /* total data blocks in file system */
  32.      long    f_bfree;          /* free blocks in fs */
  33.      long    f_bavail;         /* free blocks avail to non­superuser */
  34.      long    f_files;          /* total file nodes in file system */
  35.      long    f_ffree;          /* free file nodes in fs */
  36.      fsid_t  f_fsid;           /* file system id */
  37.      long    f_spare[6];       /* spare for later */
  38.      char    f_mntonname[MNAMELEN];    /* mount point */
  39.      char    f_mntfromname[MNAMELEN];  /* mounted filesystem */
  40.      };
  41.      /*
  42.      * File system types.
  43.      */
  44.      #define MOUNT_UFS       1
  45.      #define MOUNT_NFS       2
  46.      #define MOUNT_MFS       3
  47.      #define MOUNT_PC        4
  48.  
  49.      Fields that are undefined for a particular file system are set to ­1.
  50.      FFssttaattffss() returns the same information about an open file referenced by
  51.      descriptor _f_d.
  52.  
  53. RREETTUURRNN VVAALLUUEESS
  54.      Upon successful completion, a value of 0 is returned.  Otherwise, ­1 is
  55.      returned and the global variable _e_r_r_n_o is set to indicate the error.
  56.  
  57. EERRRROORRSS
  58.      SSttaattffss() fails if one or more of the following are true:
  59.  
  60.      [ENOTDIR]      A component of the path prefix of _P_a_t_h is not a directory.
  61.  
  62.      [EINVAL]       _p_a_t_h contains a character with the high­order bit set.
  63.  
  64.      [ENAMETOOLONG]
  65.                     The length of a component of _p_a_t_h exceeds 255 characters,
  66.  
  67.                     or the length of _p_a_t_h exceeds 1023 characters.
  68.  
  69.      [ENOENT]       The file referred to by _p_a_t_h does not exist.
  70.  
  71.      [EACCES]       Search permission is denied for a component of the path
  72.                     prefix of _p_a_t_h.
  73.  
  74.      [ELOOP]        Too many symbolic links were encountered in translating
  75.                     _p_a_t_h.
  76.  
  77.      [EFAULT]       _B_u_f or _p_a_t_h points to an invalid address.
  78.  
  79.      [EIO]          An I/O error occurred while reading from or writing to the
  80.                     file system.
  81.  
  82.      FFssttaattffss() fails if one or both of the following are true:
  83.  
  84.      [EBADF]        _F_d is not a valid open file descriptor.
  85.  
  86.      [EFAULT]       _B_u_f points to an invalid address.
  87.  
  88.      [EIO]          An I/O error occurred while reading from or writing to the
  89.                     file system.
  90.  
  91. HHIISSTTOORRYY
  92.      The ssttaattffss function call is currently under development.
  93.  
  94. BSD Experimental                 July 23, 1991                               2
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.