title: Linux and KERN_PROC
body: <p>I'm attempting to get the information of another process via the sysctl interface</p>
  
  <pre><code>   int mib[4] = {0};
     size_t len = sizeof( mib ) / sizeof( int );
     struct kinfo_proc kp;
  
     mib[0] = CTL_KERN;
     mib[1] = KERN_PROC;
     mib[2] = KERN_PROC_PID;
     mib[3] = 3027;
  
     sysctl(mib, 4, &amp;kp, &amp;len, NULL, 0);
  
   Error:
  test.cpp: In function ‘int main(int, char**)’:
  test.cpp:13:22: error: aggregate ‘main(int, char**)::kinfo_proc kp’ has incomplete type and cannot be defined
  test.cpp:16:13: error: ‘KERN_PROC’ was not declared in this scope
  </code></pre>
  
  <p>Had a good look but to no definitive answer. Does linux support <code>KERN_PROC</code> via the <code>sysctl</code> system call.</p>
  
  <p>Distro: Centos 6.2</p>