strace/test/sig.c
Denys Vlasenko 8ed5727642 By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):
strace.c: suppress "warning: unused static" message by adding #ifdef's around
 a variable
.gitignore: trivial
test/*.c: cleanup (suppress warnings, much better style).
2009-02-25 14:24:02 +00:00

19 lines
230 B
C

#include <stdlib.h>
#include <signal.h>
void interrupt()
{
write(2, "xyzzy\n", 6);
}
int main(int argc, char *argv[])
{
char buf[1024];
signal(SIGINT, interrupt);
read(0, buf, 1024);
write(2, "qwerty\n", 7);
return 0;
}