From 8d43fb9c5ec9d2afd4605d83b57d4b5fbf313114 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Sat, 29 Dec 2018 16:10:49 +0100 Subject: executor: add clarifying comment for FreeBSD. --- executor/executor_bsd.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'executor') 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); -- cgit mrf-deployment