1 #include <stdlib.h> 2 #include <signal.h> 3 #include <unistd.h> 4 5 void interrupt() 6 { 7 write(2, "xyzzy\n", 6); 8 } 9 10 int main(int argc, char *argv[]) 11 { 12 char buf[1024]; 13 14 signal(SIGINT, interrupt); 15 read(0, buf, 1024); 16 write(2, "qwerty\n", 7); 17 18 return 0; 19 } 20