statvfs.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* Copyright (C) 1997, 1998 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 Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. 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. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  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> /* For __fsid_t, __fsblkcnt_t and __fsfilcnt_t. */
  19. struct statvfs
  20. {
  21. unsigned long int f_bsize;
  22. unsigned long int f_frsize;
  23. #ifndef __USE_FILE_OFFSET64
  24. __fsblkcnt_t f_blocks;
  25. __fsblkcnt_t f_bfree;
  26. __fsblkcnt_t f_bavail;
  27. __fsfilcnt_t f_files;
  28. __fsfilcnt_t f_ffree;
  29. __fsfilcnt_t f_favail;
  30. #else
  31. __fsblkcnt64_t f_blocks;
  32. __fsblkcnt64_t f_bfree;
  33. __fsblkcnt64_t f_bavail;
  34. __fsfilcnt64_t f_files;
  35. __fsfilcnt64_t f_ffree;
  36. __fsfilcnt64_t f_favail;
  37. #endif
  38. __fsid_t f_fsid;
  39. unsigned long int f_flag;
  40. unsigned long int f_namemax;
  41. int f_spare[6];
  42. };
  43. #ifdef __USE_LARGEFILE64
  44. struct statvfs64
  45. {
  46. unsigned long int f_bsize;
  47. unsigned long int f_frsize;
  48. __fsblkcnt64_t f_blocks;
  49. __fsblkcnt64_t f_bfree;
  50. __fsblkcnt64_t f_bavail;
  51. __fsfilcnt64_t f_files;
  52. __fsfilcnt64_t f_ffree;
  53. __fsfilcnt64_t f_favail;
  54. __fsid_t f_fsid;
  55. unsigned long int f_flag;
  56. unsigned long int f_namemax;
  57. int f_spare[6];
  58. };
  59. #endif
  60. /* Definitions for the flag in `f_flag'. These definitions should be
  61. kept in sync which the definitions in <sys/mount.h>. */
  62. enum
  63. {
  64. ST_RDONLY = 1, /* Mount read-only. */
  65. #define ST_RDONLY ST_RDONLY
  66. ST_NOSUID = 2, /* Ignore suid and sgid bits. */
  67. #define ST_NOSUID ST_NOSUID
  68. ST_NODEV = 4, /* Disallow access to device special files. */
  69. #define ST_NODEV ST_NODEV
  70. ST_NOEXEC = 8, /* Disallow program execution. */
  71. #define ST_NOEXEC ST_NOEXEC
  72. ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
  73. #define ST_SYNCHRONOUS ST_SYNCHRONOUS
  74. ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
  75. #define ST_MANDLOCK ST_MANDLOCK
  76. ST_WRITE = 128, /* Write on file/directory/symlink. */
  77. #define ST_WRITE ST_WRITE
  78. ST_APPEND = 256, /* Append-only file. */
  79. #define ST_APPEND ST_APPEND
  80. ST_IMMUTABLE = 512, /* Immutable file. */
  81. #define ST_IMMUTABLE ST_IMMUTABLE
  82. ST_NOATIME = 1024, /* Do not update access times. */
  83. #define ST_NOATIME ST_NOATIME
  84. ST_NODIRATIME /* Do not update directory access times. */
  85. #define ST_NODIRATIME ST_NODIRATIME
  86. };