yamt commented on code in PR #8868: URL: https://github.com/apache/nuttx/pull/8868#discussion_r1163614758
########## arch/sim/src/sim/posix/sim_hostfs.c: ########## @@ -36,10 +36,66 @@ #include "hostfs.h" +#ifdef CONFIG_HOST_MACOS +#include <sys/syslimits.h> +#include <mach-o/dyld.h> +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: host_path_convert + ****************************************************************************/ + +static int host_path_convert(const char *path, char *abspath, + uint32_t buflen) +{ +#ifndef CONFIG_SIM_HOSTFS_PATH_CONVERSION + strncpy(abspath, path, buflen); + abspath[buflen - 1] = '\0'; + return 0; +#else + int ret; + char *name; + + if (path[0] == '/') + { + strncpy(abspath, path, buflen); + abspath[buflen - 1] = '\0'; + return 0; + } + + /* Get the absolute path of the executable file */ + +# ifdef CONFIG_HOST_LINUX + ret = readlink("/proc/self/exe", abspath, buflen); Review Comment: i meant to chdir into the directory where the nuttx executable is. or use the directory for the "at" fd for openat family. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org