-
Notifications
You must be signed in to change notification settings - Fork 344
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 blocking support for eventfd and socketpair #3665
Comments
Alternatively we could implement it similar to That does mean we cannot mutate any state before blocking or we'd get incorrect behavior |
|
May I work on this issue? Or it belongs to a larger project? I don't want to block others' work :-) |
I think my work on #3448 might potentially block this. The current specification for epoll is only for non-blocking eventfd and socketpair. I wish to let that land then incorporate blocking mechanism to it. |
I see. Thanks for letting me know. I'll look for something else then. |
FWIW we could have blocking socketpair without that being supported by epoll. But also we currently don't have enough review capacity for another large projects like this. I can't even keep up with the PRs we already have. So picking something smaller is probably better. |
I'd like to work on this. @rustbot claim |
A good preparation for this would be to change |
Refactor fd read/write This PR passed the responsibility of reading to user supplied buffer and dest place to each implementation of ``FileDescription::read/write/pread/pwrite``. This is part of #3665.
Refactor fd read/write This PR passed the responsibility of reading to user supplied buffer and dest place to each implementation of ``FileDescription::read/write/pread/pwrite``. This is part of #3665.
Our
socketpair
andeventfd
implementations currently do not support blocking.To fix that will require a bit of re-structuring to enable
FileDescription::{read,write}
to block. In that case we can't use the convenientbytes: &mut [u8]
/bytes: &[u8]
arguments, we need the underlying Miri place, so that we can store it in a callback to be used on unblocking. (Incidentally that would also simplify eventfd read/write a bit since we could use the normal memory APIs to reading/writing u64 in an endianess-aware way, rather than having to implement that on a byte slice.) The functions also need access to the return place so they can write the return value later, when they are unblocked.Basically, a bunch of the convenience that is currently implemented here can't be used when blocking is involved. We have to make read/write lower-level functions that look more like the usual Miri hooks, and possibly add some helper functions to make it still easy to implement the current behavior. (Those helper functions are then likely useful with other file system functions as well.)
The text was updated successfully, but these errors were encountered: