How can I get the process name in C? The same name, which is in /proc/$pid/status. I do not want to parse that file. Is there any programmatic way of doing this
It's either pointed to by the argv[0] or indeed you can read /proc/self/status. Or you can use getenv("_"), not sure who sets that and how reliable it is.