Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
Required, but never shown