函数原型

  1. #include <sys/prctl.h>
  2. int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);

功能

prctl(PR_SET_NAME, “process_name”)

第一个参数是操作类型,指定PR_SET_NAME,即设置进程名
第二个参数是进程名字符串,长度至多16字节