summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2016-02-23 11:10:06 (GMT)
committerNed Deily <nad@python.org>2016-02-23 11:10:06 (GMT)
commit3d2778c8dacd19abd7f92c2d3e3563aa190e56bf (patch)
tree9db5d727419da28de5766c97ded02c7b2668ef39 /Modules/socketmodule.c
parent2d43bc2fc26ff50b4aa273d313c7decc80590cc7 (diff)
parente1d4e58777f28bb000fe95768186f70ff1de45a3 (diff)
downloadcpython-3d2778c8dacd19abd7f92c2d3e3563aa190e56bf.zip
cpython-3d2778c8dacd19abd7f92c2d3e3563aa190e56bf.tar.gz
cpython-3d2778c8dacd19abd7f92c2d3e3563aa190e56bf.tar.bz2
Issue #26406: merge from 3.5
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index cc4e55a..77a6b31 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -184,7 +184,7 @@ if_indextoname(index) -- return the corresponding interface name\n\
# define USE_GETHOSTBYNAME_LOCK
#endif
-/* To use __FreeBSD_version */
+/* To use __FreeBSD_version, __OpenBSD__, and __NetBSD_Version__ */
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -195,15 +195,21 @@ if_indextoname(index) -- return the corresponding interface name\n\
a mix of code including an unsafe implementation from an old BSD's
libresolv. In 10.5 Apple reimplemented it as a safe IPC call to the
mDNSResponder process. 10.5 is the first be UNIX '03 certified, which
- includes the requirement that getaddrinfo be thread-safe.
+ includes the requirement that getaddrinfo be thread-safe. See issue #25924.
- See issue #25924 for details.
+ It's thread-safe in OpenBSD starting with 5.4, released Nov 2013:
+ http://www.openbsd.org/plus54.html
+
+ It's thread-safe in NetBSD starting with 4.0, released Dec 2007:
+
+http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&r2=1.83
*/
#if defined(WITH_THREAD) && ( \
(defined(__APPLE__) && \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) || \
(defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
- defined(__OpenBSD__) || defined(__NetBSD__) || \
+ (defined(__OpenBSD__) && OpenBSD+0 < 201311) || \
+ (defined(__NetBSD__) && __NetBSD_Version__+0 < 400000000) || \
!defined(HAVE_GETADDRINFO))
#define USE_GETADDRINFO_LOCK
#endif