strace/test/sig.c

20 lines
250 B
C
Raw Normal View History

#include <stdlib.h>
1999-02-19 03:21:36 +03:00
#include <signal.h>
#include <unistd.h>
void interrupt()
{
write(2, "xyzzy\n", 6);
}
int main(int argc, char *argv[])
1999-02-19 03:21:36 +03:00
{
char buf[1024];
signal(SIGINT, interrupt);
read(0, buf, 1024);
write(2, "qwerty\n", 7);
return 0;
1999-02-19 03:21:36 +03:00
}