1
0

statvfs.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* Definitions for getting information about a filesystem.
  17. Copyright (C) 1998-2026 Free Software Foundation, Inc.
  18. This file is part of the GNU C Library.
  19. The GNU C Library is free software; you can redistribute it and/or
  20. modify it under the terms of the GNU Lesser General Public
  21. License as published by the Free Software Foundation; either
  22. version 2.1 of the License, or (at your option) any later version.
  23. The GNU C Library is distributed in the hope that it will be useful,
  24. but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. Lesser General Public License for more details.
  27. You should have received a copy of the GNU Lesser General Public
  28. License along with the GNU C Library; if not, see
  29. <https://www.gnu.org/licenses/>. */
  30. #ifndef _SYS_STATVFS_H
  31. #define _SYS_STATVFS_H 1
  32. #include <features.h>
  33. /* Get the system-specific definition of `struct statvfs'. */
  34. #include <bits/statvfs.h>
  35. #ifndef __USE_FILE_OFFSET64
  36. # ifndef __fsblkcnt_t_defined
  37. typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
  38. # define __fsblkcnt_t_defined
  39. # endif
  40. # ifndef __fsfilcnt_t_defined
  41. typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
  42. # define __fsfilcnt_t_defined
  43. # endif
  44. #else
  45. # ifndef __fsblkcnt_t_defined
  46. typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
  47. # define __fsblkcnt_t_defined
  48. # endif
  49. # ifndef __fsfilcnt_t_defined
  50. typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
  51. # define __fsfilcnt_t_defined
  52. # endif
  53. #endif
  54. __BEGIN_DECLS
  55. /* Return information about the filesystem on which FILE resides. */
  56. #ifndef __USE_FILE_OFFSET64
  57. extern int statvfs (const char *__restrict __file,
  58. struct statvfs *__restrict __buf)
  59. __THROW __nonnull ((1, 2));
  60. #else
  61. # ifdef __REDIRECT_NTH
  62. extern int __REDIRECT_NTH (statvfs,
  63. (const char *__restrict __file,
  64. struct statvfs *__restrict __buf), statvfs64)
  65. __nonnull ((1, 2));
  66. # else
  67. # define statvfs statvfs64
  68. # endif
  69. #endif
  70. #ifdef __USE_LARGEFILE64
  71. extern int statvfs64 (const char *__restrict __file,
  72. struct statvfs64 *__restrict __buf)
  73. __THROW __nonnull ((1, 2));
  74. #endif
  75. /* Return information about the filesystem containing the file FILDES
  76. refers to. */
  77. #ifndef __USE_FILE_OFFSET64
  78. extern int fstatvfs (int __fildes, struct statvfs *__buf)
  79. __THROW __nonnull ((2));
  80. #else
  81. # ifdef __REDIRECT_NTH
  82. extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
  83. fstatvfs64) __nonnull ((2));
  84. # else
  85. # define fstatvfs fstatvfs64
  86. # endif
  87. #endif
  88. #ifdef __USE_LARGEFILE64
  89. extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
  90. __THROW __nonnull ((2));
  91. #endif
  92. __END_DECLS
  93. #endif /* sys/statvfs.h */