What the difference in doing something like
Code:
int main(void)
{
pid_t pid;
int count;
for(count=0; count<5; count++) {
pid=fork();
if (pid==0) {
/* child process */
execlp("kedit", "kedit", (char *) NULL);
perror("exec failure");
exit(1);
}
}
return 0;
}
as opposed to say something like
Code:
int main(void)
{
pid_t pid;
int count;
for(count=0; count<5; count++) {
pid=fork();
if (pid==0) {
/* child process */
if((execlp("kedit", "kedit", (char *) NULL)) < 0){
perror("exec failure");
exit(1);
}
}
}
return 0;
}