How does one do a zero-length read or write? I've been testing
various userspace methods to detect the nbd-client's connection to be
hung (TCP timeout). Using dd is unreliable because the read request
is fulfilled from cache if you don't use O_DIRECT.
If we could do a zero-length write then this would very easily
excercise the nbd connection without any protocol change or O_DIRECT
reads. Can you elaborate on what is needed for reliable zero-length
writes? The 'man 2 write' states:
"If count is zero and the file descriptor refers to a regular file, 0
may be returned, or an error could be detected. For a special file,
the results are not portable."