Print this page
XXXX adding PID information to netstat output

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/doorfs/door_sys.c
          +++ new/usr/src/uts/common/fs/doorfs/door_sys.c
↓ open down ↓ 1776 lines elided ↑ open up ↑
1777 1777          struct vnode *vp;
1778 1778          int     fd;
1779 1779          door_attr_t attributes = DOOR_DESCRIPTOR;
1780 1780  
1781 1781          ASSERT(MUTEX_NOT_HELD(&door_knob));
1782 1782          if ((fd = ufalloc(0)) == -1)
1783 1783                  return (-1);
1784 1784          setf(fd, fp);
1785 1785          dp->d_data.d_desc.d_descriptor = fd;
1786 1786  
     1787 +        /* Add pid to the list associated with that descriptor. */
     1788 +        if (fp->f_vnode != NULL)
     1789 +                (void) VOP_IOCTL(fp->f_vnode, F_ASSOCI_PID,
     1790 +                    (intptr_t)curproc->p_pidp->pid_id, FKIOCTL, kcred, NULL,
     1791 +                    NULL);
     1792 +
1787 1793          /* Fill in the attributes */
1788 1794          if (VOP_REALVP(fp->f_vnode, &vp, NULL))
1789 1795                  vp = fp->f_vnode;
1790 1796          if (vp && vp->v_type == VDOOR) {
1791 1797                  if (VTOD(vp)->door_target == curproc)
1792 1798                          attributes |= DOOR_LOCAL;
1793 1799                  attributes |= VTOD(vp)->door_flags & DOOR_ATTR_MASK;
1794 1800                  dp->d_data.d_desc.d_id = VTOD(vp)->door_index;
1795 1801          }
1796 1802          dp->d_attributes = attributes;
↓ open down ↓ 920 lines elided ↑ open up ↑
2717 2723                  }
2718 2724          }
2719 2725          return (0);
2720 2726  }
2721 2727  
2722 2728  /*
2723 2729   * Move the results from the server to the client
2724 2730   */
2725 2731  static int
2726 2732  door_results(kthread_t *caller, caddr_t data_ptr, size_t data_size,
2727      -                door_desc_t *desc_ptr, uint_t desc_num)
     2733 +    door_desc_t *desc_ptr, uint_t desc_num)
2728 2734  {
2729 2735          door_client_t   *ct = DOOR_CLIENT(caller->t_door);
2730 2736          door_upcall_t   *dup = ct->d_upcall;
2731 2737          size_t          dsize;
2732 2738          size_t          rlen;
2733 2739          size_t          result_size;
2734 2740  
2735 2741          ASSERT(DOOR_T_HELD(ct));
2736 2742          ASSERT(MUTEX_NOT_HELD(&door_knob));
2737 2743  
↓ open down ↓ 825 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX