Skip to content

Commit 5a8e6f8

Browse files
authored
[3.12] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-111919)
GH-111804: Drop posix.fallocate() under WASI (GH-111869) Drop posix.fallocate() under WASI. The underlying POSIX function, posix_fallocate(), was found to vary too much between implementations to remain in WASI. As such, while it was available in WASI preview1, it's been dropped in preview2.
1 parent 09df271 commit 5a8e6f8

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove posix.fallocate() under WASI as the underlying posix_fallocate() is
2+
not available in WASI preview2.

Modules/clinic/posixmodule.c.h

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

Modules/posixmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11891,7 +11891,10 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
1189111891
#endif
1189211892

1189311893

11894-
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
11894+
/* GH-111804: Due to posix_fallocate() not having consistent semantics across
11895+
OSs, support was dropped in WASI preview2. */
11896+
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
11897+
!defined(__wasi__)
1189511898
/*[clinic input]
1189611899
os.posix_fallocate
1189711900
@@ -11929,7 +11932,7 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
1192911932
errno = result;
1193011933
return posix_error();
1193111934
}
11932-
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
11935+
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
1193311936

1193411937

1193511938
#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)

0 commit comments

Comments
 (0)