1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" The pathconf note is from Walter Harms
26 .\" This is not a system call on Linux
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
30 .\"*******************************************************************
32 .\" This file was generated with po4a. Translate the source file.
34 .\"*******************************************************************
36 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
37 .\" all rights reserved.
38 .\" Translated Tue Jun 29 23:36:41 JST 2004
39 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
40 .\" Updated & Modified Sun Jan 9 22:50:29 JST 2005 by Yuichi SATO
42 .TH STATVFS 3 2003\-08\-22 Linux "Linux Programmer's Manual"
44 statvfs, fstatvfs \- get filesystem statistics
46 \fB#include <sys/statvfs.h>\fP
48 \fBint statvfs(const char *\fP\fIpath\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
50 \fBint fstatvfs(int \fP\fIfd\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
52 The function \fBstatvfs\fP() returns information about a mounted filesystem.
53 \fIpath\fP is the pathname of any file within the mounted filesystem. \fIbuf\fP
54 is a pointer to a \fIstatvfs\fP structure defined approximately as follows:
59 unsigned long f_bsize; /* filesystem block size */
60 unsigned long f_frsize; /* fragment size */
61 fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
62 fsblkcnt_t f_bfree; /* # free blocks */
63 fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */
64 fsfilcnt_t f_files; /* # inodes */
65 fsfilcnt_t f_ffree; /* # free inodes */
66 fsfilcnt_t f_favail; /* # free inodes for unprivileged users */
67 unsigned long f_fsid; /* filesystem ID */
68 unsigned long f_flag; /* mount flags */
69 unsigned long f_namemax; /* maximum filename length */
74 ここで、型 \fIfsblkcnt_t\fP と \fIfsfilcnt_t\fP は \fI<sys/types.h>\fP で定義されている。
75 かつて、これらは共に \fIunsigned long\fP であった。
77 フィールド \fIf_flag\fP は (マウントフラグの) ビットマスクである (マウントフラグについては、 \fBmount\fP(8) を参照すること)。
78 POSIX で定義されているビットは以下の通り:
81 Read\-only filesystem.
84 \fBexec\fP(3) に無視される set\-user\-id/set\-group\-ID ビット。
86 It is unspecified whether all members of the returned struct have meaningful
87 values on all filesystems.
89 \fBfstatvfs\fP() は、ディスクリプタ \fIfd\fP で参照されるオープンされたファイルについて、同じ情報を返す。
91 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
95 (\fBstatvfs\fP() の場合) \fIpath\fP のディレクトリ部分に検索許可が与えられていない (\fBpath_resolution\fP(7)
99 (\fBfstatvfs\fP() の場合) \fIfd\fP が有効なオープンファイルディスクリプタではない。
102 \fIbuf\fP または \fIpath\fP が無効なアドレスを指している。
108 An I/O error occurred while reading from the filesystem.
111 (\fBstatvfs\fP() の場合) \fIpath\fP にシンボリックリンクが多すぎる。
114 (\fBstatvfs\fP() の場合) \fIpath\fP が長すぎる。
117 (\fBstatvfs\fP() の場合) \fIpath\fP で参照されるファイルが存在しない。
123 The filesystem does not support this call.
126 (\fBstatvfs\fP() の場合) \fIpath\fP のディレクトリ部分がディレクトリでない。
129 いくつかの値が大き過ぎて、返り値の構造体で表現できない。
133 Linux カーネルには、このライブラリコールをサポートするために、 \fBstatfs\fP(2), \fBfstatfs\fP(2) システムコールがある。
138 pathconf(path, _PC_REC_XFER_ALIGN);
139 pathconf(path, _PC_ALLOC_SIZE_MIN);
140 pathconf(path, _PC_REC_MIN_XFER_SIZE);
143 は、それぞれ \fIstatvfs(path,buf)\fP の返り値の \fIf_frsize\fP, \fIf_frsize\fP, \fIf_bsize\fP
148 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
149 である。プロジェクトの説明とバグ報告に関する情報は
150 http://www.kernel.org/doc/man\-pages/ に書かれている。