#include #include #include using namespace std; int main() { pid_t pid{fork()}; if (pid == 0) { sleep(1); cout << "The child here, with pid " << getpid() << endl; cout << "The child here: goodby " << endl << endl; cout << "do a ps -ef | grep " << getpid() << endl; exit(0); } sigset_t blockSet, prevMask; sigemptyset(&blockSet); sigaddset(&blockSet, SIGCHLD); sigprocmask(SIG_BLOCK, &blockSet, &prevMask); cout << "I am a bad parent, I am now ignoring my children " << endl; sleep(200); return 0; }