Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/cloudabi/cloudabi_mem.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap) | ||||
if (uap->flags & CLOUDABI_MAP_SHARED) | if (uap->flags & CLOUDABI_MAP_SHARED) | ||||
flags |= MAP_SHARED; | flags |= MAP_SHARED; | ||||
/* Translate protection. */ | /* Translate protection. */ | ||||
error = convert_mprot(uap->prot, &prot); | error = convert_mprot(uap->prot, &prot); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, | return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, | ||||
uap->fd, uap->off)); | PROT_MAX(PROT_ALL) | prot, flags, uap->fd, uap->off)); | ||||
} | } | ||||
int | int | ||||
cloudabi_sys_mem_protect(struct thread *td, | cloudabi_sys_mem_protect(struct thread *td, | ||||
struct cloudabi_sys_mem_protect_args *uap) | struct cloudabi_sys_mem_protect_args *uap) | ||||
{ | { | ||||
int error, prot; | int error, prot; | ||||
Show All 39 Lines |