Setting the thread /proc/PID/cmdline?

后端 未结 3 887
离开以前
离开以前 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:17

    argv points to writable strings. Just write stuff to them:

    #include 
    #include 
    
    int
    main(int argc, char** argv)
    {
        strcpy(argv[0], "Hello, world!");
        sleep(10);
        return 0;
    }
    

提交回复
热议问题