Read into a buffer object from a file descriptor.
The buffer should be mutable and bytes-like. On success, returns the
number of bytes read. Less bytes may be read than the size of the
buffer. The underlying system call will be retried when interrupted by
a signal, unless the signal handler raises an exception. Other errors
will not be retried and an error will be raised.
Returns 0 if *fd* is at end of file or if the provided *buffer* has
length 0 (which can be used to check for errors without reading data).
Never returns negative.