1

On AIX 7 I have a process whose name appears between square brackets in the ps output:

      PID    TTY  TIME CMD
  7798784  pts/2  0:00 [myproc]
  9044154  pts/2  0:00 ps 
  10485770  pts/2  0:00 bash 

I found that overwriting argv[0][0] leads to such a result. Is there any other reasons which could lead to this result?

1 Answers1

0

According to the man ps:

Under the -f flag, ps tries to determine the current command name and arguments both of which may be changed asynchronously by
        the process. These are then displayed. Failing this, the command name as it would appear without the option -f, is written in square brackets.

It does mean that the system fails to identify the command and the arguments (probably because it change during execution) and then show the output as it would have shown without the -f option.

Kiwy
  • 9,534