I have a function on Windows to get the address of the module in buf:
GetModuleFileName(0, buf, buf_size);
I want to do the same on Linux (which I do not know much about). I found the function dladdr(X, &dlInfo) which seems to do the right thing. As I understand I get the name and other details (dli_sname, dli_saddr, dli_fname, ..) of X in dlInfo with this function.
But what is X? I know it it an address. But which one? How would I use this to obtain the same result as on Windows?