getpid and getppid return two different values

后端 未结 2 1153
陌清茗
陌清茗 2020-12-14 20:25

When I run the code below

#include 
#include 
//int i=0;
int main(){

int id ;
id = fork() ;
printf(\"id value : %d\\n\",i         


        
2条回答
  •  生来不讨喜
    2020-12-14 20:36

    Because the parent process runs out and released, its child process became an orphan, The init (short for initialization)whose pid is 1 received the orphan process.

提交回复
热议问题