Number of bytes read is returned. Upon reading end-of-file, zero is returned.
For POSIX systems, if fd
is opened in non blocking mode, the function will return error.WouldBlock when EAGAIN is received. On Windows, if the application has a global event loop enabled, I/O Completion Ports are used to perform the I/O. error.WouldBlock
is not possible on Windows.
This operation is non-atomic on the following systems:
- Windows On these systems, the read races with concurrent writes to the same file descriptor.
This function assumes that all vectors, including zero-length vectors, have a pointer within the address space of the application.