DCMD_ETFS_ERASE_RANGE

Erase a specified range in an embedded transaction filesystem

Synopsis:

#include <sys/dcmd_mem.h>

#define DCMD_ETFS_ERASE_RANGE     __DIOT(_DCMD_MEM, 106, struct etfs_erase_range)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the filesystem partition, /dev/etfs2
dcmd DCMD_ETFS_ERASE_RANGE
dev_data_ptr A pointer to a struct etfs_erase_range
n_bytes sizeof(struct etfs_erase_range)
dev_info_ptr NULL

Description:

This command erases a specified range of the filesystem. You must be root or have the appropriate permissions to use this command.

Input:

A etfs_erase_range structure, which is defined as:

struct etfs_erase_range {
        int64_t         offset;
        int64_t         length;
};

The members include:

offset
The offset to start erasing at, in bytes.
length
The number of bytes to erase, or -1 to erase to the end of the partition.

Output:

None.

Errors:

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

EBUSY
There are open files in the filesystem.
EINVAL
The file descriptor doesn't correspond to the filesystem partition, /dev/etfs2.
EPERM
You don't have the required permissions.

See also:

DCMD_ETFS_ERASE

devctl() in the QNX Neutrino C Library Reference

etfsctl, fs-etfs-ram in the Utilities Reference