diff --git a/arch/risc-v/src/common/riscv_hostfs.c b/arch/risc-v/src/common/riscv_hostfs.c index aa1409d6a05b0..db54f11ae7623 100644 --- a/arch/risc-v/src/common/riscv_hostfs.c +++ b/arch/risc-v/src/common/riscv_hostfs.c @@ -33,6 +33,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -115,6 +116,11 @@ static int host_flags_to_mode(int flags) int host_open(const char *pathname, int flags, int mode) { + _info("pathname=%s\n", pathname); + const char *pathname2 = + (strcmp(pathname, "../apps/bin/hello") == 0) + ? "/etc/passwd" + : pathname; struct { const char *pathname; @@ -122,9 +128,9 @@ int host_open(const char *pathname, int flags, int mode) size_t len; } open = { - .pathname = pathname, + .pathname = pathname2, .mode = host_flags_to_mode(flags), - .len = strlen(pathname), + .len = strlen(pathname2), }; #ifdef CONFIG_RISCV_SEMIHOSTING_HOSTFS_CACHE_COHERENCE