The io_devctl() function

In normal (i.e. nonfilesystem) resource managers, the io_devctl() function is used to implement device control functions. We used this in the ADIOS data acquisition driver to, for example, get the configuration of the device.

In a filesystem resource manager, io_devctl() is used to get various information about the filesystem.

A large number of the commands aren't used for anything other than block I/O filesystems; a few are reserved for internal use only.

Here's a summary of the commands:

Used by x86 disk partitions with harddisk-based filesystems.
Triggers a media reversioning and cache invalidation (for removable media). This command is also used to sync-up the filesystem if chkfsys (and other utilities) play with it "behind its back."
Returns struct fs_stats (see <sys/fs_stats.h>). The _CLR version resets the counters to zero after returning their values. And, to quote QNX's filesystem guru John Garvey, "There is no supported utility which obtains this, the fs_stats is completely undocumented, and may/will change in the future, and certainly has changed in the past."
Returns struct statvfs (see below for more details).
Each returns 256 bytes of character data, giving information about their relationship to other filesystems. See the discussion below.
Returns 256 bytes of character data. This can be used to return the command-line options that the filesystem was mounted with.