Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-enable :func:`os.posix_fallocate` and :func:`os.posix_fadvise` on AIX.
10 changes: 5 additions & 5 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -13376,19 +13376,9 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
#endif /* HAVE_TRUNCATE || MS_WINDOWS */


/* 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


/* GH-111804: Due to posix_fallocate() not having consistent semantics across
OSs, support was dropped in WASI preview2. */
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
!defined(__wasi__)
#if defined(HAVE_POSIX_FALLOCATE) && !defined(__wasi__)
/*[clinic input]
os.posix_fallocate

Expand Down Expand Up @@ -13426,10 +13416,10 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
errno = result;
return posix_error();
}
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
#endif /* HAVE_POSIX_FALLOCATE && !defined(__wasi__) */


#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
#if defined(HAVE_POSIX_FADVISE)
/*[clinic input]
os.posix_fadvise

Expand Down Expand Up @@ -13473,7 +13463,7 @@ os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
errno = result;
return posix_error();
}
#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
#endif /* HAVE_POSIX_FADVISE */


#ifdef MS_WINDOWS
Expand Down
Loading