statvfs.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* Copyright (C) 1997-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_STATVFS_H
  15. # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
  16. #endif
  17. #include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
  18. #if (__WORDSIZE == 32 \
  19. && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
  20. #define _STATVFSBUF_F_UNUSED
  21. #endif
  22. struct statvfs
  23. {
  24. unsigned long int f_bsize;
  25. unsigned long int f_frsize;
  26. #ifndef __USE_FILE_OFFSET64
  27. __fsblkcnt_t f_blocks;
  28. __fsblkcnt_t f_bfree;
  29. __fsblkcnt_t f_bavail;
  30. __fsfilcnt_t f_files;
  31. __fsfilcnt_t f_ffree;
  32. __fsfilcnt_t f_favail;
  33. #else
  34. __fsblkcnt64_t f_blocks;
  35. __fsblkcnt64_t f_bfree;
  36. __fsblkcnt64_t f_bavail;
  37. __fsfilcnt64_t f_files;
  38. __fsfilcnt64_t f_ffree;
  39. __fsfilcnt64_t f_favail;
  40. #endif
  41. unsigned long int f_fsid;
  42. #ifdef _STATVFSBUF_F_UNUSED
  43. int __f_unused;
  44. #endif
  45. unsigned long int f_flag;
  46. unsigned long int f_namemax;
  47. unsigned int f_type;
  48. int __f_spare[5];
  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. unsigned long int f_fsid;
  62. #ifdef _STATVFSBUF_F_UNUSED
  63. int __f_unused;
  64. #endif
  65. unsigned long int f_flag;
  66. unsigned long int f_namemax;
  67. unsigned int f_type;
  68. int __f_spare[5];
  69. };
  70. #endif
  71. /* Definitions for the flag in `f_flag'. These definitions should be
  72. kept in sync with the definitions in <sys/mount.h>. */
  73. enum
  74. {
  75. ST_RDONLY = 1, /* Mount read-only. */
  76. #define ST_RDONLY ST_RDONLY
  77. ST_NOSUID = 2 /* Ignore suid and sgid bits. */
  78. #define ST_NOSUID ST_NOSUID
  79. #ifdef __USE_GNU
  80. ,
  81. ST_NODEV = 4, /* Disallow access to device special files. */
  82. # define ST_NODEV ST_NODEV
  83. ST_NOEXEC = 8, /* Disallow program execution. */
  84. # define ST_NOEXEC ST_NOEXEC
  85. ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
  86. # define ST_SYNCHRONOUS ST_SYNCHRONOUS
  87. ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
  88. # define ST_MANDLOCK ST_MANDLOCK
  89. ST_WRITE = 128, /* Write on file/directory/symlink. */
  90. # define ST_WRITE ST_WRITE
  91. ST_APPEND = 256, /* Append-only file. */
  92. # define ST_APPEND ST_APPEND
  93. ST_IMMUTABLE = 512, /* Immutable file. */
  94. # define ST_IMMUTABLE ST_IMMUTABLE
  95. ST_NOATIME = 1024, /* Do not update access times. */
  96. # define ST_NOATIME ST_NOATIME
  97. ST_NODIRATIME = 2048, /* Do not update directory access times. */
  98. # define ST_NODIRATIME ST_NODIRATIME
  99. ST_RELATIME = 4096, /* Update atime relative to mtime/ctime. */
  100. # define ST_RELATIME ST_RELATIME
  101. ST_NOSYMFOLLOW = 8192 /* Do not follow symlinks. */
  102. # define ST_NOSYMFOLLOW ST_NOSYMFOLLOW
  103. #endif /* Use GNU. */
  104. };