signal: When the process receives a termination signal, it first terminates mcexec.

refs #863
refs #870
This commit is contained in:
Tomoki Shirasawa
2018-01-23 14:40:38 +09:00
parent 2f2b3cdc6f
commit 4bb65494e9
3 changed files with 37 additions and 16 deletions

View File

@@ -32,6 +32,7 @@
#include <limits.h>
#include <syscall.h>
void terminate_mcexec(int, int);
extern long do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact);
long syscall(int num, ihk_mc_user_context_t *ctx);
void set_signal(int sig, void *regs0, siginfo_t *info);
@@ -1116,7 +1117,15 @@ check_sig_pending()
}
if (found) {
interrupt_syscall(thread, 0);
if (sig != SIGCHLD && sig != SIGURG &&
thread->sigcommon->action[sig - 1].sa.sa_handler == NULL) {
terminate_mcexec(0, sig);
}
else if (thread->sigcommon->action[sig - 1].sa.sa_handler &&
thread->sigcommon->action[sig - 1].sa.sa_handler !=
(void *)1) {
interrupt_syscall(thread, 0);
}
}
}