#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main(int argc,char *argv[])
{
pid_t pid,ppid,pgid;
pid = getpid();
printf("pid = %d\n",pid);
ppid = getppid();
printf("father pid = %d\n",ppid);
pgid = getpgid(pid);
printf("group pid = %d\n",pgid);
return 0;
}
Linux C 查询当前进程号、父进程号、进程组号
最新推荐文章于 2024-12-05 02:04:22 发布