Print this page
XXXX adding PID information to netstat output

@@ -75,10 +75,11 @@
 #include <sys/autoconf.h>
 #include <sys/policy.h>
 #include <sys/dld.h>
 #include <sys/zone.h>
 #include <c2/audit.h>
+#include <sys/fcntl.h>
 
 /*
  * This define helps improve the readability of streams code while
  * still maintaining a very old streams performance enhancement.  The
  * performance enhancement basically involved having all callers

@@ -5680,10 +5681,22 @@
         }
 
         case FIONBIO:
         case FIOASYNC:
                 return (0);     /* handled by the upper layer */
+        case F_FORKED: {
+                if (crp != kcred)
+                        return (-1);
+                sh_insert_pid(stp, (proc_t *)arg);
+                return (0);
+        }
+        case F_CLOSED: {
+                if (crp != kcred)
+                        return (-1);
+                sh_remove_pid(stp, (proc_t *)arg);
+                return (0);
+        }
         }
 }
 
 /*
  * Custom free routine used for M_PASSFP messages.