OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / 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 \- ファイルシステムの統計を取得する
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 関数 \fBstatvfs\fP()  はマウントされたファイルシステムについての情報を返す。 \fIpath\fP
53 はマウントされたファイルシステム中の任意のファイルのパス名である。 \fIbuf\fP は、だいたい以下のように定義されている \fIstatvfs\fP
54 構造体へのポインタである:
55
56 .in +4n
57 .nf
58 struct statvfs {
59     unsigned long  f_bsize;    /* ファイルシステムのブロックサイズ */
60     unsigned long  f_frsize;   /* フラグメントサイズ */
61     fsblkcnt_t     f_blocks;   /* ファイルシステムのサイズ (f_frsize 単位) */
62     fsblkcnt_t     f_bfree;    /* 解放されているブロック数 */
63     fsblkcnt_t     f_bafvail;   /* 非特権ユーザ用に解放されているブロック数 */
64     fsfilcnt_t     f_files;    /* inode 数 */
65     fsfilcnt_t     f_ffree;    /* 解放されている inode の数 */
66     fsfilcnt_t     f_favail;   /* 非特権ユーザ用に解放されている inode の数 */
67     unsigned long  f_fsid;     /* ファイルシステム ID */
68     unsigned long  f_flag;     /* マウントフラグ */
69     unsigned long  f_namemax;  /* ファイル名の長さの最大値 */
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 読み込み専用のファイルシステム。
82 .TP 
83 \fBST_NOSUID\fP
84 \fBexec\fP(3)  に無視される set\-user\-id/set\-group\-ID ビット。
85 .LP
86 返された構造体の全てのメンバが全てのファイルシステムで 意味のある値であるか否かは、指定されていない。
87
88 \fBfstatvfs\fP()  は、ディスクリプタ \fIfd\fP で参照されるオープンされたファイルについて、同じ情報を返す。
89 .SH 返り値
90 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
91 .SH エラー
92 .TP 
93 \fBEACCES\fP
94 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分に検索許可が与えられていない (\fBpath_resolution\fP(7)
95 も参照すること)。
96 .TP 
97 \fBEBADF\fP
98 (\fBfstatvfs\fP()  の場合)  \fIfd\fP が有効なオープンファイルディスクリプタではない。
99 .TP 
100 \fBEFAULT\fP
101 \fIbuf\fP または \fIpath\fP が無効なアドレスを指している。
102 .TP 
103 \fBEINTR\fP
104 この呼び出しがシグナルで中断された。
105 .TP 
106 \fBEIO\fP
107 ファイルシステムからの読み込みの間に I/O エラーが発生した。
108 .TP 
109 \fBELOOP\fP
110 (\fBstatvfs\fP()  の場合)  \fIpath\fP にシンボリックリンクが多すぎる。
111 .TP 
112 \fBENAMETOOLONG\fP
113 (\fBstatvfs\fP()  の場合)  \fIpath\fP が長すぎる。
114 .TP 
115 \fBENOENT\fP
116 (\fBstatvfs\fP()  の場合)  \fIpath\fP で参照されるファイルが存在しない。
117 .TP 
118 \fBENOMEM\fP
119 十分なカーネルメモリがない。
120 .TP 
121 \fBENOSYS\fP
122 ファイルシステムがこの呼び出しをサポートしていない。
123 .TP 
124 \fBENOTDIR\fP
125 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分がディレクトリでない。
126 .TP 
127 \fBEOVERFLOW\fP
128 いくつかの値が大き過ぎて、返り値の構造体で表現できない。
129 .SH 準拠
130 POSIX.1\-2001.
131 .SH 注意
132 Linux カーネルには、このライブラリコールをサポートするために、 \fBstatfs\fP(2), \fBfstatfs\fP(2)  システムコールがある。
133
134 現在の glibc の実装において、
135 .sp
136 .nf
137    pathconf(path, _PC_REC_XFER_ALIGN);
138    pathconf(path, _PC_ALLOC_SIZE_MIN);
139    pathconf(path, _PC_REC_MIN_XFER_SIZE);
140 .fi
141 .sp
142 は、それぞれ \fIstatvfs(path,buf)\fP の返り値の \fIf_frsize\fP, \fIf_frsize\fP, \fIf_bsize\fP
143 フィールドを使う。
144 .SH 関連項目
145 \fBstatfs\fP(2)
146 .SH この文書について
147 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
148 である。プロジェクトの説明とバグ報告に関する情報は
149 http://www.kernel.org/doc/man\-pages/ に書かれている。