title: how can I get the processor ID of the current process in C in Linux?
body: <p>I'm writing a program that needs to know what logical processor it's running on.</p>
  
  <p><a href="https://stackoverflow.com/questions/790682/" title="Assembly instructions to find how many threads are enabled in a multi-core system">This question</a> tells me how to do it in assembly, while <a href="https://stackoverflow.com/questions/9347909/" title="Can I use Intel syntax of x86 assembly with GCC?">this question</a> tells me how to use this code in assembly without translating it to AT&amp;T syntax. </p>
  
  <p>Is there an easier way to do this using existing Linux system calls or library functions, or is it necessary for me to reinvent the wheel?</p>