Skip to content

Add network socket shutdown shim#4987

Queued
WhySoBad wants to merge 1 commit intorust-lang:masterfrom
WhySoBad:network-socket-shutdown
Queued

Add network socket shutdown shim#4987
WhySoBad wants to merge 1 commit intorust-lang:masterfrom
WhySoBad:network-socket-shutdown

Conversation

@WhySoBad
Copy link
Copy Markdown
Contributor

Hi,

This pull request adds the shim for the shutdown syscall for TCP sockets.
I've ran the tokio TCP tests using Miri and noticed that many of them require TcpStream::shutdown so it would be nice to also have this shimmed.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Apr 29, 2026
@WhySoBad
Copy link
Copy Markdown
Contributor Author

The CI fails for the same reason mentioned here: #4984 (comment).
It's because WSAESHUTDOWN is not a known error kind in the standard library.

What would you suggest doing to handle such unknown I/O errors?

Comment thread src/shims/io_error.rs Outdated
Copy link
Copy Markdown
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even know this operation exists.^^ I wonder what the point is, why wouldn't you just close?

Anyway, this mostly looks good, except for some test nits.
@rustbot author

View changes since this review

Comment thread tests/pass-dep/libc/libc-socket.rs Outdated
Comment thread tests/pass-dep/libc/libc-socket.rs Outdated
Comment thread tests/pass-dep/libc/libc-socket.rs Outdated
Comment thread tests/pass/shims/socket.rs Outdated
Comment thread tests/pass/shims/socket.rs Outdated
Comment thread tests/pass/shims/socket.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Apr 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 30, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@WhySoBad
Copy link
Copy Markdown
Contributor Author

WhySoBad commented May 1, 2026

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels May 1, 2026
Copy link
Copy Markdown
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one final nit. :) Please also squash the commits.

@rustbot author

View changes since this review

Comment thread tests/pass-dep/libc/libc-socket.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels May 1, 2026
@WhySoBad WhySoBad force-pushed the network-socket-shutdown branch from 89b417b to 5e0971e Compare May 1, 2026 11:30
@WhySoBad
Copy link
Copy Markdown
Contributor Author

WhySoBad commented May 1, 2026

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels May 1, 2026
@RalfJung RalfJung added this pull request to the merge queue May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting for a review to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants