fsusage.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* fsusage.h -- declarations for file system space usage info
  2. Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005 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 <stdbool.h>
  19. struct fs_usage
  20. {
  21. uintmax_t fsu_blocksize; /* Size of a block. */
  22. uintmax_t fsu_blocks; /* Total blocks. */
  23. uintmax_t fsu_bfree; /* Free blocks available to superuser. */
  24. uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
  25. bool fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
  26. uintmax_t fsu_files; /* Total file nodes. */
  27. uintmax_t fsu_ffree; /* Free file nodes. */
  28. };
  29. int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
  30. #endif