Is there a way to determine the amount of data transfered to/from a device. I'm not asking about the block or sector size. I want to know the amount transferred by a read/write operation.
For example, if I want to transfer 1 block of 0x200 bytes:
blocks=fread((void *)&Block, 0x200, 1, FILE *fp);
what happens if I reach end of file and only a partial block is read, and how do I determine the actual byte count.
I realize I could do the opposite as in:
bytes=fread((void *)&Block, 1, 0x200, FILE *fp);
but what if I want to read multiple blocks???
Is there a kernel function such as ioctl(dev, FNUM) that will return the actual byte count?
Much thanks, CB