statvfs.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* Definition of `struct statvfs', information about a filesystem.
  2. Copyright (C) 1998-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_STATVFS_H
  16. # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.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 statvfs
  27. {
  28. unsigned long int f_bsize;
  29. unsigned long int f_frsize;
  30. #ifndef __USE_FILE_OFFSET64
  31. __fsblkcnt_t f_blocks;
  32. __fsblkcnt_t f_bfree;
  33. __fsblkcnt_t f_bavail;
  34. __fsfilcnt_t f_files;
  35. __fsfilcnt_t f_ffree;
  36. __fsfilcnt_t f_favail;
  37. #else
  38. __fsblkcnt64_t f_blocks;
  39. __fsblkcnt64_t f_bfree;
  40. __fsblkcnt64_t f_bavail;
  41. __fsfilcnt64_t f_files;
  42. __fsfilcnt64_t f_ffree;
  43. __fsfilcnt64_t f_favail;
  44. #endif
  45. __fsid_t f_fsid;
  46. unsigned long int f_flag;
  47. unsigned long int f_namemax;
  48. unsigned int f_spare[6];
  49. };
  50. #ifdef __USE_LARGEFILE64
  51. struct statvfs64
  52. {
  53. unsigned long int f_bsize;
  54. unsigned long int f_frsize;
  55. __fsblkcnt64_t f_blocks;
  56. __fsblkcnt64_t f_bfree;
  57. __fsblkcnt64_t f_bavail;
  58. __fsfilcnt64_t f_files;
  59. __fsfilcnt64_t f_ffree;
  60. __fsfilcnt64_t f_favail;
  61. __fsid_t f_fsid;
  62. unsigned long int f_flag;
  63. unsigned long int f_namemax;
  64. unsigned int f_spare[6];
  65. };
  66. #endif
  67. /* Definitions for the flag in `f_flag'. */
  68. enum
  69. {
  70. ST_RDONLY = 1,
  71. #define ST_RDONLY ST_RDONLY
  72. ST_NOSUID = 2
  73. #define ST_NOSUID ST_NOSUID
  74. };