como sair de um processo filho - _exit () vs. exit
Considere este trecho de código:
pid_t cpid = fork();
if (cpid == -1) {
perror("fork");
exit(EXIT_FAILURE);
}
if (cpid == 0) { // in child
execvp(argv[1], argv + 1);
perror("execvp");
_exit(EXIT_FAILURE);
}
// in parent
Como devo sair do processo filho se o execvp retornar? Devo usar exit () ou _exit ()?