-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed tests on OpenBSD #142
Conversation
Do all tests pass on OpenBSD? |
Yes they do. |
I'm thinking to add Lines 42 to 55 in 4296c35
|
b602268
to
348b011
Compare
Good idea. I updated the patch to account for this. Despite the point I don't think OpenBSD is a system to mine efficiently on :) |
Since OpenBSD 6.0 W^X is enforced. Added `RANDOMX_FLAG_SECURE` in tests and benchmarks. Updated comment. Excluded `cpu_set_t` since it is not defined on OpenBSD.
4347f72
to
5c0486b
Compare
@@ -65,7 +65,7 @@ set_thread_affinity(std::thread::native_handle_type thread, | |||
(thread_policy_t)&policy, 1); | |||
#elif defined(_WIN32) || defined(__CYGWIN__) | |||
rc = SetThreadAffinityMask(reinterpret_cast<HANDLE>(thread), 1ULL << cpuid) == 0 ? -2 : 0; | |||
#else | |||
#elif !defined(__OpenBSD__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with this on OpenBSD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm, I missed your comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually be rewritten for OpenBSD: https://man.openbsd.org/NetBSD-7.0.1/affinity.3
Struct name is cpuset_t
there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be mistaken but you are referring to a man page of NetBSD.
I can't find either one of these in the OpenBSD sources: cpu_set_t
, cpuset_t
, CPU_ZERO
, CPU_SET
.
I think there is no thread affinity for OpenBSD: https://man.openbsd.org/pthreads.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right and it seems to be a design decision for OpenBSD.
@ston1th Edit: nvm, OpenBSD doesn't support it. |
Since OpenBSD 6.0 W^X is enforced.
Added
RANDOMX_FLAG_SECURE
in tests and benchmarks.Excluded
cpu_set_t
since it is not defined on OpenBSD.