if ((error = procfs_checkioperm(curp, p)) != 0) return (error);
procfs_doregs(curp, p, pfs, uio)	struct proc *curp;	struct proc *p;	struct pfsnode *pfs;	struct uio *uio;{#if defined(PT_GETREGS) || defined(PT_SETREGS)	int error;	struct reg r;	char *kv;	int kl;	kl = sizeof(r);	kv = (char *) &r;	kv += uio->uio_offset;	kl -= uio->uio_offset;	if (kl > uio->uio_resid)		kl = uio->uio_resid;	PHOLD(p);	if (kl < 0)		error = EINVAL;	else		error = process_read_regs(p, &r);	if (error == 0)		error = uiomove(kv, kl, uio);	if (error == 0 && uio->uio_rw == UIO_WRITE) {		if (p->p_stat != SSTOP)			error = EBUSY;		else			error = process_write_regs(p, &r);	}	PRELE(p);	uio->uio_offset = 0;	return (error);#else	return (EINVAL);#endif}