On Linux PROT_WRITE implies PROT_READ but on other Unices like Solaris,
it's not the case. This resulted in a segfault when reading from the
mapping.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Change-Id: If11bbcf32e33bf5e682afaade2d3769a141c6583
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1302
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tested-by: jenkins
static inline
void mmap_align_ctfser(struct bt_ctfser *ctfser)
{
- ctfser->base_mma = mmap_align(ctfser->cur_packet_size_bytes, PROT_WRITE,
+ ctfser->base_mma = mmap_align(ctfser->cur_packet_size_bytes,
+ PROT_READ | PROT_WRITE,
MAP_SHARED, ctfser->fd, ctfser->mmap_offset);
}