title: get data as pfiles within kernel module code in solaris
body: <p>When I execute on solaris 11.0:  </p>
  
  <pre><code>pfiles /proc/PROCESSID
  </code></pre>
  
  <p>The result is process information, a small chunk of output is what interest me:  </p>
  
  <pre><code> 4: S_IFSOCK mode:0666 dev:543,0 ino:46228 uid:0 gid:0 size:0
    O_RDWR|O_NONBLOCK
      SOCK_STREAM
      SO_REUSEADDR,SO_KEEPALIVE,SO_SNDBUF(49152),SO_RCVBUF(128480)
      sockname: AF_INET6 ::ffff:10.10.50.28  port: 22
      peername: AF_INET6 ::ffff:10.16.6.150  port: 55504
  </code></pre>
  
  <p>The process I pfiles /proc/PROCESSID is the sshd session itself.  </p>
  
  <p><strong>My question is given a process id, how can i get this (pfiles) information from within a kernel code ?</strong>  </p>
  
  <p>When looking in <em>struct proc</em> i could not find something that give me this data.  </p>
  
  <p>Is there a pointer to struct that hold all open files occupied by the process on the proccess' proc?  </p>
  
  <p>I also executed <em>truss pfiles /proc/PROCESSID</em> but could not find the exact call</p>