aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-05 17:00:28 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-05 19:02:12 +0200
commit3a866068b39a13e38cfb9287d84c912faf2b1d7e (patch)
treef18920e5ca210deb37b0a03994eb4b0473b47a62 /executor
parent5060392c4994654ed965a21d785eb1a2cf2e2640 (diff)
executor: fix 32-bit mode
The correct type is kernel long size, not user-space long size. We approximate it with uint64.
Diffstat (limited to 'executor')
-rw-r--r--executor/executor.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 8fa4a071b..7ccca2230 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -814,17 +814,13 @@ void cover_open()
th->cover_fd = open("/sys/kernel/debug/kcov", O_RDWR);
if (th->cover_fd == -1)
fail("open of /sys/kernel/debug/kcov failed");
-
if (ioctl(th->cover_fd, KCOV_INIT_TRACE, kCoverSize))
fail("cover init trace write failed");
-
- size_t mmap_alloc_size = kCoverSize * sizeof(unsigned long);
+ size_t mmap_alloc_size = kCoverSize * sizeof(th->cover_data[0]);
uint64_t* mmap_ptr = (uint64_t*)mmap(NULL, mmap_alloc_size,
PROT_READ | PROT_WRITE, MAP_SHARED, th->cover_fd, 0);
-
if (mmap_ptr == MAP_FAILED)
fail("cover mmap failed");
-
th->cover_size_ptr = mmap_ptr;
th->cover_data = &mmap_ptr[1];
}