I've seen following statement in a few programs, most/all seem to be made for Linux.
rv = read(fd, NULL, 0);
In some programs it's in a loop, in some a single statement.
What does it do really?
Man page says that an invocation like this may or may not check for errors...
What is the significance of return value?
What types of file descriptors are supported?
And if rv==0
how to distinguish "no error" from e.g. "socket closed".