From a2af97ddf7ceb4d024d2c8cc7c7d08b226365057 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Sat, 29 Dec 2018 18:58:16 +0100 Subject: executor: Fix FreeBSD such all platforms use same number of entries FreeBSD sets the kcov buffer as number of bytes instead of number of entries. This also fixes the mmap() call, which was failing due to inconsistent sizes. The failing was hidden due to wrong error handling. --- executor/executor_bsd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'executor/executor_bsd.h') diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h index 3d22f91ed..1095c2beb 100644 --- a/executor/executor_bsd.h +++ b/executor/executor_bsd.h @@ -71,7 +71,8 @@ static void cover_open(cover_t* cov) close(fd); #if GOOS_freebsd - if (ioctl(cov->fd, KIOSETBUFSIZE, kCoverSize)) + // On FreeBSD provide the size in bytes, not in number of entries. + if (ioctl(cov->fd, KIOSETBUFSIZE, kCoverSize * sizeof(uint64_t))) fail("ioctl init trace write failed"); #elif GOOS_openbsd unsigned long cover_size = kCoverSize; -- cgit mrf-deployment