summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2023-03-17 09:24:09 +0100
committerxenu <me@xenu.pl>2023-03-17 09:26:39 +0100
commit8552f09f5cfe61a536a65f11290ef026f7aa0356 (patch)
tree962609984d5e2bb3cd9d1a7ffb168f728e31ebc8 /pod
parent8a548d15292f2166cb07a69fc5fc943391b7fba5 (diff)
downloadperl-8552f09f5cfe61a536a65f11290ef026f7aa0356.tar.gz
win32: inject a socket-aware version of CloseHandle() into the CRT
_close() on an fd calls CloseHandle(), which is illegal if the fd contains a socket handle. We previously worked around this by having our own close(), which called closesocket() before calling _close() (e601c439adce167078ac7b49550c0418ace86f94). Amusingly, the author of that solution thought it's just a temporary workaround: /* * close RTL fd while respecting sockets * added as temporary measure until PerlIO has real * Win32 native layer * -- BKS, 11-11-2000 */ To make it thread-safe, we had to manipulate the internals of file descriptors, which kept changing (b47a847f6284f6f98ad7509cf77a4aeb802d8fce). Unfortunately, the C runtime has been rewritten and it no longer exposes them at all. We had to disable the thread-safety fix in Visual C++ 2015 builds (1f664ef5314fb6e438137c44c95cf5ecdbdb5e9b). It also wouldn't work with MinGW configured to use UCRT. This commit introduces a new solution: we inject a socket-aware version of CloseHandle() into the C runtime library. Hopefully, this will be less fragile. This also fixes a few issues that the original solution didn't: - Closing a busy pipe doesn't cause a deadlock (fixes #19963) - _dup2 properly closes an overwritten socket (fixes #20920)
Diffstat (limited to 'pod')
-rw-r--r--pod/perldelta.pod14
1 files changed, 12 insertions, 2 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4183474c53..1953ca6e55 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -365,9 +365,19 @@ L</Modules and Pragmata> section.
=over 4
-=item XXX-some-platform
+=item Windows
-XXX
+=over 4
+
+=item *
+
+C<POSIX::dup2> no longer creates broken sockets. [GH #20920]
+
+=item *
+
+Closing a busy pipe could cause Perl to hang. [GH #19963]
+
+=back
=back