int sys_munlockall(struct proc *p, void *v, register_t *retval) { (void) uvm_map_pageable_all(&p->p_vmspace->vm_map, 0, 0); return (0); }
int sys_mlockall(struct proc *p, void *v, register_t *retval) { struct sys_mlockall_args /* { syscallarg(int) flags; } */ *uap = v; int error, flags; flags = SCARG(uap, flags); if (flags == 0 || (flags & ~(MCL_CURRENT|MCL_FUTURE)) != 0) return (EINVAL); #ifndef pmap_wired_count if ((error = suser(p, 0)) != 0) return (error); #endif error = uvm_map_pageable_all(&p->p_vmspace->vm_map, flags, p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur); if (error != 0 && error != ENOMEM) return (EAGAIN); return (error); }
int sys_munlockall(struct lwp *l, const void *v, register_t *retval) { struct proc *p = l->l_proc; (void) uvm_map_pageable_all(&p->p_vmspace->vm_map, 0, 0); return 0; }
int sys_mlockall(struct lwp *l, const struct sys_mlockall_args *uap, register_t *retval) { /* { syscallarg(int) flags; } */ struct proc *p = l->l_proc; int error, flags; flags = SCARG(uap, flags); if (flags == 0 || (flags & ~(MCL_CURRENT|MCL_FUTURE)) != 0) return EINVAL; error = uvm_map_pageable_all(&p->p_vmspace->vm_map, flags, p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur); return error; }