Skip to content
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

socketpair SOCK_DGRAM support #3986

Open
tiif opened this issue Oct 22, 2024 · 1 comment
Open

socketpair SOCK_DGRAM support #3986

tiif opened this issue Oct 22, 2024 · 1 comment
Labels
A-linux Area: affects only Linux targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@tiif
Copy link
Contributor

tiif commented Oct 22, 2024

Tokio seems to have usecase for SOCK_DGRAM in socketpair.

Related test:

  • tokio::uds_datagram recv_buf
  • tokio::uds_datagram try_recv_buf_never_block
  • tokio::uds_datagram try_send_recv_never_block

All of them terminated with the error similar to the one below:

error: unsupported operation: socketpair: type 0x2 is unsupported, only SOCK_STREAM, SOCK_CLOEXEC and SOCK_NONBLOCK are allowed
   --> /home/gh-tiif/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.2/src/sys/unix/uds/mod.rs:103:5
    |
103 |     syscall!(socketpair(libc::AF_UNIX, flags, 0, fds.as_mut_ptr()))?;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketpair: type 0x2 is unsupported, only SOCK_STREAM, SOCK_CLOEXEC and SOCK_NONBLOCK are allowed
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE on thread `try_send_recv_n`:
    = note: inside `mio::sys::unix::uds::pair::<std::os::unix::net::UnixDatagram>` at /home/gh-tiif/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.2/src/sys/unix/mod.rs:8:28: 8:49
    = note: inside `mio::sys::unix::uds::datagram::pair` at /home/gh-tiif/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.2/src/sys/unix/uds/datagram.rs:24:5: 24:34
    = note: inside `mio::net::uds::datagram::UnixDatagram::pair` at /home/gh-tiif/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.2/src/net/uds/datagram.rs:54:9: 54:35
@tiif
Copy link
Contributor Author

tiif commented Nov 10, 2024

I am not sure what needs to be done to properly emulate datagram socket behaviour, and I don't think I could get to this issue anytime soon.

@rustbot label +A-linux +A-shims +C-enhancement

@rustbot rustbot added A-linux Area: affects only Linux targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linux Area: affects only Linux targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

2 participants