Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sig.c 261B

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