On Ubuntu 18.04, I have a C++ compiled program MyServer. top -c
shows the "command line" correctly as ./MyServer, but the "command name" with top
is shown as "main".
I wanted to know how to get the command name to be MyServer.
It appears to be getting the command name from the main thread's name set by pthread_setname_np
.