when mcexec is killed by SIGKILL, terminate mckernel process (BUG#259)

This commit is contained in:
Tomoki Shirasawa
2014-11-27 16:13:52 +09:00
parent 58e2e0a246
commit 8f30e16976
11 changed files with 164 additions and 8 deletions

View File

@ -1530,6 +1530,7 @@ int main_loop(int fd, int cpu, pthread_mutex_t *lock, int mcosid)
case 0: {
int i;
int ret = 1;
struct newprocess_desc npdesc;
ischild = 1;
/* Reopen device fd */
@ -1572,6 +1573,9 @@ fork_child_out:
close(sync_pipe_fd[0]);
close(sync_pipe_fd[1]);
npdesc.pid = getpid();
ioctl(fd, MCEXEC_UP_NEW_PROCESS, &npdesc);
/* TODO: does the forked thread run in a pthread context? */
for (i = 0; i <= ncpu; ++i) {
pthread_join(thread_data[i].thread_id, NULL);