.\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" The pathconf note is from Walter Harms .\" This is not a system call on Linux .\" .\" Modified 2004-06-23 by Michael Kerrisk .\" .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO .\" all rights reserved. .\" Translated Tue Jun 29 23:36:41 JST 2004 .\" by Yuichi SATO .\" Updated & Modified Sun Jan 9 22:50:29 JST 2005 by Yuichi SATO .\" .TH STATVFS 3 2003-08-22 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O statvfs, fstatvfs \- get file system statistics statvfs, fstatvfs \- ファイルシステムの統計を取得する .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .BI "int statvfs(const char *" path ", struct statvfs *" buf ); .br .BI "int fstatvfs(int " fd ", struct statvfs *" buf ); .\"O .SH DESCRIPTION .SH 説明 .\"O The function .\"O .BR statvfs () .\"O returns information about a mounted file system. 関数 .BR statvfs () はマウントされたファイルシステムについての情報を返す。 .\"O .I path .\"O is the pathname of any file within the mounted file system. .I path はマウントされたファイルシステム中の任意のファイルのパス名である。 .\"O .I buf .\"O is a pointer to a .\"O .I statvfs .\"O structure defined approximately as follows: .I buf は、だいたい以下のように定義されている .I statvfs 構造体へのポインタである: .in +4n .nf struct statvfs { .\"O unsigned long f_bsize; /* file system block size */ .\"O unsigned long f_frsize; /* fragment size */ .\"O fsblkcnt_t f_blocks; /* size of fs in f_frsize units */ .\"O fsblkcnt_t f_bfree; /* # free blocks */ .\"O fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */ .\"O fsfilcnt_t f_files; /* # inodes */ .\"O fsfilcnt_t f_ffree; /* # free inodes */ .\"O fsfilcnt_t f_favail; /* # free inodes for unprivileged users */ .\"O unsigned long f_fsid; /* file system ID */ .\"O unsigned long f_flag; /* mount flags */ .\"O unsigned long f_namemax; /* maximum filename length */ unsigned long f_bsize; /* ファイルシステムのブロックサイズ */ unsigned long f_frsize; /* フラグメントサイズ */ fsblkcnt_t f_blocks; /* ファイルシステムのサイズ (f_frsize 単位) */ fsblkcnt_t f_bfree; /* 解放されているブロック数 */ fsblkcnt_t f_bafvail; /* 非特権ユーザ用に解放されているブロック数 */ fsfilcnt_t f_files; /* inode 数 */ fsfilcnt_t f_ffree; /* 解放されている inode の数 */ fsfilcnt_t f_favail; /* 非特権ユーザ用に解放されている inode の数 */ unsigned long f_fsid; /* ファイルシステム ID */ unsigned long f_flag; /* マウントフラグ */ unsigned long f_namemax; /* ファイル名の長さの最大値 */ }; .fi .in .\"O Here the types .\"O .I fsblkcnt_t .\"O and .\"O .I fsfilcnt_t .\"O are defined in .\"O .IR . ここで、型 .I fsblkcnt_t と .I fsfilcnt_t は .I で定義されている。 .\"O Both used to be .\"O .IR "unsigned long" . かつて、これらは共に .I "unsigned long" であった。 .\"O The field .\"O .I f_flag .\"O is a bit mask (of mount flags, see .\"O .BR mount (8)). フィールド .I f_flag は (マウントフラグの) ビットマスクである (マウントフラグについては、 .BR mount (8) を参照すること)。 .\"O Bits defined by POSIX are POSIX で定義されているビットは以下の通り: .TP .B ST_RDONLY .\"O Read-only file system. 読み込み専用のファイルシステム。 .TP .B ST_NOSUID .\"O Set-user-id/set-group-ID bits are ignored by .\"O .BR exec (3). .BR exec (3) に無視される set-user-id/set-group-ID ビット。 .LP .\"O It is unspecified whether all members of the returned struct .\"O have meaningful values on all file systems. 返された構造体の全てのメンバが全てのファイルシステムで 意味のある値であるか否かは、指定されていない。 .\"O .BR fstatvfs () .\"O returns the same information about an open file referenced by descriptor .\"O .IR fd . .BR fstatvfs () は、ディスクリプタ .I fd で参照されるオープンされたファイルについて、同じ情報を返す。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned, and .\"O .I errno .\"O is set appropriately. 成功した場合、0 が返される。 エラーの場合、\-1 が返されて、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EACCES .\"O .RB ( statvfs ()) .\"O Search permission is denied for a component of the path prefix of .\"O .IR path . .\"O (See also .\"O .BR path_resolution (7).) .RB ( statvfs () の場合) .I path のディレクトリ部分に検索許可が与えられていない .RB ( path_resolution (7) も参照すること)。 .TP .B EBADF .\"O .RB ( fstatvfs ()) .\"O .I fd .\"O is not a valid open file descriptor. .RB ( fstatvfs () の場合) .I fd が有効なオープンファイルディスクリプタではない。 .TP .B EFAULT .\"O .I Buf .\"O or .\"O .I path .\"O points to an invalid address. .I buf または .I path が無効なアドレスを指している。 .TP .B EINTR .\"O This call was interrupted by a signal. この呼び出しがシグナルによって中断された。 .TP .B EIO .\"O An I/O error occurred while reading from the file system. ファイルシステムから読み出している間に I/O エラーが発生した。 .TP .B ELOOP .\"O .RB ( statvfs ()) .\"O Too many symbolic links were encountered in translating .\"O .IR path . .RB ( statvfs () の場合) .I path にシンボリックリンクが多すぎる。 .TP .B ENAMETOOLONG .\"O .RB ( statvfs ()) .\"O .I path .\"O is too long. .RB ( statvfs () の場合) .I path が長すぎる。 .TP .B ENOENT .\"O .RB ( statvfs ()) .\"O The file referred to by .\"O .I path .\"O does not exist. .RB ( statvfs () の場合) .I path で参照されるファイルが存在しない。 .TP .B ENOMEM .\"O Insufficient kernel memory was available. 十分なカーネルメモリが使用できない。 .TP .B ENOSYS .\"O The file system does not support this call. ファイルシステムがこの呼び出しをサポートしていない。 .TP .B ENOTDIR .\"O .RB ( statvfs ()) .\"O A component of the path prefix of .\"O .I path .\"O is not a directory. .RB ( statvfs () の場合) .I path のディレクトリ部分がディレクトリでない。 .TP .B EOVERFLOW .\"O Some values were too large to be represented in the returned struct. いくつかの値は、返される構造体で表現するには大きすぎる。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O The Linux kernel has system calls .\"O .BR statfs (2) .\"O and .\"O .BR fstatfs (2) .\"O to support this library call. Linux カーネルには、このライブラリコールをサポートするために、 .BR statfs (2), .BR fstatfs (2) システムコールがある。 .\"O The current glibc implementations of 現在の glibc の実装において、 .sp .nf pathconf(path, _PC_REC_XFER_ALIGN); pathconf(path, _PC_ALLOC_SIZE_MIN); pathconf(path, _PC_REC_MIN_XFER_SIZE); .fi .sp .\"O respectively use the .\"O .IR f_frsize , .\"O .IR f_frsize , .\"O and .\"O .I f_bsize .\"O fields of the return value of .\"O .IR "statvfs(path,buf)" . は、それぞれ .I "statvfs(path,buf)" の返り値の .IR f_frsize , .IR f_frsize , .I f_bsize フィールドを使う。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR statfs (2)