#include <iostream>
using namespace std;
#include <sys/types.h> 
#include <unistd.h> 

/* getpid() and fork() are system calls declared in unistd.h.  They return */
/* values of type pid_t.  This pid_t is a special type for process ids. */
/* It's equivalent to int. */

int main(void) 
{ 
	pid_t childpid;

	childpid = fork();
	for (int i = 0;  i < 5;  i++) {
		cout << "This is process " << getpid() << endl;
		/* sleep is a system call or library function that suspends
		   this process for the indicated number of seconds */
		sleep(2);
	}

	return 0;
}

