+ }
+ /*
+ * root directory vnode, if one
+ */
+ if (up->u_rdir)
+ vtrans(up->u_rdir, RDIR);
+ /*
+ * text vnode
+ */
+ if (p->p_textp &&
+ kvm_read(&(p->p_textp->x_vptr), &xvptr,
+ sizeof (struct vnode *)) == sizeof (struct vnode *) &&
+ xvptr != NULL)
+ vtrans(xvptr, TEXT);
+ /*
+ * current working directory vnode
+ */
+ vtrans(up->u_cdir, CDIR);
+ /*
+ * ktrace vnode, if one
+ */
+ if (p->p_tracep)
+ vtrans(p->p_tracep, TRACE);
+ /*
+ * open files
+ */
+ for (i = 0; i <= up->u_lastfile; i++) {
+ if (up->u_ofile[i] == 0)
+ continue;
+ if (kvm_read(up->u_ofile[i], &file, sizeof (struct file)) !=
+ sizeof (struct file)) {
+ dprintf(stderr, "can't read file %d for pid %d\n",
+ i, Pid);
+ continue;
+ }
+ if (file.f_type == DTYPE_VNODE)
+ vtrans((struct vnode *)file.f_data, i);
+ else if (file.f_type == DTYPE_SOCKET && checkfile == 0)
+ socktrans((struct socket *)file.f_data, i);
+ else {
+ dprintf(stderr,
+ "unknown file type %d for file %d of pid %d\n",
+ file.f_type, i, Pid);
+ }
+ }