switch (error) { case KERN_SUCCESS: error = 0; break;  case KERN_NO_SPACE:	 error = ENOMEM; break;  default:  error = EAGAIN; }
sys_mlockall(p, v, retval)	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->p_ucred, &p->p_acflag)) != 0)		return (error);#endif	error = uvm_map_pageable_all(&p->p_vmspace->vm_map, flags,	    p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur);	return (error);}