title: How to extract information from the content of /proc files on Linux using C?
body: <p>I have been working on this for over 7 hours a day for 5 days. I am not exactly the best coder, so I need some help. I need to know how should I get the info from /proc using a C program on Linux.
  The info has to be printed out and include the following:</p>
  <ul>
  <li>The complete command line for the process.</li>
  <li>State of the process.</li>
  <li>The PID of the parent.</li>
  <li>Priority.</li>
  <li>The nice value.</li>
  <li>Real­time  scheduling priority.</li>
  <li>CPU number last executed on.</li>
  <li>Amount of time that this process has been scheduled  in  user  mode.</li>
  <li>Amount of time that this process has been scheduled in kernel  mode.</li>
  <li>Virtual memory size in bytes.</li>
  <li>Total program size in pages.</li>
  <li>Resident Set Size (RSS) in bytes.</li>
  <li>Resident Set Size (RSS): number of pages the process has in real memory in 
  pages.</li>
  <li>Text (code) size in pages.</li>
  <li>Data + stack size in pages.</li>
  <li>Page table entries size in KB.</li>
  <li>Size of data in KB.</li>
  <li>Size of stack in KB.</li>
  <li>Size of text segment KB.</li>
  </ul>