I need to add functionality to also output the name of the application.
I cannot use argv[0] because in some cases sys_err() used from the libraries so I do not have argv[0]. I know ps -ef gives the list of processes and corresponding commands so I guess this should be possible. I run Ubuntu.