save
This commit is contained in:
parent
46dd752890
commit
3d6d85e715
19
cmd/test.cpp
Normal file
19
cmd/test.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
// C++ Code to demonstrate getppid()
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
using namespace std;
|
||||
|
||||
// Driver Code
|
||||
int main()
|
||||
{
|
||||
int pid;
|
||||
pid = fork();
|
||||
if (pid == 0)
|
||||
{
|
||||
cout << "\nParent Process id : "
|
||||
<< getpid() << endl;
|
||||
cout << "\nChild Process with parent id : "
|
||||
<< getppid() << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user