OSDN Git Service

(split) LDP: Update release pages based on LDP 3.54 release
[linuxjm/LDP_man-pages.git] / release / man3 / statvfs.3
1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
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.
7 .\"
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.
12 .\"
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
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" The pathconf note is from Walter Harms
26 .\" This is not a system call on Linux
27 .\"
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .\"
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
41 .\"
42 .TH STATVFS 3 2003\-08\-22 Linux "Linux Programmer's Manual"
43 .SH 名前
44 statvfs, fstatvfs \- get filesystem statistics
45 .SH 書式
46 \fB#include <sys/statvfs.h>\fP
47 .sp
48 \fBint statvfs(const char *\fP\fIpath\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
49 .br
50 \fBint fstatvfs(int \fP\fIfd\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
51 .SH 説明
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:
55
56 .in +4n
57 .nf
58 struct statvfs {
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 */
70 };
71 .fi
72 .in
73
74 ここで、型 \fIfsblkcnt_t\fP と \fIfsfilcnt_t\fP は \fI<sys/types.h>\fP で定義されている。
75 かつて、これらは共に \fIunsigned long\fP であった。
76
77 フィールド \fIf_flag\fP は (マウントフラグの) ビットマスクである (マウントフラグについては、 \fBmount\fP(8)  を参照すること)。
78 POSIX で定義されているビットは以下の通り:
79 .TP 
80 \fBST_RDONLY\fP
81 Read\-only filesystem.
82 .TP 
83 \fBST_NOSUID\fP
84 \fBexec\fP(3)  に無視される set\-user\-id/set\-group\-ID ビット。
85 .LP
86 It is unspecified whether all members of the returned struct have meaningful
87 values on all filesystems.
88
89 \fBfstatvfs\fP()  は、ディスクリプタ \fIfd\fP で参照されるオープンされたファイルについて、同じ情報を返す。
90 .SH 返り値
91 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
92 .SH エラー
93 .TP 
94 \fBEACCES\fP
95 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分に検索許可が与えられていない (\fBpath_resolution\fP(7)
96 も参照すること)。
97 .TP 
98 \fBEBADF\fP
99 (\fBfstatvfs\fP()  の場合)  \fIfd\fP が有効なオープンファイルディスクリプタではない。
100 .TP 
101 \fBEFAULT\fP
102 \fIbuf\fP または \fIpath\fP が無効なアドレスを指している。
103 .TP 
104 \fBEINTR\fP
105 この呼び出しがシグナルで中断された。
106 .TP 
107 \fBEIO\fP
108 An I/O error occurred while reading from the filesystem.
109 .TP 
110 \fBELOOP\fP
111 (\fBstatvfs\fP()  の場合)  \fIpath\fP にシンボリックリンクが多すぎる。
112 .TP 
113 \fBENAMETOOLONG\fP
114 (\fBstatvfs\fP()  の場合)  \fIpath\fP が長すぎる。
115 .TP 
116 \fBENOENT\fP
117 (\fBstatvfs\fP()  の場合)  \fIpath\fP で参照されるファイルが存在しない。
118 .TP 
119 \fBENOMEM\fP
120 十分なカーネルメモリがない。
121 .TP 
122 \fBENOSYS\fP
123 The filesystem does not support this call.
124 .TP 
125 \fBENOTDIR\fP
126 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分がディレクトリでない。
127 .TP 
128 \fBEOVERFLOW\fP
129 いくつかの値が大き過ぎて、返り値の構造体で表現できない。
130 .SH 準拠
131 POSIX.1\-2001.
132 .SH 注意
133 Linux カーネルには、このライブラリコールをサポートするために、 \fBstatfs\fP(2), \fBfstatfs\fP(2)  システムコールがある。
134
135 現在の glibc の実装において、
136 .sp
137 .nf
138    pathconf(path, _PC_REC_XFER_ALIGN);
139    pathconf(path, _PC_ALLOC_SIZE_MIN);
140    pathconf(path, _PC_REC_MIN_XFER_SIZE);
141 .fi
142 .sp
143 は、それぞれ \fIstatvfs(path,buf)\fP の返り値の \fIf_frsize\fP, \fIf_frsize\fP, \fIf_bsize\fP
144 フィールドを使う。
145 .SH 関連項目
146 \fBstatfs\fP(2)
147 .SH この文書について
148 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
149 である。プロジェクトの説明とバグ報告に関する情報は
150 http://www.kernel.org/doc/man\-pages/ に書かれている。