fsusage.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* fsusage.h -- declarations for file system space usage info
  2. Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005, 2006 Free Software
  3. Foundation, Inc.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  15. /* Space usage statistics for a file system. Blocks are 512-byte. */
  16. #if !defined FSUSAGE_H_
  17. # define FSUSAGE_H_
  18. # include <stdint.h>
  19. # include <stdbool.h>
  20. struct fs_usage
  21. {
  22. uintmax_t fsu_blocksize; /* Size of a block. */
  23. uintmax_t fsu_blocks; /* Total blocks. */
  24. uintmax_t fsu_bfree; /* Free blocks available to superuser. */
  25. uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
  26. bool fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
  27. uintmax_t fsu_files; /* Total file nodes. */
  28. uintmax_t fsu_ffree; /* Free file nodes. */
  29. };
  30. int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
  31. #endif