aboutsummaryrefslogtreecommitdiff
path: root/executor/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'executor/x86_64')
-rw-r--r--executor/x86_64/asm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/executor/x86_64/asm.c b/executor/x86_64/asm.c
index f57f117..718ebef 100644
--- a/executor/x86_64/asm.c
+++ b/executor/x86_64/asm.c
@@ -206,7 +206,7 @@ int asm_init(Asm *self) {
amal_log_debug("asm: page size: %u", self->allocated_size);
self->code = mmap(NULL, self->allocated_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if(self->code == MAP_FAILED)
- return -errno;
+ return -1;
self->code_it = self->code;
return 0;
}
@@ -253,7 +253,7 @@ typedef union {
int asm_execute(Asm *self, u32 offset) {
RawFuncCallPtr raw_func_ptr;
if(mprotect(self->code, self->allocated_size, PROT_READ | PROT_EXEC) != 0)
- return -errno;
+ return -1;
/*asm_print_code_hex(self);*/
@@ -270,7 +270,7 @@ int asm_ensure_capacity(Asm *self, usize size) {
usize new_size = self->allocated_size + am_pagesize();
void *new_mem = mmap(NULL, new_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if(new_mem == MAP_FAILED)
- return -errno;
+ return -1;
am_memcpy(new_mem, self->code, self->allocated_size);
munmap(self->code, self->allocated_size);