Get filesystem information, given a file descriptor
#include <sys/statvfs.h>
int fstatvfs( int fildes,
struct statvfs *buf );
int fstatvfs64( int fildes,
struct statvfs64 *buf );
BlackBerry 10.0.0
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The fstatvfs() and fstatvfs64() functions return a "generic superblock" describing a filesystem that you can use to get information about mounted filesystems. The fstatvfs64() function is a 64-bit version of fstatvfs(). The statvfs() and statvfs64() functions are similar, but they take a path name instead of a file descriptor.
The fildes argument is an open file descriptor, obtained from a successful call to open() , creat() , dup() , fcntl() , or pipe() , for a file that resides on that filesystem. The filesystem type is known to the operating system. Read, write, or execute permission for the named file isn't required.
The buf argument is a pointer to a statvfs or statvfs64 structure that's filled by the function. It contains at least:
| _MOUNT_* | ST_* | Meaning |
|---|---|---|
| _MOUNT_READONLY | ST_RDONLY | The filesystem is read-only. |
| _MOUNT_NOEXEC | ST_NOEXEC | The filesystem doesn't permit the loading of executables. |
| _MOUNT_NOSUID | ST_NOSUID | The filesystem doesn't support setuid() and setgid() semantics. |
| _MOUNT_NOCREAT | ST_NOCREAT | You can't create files on the filesystem. |
| _MOUNT_OFF32 | ST_OFF32 | The off_t type is limited to 32 bits. |
| _MOUNT_NOATIME | ST_NOATIME | The filesystem doesn't support the logging of file access times. |
The values returned for f_files, f_ffree, and f_favail depend on the filesystem:
fstatvfs() is POSIX 1003.1 XSI; fstatvfs64() is Large-file support
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |