OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / statvfs.3
1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" The pathconf note is from Walter Harms
24 .\" This is not a system call on Linux
25 .\"
26 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH STATVFS 3 2003\-08\-22 Linux "Linux Programmer's Manual"
34 .SH 名前
35 statvfs, fstatvfs \- ファイルシステムの統計を取得する
36 .SH 書式
37 \fB#include <sys/statvfs.h>\fP
38 .sp
39 \fBint statvfs(const char *\fP\fIpath\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
40 .br
41 \fBint fstatvfs(int \fP\fIfd\fP\fB, struct statvfs *\fP\fIbuf\fP\fB);\fP
42 .SH 説明
43 関数 \fBstatvfs\fP()  はマウントされたファイルシステムについての情報を返す。 \fIpath\fP
44 はマウントされたファイルシステム中の任意のファイルのパス名である。 \fIbuf\fP は、だいたい以下のように定義されている \fIstatvfs\fP
45 構造体へのポインタである:
46
47 .in +4n
48 .nf
49 struct statvfs {
50     unsigned long  f_bsize;    /* ファイルシステムのブロックサイズ */
51     unsigned long  f_frsize;   /* フラグメントサイズ */
52     fsblkcnt_t     f_blocks;   /* ファイルシステムのサイズ (f_frsize 単位) */
53     fsblkcnt_t     f_bfree;    /* 解放されているブロック数 */
54     fsblkcnt_t     f_bafvail;   /* 非特権ユーザ用に解放されているブロック数 */
55     fsfilcnt_t     f_files;    /* inode 数 */
56     fsfilcnt_t     f_ffree;    /* 解放されている inode の数 */
57     fsfilcnt_t     f_favail;   /* 非特権ユーザ用に解放されている inode の数 */
58     unsigned long  f_fsid;     /* ファイルシステム ID */
59     unsigned long  f_flag;     /* マウントフラグ */
60     unsigned long  f_namemax;  /* ファイル名の長さの最大値 */
61 };
62 .fi
63 .in
64
65 ここで、型 \fIfsblkcnt_t\fP と \fIfsfilcnt_t\fP は \fI<sys/types.h>\fP で定義されている。
66 かつて、これらは共に \fIunsigned long\fP であった。
67
68 フィールド \fIf_flag\fP は (マウントフラグの) ビットマスクである (マウントフラグについては、 \fBmount\fP(8)  を参照すること)。
69 POSIX で定義されているビットは以下の通り:
70 .TP 
71 \fBST_RDONLY\fP
72 読み込み専用のファイルシステム。
73 .TP 
74 \fBST_NOSUID\fP
75 \fBexec\fP(3)  に無視される set\-user\-id/set\-group\-ID ビット。
76 .LP
77 返された構造体の全てのメンバが全てのファイルシステムで 意味のある値であるか否かは、指定されていない。
78
79 \fBfstatvfs\fP()  は、ディスクリプタ \fIfd\fP で参照されるオープンされたファイルについて、同じ情報を返す。
80 .SH 返り値
81 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
82 .SH エラー
83 .TP 
84 \fBEACCES\fP
85 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分に検索許可が与えられていない (\fBpath_resolution\fP(7)
86 も参照すること)。
87 .TP 
88 \fBEBADF\fP
89 (\fBfstatvfs\fP()  の場合)  \fIfd\fP が有効なオープンファイルディスクリプタではない。
90 .TP 
91 \fBEFAULT\fP
92 \fIbuf\fP または \fIpath\fP が無効なアドレスを指している。
93 .TP 
94 \fBEINTR\fP
95 この呼び出しがシグナルで中断された。
96 .TP 
97 \fBEIO\fP
98 ファイルシステムからの読み込みの間に I/O エラーが発生した。
99 .TP 
100 \fBELOOP\fP
101 (\fBstatvfs\fP()  の場合)  \fIpath\fP にシンボリックリンクが多すぎる。
102 .TP 
103 \fBENAMETOOLONG\fP
104 (\fBstatvfs\fP()  の場合)  \fIpath\fP が長すぎる。
105 .TP 
106 \fBENOENT\fP
107 (\fBstatvfs\fP()  の場合)  \fIpath\fP で参照されるファイルが存在しない。
108 .TP 
109 \fBENOMEM\fP
110 十分なカーネルメモリがない。
111 .TP 
112 \fBENOSYS\fP
113 ファイルシステムがこの呼び出しをサポートしていない。
114 .TP 
115 \fBENOTDIR\fP
116 (\fBstatvfs\fP()  の場合)  \fIpath\fP のディレクトリ部分がディレクトリでない。
117 .TP 
118 \fBEOVERFLOW\fP
119 いくつかの値が大き過ぎて、返り値の構造体で表現できない。
120 .SH 準拠
121 POSIX.1\-2001.
122 .SH 注意
123 Linux カーネルには、このライブラリコールをサポートするために、 \fBstatfs\fP(2), \fBfstatfs\fP(2)  システムコールがある。
124
125 現在の glibc の実装において、
126 .sp
127 .nf
128    pathconf(path, _PC_REC_XFER_ALIGN);
129    pathconf(path, _PC_ALLOC_SIZE_MIN);
130    pathconf(path, _PC_REC_MIN_XFER_SIZE);
131 .fi
132 .sp
133 は、それぞれ \fIstatvfs(path,buf)\fP の返り値の \fIf_frsize\fP, \fIf_frsize\fP, \fIf_bsize\fP
134 フィールドを使う。
135 .SH 関連項目
136 \fBstatfs\fP(2)