Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>statfs</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
statfs
======

Syntax
------

     #include <sys/vfs.h>
     
     int statfs(const char *filename, struct statfs *buf);

Description
-----------

This function returns information about the given "filesystem".  The
drive letter of the given FILENAME, or the default drive if none is
given, is used to retrieve the following structure:

     struct statfs
     {
         long       f_type;   /* 0 */
         long       f_bsize;  /* bytes per cluster */
         long       f_blocks; /* clusters on drive */
         long       f_bfree;  /* available clusters */
         long       f_bavail; /* available clusters */
         long       f_files;  /* clusters on drive */
         long       f_ffree;  /* available clusters */
         fsid_t       f_fsid;   /* [0]=drive_number, [1]=MOUNT_UFS
         long       f_magic;  /* FS_MAGIC */
     };

Return Value
------------

Zero on success, nonzero on failure.

Example
-------

     struct statfs fs;
     statfs("anything", &fs);
     printf("%d bytes left\n", fs.f_bfree * fs.f_bsize);


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson