summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-09-30 10:35:58 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-09-30 10:35:58 (GMT)
commitec39e26881e2d8811ffbe868d4f0c640ecb4f68d (patch)
tree8b34ba76c3673c0504bd4e8cdc503715fb7c5f73 /Modules/posixmodule.c
parent8486f9b134e0a25a3c64405223e0ba96192e02d9 (diff)
parentd6b176905d073ae6c109fa32bb16ec55a6e68c17 (diff)
downloadcpython-ec39e26881e2d8811ffbe868d4f0c640ecb4f68d.zip
cpython-ec39e26881e2d8811ffbe868d4f0c640ecb4f68d.tar.gz
cpython-ec39e26881e2d8811ffbe868d4f0c640ecb4f68d.tar.bz2
(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.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 473fefa..aa2d63a 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -12708,7 +12708,16 @@ os_truncate_impl(PyModuleDef *module, path_t *path, Py_off_t length)
#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 @@ os_posix_fallocate_impl(PyModuleDef *module, int fd, Py_off_t offset, Py_off_t l
}
Py_RETURN_NONE;
}
-#endif /* HAVE_POSIX_FALLOCATE */
+#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
-#ifdef HAVE_POSIX_FADVISE
+#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
/*[clinic input]
os.posix_fadvise
@@ -12849,7 +12858,7 @@ os_posix_fadvise_impl(PyModuleDef *module, int fd, Py_off_t offset, Py_off_t len
}
Py_RETURN_NONE;
}
-#endif /* HAVE_POSIX_FADVISE */
+#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
#ifdef HAVE_PUTENV