From ec78d0ae0e064d1ee9f2fa418d7fa3adba717e48 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= <martin@v.loewis.de>
Date: Fri, 4 Jun 2010 17:20:56 +0000
Subject: [PATCH] Merged revisions 81692 via svnmerge from
 svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81692 | martin.v.loewis | 2010-06-04 19:18:42 +0200 (Fr, 04 Jun 2010) | 3 lines

  Issue #8864: Define _XOPEN_SOURCE on Solaris for the
  multiprocessing module.
........
---
 Misc/NEWS                                  | 3 ++-
 Modules/_multiprocessing/multiprocessing.h | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Misc/NEWS b/Misc/NEWS
index 0dff231331..1bd8a5f138 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1328,7 +1328,8 @@ Extension Modules
 Build
 -----
 
-- Issue #1759169: Drop _XOPEN_SOURCE on Solaris.
+- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
+  multiprocessing only.
 
 - Issue #8625: Turn off optimization in --with-pydebug builds with
   gcc.  (Optimization was unintentionally turned on in gcc
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index c1496343c3..14425de821 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -3,6 +3,12 @@
 
 #define PY_SSIZE_T_CLEAN
 
+#ifdef __sun
+/* The control message API is only available on Solaris 
+   if XPG 4.2 or later is requested. */
+#define _XOPEN_SOURCE 500
+#endif
+
 #include "Python.h"
 #include "structmember.h"
 #include "pythread.h"
-- 
2.40.0