-
Notifications
You must be signed in to change notification settings - Fork 348
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
Add flock
shim
#3759
Add flock
shim
#3759
Conversation
32b71a3
to
5979937
Compare
src/shims/unix/fs.rs
Outdated
// in the `helpers` module | ||
if lock_nb && matches!(code, ERROR_IO_PENDING | ERROR_LOCK_VIOLATION) { | ||
let desc = format!("LockFileEx wouldblock error: {err}"); | ||
err = io::Error::new(io::ErrorKind::WouldBlock, desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This remapping is a bit hacky, but I couldn't find a better solution. Mapping it here or in fd.rs
conflicts with mapping in helpers.rs
.
Also, according to LockFileEx
non-blocking call should return ERROR_IO_PENDING
, but in practice we get ERROR_LOCK_VIOLATION
, so to be safe I remap both of those.
☔ The latest upstream changes (presumably #3766) made this pull request unmergeable. Please resolve the merge conflicts. |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
9bd15b3
to
2313892
Compare
c4ece75
to
f4b70b0
Compare
@bors r+ |
☀️ Test successful - checks-actions |
@@ -0,0 +1,71 @@ | |||
// Flock tests are separate since they don't in general work on a Windows host. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is confusing... CI seems to indicate that it works just fine on a windows host? It doesn't work with a windows target but that's normal for these libc tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was copied from another test and I forgot to update it after the emulation was implemented.
flock: a bit of cleanup Follow-up to #3759
flock: a bit of cleanup Follow-up to rust-lang/miri#3759
No description provided.