Skip to content
Snippets Groups Projects
Select Git revision
  • 98fbc382804291fb14c645e0f32730b3ec6569b4
  • master default
2 results

utils.c

Blame
  • Forked from sce213ta / mysh-1
    Source project has a limited visibility.
    forktest.c 285 B
    #include <stdio.h>
    #include <sys/types.h>
    #include <unistd.h>
    
    int main()
    {
    	int a = 0; 
    	pid_t pid ,pid2;
           	pid = fork(); 
    	pid2 = fork(); 
    	for (int i = 0; i < 100; i++)
    	{
    		sleep(1);
    		if (pid == 0)	
    			printf("PID %d : PID2 %d : A=%d : i=%d : \n", pid, pid2,  a++, i);
    	}
    }