It seems to me that Linux has it easy with /proc/self/exe. But I\'d like to know if there is a convenient way to find the current application\'s directory in C/C++ with cros
Depending on the version of QNX Neutrino, there are different ways to find the full path and name of the executable file that was used to start the running process. I denote the process identifier as . Try the following:
/proc/self/exefile exists, then its contents are the requested information./proc//exefile exists, then its contents are the requested information./proc/self/as exists, then:
open() the file.sizeof(procfs_debuginfo) + _POSIX_PATH_MAX.devctl(fd, DCMD_PROC_MAPDEBUG_BASE,....procfs_debuginfo*.path field of the procfs_debuginfo structure. Warning: For some reason, sometimes, QNX omits the first slash / of the file path. Prepend that / when needed.3. with the file /proc//as .dladdr(dlsym(RTLD_DEFAULT, "main"), &dlinfo) where dlinfo is a Dl_info structure whose dli_fname might contain the requested information.I hope this helps.