Skip to content

Commit 226f4bc

Browse files
authored
[3.11] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-111920)
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 078cdcc commit 226f4bc

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
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

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -10987,7 +10987,10 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
1098710987
#endif
1098810988

1098910989

10990-
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
10990+
/* GH-111804: Due to posix_fallocate() not having consistent semantics across
10991+
OSs, support was dropped in WASI preview2. */
10992+
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
10993+
!defined(__wasi__)
1099110994
/*[clinic input]
1099210995
os.posix_fallocate
1099310996
@@ -11025,7 +11028,7 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
1102511028
errno = result;
1102611029
return posix_error();
1102711030
}
11028-
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
11031+
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
1102911032

1103011033

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

0 commit comments

Comments
 (0)