ringbahn / iou

Rust interface to io_uring
Apache License 2.0
328 stars 22 forks source link

Feature request: support more io_uring functionality: poll_add, poll_remove, prep_accept, etc... #19

Closed twissel closed 4 years ago

twissel commented 4 years ago

Is anyone working on this? If not, then I would like to try

withoutboats commented 4 years ago

It was on my to-do list after #18, but you're welcome to take it on instead! It would be good to have full parity with liburing here.

twissel commented 4 years ago

Here what I have so far: https://github.com/twissel/iou/blob/new-prep-functions/src/sqe.rs

Couple of questions: 1) I've added libc dependency because I don't want to define: libc::sockaddr, libc::socklen_t, libc::msghdr, etc... and all constants related to poll, accept, recvmsg by my self, is that OK? 2) Currently io_uring_prep_timeout_remove and io_uring_prep_cancel flags are useless, see https://github.com/axboe/liburing/issues/21#issuecomment-556014336, should we still use them in https://github.com/twissel/iou/blob/dac7550113bab72491f9c71eb380d0e3ed04937d/src/sqe.rs#L165 and https://github.com/twissel/iou/blob/dac7550113bab72491f9c71eb380d0e3ed04937d/src/sqe.rs#L208?

withoutboats commented 4 years ago

I've added libc dependency because I don't want to define: libc::sockaddr, libc::socklen_t, libc::msghdr, etc... and all constants related to poll, accept, recvmsg by my self, is that OK?

Yea adding the dependency is fine.

Currently io_uring_prep_timeout_remove and io_uring_prep_cancel flags are useless

I would leave them out for now. iou is going to be making breaking changes for a while. But leave a comment in the body of those functions about it so its noted.

twissel commented 4 years ago

@withoutboats What do you think, should iou expose libc types to user? For example https://github.com/twissel/iou/blob/855e4d645e84150eb11e2de722896964c8f3c0d5/src/sqe.rs#L218, or we should use some kind of wrappers for them from std or nix, or our owns? And if you don't mind I would prefer to split this in series of pull requests: one for poll{add, remove} and basic test for poll{add, remove} , another for prep_{send, recv}_msg and test, etc

withoutboats commented 4 years ago

or we should use some kind of wrappers for them from std or nix, or our owns?

We should expose higher level types than what's in libc (as you've done in the PR). If they're defined in std, we should use the ones in std. If not, we should have the discussion on #26 to decide if we should add a dependency on nix.

withoutboats commented 4 years ago

iou now supports every API supported by the most recent release of liburing except openat2.