]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/cloudlibc/src/libc/stdio/renameat.c
Delete several blocks of unused code. (#294)
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / stdio / renameat.c
index fd5bcb9343392939b74910678f89542210907ceb..86c6a5cbe3fc5b8298b763813ea63ec331b7055f 100644 (file)
@@ -2,22 +2,14 @@
 //
 // SPDX-License-Identifier: BSD-2-Clause
 
-#include <common/errno.h>
-
-#include <wasi/core.h>
+#include <wasi/api.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
 
-int renameat(int oldfd, const char *old, int newfd, const char *new) {
-#ifdef __wasilibc_unmodified_upstream
-  __wasi_errno_t error = __wasi_file_rename(oldfd, old, strlen(old),
-#else
-  __wasi_errno_t error = __wasi_path_rename(oldfd, old, strlen(old),
-#endif
-                                                    newfd, new, strlen(new));
+int __wasilibc_nocwd_renameat(int oldfd, const char *old, int newfd, const char *new) {
+  __wasi_errno_t error = __wasi_path_rename(oldfd, old, newfd, new);
   if (error != 0) {
-    errno = errno_fixup_directory(oldfd, errno_fixup_directory(newfd, error));
     return -1;
   }
   return 0;