logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fstatvfs.3p (5503B)


  1. '\" et
  2. .TH FSTATVFS "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. fstatvfs,
  12. statvfs
  13. \(em get file system information
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <sys/statvfs.h>
  18. .P
  19. int fstatvfs(int \fIfildes\fP, struct statvfs *\fIbuf\fP);
  20. int statvfs(const char *restrict \fIpath\fP, struct statvfs *restrict \fIbuf\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. The
  24. \fIfstatvfs\fR()
  25. function shall obtain information about the file system containing
  26. the file referenced by
  27. .IR fildes .
  28. .P
  29. The
  30. \fIstatvfs\fR()
  31. function shall obtain information about the file system
  32. containing the file named by
  33. .IR path .
  34. .P
  35. For both functions, the
  36. .IR buf
  37. argument is a pointer to a
  38. .BR statvfs
  39. structure that shall be filled. Read, write, or execute permission of
  40. the named file is not required.
  41. .P
  42. The following flags can be returned in the
  43. .IR f_flag
  44. member:
  45. .IP ST_RDONLY 12
  46. Read-only file system.
  47. .IP ST_NOSUID 12
  48. Setuid/setgid bits ignored by
  49. .IR exec .
  50. .P
  51. It is unspecified whether all members of the
  52. .BR statvfs
  53. structure have meaningful values on all file systems.
  54. .SH "RETURN VALUE"
  55. Upon successful completion,
  56. \fIstatvfs\fR()
  57. shall return 0. Otherwise, it shall return \-1 and set
  58. .IR errno
  59. to indicate the error.
  60. .SH ERRORS
  61. The
  62. \fIfstatvfs\fR()
  63. and
  64. \fIstatvfs\fR()
  65. functions shall fail if:
  66. .TP
  67. .BR EIO
  68. An I/O error occurred while reading the file system.
  69. .TP
  70. .BR EINTR
  71. A signal was caught during execution of the function.
  72. .TP
  73. .BR EOVERFLOW
  74. One of the values to be returned cannot be represented correctly in
  75. the structure pointed to by
  76. .IR buf .
  77. .P
  78. The
  79. \fIfstatvfs\fR()
  80. function shall fail if:
  81. .TP
  82. .BR EBADF
  83. The
  84. .IR fildes
  85. argument is not an open file descriptor.
  86. .P
  87. The
  88. \fIstatvfs\fR()
  89. function shall fail if:
  90. .TP
  91. .BR EACCES
  92. Search permission is denied on a component of the path prefix.
  93. .TP
  94. .BR ELOOP
  95. A loop exists in symbolic links encountered during resolution of the
  96. .IR path
  97. argument.
  98. .TP
  99. .BR ENAMETOOLONG
  100. .br
  101. The length of a component of a pathname is longer than
  102. {NAME_MAX}.
  103. .TP
  104. .BR ENOENT
  105. A component of
  106. .IR path
  107. does not name an existing file or
  108. .IR path
  109. is an empty string.
  110. .TP
  111. .BR ENOTDIR
  112. A component of the path prefix names an existing file that is neither
  113. a directory nor a symbolic link to a directory, or the
  114. .IR path
  115. argument contains at least one non-\c
  116. <slash>
  117. character and ends with one or more trailing
  118. <slash>
  119. characters and the last pathname component names an existing file
  120. that is neither a directory nor a symbolic link to a directory.
  121. .br
  122. .P
  123. The
  124. \fIstatvfs\fR()
  125. function may fail if:
  126. .TP
  127. .BR ELOOP
  128. More than
  129. {SYMLOOP_MAX}
  130. symbolic links were encountered during resolution of the
  131. .IR path
  132. argument.
  133. .TP
  134. .BR ENAMETOOLONG
  135. .br
  136. The length of a pathname exceeds
  137. {PATH_MAX},
  138. or pathname resolution of a symbolic link produced an intermediate
  139. result with a length that exceeds
  140. {PATH_MAX}.
  141. .LP
  142. .IR "The following sections are informative."
  143. .SH EXAMPLES
  144. .SS "Obtaining File System Information Using fstatvfs(\|)"
  145. .P
  146. The following example shows how to obtain file system information for
  147. the file system upon which the file named
  148. .BR /home/cnd/mod1
  149. resides, using the
  150. \fIfstatvfs\fR()
  151. function. The
  152. .BR /home/cnd/mod1
  153. file is opened with read/write privileges and the open file descriptor
  154. is passed to the
  155. \fIfstatvfs\fR()
  156. function.
  157. .sp
  158. .RS 4
  159. .nf
  160. #include <sys/statvfs.h>
  161. #include <fcntl.h>
  162. .P
  163. struct statvfs buffer;
  164. int status;
  165. \&...
  166. fildes = open("/home/cnd/mod1", O_RDWR);
  167. status = fstatvfs(fildes, &buffer);
  168. .fi
  169. .P
  170. .RE
  171. .SS "Obtaining File System Information Using statvfs(\|)"
  172. .P
  173. The following example shows how to obtain file system information for
  174. the file system upon which the file named
  175. .BR /home/cnd/mod1
  176. resides, using the
  177. \fIstatvfs\fR()
  178. function.
  179. .sp
  180. .RS 4
  181. .nf
  182. #include <sys/statvfs.h>
  183. .P
  184. struct statvfs buffer;
  185. int status;
  186. \&...
  187. status = statvfs("/home/cnd/mod1", &buffer);
  188. .fi
  189. .P
  190. .RE
  191. .SH "APPLICATION USAGE"
  192. None.
  193. .SH RATIONALE
  194. None.
  195. .SH "FUTURE DIRECTIONS"
  196. None.
  197. .SH "SEE ALSO"
  198. .IR "\fIchmod\fR\^(\|)",
  199. .IR "\fIchown\fR\^(\|)",
  200. .IR "\fIcreat\fR\^(\|)",
  201. .IR "\fIdup\fR\^(\|)",
  202. .IR "\fIexec\fR\^",
  203. .IR "\fIfcntl\fR\^(\|)",
  204. .IR "\fIlink\fR\^(\|)",
  205. .IR "\fImknod\fR\^(\|)",
  206. .IR "\fIopen\fR\^(\|)",
  207. .IR "\fIpipe\fR\^(\|)",
  208. .IR "\fIread\fR\^(\|)",
  209. .IR "\fItime\fR\^(\|)",
  210. .IR "\fIunlink\fR\^(\|)",
  211. .IR "\fIutime\fR\^(\|)",
  212. .IR "\fIwrite\fR\^(\|)"
  213. .P
  214. The Base Definitions volume of POSIX.1\(hy2017,
  215. .IR "\fB<sys_statvfs.h>\fP"
  216. .\"
  217. .SH COPYRIGHT
  218. Portions of this text are reprinted and reproduced in electronic form
  219. from IEEE Std 1003.1-2017, Standard for Information Technology
  220. -- Portable Operating System Interface (POSIX), The Open Group Base
  221. Specifications Issue 7, 2018 Edition,
  222. Copyright (C) 2018 by the Institute of
  223. Electrical and Electronics Engineers, Inc and The Open Group.
  224. In the event of any discrepancy between this version and the original IEEE and
  225. The Open Group Standard, the original IEEE and The Open Group Standard
  226. is the referee document. The original Standard can be obtained online at
  227. http://www.opengroup.org/unix/online.html .
  228. .PP
  229. Any typographical or formatting errors that appear
  230. in this page are most likely
  231. to have been introduced during the conversion of the source files to
  232. man page format. To report such errors, see
  233. https://www.kernel.org/doc/man-pages/reporting_bugs.html .