fn sys_mem_alloc(envid: u32, va: u32, perm: u32) -> u32Expand description
SYSNO: 6, alloc a page and map it to va.
The perm is used when insert the page alloced into the
env’s page table.
Only the current env or the child of the current env can be allocated.
If va is already mapped, that original page is sliently unmapped.
§Failure
This syscall will return a negated-KError returned by envid2env, page_alloc and page_insert.
For example, the envid is not allowed or the pages are ran out.