I'd prefer when both stat().st_size and lseek() just return the "number of bytes" (that you can read out until you get EOF) of that block device. Anything else is just awkward and does not make any sense to me (from the programmer's point of view), even though POSIX might not require it for block devices. And for NBD this size is always known to the nbd-server: Either size of served file, sum of the sizes of all chunks ("multifile") or configured size (for "treefiles"). So why not just give that information to the clients easily? Just my 2 ct, Lars R.
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature