sys/vm/vm_vmspace.c
int
sys_vmspace_destroy(struct vmspace_destroy_args *uap)
{
	struct vkernel_proc *vkp;
	struct vmspace_entry *ve;
	int error;

	get_mplock();
	if ((vkp = curproc->p_vkernel) == NULL) {
		error = EINVAL;
		goto done3;
	}
	lwkt_gettoken(&vkp->token);
	if ((ve = vkernel_find_vmspace(vkp, uap->id)) == NULL) {
		error = ENOENT;
		goto done2;
	}
	if (ve->refs) {
		error = EBUSY;
		goto done2;
	}
	vmspace_entry_delete(ve, vkp);
	error = 0;
done2:
	lwkt_reltoken(&vkp->token);
done3:
	rel_mplock();
	return(error);
}
/*
 * Destroy a VMSPACE given its identifier.
 *
 * No requirements.
 */
Destroy a VMSPACE given its identifier.
No requirements.
Destroy a VMSPACE given its identifier . No requirements .
int
sys_vmspace_destroy(struct vmspace_destroy_args *uap)
{
	struct vkernel_proc *vkp;
	struct vmspace_entry *ve;
	int error;
	get_mplock();
	if ((vkp = curproc->p_vkernel) == NULL) {
		error = EINVAL;
		goto done3;
	}
	lwkt_gettoken(&vkp->token);
	if ((ve = vkernel_find_vmspace(vkp, uap->id)) == NULL) {
		error = ENOENT;
		goto done2;
	}
	if (ve->refs) {
		error = EBUSY;
		goto done2;
	}
	vmspace_entry_delete(ve, vkp);
	error = 0;
done2:
	lwkt_reltoken(&vkp->token);
done3:
	rel_mplock();
	return(error);
}
int sys_vmspace_destroy ( struct vmspace_destroy_args * uap ) { struct vkernel_proc * vkp ; struct vmspace_entry * ve ; int error ; get_mplock ( ) ; if ( ( vkp = curproc -> p_vkernel ) == NULL ) { error = EINVAL ; goto done3 ; } lwkt_gettoken ( & vkp -> token ) ; if ( ( ve = vkernel_find_vmspace ( vkp , uap -> id ) ) == NULL ) { error = ENOENT ; goto done2 ; } if ( ve -> refs ) { error = EBUSY ; goto done2 ; } vmspace_entry_delete ( ve , vkp ) ; error = 0 ; done2 : lwkt_reltoken ( & vkp -> token ) ; done3 : rel_mplock ( ) ; return ( error ) ; }
Destroy a VMSPACE given its identifier.
Destroy a VMSPACE given its identifier .