There are many similar questions to this but I could not find one which exactly matches to what I need to know.
It's a C++ application in Linux. I am in a deep nested function where I need to know the name of the this application instance. How can I do that?
Following are not the possible options:
- Getcwd function return the directory name, and not the application name.
- I cannot use argv[0] since I am not in the main function. Also, my main function does not access argv[0] and save it somewhere. Also, I am not the author of main function and I cannot change it.