-
Notifications
You must be signed in to change notification settings - Fork 150
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
Implement select
.
#1162
base: main
Are you sure you want to change the base?
Implement select
.
#1162
Conversation
Add a `select` function, defined only on platforms where it doesn't have an `FD_SETSIZE` limitation.
896036c
to
fff5c2a
Compare
In the `waitpid` tests, ensure that the child process has exited, as dropping `Command` otherwise leaves the process running. This fixes test hangs on macos.
63acdd8
to
dd44e09
Compare
And make `select` unsafe due to I/O safety.
readfds: Option<&mut [FdSetElement]>, | ||
writefds: Option<&mut [FdSetElement]>, | ||
exceptfds: Option<&mut [FdSetElement]>, |
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.
Is this tested on Win32? It looks like it has a slightly different implementation of FD_SET
than Unix does, that isn't implemented in the bitfield way.
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.
Ooh, good spot. I had not yet tested it on Windows. I'll just disable Windows support for now.
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.
I'm worried that the current way it's implemented would make Windows support impossible in the future without a breaking change.
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.
Yes. I was thinking of just skipping the Windows tax here until someone shows up with a use case that needs it. If that happens, we could do like a select_ng
or whatever until the next semver break.
Windows has a different `FD_SET` representation. Supporting it might be possible, though the documentation is ambiguous about whether it supports arbitrary `FD_SETSIZE` values. But even if so, it would require a more elaborate abstraction, so just drop it for now.
Add a
select
function, defined only on platforms where it doesn't have anFD_SETSIZE
limitation.