2016-09-07 09:16:31 +00:00
|
|
|
/**
|
|
|
|
* Author......: Jens Steube <jens.steube@gmail.com>
|
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _AFFINITY_H
|
|
|
|
#define _AFFINITY_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2016-09-07 09:42:05 +00:00
|
|
|
#include <stdarg.h>
|
2016-09-07 09:16:31 +00:00
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (_POSIX)
|
2016-09-07 09:16:31 +00:00
|
|
|
#include <pthread.h>
|
2016-09-07 09:24:21 +00:00
|
|
|
#include <sys/sysctl.h>
|
2016-09-07 09:16:31 +00:00
|
|
|
#endif // _POSIX
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (__APPLE__)
|
2016-09-07 09:24:21 +00:00
|
|
|
#include <mach-o/dyld.h>
|
|
|
|
#include <mach/mach.h>
|
|
|
|
#endif // __APPLE__
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (_WIN)
|
2016-09-07 09:16:31 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#endif // _WIN
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (__APPLE__)
|
2016-09-07 09:16:31 +00:00
|
|
|
typedef struct cpu_set
|
|
|
|
{
|
|
|
|
uint32_t count;
|
|
|
|
|
|
|
|
} cpu_set_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void set_cpu_affinity (char *cpu_affinity);
|
|
|
|
|
|
|
|
#endif // _AFFINITY_H
|