Is your feature request related to a problem? Please describe.
Currently the nuttx rust app is not compiled, when using the tokio net feature.
So I added the interrelated definitions for Nuttx target in libc and other crates as follows.
rust-lang/libc#5258
tokio-rs/tokio#8259
lambda-fairy/rust-errno#129
tokio-rs/mio#1966
rust-lang/socket2#663
rust-lang/socket2#664
However, I'm worried some details might be incorrect, so I'd appreciate it if the NuttX maintainers could review this together. Thank you.
Describe the solution you'd like
- Enabled keepalive in socket2.
- Disabled unsupported capabilities.
These flags are not supported in Nuttx target.
SO_REUSEPORT
IP_HDRINCL
IP_RECVTOS
IPV6_RECVTCLASS
IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP
- Used
poll as the selector instead of epoll. because the epoll_event structure is defined differently from the linux_like. Therefore, additional support may be needed; for now, let's get tokio working. Supporting epoll is the final solution. It may open other pr to progress epoll support.
- Linked
errno crate to use __errno symbol.
- Disabled
reuseport in tokio.
- Use
impl_noproc to handle get_peer_cred,in tokio for working. In future, may be needed coding to support.
- Added some definitions in libc.
- Type IovLen to c_ulong in socket2. Using
msg_iovlen with unsigned long is not entirely consistent with POSIX. Other platform is defined c_int.
Describe alternatives you've considered
No response
Verification
Is your feature request related to a problem? Please describe.
Currently the nuttx rust app is not compiled, when using the tokio net feature.
So I added the interrelated definitions for Nuttx target in
libcand other crates as follows.rust-lang/libc#5258
tokio-rs/tokio#8259
lambda-fairy/rust-errno#129
tokio-rs/mio#1966
rust-lang/socket2#663
rust-lang/socket2#664
However, I'm worried some details might be incorrect, so I'd appreciate it if the NuttX maintainers could review this together. Thank you.
Describe the solution you'd like
These flags are not supported in Nuttx target.
SO_REUSEPORT
IP_HDRINCL
IP_RECVTOS
IPV6_RECVTCLASS
IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP
pollas the selector instead ofepoll. because theepoll_eventstructure is defined differently from thelinux_like. Therefore, additional support may be needed; for now, let's get tokio working. Supporting epoll is the final solution. It may open other pr to progress epoll support.errnocrate to use__errnosymbol.reuseportin tokio.impl_noprocto handleget_peer_cred,in tokio for working. In future, may be needed coding to support.msg_iovlenwithunsigned longis not entirely consistent with POSIX. Other platform is definedc_int.Describe alternatives you've considered
No response
Verification