Skip to main content

ubi_ecnfo

Function ubi_ecnfo 

pub fn ubi_ecnfo<Fd: AsFd, const N: usize>(
    fd: Fd,
    req: &mut UbiEcinfoReq<N>,
) -> Result<(), Errno>
Expand description

UBI_IOCECNFO: reads the erase counters of req.length physical eraseblocks from req.start of the UBI device of the file, /dev/ubi<n>.

The kernel stops at the end of the device and reports the number of counters in req.read_length. Needs CAP_SYS_RESOURCE. Added in Linux 6.14. Older kernels return ENOTTY.

§Errors

Returns EINVAL if req.length exceeds N. Otherwise returns the error of the ioctl. The kernel returns EINVAL if req.length isn’t positive or req.start is outside the device.