Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <stdint.h>
0003 #include <pthread.h>
0004 #include <sched.h>
0005 
0006 int main(void)
0007 {
0008     int ret = 0;
0009     pthread_attr_t thread_attr;
0010     cpu_set_t cs;
0011 
0012     pthread_attr_init(&thread_attr);
0013     CPU_ZERO(&cs);
0014 
0015     ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
0016 
0017     return ret;
0018 }