Skip to content

Commit

Permalink
runtime: track_memory_map: move includes to top
Browse files Browse the repository at this point in the history
  • Loading branch information
fw-immunant committed Sep 6, 2023
1 parent cc942e5 commit c6d2916
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions runtime/track_memory_map.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#define _GNU_SOURCE
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/ptrace.h>
#include <sys/user.h>
#include <sys/wait.h>

#include "get_inferior_pkru.h"
Expand Down Expand Up @@ -181,8 +183,6 @@ unsigned char pkey_for_pkru(uint32_t pkru) {
#undef CHECK
}

#include <sys/user.h>

/* query pid to determine the mmap-relevant event being requested. returns true
* unless something horrible happens */
bool interpret_syscall(struct user_regs_struct *regs, unsigned char pkey,
Expand Down Expand Up @@ -341,7 +341,6 @@ void return_syscall_eperm(pid_t pid) {
return;
}
/* return -EPERM */
#include <errno.h>
regs.rax = -EPERM;
ptrace(PTRACE_SETREGS, pid, 0, &regs);
fprintf(stderr, "wrote -eperm to rax\n");
Expand Down

0 comments on commit c6d2916

Please sign in to comment.