compio-rs / compio

A thread-per-core Rust runtime with IOCP/io_uring/polling.
MIT License
420 stars 37 forks source link

feat: unify `RecvFrom`/`SendTo` (and vectored version) syscall #274

Closed AsakuraMizu closed 3 months ago

AsakuraMizu commented 3 months ago

This PR unfies syscalls of RecvFrom/RecvFromVectored/SendTo/SendToVectored on all platform.
This is needed for a sequent PR that will add support for encoding control information, or rather ancillary data.

Changes

Drawbacks

Alternative solution

Keep current implementation unchanged and add new opcode RecvMsg and SendMsg to unify behaviour and support cmsg.

Berrysoft commented 3 months ago

Actually you need to send cmsg, right? Add RecvMsg & SendMsg then. Although the PR seems OK, I don't think the current implementation should be changed, unless you prove it:)

Just add the two new opcodes if you need cmsg, and we'll see if the old implementation of RecvFrom & SendTo need to be refactored.

AsakuraMizu commented 3 months ago

The main reason stopped me from adding RecvMsg & SendMsg may be that it's redundant for io-uring driver and I want to reuse existing opcode... But yes, that's not the case if considering cmsg. I'll open a separate PR for that.