fstatvfs, statvfs - get file system information
#include <sys/statvfs.h>
int fstatvfs(int fildes, struct statvfs *buf);
int statvfs(const char *restrict path, struct statvfs
*restrict buf);
The fstatvfs() function shall obtain information about the file system containing the file referenced by fildes.
The statvfs() function shall obtain information about the file system containing the file named by path.
For both functions, the buf argument is a pointer to a statvfs structure that shall be filled. Read, write, or execute permission of the named file is not required.
The following flags can be returned in the f_flag member:
It is unspecified whether all members of the statvfs structure have meaningful values on all file systems.
Upon successful completion, statvfs() shall return 0. Otherwise, it shall return -1 and set errno to indicate the error.
The fstatvfs() and statvfs() functions shall fail if:
The fstatvfs() function shall fail if:
The statvfs() function shall fail if:
The statvfs() function may fail if:
The following sections are informative.
The following example shows how to obtain file system information for the file system upon which the file named /home/cnd/mod1 resides, using the fstatvfs() function. The /home/cnd/mod1 file is opened with read/write privileges and the open file descriptor is passed to the fstatvfs() function.
#include <statvfs.h>
#include <fcntl.h>
struct statvfs buffer;
int status;
...
fildes = open("/home/cnd/mod1", O_RDWR);
status = fstatvfs(fildes, &buffer);
The following example shows how to obtain file system information for the file system upon which the file named /home/cnd/mod1 resides, using the statvfs() function.
#include <statvfs.h>
struct statvfs buffer;
int status;
...
status = statvfs("/home/cnd/mod1", &buffer);
chmod() , chown() , creat() , dup() , exec() , fcntl() , link() , mknod() , open() , pipe() , read() , time() , unlink() , utime() , write() , the Base Definitions volume of IEEE Std 1003.1-2001, <sys/statvfs.h>
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |