blob: fdada5e8d454c549e4cb57059f52ebb8a1825c8e [file] [log] [blame]
Vineet Gupta459a3df2015-01-13 19:13:24 +05301#include <stdint.h>
2#include <pthread.h>
Adrian Hunter543d9762015-03-02 09:59:05 +02003#include <sched.h>
Vineet Gupta459a3df2015-01-13 19:13:24 +05304
5int main(void)
6{
7 int ret = 0;
8 pthread_attr_t thread_attr;
Adrian Hunter95a09cf2015-02-24 12:46:06 +02009 cpu_set_t cs;
Vineet Gupta459a3df2015-01-13 19:13:24 +053010
11 pthread_attr_init(&thread_attr);
Adrian Hunter543d9762015-03-02 09:59:05 +020012 CPU_ZERO(&cs);
13
Adrian Hunter95a09cf2015-02-24 12:46:06 +020014 ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
Vineet Gupta459a3df2015-01-13 19:13:24 +053015
16 return ret;
17}