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

Is it guaranteed that return error values are always stritctly bigger than i32::MIN? #957

Open
newpavlov opened this issue Oct 16, 2023 · 1 comment
Assignees

Comments

@newpavlov
Copy link

newpavlov commented Oct 16, 2023

IIUC error codes are defined as positive i32, so they can not be bigger than i32::MAX.

It would be nice if it was a written guarantee that negative values returned by syscalls are always strictly bigger than i32::MIN. See rust-random/getrandom#377

@mkroening mkroening self-assigned this Oct 16, 2023
@newpavlov newpavlov changed the title Is it guaranteed that error codes are always stritctly smaller than i32::MIN? Is it guaranteed that return error values are always stritctly smaller than i32::MIN? Oct 16, 2023
@newpavlov newpavlov changed the title Is it guaranteed that return error values are always stritctly smaller than i32::MIN? Is it guaranteed that return error values are always stritctly bigger than i32::MIN? Oct 16, 2023
@mkroening
Copy link
Member

Hmmm, sure. Guaranteeing that would be nice in general.

For read_entropy specifically, I'd say that the current doc comments are sufficient, as you already mentioned here: rust-random/getrandom#377 (comment)

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