Kernel: Userspace signal handlers are now called one at a time
I added a syscall for telling the kernel when signal execution has finished. We should send a random hash or id to the signal trampoline that we would include in the syscall, so validity of signal exit can be confirmed.
This commit is contained in:
@@ -281,6 +281,39 @@ int execute_command(BAN::Vector<BAN::String>& args)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (args.front() == "signal-test"sv)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
if (pid == 0)
|
||||
{
|
||||
if (signal(SIGSEGV, [](int) { printf("SIGSEGV\n"); }) == SIG_ERR)
|
||||
{
|
||||
perror("signal");
|
||||
exit(1);
|
||||
}
|
||||
printf("child\n");
|
||||
for (;;);
|
||||
}
|
||||
if (pid == -1)
|
||||
{
|
||||
perror("fork");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
if (kill(pid, SIGSEGV) == -1)
|
||||
{
|
||||
perror("kill");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
if (kill(pid, SIGTERM) == -1)
|
||||
{
|
||||
perror("kill");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (args.front() == "cd"sv)
|
||||
{
|
||||
if (args.size() > 2)
|
||||
|
||||
Reference in New Issue
Block a user