sanitize_standard_fds: Miri supports poll now#159961
Conversation
|
cc @rust-lang/miri |
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
a36f0a9 to
a4caad8
Compare
| /// closed in the mean time. | ||
| fn test_unblock_after_socket_close() { | ||
| // MacOS behaves different (`read` errors with EBADFD when the file description is closed) | ||
| // MacOS behaves different (`read` errors with EBADF when the file description is closed) |
There was a problem hiding this comment.
Frustrated that these both are very similar errors that exist and mean slightly different things, but want to verify this is actually correct here. Based upon the Linux manual:
EBADF Bad file descriptor (POSIX.1-2001).
EBADFD File descriptor in bad state.
It feels like EBADFD is correct, but from what it seems, MacOS only has EBADF? And just want to verify this is correct since I'm not 100% sure.
There was a problem hiding this comment.
I only just realized that those two errors both exist and are different. I am fairly sure that we saw EBADF on macOS, not EBADFD, as EBADF is usually returned when calling read on a closed FD so that would make sense. Also as you say macOS doesn't even seem to have EBADFD. I don't have macOS machine so verifying this isn't entirely trivial and doesn't seem worth it.
There was a problem hiding this comment.
That's fair, then. My verification after poking around was the macos-errno crate which does indeed list EBADF and not EBADFD, so, I'll say that's good enough.
|
r=me minus one small note. |
|
@bors r+ |
However, so far it doesn't support it on the standard FDs (0..=2). So let's support those in poll and then remove a Miri special case in std.