Skip to content

Commit f1cf762

Browse files
encukouisidentical
andauthored
gh-84393: Remove AIX workaround: re-enable posix_fadvise and f_allocate (GH-144784)
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
1 parent 28b3a8a commit f1cf762

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Re-enable :func:`os.posix_fallocate` and :func:`os.posix_fadvise` on AIX.

Modules/clinic/posixmodule.c.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13376,19 +13376,9 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
1337613376
#endif /* HAVE_TRUNCATE || MS_WINDOWS */
1337713377

1337813378

13379-
/* Issue #22396: On 32-bit AIX platform, the prototypes of os.posix_fadvise()
13380-
and os.posix_fallocate() in system headers are wrong if _LARGE_FILES is
13381-
defined, which is the case in Python on AIX. AIX bug report:
13382-
http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 */
13383-
#if defined(_AIX) && defined(_LARGE_FILES) && !defined(__64BIT__)
13384-
# define POSIX_FADVISE_AIX_BUG
13385-
#endif
13386-
13387-
1338813379
/* GH-111804: Due to posix_fallocate() not having consistent semantics across
1338913380
OSs, support was dropped in WASI preview2. */
13390-
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
13391-
!defined(__wasi__)
13381+
#if defined(HAVE_POSIX_FALLOCATE) && !defined(__wasi__)
1339213382
/*[clinic input]
1339313383
os.posix_fallocate
1339413384
@@ -13426,10 +13416,10 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
1342613416
errno = result;
1342713417
return posix_error();
1342813418
}
13429-
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
13419+
#endif /* HAVE_POSIX_FALLOCATE && !defined(__wasi__) */
1343013420

1343113421

13432-
#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
13422+
#if defined(HAVE_POSIX_FADVISE)
1343313423
/*[clinic input]
1343413424
os.posix_fadvise
1343513425
@@ -13473,7 +13463,7 @@ os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
1347313463
errno = result;
1347413464
return posix_error();
1347513465
}
13476-
#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
13466+
#endif /* HAVE_POSIX_FADVISE */
1347713467

1347813468

1347913469
#ifdef MS_WINDOWS

0 commit comments

Comments
 (0)