Skip to content

Commit

Permalink
[3.12] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-1…
Browse files Browse the repository at this point in the history
…11919)

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.
  • Loading branch information
brettcannon committed Nov 9, 2023
1 parent 09df271 commit 5a8e6f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove posix.fallocate() under WASI as the underlying posix_fallocate() is
not available in WASI preview2.
6 changes: 3 additions & 3 deletions Modules/clinic/posixmodule.c.h

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

7 changes: 5 additions & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11891,7 +11891,10 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
#endif


#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
/* 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__)
/*[clinic input]
os.posix_fallocate
Expand Down Expand Up @@ -11929,7 +11932,7 @@ 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 */
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */


#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
Expand Down

0 comments on commit 5a8e6f8

Please sign in to comment.