-
Notifications
You must be signed in to change notification settings - Fork 388
Add shim test for DuplicateHandle
#4371
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
base: master
Are you sure you want to change the base?
Conversation
There are some CI failures, could you look into that? |
Reminder, once the PR becomes ready for a review, use |
Well, I've just learned that attempting to read from a write-only file on Unix returns
The first though would likely be the first in a long line of this kind of change - several currently-disabled filesystem-related tests appear to rely on the specific OS error returned by functions, but this is a property of the backend, not the emulated target. If it's desired to always match the OS error kinds returned by the target, I'd want to brainstorm a more holistic way to handle the likely large amount of mapping that will require (and in some cases probably be impossible, since not all OSes will provide the same error granularity) |
EBADF is the error you get when the FD doesn't even exist, so it sounds to me like something else is going on. But, anyway, why does this test have to involve "reading from a write-only file"? You can mirror the test at miri/tests/pass-dep/libc/libc-fs.rs Lines 82 to 105 in 57bac2e
by having two FDs read from the same file and observing that reading one advances the position of the other. (The dup test doesn't even quite do that, it just checks that the position is copied over on dup ; #4382 fixes that.)
|
I was hoping to verify that permissions were copied correctly, was the idea. I can just test position matching. That does still leave the underlying issue of the error kind being based on the miri target, not the emulated one. But that's also pre-existing. Also, EBADF being the error for no read permissions, outside of Miri and with no |
👍
Yeah, that's not surprising, though maybe we should have an issue for this. It'd take a huge amount of code to match up the error kinds, I don't think it's worth it. |
No description provided.