#include #include #include void handler(int a) {} int main() { signal(SIGUSR1, &handler); int fpid = fork(); if (fpid == 0) { while (1) { pause(); printf("child\n"); } } else { while (1) { printf("parent\n"); kill(fpid, SIGUSR1); sleep(1); } } return 0; }