Print this page
XXXX adding PID information to netstat output

@@ -1782,10 +1782,16 @@
         if ((fd = ufalloc(0)) == -1)
                 return (-1);
         setf(fd, fp);
         dp->d_data.d_desc.d_descriptor = fd;
 
+        /* Add pid to the list associated with that descriptor. */
+        if (fp->f_vnode != NULL)
+                (void) VOP_IOCTL(fp->f_vnode, F_ASSOCI_PID,
+                    (intptr_t)curproc->p_pidp->pid_id, FKIOCTL, kcred, NULL,
+                    NULL);
+
         /* Fill in the attributes */
         if (VOP_REALVP(fp->f_vnode, &vp, NULL))
                 vp = fp->f_vnode;
         if (vp && vp->v_type == VDOOR) {
                 if (VTOD(vp)->door_target == curproc)