title: Memory usage of current process in C
body: <p>I need to get the memory usage of the current process in C. Can someone offer a code sample of how to do this on a Linux platform?</p>
  
  <p>I'm aware of the <code>cat /proc/&lt;your pid&gt;/status</code> method of getting memory usage, but I have no idea how to capture that in C.</p>
  
  <p>BTW, it's for a PHP extension I'm modifying (granted, I'm a C newbie). If there are shortcuts available within the PHP extension API, that would be even more helpful.</p>