aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_bsd.h
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@freebsd.org>2018-12-29 16:10:49 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-12-29 19:17:28 +0100
commit8d43fb9c5ec9d2afd4605d83b57d4b5fbf313114 (patch)
tree879a90534d5dcd1600c11243db43004cbab3e393 /executor/executor_bsd.h
parente0cd1d2e842e0574df4acaca1cab2526114b68cd (diff)
executor: add clarifying comment for FreeBSD.
Diffstat (limited to 'executor/executor_bsd.h')
-rw-r--r--executor/executor_bsd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h
index c1b5bddb6..b359d4781 100644
--- a/executor/executor_bsd.h
+++ b/executor/executor_bsd.h
@@ -79,7 +79,13 @@ static void cover_open(cover_t* cov)
fail("ioctl init trace write failed");
#endif
+#if GOOS_freebsd
+ // FreeBSD only supports kcov on 64-bit platforms and always uses
+ // entries of type uint64_t.
+ size_t mmap_alloc_size = kCoverSize * sizeof(uint64_t);
+#else
size_t mmap_alloc_size = kCoverSize * (is_kernel_64_bit ? 8 : 4);
+#endif
char* mmap_ptr = (char*)mmap(NULL, mmap_alloc_size,
PROT_READ | PROT_WRITE,
MAP_SHARED, cov->fd, 0);