statfs.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Definition of `struct statfs', information about a filesystem.
  2. Copyright (C) 1996-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library 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 GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_STATFS_H
  16. # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
  17. #endif
  18. #include <bits/types.h>
  19. /* GNU Hurd NOTE: The size of this structure (16 ints) is known in
  20. <hurd/hurd_types.defs>, since it is used in the `file_statfs' RPC. MiG
  21. does not cope at all well with the passed C structure not being of the
  22. expected size. There are some filler words at the end to allow for
  23. future expansion. To increase the size of the structure used in the RPC
  24. and retain binary compatibility, we would need to assign a new message
  25. number. */
  26. struct statfs
  27. {
  28. unsigned int f_type;
  29. unsigned int f_bsize;
  30. #ifndef __USE_FILE_OFFSET64
  31. __fsblkcnt_t f_blocks;
  32. __fsblkcnt_t f_bfree;
  33. __fsblkcnt_t f_bavail;
  34. __fsblkcnt_t f_files;
  35. __fsblkcnt_t f_ffree;
  36. #else
  37. __fsblkcnt64_t f_blocks;
  38. __fsblkcnt64_t f_bfree;
  39. __fsblkcnt64_t f_bavail;
  40. __fsblkcnt64_t f_files;
  41. __fsblkcnt64_t f_ffree;
  42. #endif
  43. __fsid_t f_fsid;
  44. unsigned int f_namelen;
  45. unsigned int f_spare[6];
  46. };
  47. #ifdef __USE_LARGEFILE64
  48. struct statfs64
  49. {
  50. unsigned int f_type;
  51. unsigned int f_bsize;
  52. __fsblkcnt64_t f_blocks;
  53. __fsblkcnt64_t f_bfree;
  54. __fsblkcnt64_t f_bavail;
  55. __fsblkcnt64_t f_files;
  56. __fsblkcnt64_t f_ffree;
  57. __fsid_t f_fsid;
  58. unsigned int f_namelen;
  59. unsigned int f_spare[6];
  60. };
  61. #endif