title: find out filesystem size and name on which specific directory is lying
body: <p>I need to find out the name of the <code>filesystem</code> and <code>mount directory</code> name from a given subdirectory name on LINUX(CentOS 5.4).</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;sys/vfs.h&gt;
  #include &lt;sys/mount.h&gt;
  
  int main(int argc, char** argv) {
      struct statfs ls_tbs_fs;
      statfs(argv[1], &amp;ls_tbs_fs);
  
      printf("TOTAL DISK KB : %lu\n", ls_tbs_fs.f_blocks*ls_tbs_fs.f_bsize/1024);
      printf("USED  DISK KB : %lu\n", (ls_tbs_fs.f_blocks-ls_tbs_fs.f_bavail)*ls_tbs_fs.f_bsize/1024);
      // I need filesystem here
      // I need mount point here
      return 0;
  }
  </code></pre>
  
  <p>I want to do this without linux command like df. Any advice would be appreciated.</p>