mcexec: Add --stack-premap=<premap_size>[,<max>]

<premap_size> of stack is pre-mapped on creating a process.
And its max size of stack is set to <max>.
This replaces MCKERNEL_RLIMIT_STACK=<premap_size>,<max>.
This commit is contained in:
Masamichi Takagi
2017-09-26 16:49:40 +09:00
parent c43c1b640a
commit be4d84c0c1
5 changed files with 67 additions and 16 deletions

View File

@@ -497,6 +497,11 @@ static int process_msg_prepare_process(unsigned long rphys)
}
vm->region.map_end = vm->region.map_start;
memcpy(proc->rlimit, pn->rlimit, sizeof(struct rlimit) * MCK_RLIM_MAX);
dkprintf("%s: rlim_cur: %ld, rlim_max: %ld, stack_premap: %ld\n",
__FUNCTION__,
proc->rlimit[MCK_RLIMIT_STACK].rlim_cur,
proc->rlimit[MCK_RLIMIT_STACK].rlim_max,
pn->stack_premap);
if (prepare_process_ranges_args_envs(thread, pn, p, attr,
NULL, 0, NULL, 0) != 0) {