Updated: May 06, 2022

Get filesystem information


#include <sys/dcmd_blk.h>

#define DCMD_FSYS_STATVFS   __DIOF(_DCMD_FSYS,  13, struct __msg_statvfs)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device.
dev_data_ptr A pointer to a struct __msg_statvfs
n_bytes sizeof(struct __msg_statvfs)
dev_info_ptr NULL


This command gets information about the filesystem associated with the file descriptor passed to devctl().




A filled-in __msg_statvfs structure.

(QNX Neutrino 7.0 or later) For compatibility between 32- and 64-bit programs, the DCMD_FSYS_STATVFS command uses a __msg_statvfs structure instead of a statvfs structure. The __msg_statvfs structure is equivalent to the 32-bit version of statvfs. The <sys/statvfs.h> header file declares some functions and macros that you can use to convert one structure into the other:

/* Conversion methods from/to __msg_statvfs and statvfs */
extern void __msg_statvfs_init64(struct __msg_statvfs * _msg, const struct statvfs64 * _statvfsp);
extern void __msg_statvfs_copy64(struct statvfs64 * _statvfsp, const struct __msg_statvfs * _msg);

/* Alias methods, casting to statvfs64 simplifies handling the fsblkcnt_t high and low bytes */
#define __msg_statvfs_init(_msg, _statvfsp) (__msg_statvfs_init64((_msg), (const struct statvfs64 *)(_statvfsp)))
#define __msg_statvfs_copy(_statvfsp, _msg) (__msg_statvfs_copy64((struct statvfs64 *)(_statvfsp), (_msg)))

For a description of the statvfs structure, see statvfs() in the C Library Reference.


For an example of providing the information for this command, see Filesystem statistics in the RAM-disk Filesystem chapter of The QNX Neutrino Cookbook.

See also:

devctl(), fstatvfs() statvfs() in the QNX Neutrino C Library Reference