about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-10-04 10:24:41 +0200
committerGitHub <noreply@github.com>2019-10-04 10:24:41 +0200
commit9af6395e92a0f5aafcbd5e58b12a162fa7fe5d8c (patch)
tree4f8311a6c4fab94ed7af48208ecd2a8208ffcaa0 /include
parentd544a5a94790b85dd2326d0776d4aab6567dfd50 (diff)
parent670316f997826f4846b6c596903ea330c7a3a5d5 (diff)
downloadafl++-9af6395e92a0f5aafcbd5e58b12a162fa7fe5d8c.tar.gz
Merge pull request #75 from devnexen/fbsd_binding_to_cpu_x
Binding to the first free cpu, porting to FreeBSD
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 4912b3f0..ff26c894 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -78,8 +78,15 @@
 /* For systems that have sched_setaffinity; right now just Linux, but one
    can hope... */
 
-#ifdef __linux__
+#if defined (__linux__) || defined(__FreeBSD__)
 #define HAVE_AFFINITY 1
+#if defined(__FreeBSD__)
+#include <sys/cpuset.h>
+#include <sys/user.h>
+#include <pthread.h>
+#include <pthread_np.h>
+#define cpu_set_t cpuset_t
+#endif
 #endif                                                         /* __linux__ */
 
 #ifndef SIMPLE_FILES