CPU_ZERO( &set );
CPU_SET( proc_num, &set );
if (sched_setaffinity( gettid(), sizeof( cpu_set_t ), &set ))
perror( "sched_setaffinity" );
undefined reference to 'CPU_ZERO'
undefined reference to 'CPU_SET'
You need to place
at least before
as the define steers what the file included shall provide.
To make sure everything is set as needed, place the
#define at the very beginning of your source files, that is before all
Alternatively you can pass the
#define on GCC's command line by specifying the option