linux 进程控制1 获得当前进程的进程ID和其父进程ID 华清远见-《嵌入式 Linux 应用程序开发标准教程》

来源:互联网 发布:afnetworking数据缓存 编辑:程序博客网 时间:2024/05/17 22:50
#include<stdio.h>#include<unistd.h>#include <stdlib.h>int main(){printf("The PID of this process is %d\n",getpid()); /*获得当前进程的进程ID*/printf("The PPID of this process is %d\n",getppid());/*其父进程ID*/return 0;}

0 0
原创粉丝点击