DCMD_FSYS_OPTIONS

Get the options that a filesystem was mounted with

Synopsis:

#include <sys/dcmd_blk.h>

#define DCMD_FSYS_OPTIONS   __DIOF(_DCMD_FSYS,  19, char[256])

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device.
dcmd DCMD_FSYS_OPTIONS
dev_data_ptr A char[256] buffer
n_bytes The size of the buffer
dev_info_ptr NULL

Description:

This command gets the command-line options that the given filesystem was mounted with. The df utility uses this command if you specify the -g option.

Input:

None.

Output:

A null-terminated string that contains the command-line arguments.

Errors:

The devctl() function can return the following, in addition to the error codes listed in its entry in the C Library Reference:

EMSGSIZE
The provided buffer isn't big enough.

Example:

char o[265];
int fd, err;

if(-1 == (fd = open(argv[1] ? argv[1] : "/", O_RDONLY)))
{
    perror ("Couldn't open the device");
    return EXIT_FAILURE;
}

memset(o, 0, sizeof(o));
if((err = devctl(fd, DCMD_FSYS_OPTIONS, o, sizeof(o), 0)) != EOK)
{
    o[0] = '\0';
    printf("Couldn't get the options: %s (%d)\n", strerror(err), err);
} else {
    printf("Fsys options: \"%s\"\n", o);
}

See also:

devctl() in the QNX Neutrino C Library Reference