int status,i;for (i = 0; i < 10; i++){ status = fork(); if (status == 0 || status == -1) break;}if (status == -1){ //error}else if (status == 0){ //sub process}else{ //parent process}