mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-09 16:52:40 -05:00
DragonflyBSD compilation fixes
This commit is contained in:
@@ -16,10 +16,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#ifdef XMRIG_OS_FREEBSD
|
||||
# include <sys/types.h>
|
||||
# include <sys/param.h>
|
||||
# include <sys/cpuset.h>
|
||||
# ifndef __DragonFly__
|
||||
# include <sys/cpuset.h>
|
||||
# endif
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
@@ -41,11 +43,6 @@
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
typedef cpuset_t cpu_set_t;
|
||||
#endif
|
||||
|
||||
|
||||
char *xmrig::Platform::createUserAgent()
|
||||
{
|
||||
constexpr const size_t max = 256;
|
||||
@@ -74,6 +71,19 @@ char *xmrig::Platform::createUserAgent()
|
||||
|
||||
|
||||
#ifndef XMRIG_FEATURE_HWLOC
|
||||
#ifdef __DragonFly__
|
||||
|
||||
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifdef XMRIG_OS_FREEBSD
|
||||
typedef cpuset_t cpu_set_t;
|
||||
#endif
|
||||
|
||||
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
{
|
||||
cpu_set_t mn;
|
||||
@@ -89,7 +99,9 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __DragonFly__
|
||||
#endif // XMRIG_FEATURE_HWLOC
|
||||
|
||||
|
||||
void xmrig::Platform::setProcessPriority(int)
|
||||
|
||||
Reference in New Issue
Block a user