This commit is contained in:
Ivan Titov 2024-12-21 12:42:35 +03:00
parent 46dd752890
commit 3d6d85e715
2 changed files with 19 additions and 0 deletions

BIN
cmd/a.out Executable file

Binary file not shown.

19
cmd/test.cpp Normal file
View 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;
}