Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case when read actually reads less data than the user requested #100

Open
JackKelly opened this issue Mar 12, 2024 · 0 comments
Open
Labels
bug Something isn't working usability Make things more user-friendly

Comments

@JackKelly
Copy link
Owner

The manual for read says:

On success, the number of bytes read is returned (zero indicates
end of file), and the file position is advanced by this number.
It is not an error if this number is smaller than the number of
bytes requested; this may happen for example because fewer bytes
are actually available right now (maybe because we were close to
end-of-file, or because we are reading from a pipe, or from a
terminal), or because read() was interrupted by a signal. See
also NOTES.

I guess we submit a new read operation, to get the remaining bytes? But don't retry forever!

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working usability Make things more user-friendly
Projects
Status: Todo
Development

No branches or pull requests

1 participant