title: Get process and thread affinity mask on Linux
body: <p>On Windows, there exists the GetProcessAffinityMask API call, and there also exists a roundabout way of finding the thread affinity mask, seen here:</p>
  
  <p><a href="https://stackoverflow.com/questions/6601862/query-thread-not-process-processor-affinity">Query thread (not process) processor affinity?</a></p>
  
  <p>Is there any way of getting this information in Linux? A call to sched_getcpu() returns only the cpu that the thread is <em>currently</em> running on, not its affinity mask.</p>