0

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.

1 Answer 1

0

It appears to be getting the command name from the main thread's name set by pthread_setname_np.

2
  • The answer is using knowledge that is not present in the question. If you could reformulate the question in such a way that this answer would have been possible to give without psychic powers, then it would be ok. Commented Nov 16, 2019 at 13:10
  • @Kusalananda But I thought that being psychic was required in order to reach a certain rep on the site... Commented Nov 16, 2019 at 13:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.