ustat

Section: System Calls (2)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

ustat - ファイルシステム (file system) の統計を得る  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <sys/types.h>
#include <unistd.h>    /* libc[45] */
#include <ustat.h>     /* glibc2 */

[[deprecated]] 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 */

The last two fields, f_fname and f_fpack, are not implemented and will always be filled with null bytes ('\0').  

返り値

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 to indicate the error.  

エラー

EFAULT
ubuf がアクセス可能な空間の外側を指している。
EINVAL
dev がマウントされたファイルシステムを含むデバイスを参照していない。
ENOSYS
The mounted filesystem referenced by dev does not support this operation, or any version of Linux before Linux 1.3.16.
 

標準規格

なし。  

歴史

SVr4. Removed in glibc 2.28.

ustat() は推奨されず、互換性のためだけに提供される。 新しいプログラムは全てこれの代りに statfs(2) を使用するべきである。  

HP-UX における注意

HP-UX 版の構造体 ustat には、その他にフィールド f_blksize が存在するが、他では見かけない。 HP-UX は次のように警告している: ファイルシステムの中には、解放されている inode の数を変更しないものもある。 このようなファイルシステムは、フィールド f_tinode に -1 を返す。 ファイルシステムの中には、inode を動的に確保するものもある。 このようなファイルシステムは、現在解放されている inode の数を返す。  

関連項目

stat(2), statfs(2)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
標準規格
歴史
HP-UX における注意
関連項目

This document was created by man2html, using the manual pages.