From d612511c1809dce428721a284adfb6a7d5be6e57 Mon Sep 17 00:00:00 2001 From: Stephen Berard Date: Tue, 3 Dec 2024 13:36:37 +0100 Subject: [PATCH 1/3] Added os_is_* methods for stdin/stdout/stderr. Fixed issues in os_renameat Signed-off-by: Stephen Berard --- core/shared/platform/zephyr/zephyr_file.c | 47 ++++++++++++++++------ samples/socket-api/file.wasm | Bin 34794 -> 0 bytes 2 files changed, 35 insertions(+), 12 deletions(-) delete mode 100755 samples/socket-api/file.wasm diff --git a/core/shared/platform/zephyr/zephyr_file.c b/core/shared/platform/zephyr/zephyr_file.c index f77e4338b6..d650c537fc 100644 --- a/core/shared/platform/zephyr/zephyr_file.c +++ b/core/shared/platform/zephyr/zephyr_file.c @@ -16,14 +16,16 @@ /* Notes: * This is the implementation of a POSIX-like file system interface for Zephyr. - * To manage our file descriptors, we created a struct `zephyr_fs_desc` that - * represent a zephyr file descriptor and hold useful informations. - * We also created a file descriptor table to keep track of all the file + * To manage our file descriptors, we a struct `zephyr_fs_desc` is created that + * represents a zephyr file descriptor and holds useful information. + * A file descriptor table is also created to keep track of all the file * descriptors. + * * To pass the file descriptor reference to the higher level abstraction, we * pass the index of the fd table to an `os_file_handle` struct. * Then in the WASI implementation layer we can retrieve the file descriptor * reference. + * * We also fake the stdin, stdout and stderr file descriptors. * We redirect the write operation on stdin, stdout and stderr to `os_printf`. * We do not handle write on stdin and read on stdin, stdout and stderr. @@ -43,7 +45,7 @@ // We will take the maximum number of open files // from the Zephyr POSIX configuration -#define CONFIG_WASI_MAX_OPEN_FILES 16 +#define CONFIG_WASI_MAX_OPEN_FILES CONFIG_POSIX_MAX_FDS // Macro to retrieve a file system descriptor and check it's validity. #define GET_FILE_SYSTEM_DESCRIPTOR(fd, ptr) \ @@ -711,22 +713,24 @@ os_renameat(os_file_handle old_handle, const char *old_path, char abs_old_path[MAX_FILE_NAME + 1]; char abs_new_path[MAX_FILE_NAME + 1]; + GET_FILE_SYSTEM_DESCRIPTOR(old_handle->fd, ptr); + + char *path = strdup(new_path); + if (path == NULL) { + return __WASI_ENOMEM; + } + snprintf(abs_old_path, MAX_FILE_NAME, "%s/%s", prestat_dir, old_path); snprintf(abs_new_path, MAX_FILE_NAME, "%s/%s", prestat_dir, new_path); int rc = fs_rename(abs_old_path, abs_new_path); if (rc < 0) { + free(path); return convert_errno(-rc); } - GET_FILE_SYSTEM_DESCRIPTOR(old_handle->fd, ptr); - - ptr->path = strdup(new_path); - if (ptr->path == NULL) { - ptr->path = old_path; - return __WASI_ENOMEM; - } - + free(ptr->path); + ptr->path = path; return __WASI_ESUCCESS; } @@ -983,4 +987,23 @@ bool os_compare_file_handle(os_file_handle handle1, os_file_handle handle2) { return handle1->fd == handle2->fd && handle1->is_sock == handle2->is_sock; +} + + +bool +os_is_stdin_handle(os_file_handle fd) +{ + return fd == stdin; +} + +bool +os_is_stdout_handle(os_file_handle fd) +{ + return fd == stdout; +} + +bool +os_is_stderr_handle(os_file_handle fd) +{ + return fd == stderr; } \ No newline at end of file diff --git a/samples/socket-api/file.wasm b/samples/socket-api/file.wasm deleted file mode 100755 index 0580bff8a8980f2bd83d59b349c9eca158d0c0f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34794 zcmd6w3zS^6uftC_zS{`*mAt7%`w$c#R6} zMq@E3-k^eraiz7;Y22`jv9+1brRiCQ=`^N+s4?4FZ9R2EkSbPvb*-@ylx{F)Wv#V3 zJKeat&+oR|m>bxf}#h6!8&+;b6HO1qEsZaS#v1 zL1lPXIS!(7TnGXh=>dOeA4G*{Ac_mca4jsAig6f(r2~b{Fn#5}1l7$TwU6xj>&L1C zCkmzI#xf{HL1`NHv^v4=>h$!b#?0FE#hG>^js~Zv=Vm%H(~Xt6IIdK~APuX<6L*|? z^9KfB{?+jPQBaM8p!%LL+>FjfXK(uMt*xyfef~%IY)(bNaImc;4Npfw?T@QY?a$~l z32L9xw+n{D-BmhrLG3T9AgB&fSo@Q@u738-VRiE+F6p|qSPzfdrN(>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5HbC54jl*ZgU$34e) zXwbWMJeaviYSFp$*x|kwE330t=B70yc6McTd3CPw_>mpYEnMtYcw%2)1vSkYzPo7k z-h=jm;_Rgs0qc8(Etl_ud-Lku%<^{>=VyuY-d~i+U;fU5zCO_9ukL;itP}4E_M)-gM@~sS~Gzx9!Gq;kl;gF}E8ynD|)r;>ObAao_*3 c-OC#`0e1Y!rPYfwOYLLj_QI1Z$C(cKzpNnnHvj+t From da3df3d53c6628cc0e01eec6aba147c37fcd9323 Mon Sep 17 00:00:00 2001 From: Stephen Berard Date: Thu, 5 Dec 2024 16:11:10 +0100 Subject: [PATCH 2/3] Fixed clang formating issue. --- core/shared/platform/zephyr/zephyr_file.c | 1 - 1 file changed, 1 deletion(-) diff --git a/core/shared/platform/zephyr/zephyr_file.c b/core/shared/platform/zephyr/zephyr_file.c index d650c537fc..9b6c49bfee 100644 --- a/core/shared/platform/zephyr/zephyr_file.c +++ b/core/shared/platform/zephyr/zephyr_file.c @@ -989,7 +989,6 @@ os_compare_file_handle(os_file_handle handle1, os_file_handle handle2) return handle1->fd == handle2->fd && handle1->is_sock == handle2->is_sock; } - bool os_is_stdin_handle(os_file_handle fd) { From 49717c40e98fbd2ac0782d91172095f39408baa9 Mon Sep 17 00:00:00 2001 From: Stephen Berard Date: Thu, 9 Jan 2025 16:25:09 +0100 Subject: [PATCH 3/3] Fixed comment text --- core/shared/platform/zephyr/zephyr_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/shared/platform/zephyr/zephyr_file.c b/core/shared/platform/zephyr/zephyr_file.c index 9b6c49bfee..93f7dac8f2 100644 --- a/core/shared/platform/zephyr/zephyr_file.c +++ b/core/shared/platform/zephyr/zephyr_file.c @@ -16,9 +16,9 @@ /* Notes: * This is the implementation of a POSIX-like file system interface for Zephyr. - * To manage our file descriptors, we a struct `zephyr_fs_desc` is created that - * represents a zephyr file descriptor and holds useful information. - * A file descriptor table is also created to keep track of all the file + * To manage our file descriptors, we created a struct `zephyr_fs_desc` that + * represent a zephyr file descriptor and hold useful informations. + * We also created a file descriptor table to keep track of all the file * descriptors. * * To pass the file descriptor reference to the higher level abstraction, we