#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
pid_t pid = fork();
if (pid == 0) {
for(;;);
} // if
int status;
wait(&status);
if (WIFSIGNALED(status)) {
printf("child died from signal\n");
} // if
return 0;
} // main
Created
February 5, 2019 20:31
-
-
Save mepcotterell/0b97227e50fadcdf57b2631d84cebc5d to your computer and use it in GitHub Desktop.