blob: 38c71131c452e89699bee47d83bffa5f9145ec2b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Vineet Gupta459a3df2015-01-13 19:13:24 +05302#include <stdint.h>
3#include <pthread.h>
Adrian Hunter543d9762015-03-02 09:59:05 +02004#include <sched.h>
Vineet Gupta459a3df2015-01-13 19:13:24 +05305
6int main(void)
7{
8 int ret = 0;
9 pthread_attr_t thread_attr;
Adrian Hunter95a09cf2015-02-24 12:46:06 +020010 cpu_set_t cs;
Vineet Gupta459a3df2015-01-13 19:13:24 +053011
12 pthread_attr_init(&thread_attr);
Adrian Hunter543d9762015-03-02 09:59:05 +020013 CPU_ZERO(&cs);
14
Adrian Hunter95a09cf2015-02-24 12:46:06 +020015 ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
Vineet Gupta459a3df2015-01-13 19:13:24 +053016
17 return ret;
18}