Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 2 | #include <stdint.h> |
3 | #include <pthread.h> | ||||
Adrian Hunter | 543d976 | 2015-03-02 09:59:05 +0200 | [diff] [blame] | 4 | #include <sched.h> |
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 5 | |
6 | int main(void) | ||||
7 | { | ||||
8 | int ret = 0; | ||||
9 | pthread_attr_t thread_attr; | ||||
Adrian Hunter | 95a09cf | 2015-02-24 12:46:06 +0200 | [diff] [blame] | 10 | cpu_set_t cs; |
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 11 | |
12 | pthread_attr_init(&thread_attr); | ||||
Adrian Hunter | 543d976 | 2015-03-02 09:59:05 +0200 | [diff] [blame] | 13 | CPU_ZERO(&cs); |
14 | |||||
Adrian Hunter | 95a09cf | 2015-02-24 12:46:06 +0200 | [diff] [blame] | 15 | ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs); |
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 16 | |
17 | return ret; | ||||
18 | } |