quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

`libc::sendmmsg` is not available on old Android phones #1503

Closed link2xt closed 1 year ago

link2xt commented 1 year ago

sendmmsg was added in Linux 3.0 and recvmmsg was added in Linux 2.6.33 according to their man pages.

It is used in https://github.com/quinn-rs/quinn/blob/389d7ce5067fbef460f0730861340b15f13d4803/quinn-udp/src/unix.rs#L197

djc commented 1 year ago

Ugh, how old are these Android phones that you are targeting?

If it's not too much complexity, we're happy to take a PR to enable support on older kernels.

link2xt commented 1 year ago

Ugh, how old are these Android phones that you are targeting?

We support Android API 16, so the oldest phones are roughly 10 years old.

I have created a PR for sendmmsg: https://github.com/quinn-rs/quinn/pull/1504

Ralith commented 1 year ago

Fixed by #1504.

mxinden commented 1 month ago

I wonder whether the patch merged via https://github.com/quinn-rs/quinn/pull/1504 is worth the trouble it is causing. In other words, I would like to discuss switching back to calling libc::recvmmsg instead of libc::syscall(libc::SYS_recvmmsg.

//CC @link2xt, @flub and @dignifiedquire (since you have been active on https://github.com/deltachat/deltachat-core-rust/pull/4007)

link2xt commented 1 month ago

Feel free to drop Android 4 support and bump API level to 21 (Android 5.0) if supporting it is too much trouble. This is what tokio did already and we already bump to API level 19 in https://github.com/deltachat/deltachat-android/pull/3215 Slightly better if you can support Android 4.4 (API level 19), but not a big deal if it is bumped to API level 21.

As for real use cases, Delta Chat has at least a few hundred Android 4 users according to Google Play statistics.