diff --git a/cpu-miner.c b/cpu-miner.c index 9730fb62b..08a4af4a9 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -218,7 +218,11 @@ static int opt_scrypt_n = 1024; static int opt_pluck_n = 128; static unsigned int opt_nfactor = 6; int opt_n_threads = 0; +#ifdef __GNUC__ +__int128 opt_affinity = -1L; +#elif int64_t opt_affinity = -1L; +#endif int opt_priority = 0; int num_cpus; char *rpc_url; @@ -477,12 +481,20 @@ static inline void drop_policy(void) #define pthread_setaffinity_np(tid,sz,s) {} /* only do process affinity */ #endif +#ifdef __GNUC__ +static void affine_to_cpu_mask(int id, unsigned __int128 mask) { +#elif static void affine_to_cpu_mask(int id, unsigned long mask) { +#endif cpu_set_t set; CPU_ZERO(&set); for (uint8_t i = 0; i < num_cpus; i++) { // cpu mask +#ifdef __GNUC__ + if (mask & ((unsigned __int128)1UL<