I have included:
#include <sched.h> #define _GNU_SOURCE
then in my code I wrote (brief mention):
cpu_set_t set; CPU_ZERO( &set ); CPU_SET( proc_num, &set ); if (sched_setaffinity( gettid(), sizeof( cpu_set_t ), &set )) { perror( "sched_setaffinity" ); return NULL; }
But when I compile, I find
undefined reference to 'CPU_ZERO' undefined reference to 'CPU_SET'
Please, help...
c linux pthreads
muskaan
source share