Closed Martins3 closed 3 years ago
I think the signal(Ctrl-C) will no captured immediately after it happened, but in fact, it's doesn't work as expected.
while (true) {
sleep(4);
printf("sleep\n");
}
No, the assumption is wrong, the sleep causes the process to jump into kernel space, so the signal will be captured immediately.
sighandler
executed when syscall returns, so it's IOCTL return or just WRITE return?