Print this page
XXXX adding PID information to netstat output

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/streamio.c
          +++ new/usr/src/uts/common/os/streamio.c
↓ open down ↓ 69 lines elided ↑ open up ↑
  70   70  #include <sys/ptyvar.h>
  71   71  #include <sys/vuid_event.h>
  72   72  #include <sys/modctl.h>
  73   73  #include <sys/sunddi.h>
  74   74  #include <sys/sunldi_impl.h>
  75   75  #include <sys/autoconf.h>
  76   76  #include <sys/policy.h>
  77   77  #include <sys/dld.h>
  78   78  #include <sys/zone.h>
  79   79  #include <c2/audit.h>
       80 +#include <sys/fcntl.h>
  80   81  
  81   82  /*
  82   83   * This define helps improve the readability of streams code while
  83   84   * still maintaining a very old streams performance enhancement.  The
  84   85   * performance enhancement basically involved having all callers
  85   86   * of straccess() perform the first check that straccess() will do
  86   87   * locally before actually calling straccess().  (There by reducing
  87   88   * the number of unnecessary calls to straccess().)
  88   89   */
  89   90  #define i_straccess(x, y)       ((stp->sd_sidp == NULL) ? 0 : \
↓ open down ↓ 5585 lines elided ↑ open up ↑
5675 5676          {
5676 5677                  /* freectty() always assumes curproc. */
5677 5678                  if (freectty(B_FALSE) != 0)
5678 5679                          return (0);
5679 5680                  return (ENOTTY);
5680 5681          }
5681 5682  
5682 5683          case FIONBIO:
5683 5684          case FIOASYNC:
5684 5685                  return (0);     /* handled by the upper layer */
     5686 +        case F_FORKED: {
     5687 +                if (crp != kcred)
     5688 +                        return (-1);
     5689 +                sh_insert_pid(stp, (proc_t *)arg);
     5690 +                return (0);
     5691 +        }
     5692 +        case F_CLOSED: {
     5693 +                if (crp != kcred)
     5694 +                        return (-1);
     5695 +                sh_remove_pid(stp, (proc_t *)arg);
     5696 +                return (0);
     5697 +        }
5685 5698          }
5686 5699  }
5687 5700  
5688 5701  /*
5689 5702   * Custom free routine used for M_PASSFP messages.
5690 5703   */
5691 5704  static void
5692 5705  free_passfp(struct k_strrecvfd *srf)
5693 5706  {
5694 5707          (void) closef(srf->fp);
↓ open down ↓ 2922 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX