From 1d9d16e82729821197af6e240995a344e8e7e0ba Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Sat, 16 Oct 2010 00:43:13 +0000 Subject: [PATCH] Merged revisions 85554 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ........ r85554 | r.david.murray | 2010-10-15 19:12:57 -0400 (Fri, 15 Oct 2010) | 4 lines #9862: On AIX PIPE_BUF is broken. Make it 512. Patch by Sébastien Sablé. ........ --- Misc/NEWS | 3 +++ Modules/selectmodule.c | 4 ++++ configure.in | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index d7f6d1f5bd4..d8f2f1b3d62 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 2.7.1? Core and Builtins ----------------- +- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding + its value as the default 512 when compiling on AIX. + - Issue #10068: Global objects which have reference cycles with their module's dict are now cleared again. This causes issue #7140 to appear again. diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 1b88c987c66..086a6476ee8 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1768,6 +1768,10 @@ initselect(void) PyModule_AddObject(m, "error", SelectError); #ifdef PIPE_BUF +#ifdef HAVE_BROKEN_PIPE_BUF +#undef PIPE_BUF +#define PIPE_BUF 512 +#endif PyModule_AddIntConstant(m, "PIPE_BUF", PIPE_BUF); #endif diff --git a/configure.in b/configure.in index bfa5ba5127a..3a87ff11372 100644 --- a/configure.in +++ b/configure.in @@ -4261,6 +4261,12 @@ AC_CHECK_TYPE(socklen_t,, #endif ]) +case $ac_sys_system in +AIX*) + AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;; +esac + + AC_SUBST(THREADHEADERS) for h in `(cd $srcdir;echo Python/thread_*.h)`