-
Notifications
You must be signed in to change notification settings - Fork 472
Consistently use io error handlers in Unix shims #3930
Copy link
Copy link
Closed
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsA-unixArea: affects our shared Unix target supportArea: affects our shared Unix target supportC-cleanupCategory: cleaning up our codeCategory: cleaning up our codeE-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is available
Metadata
Metadata
Assignees
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsA-unixArea: affects our shared Unix target supportArea: affects our shared Unix target supportC-cleanupCategory: cleaning up our codeCategory: cleaning up our codeE-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is available
Type
Fields
Give feedbackNo fields configured for issues without a type.
Unix shims return
-1and set the thread-local "last error" variable to indicate an error occurred. With #3923 and #3929, Miri has some nice helpers to help with that, but they are not being used everywhere yet. So this is about refactoring the existing code to use the new helpers.To help, start by grepping for
-1and forthis.eval_libc("Ein thesrc/shims/unixfolder. You will find a few patterns:should become
this.set_last_error_and_return(LibcError("EFAULT"), dest)?;.should become
return this.set_last_error_and_return_i32(ErrorKind::PermissionDenied);.Feel free to ask if you encounter other patterns you are unsure about. It's also okay for the first PR to only cover parts of this and leave the harder cases for a second round.