about summary refs log tree commit diff
path: root/include/afl-fuzz.h
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2019-10-03 20:27:00 +0100
committerDavid Carlier <devnexen@gmail.com>2019-10-04 03:52:39 +0100
commit670316f997826f4846b6c596903ea330c7a3a5d5 (patch)
tree4f8311a6c4fab94ed7af48208ecd2a8208ffcaa0 /include/afl-fuzz.h
parentd544a5a94790b85dd2326d0776d4aab6567dfd50 (diff)
downloadafl++-670316f997826f4846b6c596903ea330c7a3a5d5.tar.gz
Binding to the first free cpu, porting to FreeBSD
Diffstat (limited to 'include/afl-fuzz.h')
-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