且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不执行 exec 系列函数的情况下更改子进程名称?

更新时间:2022-04-15 22:43:57

Linux下可以使用prctl()函数设置进程名:

Under Linux you can use the prctl() function to set the process name:

#include <sys/prctl.h>

prctl(PR_SET_NAME, "foobar");