Skip to content

Latest commit

 

History

History
20 lines (20 loc) · 389 Bytes

README.md

File metadata and controls

20 lines (20 loc) · 389 Bytes

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();
        }
    }
}