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

Inconsistent behavior in dealing with partial data #14

Open
Leont opened this issue Jan 11, 2025 · 1 comment
Open

Inconsistent behavior in dealing with partial data #14

Leont opened this issue Jan 11, 2025 · 1 comment
Assignees

Comments

@Leont
Copy link

Leont commented Jan 11, 2025

It seems like the implementations on Linux have different behaviors regarding a partial read.

The read implementation will implicitly retry when interrupted until the desired length is reached.

The sysread implementations on the other hand will not retry, so if it would be interrupted while only partially having filled it will throw an error, even though the situation is entirely recoverable by issuing a new read.

AFAICT the XS implementation can exhibit either behavior depending on which backend is selected.

@david-dick david-dick self-assigned this Jan 13, 2025
@david-dick
Copy link
Owner

david-dick commented Jan 13, 2025

Would you think a retry on receiving a EINTR when reading /dev/urandom or calling getrandom to be acceptable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants