home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / sys / vfs / statfs.txh < prev   
Encoding:
Text File  |  1995-07-10  |  1.0 KB  |  43 lines

  1. @node statfs, file system
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <sys/vfs.h>
  6.  
  7. int statfs(const char *filename, struct statfs *buf);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function returns information about the given "filesystem".  The
  13. drive letter of the given @var{filename}, or the default drive if none
  14. is given, is used to retrieve the following structure:
  15.  
  16. @example
  17. struct statfs
  18. @{
  19.     long    f_type;   /* 0 */
  20.     long    f_bsize;  /* bytes per cluster */
  21.     long    f_blocks; /* clusters on drive */
  22.     long    f_bfree;  /* available clusters */
  23.     long    f_bavail; /* available clusters */
  24.     long    f_files;  /* clusters on drive */
  25.     long    f_ffree;  /* available clusters */
  26.     fsid_t    f_fsid;   /* [0]=drive_number, [1]=MOUNT_UFS
  27.     long    f_magic;  /* FS_MAGIC */
  28. @};
  29. @end example
  30.  
  31. @subheading Return Value
  32.  
  33. Zero on success, nonzero on failure.
  34.  
  35. @subheading Example
  36.  
  37. @example
  38. struct statfs fs;
  39. statfs("anything", &fs);
  40. printf("%d bytes left\n", fs.f_bfree * fs.f_bsize);
  41. @end example
  42.  
  43.