mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-14 02:22:50 -05:00
Some FreeBSD fixes
This commit is contained in:
@@ -20,8 +20,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/cpuset.h>
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
@@ -30,6 +34,9 @@
|
||||
|
||||
#include "Cpu.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
typedef cpuset_t cpu_set_t;
|
||||
#endif
|
||||
|
||||
void Cpu::init()
|
||||
{
|
||||
@@ -53,7 +60,9 @@ void Cpu::setAffinity(int id, uint64_t mask)
|
||||
}
|
||||
|
||||
if (id == -1) {
|
||||
#ifndef __FreeBSD__
|
||||
sched_setaffinity(0, sizeof(&set), &set);
|
||||
#endif
|
||||
} else {
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(&set), &set);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user