From 766feb9fab6754417d92b9f0fa7011a7d4dd4e6d Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 16 Nov 2021 15:03:43 +0100 Subject: [PATCH] Allow the traces to be modified --- trace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trace.c b/trace.c index e65cac3..4b19c83 100644 --- a/trace.c +++ b/trace.c @@ -85,7 +85,7 @@ load_thread(struct ovni_ethread *thread, struct ovni_eproc *proc, int index, int thread->gindex = total_threads++; thread->state = TH_ST_UNKNOWN; thread->proc = proc; - thread->stream_fd = open(filepath, O_RDONLY); + thread->stream_fd = open(filepath, O_RDWR); if(thread->stream_fd == -1) { @@ -406,8 +406,8 @@ load_stream_buf(struct ovni_stream *stream, struct ovni_ethread *thread) } stream->size = st.st_size; - stream->buf = mmap(NULL, stream->size, PROT_READ, MAP_SHARED, - thread->stream_fd, 0); + stream->buf = mmap(NULL, stream->size, PROT_READ | PROT_WRITE, + MAP_SHARED, thread->stream_fd, 0); if(stream->buf == MAP_FAILED) {