PROCESS CREATION (In Linux/Unix)



PROCESS CREATION

 
PROGRAM:

#include<stdio.h>
#include<conio.h>           
main(int argc,char *argv[])
{
            int pid;
            pid=fork();
if(pid<0)
{
            fprintf(stderr,”Fork failed”);
            exit(-1);
}
else if(pid==0)
            execlp(“/bin/ls”,”ls”,NULL)
else
{
            wait(NULL):
            printf(“Child completed”);
}
exit (0);
}

Comments

  1. I NEED LINUX OS SCHEDULING ALGORITHM CODE

    ReplyDelete

Post a Comment

Popular posts from this blog

TRAVELING SALESMAN USING BRANCH AND BOUND TECHNIQUE

BOOKS DETAILS USING C STRUCTURE

TRAVELING SALESMAN USING BRANCH AND BOUND TECHNIQUE