ustatのヘルプ・マニュアル
日本語 英語
ustat --help
man ustat
USTAT(2) Linux Programmer’s Manual USTAT(2)
名前
ustat - ファイル・システム (file system) の統計を得る
書式
#include
#include /* libc[45] */
#include /* glibc2 */
int ustat(dev_t dev, struct ustat *ubuf);
説明
ustat() はマウント (mount) されたファイル・システムの情報を返す。 dev
は調べるファイル・システムを含んでいるデバイス (device) のデバイス番 号
。 ubuf は以下のメンバーを含む ustat 構造体へのポインター:
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free inodes */
char f_fname[6]; /* Filsys name */
char f_fpack[6]; /* Filsys pack name */
後 の 二つのフィールド f_fname と f_fpack は実装されておらず、常に NULL
バイト ('\0') で埋められる。
返り値
成功した場合にはゼロが返され、 ubuf が指す ustat 構造体が埋められる。エ
ラーの場合は -1 が返され、 errno が適切に設定される。
エラー
EFAULT ubuf がアクセス可能な空間の外側を指している。
EINVAL dev がマウントされたファイル・システムを含むデバイスを参照してい
ない。
ENOSYS dev で参照されるマウントされたファイル・システ ム が こ の 操 作
(operation) をサポートしていないか、Linux のバージョンが 1.3.16
以前である。
準拠
SVr4.
注意
ustat() は推奨されず、互換性のためだけに提供される。新しいプログラム は
全てこれの代りに statfs(2) を使用するべきである。
HP-UX における注意
HP-UX 版の構造体 ustat には、その他にフィールド f_blksize が存在するが
、他では見かけない。 HP-UX は次のように警告している: ファイルシステムの
中には、解放されている inode の数を変更しないものもある。このようなファ
イルシステムは、フィールド f_tinode に -1 を返す。ファイルシステムの 中
に は、inode を動的に確保するものもある。このようなファイルシステムは、
現在解放されている inode の数を返す。
関連項目
stat(2), statfs(2)
Linux 2003-08-04 USTAT(2)
USTAT(2) Linux Programmer’s Manual USTAT(2)
NAME
ustat - get file system statistics
SYNOPSIS
#include
#include /* libc[45] */
#include /* glibc2 */
int ustat(dev_t dev, struct ustat *ubuf);
DESCRIPTION
ustat() returns information about a mounted file system. dev is a
device number identifying a device containing a mounted file system.
ubuf is a pointer to a ustat structure that contains the following mem-
bers:
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free inodes */
char f_fname[6]; /* Filsys name */
char f_fpack[6]; /* Filsys pack name */
The last two fields, f_fname and f_fpack, are not implemented and will
always be filled with null bytes ('\0').
RETURN VALUE
On success, zero is returned and the ustat structure pointed to by ubuf
will be filled in. On error, -1 is returned, and errno is set appro-
priately.
ERRORS
EFAULT ubuf points outside of your accessible address space.
EINVAL dev does not refer to a device containing a mounted file system.
ENOSYS The mounted file system referenced by dev does not support this
operation, or any version of Linux before 1.3.16.
CONFORMING TO
SVr4.
NOTES
ustat() is deprecated and has only been provided for compatibility.
All new programs should use statfs(2) instead.
HP-UX Notes
The HP-UX version of the ustat structure has an additional field,
f_blksize, that is unknown elsewhere. HP-UX warns: For some file sys-
tems, the number of free inodes does not change. Such file systems
will return -1 in the field f_tinode. For some file systems, inodes
are dynamically allocated. Such file systems will return the current
number of free inodes.
SEE ALSO
stat(2), statfs(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2003-08-04 USTAT(2)