... ... ... if (fork()) { while (1) { system(); ... on some failure condition break the loop; } }