Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 1 | #include <stdlib.h> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2 | #include <signal.h> |
Mike Frysinger | b51ce62 | 2013-05-02 15:43:45 -0400 | [diff] [blame] | 3 | #include <unistd.h> |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 4 | |
5 | void interrupt() | ||||
6 | { | ||||
7 | write(2, "xyzzy\n", 6); | ||||
8 | } | ||||
9 | |||||
10 | int main(int argc, char *argv[]) | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 11 | { |
12 | char buf[1024]; | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 13 | |
14 | signal(SIGINT, interrupt); | ||||
15 | read(0, buf, 1024); | ||||
16 | write(2, "qwerty\n", 7); | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 17 | |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 18 | return 0; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 19 | } |