use madvise() when zap_vma_ptes() fails

This commit is contained in:
NAKAMURA Gou
2014-08-07 12:31:48 +09:00
parent b4910ec33f
commit 8c1c8a40d1
2 changed files with 19 additions and 8 deletions

View File

@ -1157,12 +1157,16 @@ int main_loop(int fd, int cpu, pthread_mutex_t *lock)
return w.sr.args[0];
case __NR_mmap:
case __NR_munmap:
case __NR_mprotect:
/* reserved for internal use */
do_syscall_return(fd, cpu, -ENOSYS, 0, 0, 0, 0);
break;
case __NR_munmap:
ret = madvise((void *)w.sr.args[0], w.sr.args[1], MADV_DONTNEED);
do_syscall_return(fd, cpu, ret, 0, 0, 0, 0);
break;
#ifdef USE_SYSCALL_MOD_CALL
case 303:{
__dprintf("mcexec.c,mod_cal,mod=%ld,cmd=%ld\n", w.sr.args[0], w.sr.args[1]);