Skip to content

Add epicsGetExecName()

Heinz Junkes requested to merge github/fork/mdavidsaver/getexecdir into 7.0

Created by: mdavidsaver

Let's try an experiment? This code isn't ready to be merged (via a LP merge request), but is in need of some feedback. So this PR is intended to assess interest, and track development progress (including CI results).

The branch adds epicsGetExecName() which is an OSI abstraction on the many OS specific mechanisms to find an (perhaps not "the") absolute path to the executable file from which the running process was loaded.

The goal of this is to enable runtime loading of file with paths relative to the executable. My idea is to reduce the need to compile $(INSTALL_LOCATION) into executables (softIoc being my first target). This is part of a larger plan to allow a built Base tree to be moved (relocated) without modification.

There are ports for WIN32, Linux, Darwin, solaris, and freebsd. My primary concern is Linux, and to a lesser extent WIN32 where relocatable trees are possible. For me the others are nice to have, but could be dropped for lack of interest in making them work.

Current state

  • The Darwin, solaris, and freebsd implementation hasn't even been compile tested.
  • The Darwin implementation doesn't follow symlinks.
  • The WIN32 implementation has only been tested with mingw+wine
  • Need manual testing of situations involving symlinks.
  • Uniform header file (unixFileName.h vs copy+paste in osiFileName.h)?

Merge request reports

Loading