summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-01-21 20:49:29 +0100
committerGitHub <noreply@github.com>2018-01-21 20:49:29 +0100
commit87317174886d43ac8db7a458f7b8329525ada271 (patch)
treeae99cfe57fd615e990402b945dfc3d03af74de76
parent26b14f316fdd86bcf898d09a89f3a5c2566cbc60 (diff)
parent4f109d0335d96e9688c6c31ec738ebfc87937384 (diff)
downloadxmr-stak-87317174886d43ac8db7a458f7b8329525ada271.zip
xmr-stak-87317174886d43ac8db7a458f7b8329525ada271.tar.gz
Merge pull request #772 from vtamara/comp_adJ
It compiles on OpenBSD/adJ 6.2
-rw-r--r--xmrstak/backend/cpu/crypto/cryptonight_common.cpp3
-rw-r--r--xmrstak/backend/cpu/minethd.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/xmrstak/backend/cpu/crypto/cryptonight_common.cpp b/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
index 88876a1..1026b04 100644
--- a/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
+++ b/xmrstak/backend/cpu/crypto/cryptonight_common.cpp
@@ -253,6 +253,9 @@ cryptonight_ctx* cryptonight_alloc_ctx(size_t use_fast_mem, size_t use_mlock, al
#elif defined(__FreeBSD__)
ptr->long_state = (uint8_t*)mmap(0, hashMemSize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_ALIGNED_SUPER | MAP_PREFAULT_READ, -1, 0);
+#elif defined(__OpenBSD__)
+ ptr->long_state = (uint8_t*)mmap(0, hashMemSize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
#else
ptr->long_state = (uint8_t*)mmap(0, hashMemSize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp
index f30d1fe..1d9165e 100644
--- a/xmrstak/backend/cpu/minethd.cpp
+++ b/xmrstak/backend/cpu/minethd.cpp
@@ -93,6 +93,8 @@ bool minethd::thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id
CPU_ZERO(&mn);
CPU_SET(cpu_id, &mn);
return pthread_setaffinity_np(h, sizeof(cpuset_t), &mn) == 0;
+#elif defined(__OpenBSD__)
+ printer::inst()->print_msg(L0,"WARNING: thread pinning is not supported under OPENBSD.");
#else
cpu_set_t mn;
CPU_ZERO(&mn);
OpenPOWER on IntegriCloud