Get current module name?

6 views
Skip to first unread message

J Decker

unread,
May 26, 2019, 5:11:39 PM5/26/19
to emscripten-discuss
On windows, I can use GetModuleFileName() to get the current program(main module) name and the current module(library) name.
On linux, I can open /proc/self/maps and find these names.
on Mac(BSD), there's another method...

can I get the current module name?
can I get the root module name? (In the case of dynamic linking, this would be the first module, the 'program'? )

As a workaround I can define a symbol; the issue with that is when the code that uses that symbol is compiled that has to be different, and it's more of a core static library, so it shouldn't have to be recompiled; and will be wrong if mislinked.
Reply all
Reply to author
Forward
0 new messages