Friday, May 24, 2013

program to create a new process using fork system call

Aim: Write a program to create a new process using fork system call.

Program:

#include<stdio.h>
#include<fcntl.h>
int main(void)
{
          int fd;
          fd=getpid();
          if(fork()<0)
          {
                   printf(“\n Child is not created.”);
          }
          else
          {
                   printf(“\n Child is created.”);
          }
}

No comments:

Post a Comment