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> |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 3 | |
4 | void interrupt() | ||||
5 | { | ||||
6 | write(2, "xyzzy\n", 6); | ||||
7 | } | ||||
8 | |||||
9 | int main(int argc, char *argv[]) | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 10 | { |
11 | char buf[1024]; | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 12 | |
13 | signal(SIGINT, interrupt); | ||||
14 | read(0, buf, 1024); | ||||
15 | write(2, "qwerty\n", 7); | ||||
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 16 | |
Denys Vlasenko | 8ed5727 | 2009-02-25 14:24:02 +0000 | [diff] [blame] | 17 | return 0; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 18 | } |