Setting the thread /proc/PID/cmdline?

后端 未结 3 893
离开以前
离开以前 2021-01-06 13:42

On Linux/NPTL, threads are created as some kind of process.

I can see some of my process have a weird cmdline:

cat /proc/5590/cmdlin         


        
3条回答
  •  天命终不由人
    2021-01-06 14:29

    Bah.. the code is not that nice, the trick is to reuse the environ (here argv_buffer) pointer:

    memset (argv_buffer[0] + len, 0, argv_size - len);
    argv_buffer[1] = NULL;
    

    Any better idea?

    Is that working for different threads?

提交回复
热议问题