test-pthread-attr-setaffinity-np.c 303 B

123456789101112131415
  1. #include <stdint.h>
  2. #include <pthread.h>
  3. int main(void)
  4. {
  5. int ret = 0;
  6. pthread_attr_t thread_attr;
  7. cpu_set_t cs;
  8. pthread_attr_init(&thread_attr);
  9. /* don't care abt exact args, just the API itself in libpthread */
  10. ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
  11. return ret;
  12. }