changeset: 100303:52a8c1965750 branch: 2.7 user: Ned Deily date: Tue Feb 23 22:03:39 2016 +1100 files: Misc/NEWS Modules/socketmodule.c description: Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. diff -r 13826ff147e4 -r 52a8c1965750 Misc/NEWS --- a/Misc/NEWS Tue Feb 23 20:45:57 2016 +1100 +++ b/Misc/NEWS Tue Feb 23 22:03:39 2016 +1100 @@ -119,7 +119,10 @@ - Issue #23914: Fixed SystemError raised by CPickle unpickler on broken data. - Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on - OS X versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.. + OS X versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. + +- Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on + current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. IDLE ---- diff -r 13826ff147e4 -r 52a8c1965750 Modules/socketmodule.c --- a/Modules/socketmodule.c Tue Feb 23 20:45:57 2016 +1100 +++ b/Modules/socketmodule.c Tue Feb 23 22:03:39 2016 +1100 @@ -183,7 +183,7 @@ # define USE_GETHOSTBYNAME_LOCK #endif -/* To use __FreeBSD_version */ +/* To use __FreeBSD_version, __OpenBSD__, and __NetBSD_Version__ */ #ifdef HAVE_SYS_PARAM_H #include #endif @@ -194,15 +194,21 @@ 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. - - See issue #25924 for details. - */ + includes the requirement that getaddrinfo be thread-safe. See issue #25924. + + 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(__VMS) || !defined(HAVE_GETADDRINFO)) #define USE_GETADDRINFO_LOCK #endif