#include
<
stdio.h
>
#include
<
unistd.h
>
int
main ( )
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
...
{
printf ("The process ID is %d ", (int) getpid ()) ; //本进程
printf ("The parent process ID is %d ", (int) getppid ()) ; //父进程
return 0 ;
}
Linux获取进程ID
最新推荐文章于 2024-06-03 16:05:53 发布