-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std: Avoid the WSA_FLAG_NO_HANDLE_INHERIT option #26658
std: Avoid the WSA_FLAG_NO_HANDLE_INHERIT option #26658
Conversation
r? @aturon |
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ We need to figure hammer out our story for using better APIs under the hood when available. |
📌 Commit 0e06370 has been approved by |
⌛ Testing commit 0e06370 with merge abf6195... |
💔 Test failed - auto-win-gnu-64-opt |
0e06370
to
fb28133
Compare
@bors: r=aturon On Tue, Jun 30, 2015 at 1:07 PM, bors [email protected] wrote:
|
📌 Commit fb28133 has been approved by |
⌛ Testing commit fb28133 with merge 7dd2bd6... |
💔 Test failed - auto-win-gnu-32-opt |
This was added after Windows 7 SP1, so it's not always available. Instead use the `SetHandleInformation` function to flag a socket as not inheritable. This is not atomic with respect to creating new processes, but it mirrors what Unix does with respect to possibly using the atomic option in the future. Closes rust-lang#26543
fb28133
to
8890089
Compare
@bors: r=aturon On Tue, Jun 30, 2015 at 6:26 PM, bors [email protected] wrote:
|
📌 Commit 8890089 has been approved by |
⌛ Testing commit 8890089 with merge 10a45ad... |
💔 Test failed - auto-linux-32-nopt-t |
@bors: retry On Wed, Jul 1, 2015 at 12:04 AM, bors [email protected] wrote:
|
This was added after Windows 7 SP1, so it's not always available. Instead use the `SetHandleInformation` function to flag a socket as not inheritable. This is not atomic with respect to creating new processes, but it mirrors what Unix does with respect to possibly using the atomic option in the future. Closes #26543
This passed all tests but one of our mac slaves disappeared so I'm going to merge manually. |
std:win: avoid WSA_FLAG_NO_INHERIT flag and don't use SetHandleInformation on UWP This flag is not supported on Windows 7 before SP1, and on windows server 2008 SP2. This breaks Socket creation & duplication. This was fixed in a previous PR. cc #26658 This PR: cc #60260 reuses this flag to support UWP, and makes an attempt to handle the potential error. This version still fails to create a socket, as the error returned by WSA on this case is WSAEINVAL (invalid argument). and not WSAEPROTOTYPE. MSDN page for WSASocketW (that states the platform support for WSA_FLAG_NO_HANDLE_INHERIT): https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw CC #26543 CC #26518
This was added after Windows 7 SP1, so it's not always available. Instead use
the
SetHandleInformation
function to flag a socket as not inheritable. This isnot atomic with respect to creating new processes, but it mirrors what Unix does
with respect to possibly using the atomic option in the future.
Closes #26543