[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) Issue #22396: On 32-bit AIX platform, don't expose

victor.stinner python-checkins at python.org
Tue Sep 30 12:36:16 CEST 2014


https://hg.python.org/cpython/rev/5ade1061fa3d
changeset:   92653:5ade1061fa3d
parent:      92651:a404bf4db6a6
parent:      92652:8e5e19b3cd4e
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Sep 30 12:35:58 2014 +0200
summary:
  (Merge 3.4) Issue #22396: On 32-bit AIX platform, don't expose
os.posix_fadvise() nor os.posix_fallocate() because their prototypes in system
headers are wrong.

files:
  Misc/NEWS             |   3 +++
  Modules/posixmodule.c |  21 +++++++++++++++------
  2 files changed, 18 insertions(+), 6 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -38,6 +38,9 @@
 Library
 -------
 
+- Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
+  os.posix_fallocate() because their prototypes in system headers are wrong.
+
 - Issue #22517: When a io.BufferedRWPair object is deallocated, clear its
   weakrefs.
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -12708,7 +12708,16 @@
 #endif /* HAVE_TRUNCATE */
 
 
-#ifdef HAVE_POSIX_FALLOCATE
+/* Issue #22396: On 32-bit AIX platform, the prototypes of os.posix_fadvise()
+   and os.posix_fallocate() in system headers are wrong if _LARGE_FILES is
+   defined, which is the case in Python on AIX. AIX bug report:
+   http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 */
+#if defined(_AIX) && defined(_LARGE_FILES) && !defined(__64BIT__)
+#  define POSIX_FADVISE_AIX_BUG
+#endif
+
+
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
 /*[clinic input]
 os.posix_fallocate
 
@@ -12771,10 +12780,10 @@
     }
     Py_RETURN_NONE;
 }
-#endif /* HAVE_POSIX_FALLOCATE */
-
-
-#ifdef HAVE_POSIX_FADVISE
+#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
+
+
+#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
 /*[clinic input]
 os.posix_fadvise
 
@@ -12849,7 +12858,7 @@
     }
     Py_RETURN_NONE;
 }
-#endif /* HAVE_POSIX_FADVISE */
+#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
 
 #ifdef HAVE_PUTENV
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list