Skip to content

generate a c/c++ code snippet for desired no. of processes to create using fork() system call

Notifications You must be signed in to change notification settings

ankurparihar/fork-logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fork-logic

generate a c/c++ code snippet for desired no. of processes to create using fork() system call
test by placing fork-logic output inside test.c
eg.

$ ./fork-logic 99
pid_t p;
if((p=fork())==0){
    fork();
    if((p=fork())==0){
        fork();
        fork();
        fork();
        fork();
        if((p=fork())==0){
            fork();
        }
    }
}

About

generate a c/c++ code snippet for desired no. of processes to create using fork() system call

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages