mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-21 07:56:31 +00:00
feat(syscall): 实现syscall restart (#1075)
能够在系统调用返回ERESTARTSYS时,信号处理结束后,自动重启系统调用. TODO: 实现wait等需要restart_block的系统调用的重启 Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
@ -62,9 +62,11 @@ int main() {
|
||||
perror("signal");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("Signal handler for SIGINT is registered.\n");
|
||||
signal_received = 0;
|
||||
kill(getpid(), SIGINT);
|
||||
sleep(5);
|
||||
|
||||
TEST_ASSERT(signal_received, 1, "SIGINT was received", "SIGINT was not received");
|
||||
signal_received = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user