__wasilibc_init_preopen
__wasilibc_register_preopened_fd
__wasilibc_rmdirat
-__wasilibc_rmfileat
__wasilibc_tell
+__wasilibc_unlinkat
__wcscoll_l
__wcsftime_l
__wcsxfrm_l
+++ /dev/null
-#include <common/errno.h>
-#include <wasi/core.h>
-#include <wasi/libc.h>
-#include <errno.h>
-#include <string.h>
-
-int __wasilibc_rmfileat(int fd, const char *path) {
- size_t path_len = strlen(path);
- __wasi_errno_t error = __wasi_path_unlink_file(fd, path, path_len);
- if (error != 0) {
- errno = error;
- return -1;
- }
- return 0;
-}
--- /dev/null
+#include <common/errno.h>
+#include <wasi/core.h>
+#include <wasi/libc.h>
+#include <errno.h>
+#include <string.h>
+
+int __wasilibc_unlinkat(int fd, const char *path) {
+ size_t path_len = strlen(path);
+ __wasi_errno_t error = __wasi_path_unlink_file(fd, path, path_len);
+ if (error != 0) {
+ errno = error;
+ return -1;
+ }
+ return 0;
+}
if ((flag & AT_REMOVEDIR) != 0) {
return __wasilibc_rmdirat(fd, path);
}
- return __wasilibc_rmfileat(fd, path);
+ return __wasilibc_unlinkat(fd, path);
#endif
}
void __wasilibc_init_preopen(void);
int __wasilibc_register_preopened_fd(int fd, const char *path);
int __wasilibc_fd_renumber(int fd, int newfd);
-int __wasilibc_rmfileat(int fd, const char *path);
+int __wasilibc_unlinkat(int fd, const char *path);
int __wasilibc_rmdirat(int fd, const char *path);
off_t __wasilibc_tell(int fd);
return -1;
}
- return __wasilibc_rmfileat(rel_pathname.dirfd, rel_pathname.relative_path);
+ return __wasilibc_unlinkat(rel_pathname.dirfd, rel_pathname.relative_path);
}
int
return -1;
}
- int r = __wasilibc_rmfileat(rel_pathname.dirfd, rel_pathname.relative_path);
+ int r = __wasilibc_unlinkat(rel_pathname.dirfd, rel_pathname.relative_path);
if (r != 0 && (errno == EISDIR || errno == ENOTCAPABLE))
r = __wasilibc_rmdirat(rel_pathname.dirfd, rel_pathname.relative_path);
return r;