mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-25 12:06:04 +00:00
Fixes for OS X.
This commit is contained in:
parent
555eee8236
commit
faf14f5e5a
3 changed files with 5 additions and 16 deletions
|
@ -42,18 +42,4 @@ void Cpu::init()
|
||||||
|
|
||||||
void Cpu::setAffinity(int id, unsigned long mask)
|
void Cpu::setAffinity(int id, unsigned long mask)
|
||||||
{
|
{
|
||||||
cpu_set_t set;
|
|
||||||
CPU_ZERO(&set);
|
|
||||||
|
|
||||||
for (int i = 0; i < m_totalThreads; i++) {
|
|
||||||
if (mask & (1UL << i)) {
|
|
||||||
CPU_SET(i, &set);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == -1) {
|
|
||||||
sched_setaffinity(0, sizeof(&set), &set);
|
|
||||||
} else {
|
|
||||||
pthread_setaffinity_np(pthread_self(), sizeof(&set), &set);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,10 @@ void Cpu::init()
|
||||||
|
|
||||||
void Cpu::setAffinity(int id, unsigned long mask)
|
void Cpu::setAffinity(int id, unsigned long mask)
|
||||||
{
|
{
|
||||||
|
if (id == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cpu_set_t set;
|
cpu_set_t set;
|
||||||
CPU_ZERO(&set);
|
CPU_ZERO(&set);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include "net/Network.h"
|
#include "net/Network.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ char *Network::userAgent()
|
||||||
const size_t max = 128;
|
const size_t max = 128;
|
||||||
|
|
||||||
char *buf = static_cast<char*>(malloc(max));
|
char *buf = static_cast<char*>(malloc(max));
|
||||||
snprintf(buf, max, "%s/%s", APP_NAME, APP_VERSION);
|
snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue