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

Function kern_minherit

freebsd/vm/vm_mmap.c:710–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710int
711kern_minherit(struct thread *td, uintptr_t addr0, size_t len, int inherit0)
712{
713 vm_offset_t addr;
714 vm_size_t size, pageoff;
715 vm_inherit_t inherit;
716
717 addr = (vm_offset_t)addr0;
718 size = len;
719 inherit = inherit0;
720
721 pageoff = (addr & PAGE_MASK);
722 addr -= pageoff;
723 size += pageoff;
724 size = (vm_size_t) round_page(size);
725 if (addr + size < addr)
726 return (EINVAL);
727
728 switch (vm_map_inherit(&td->td_proc->p_vmspace->vm_map, addr,
729 addr + size, inherit)) {
730 case KERN_SUCCESS:
731 return (0);
732 case KERN_PROTECTION_FAILURE:
733 return (EACCES);
734 }
735 return (EINVAL);
736}
737
738#ifndef _SYS_SYSPROTO_H_
739struct madvise_args {

Callers 1

sys_minheritFunction · 0.85

Calls 1

vm_map_inheritFunction · 0.85

Tested by

no test coverage detected