Monday, 7 October 2013

Creation of a child process using fork system call

#include<stdio.h> #include<sys/types.h> #include<unistd.h> int main() {     int p[2];     pid_t pid;     char inbuf[10],outbuf[10];      if(pipe(p)==-1)     {                printf("pipe failed\n");                return 1;      }     else          printf(" pipe created\n"); if((pid=fork())) {     printf("In parent process\n");  ...