From 16cdb6dd358319845d31ce954918b5fabccf8890 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 16 Dec 2025 10:27:09 +0100 Subject: [PATCH] Specify unlink-file-at in terms of POSIX. Unfortunately only MacOS has the POSIX behavior of returning EPERM when unlinking a directory; Linux returns EISDIR, and Windows returns EACCESS. Because EACCESS may arise for other reasons but which are outside the purview of WASI, we map all EACCESS to EPERM. --- proposals/filesystem/wit-0.3.0-draft/types.wit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proposals/filesystem/wit-0.3.0-draft/types.wit b/proposals/filesystem/wit-0.3.0-draft/types.wit index 141072bdb..102f663e9 100644 --- a/proposals/filesystem/wit-0.3.0-draft/types.wit +++ b/proposals/filesystem/wit-0.3.0-draft/types.wit @@ -582,8 +582,11 @@ interface types { /// Unlink a filesystem object that is not a directory. /// - /// Return `error-code::is-directory` if the path refers to a directory. - /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX. + /// This is similar to `unlinkat(fd, path, 0)` in POSIX. + /// + /// Error returns are as specified by POSIX, with the exception that any + /// `error-code::access` return is instead replaced with + /// `error-code::not-permitted`. @since(version = 0.3.0-rc-2025-09-16) unlink-file-at: async func( /// The relative path to a file to unlink.