MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_map_stack

Function vm_map_stack

freebsd/vm/vm_map.c:4492–4515  ·  view source on GitHub ↗

* Create a process's stack for exec_new_vmspace(). This function is never * asked to wire the newly created stack. */

Source from the content-addressed store, hash-verified

4490 * asked to wire the newly created stack.
4491 */
4492int
4493vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
4494 vm_prot_t prot, vm_prot_t max, int cow)
4495{
4496 vm_size_t growsize, init_ssize;
4497 rlim_t vmemlim;
4498 int rv;
4499
4500 MPASS((map->flags & MAP_WIREFUTURE) == 0);
4501 growsize = sgrowsiz;
4502 init_ssize = (max_ssize < growsize) ? max_ssize : growsize;
4503 vm_map_lock(map);
4504 vmemlim = lim_cur(curthread, RLIMIT_VMEM);
4505 /* If we would blow our VMEM resource limit, no go */
4506 if (map->size + init_ssize > vmemlim) {
4507 rv = KERN_NO_SPACE;
4508 goto out;
4509 }
4510 rv = vm_map_stack_locked(map, addrbos, max_ssize, growsize, prot,
4511 max, cow);
4512out:
4513 vm_map_unlock(map);
4514 return (rv);
4515}
4516
4517static int stack_guard_page = 1;
4518SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RWTUN,

Callers 1

exec_new_vmspaceFunction · 0.85

Calls 2

lim_curFunction · 0.85
vm_map_stack_lockedFunction · 0.85

Tested by

no test coverage detected