diff --git a/libs/libc/include/luna/syscall.h b/libs/libc/include/luna/syscall.h index 7378a77e..e4e80887 100644 --- a/libs/libc/include/luna/syscall.h +++ b/libs/libc/include/luna/syscall.h @@ -16,6 +16,7 @@ #define SYS_seek 12 #define SYS_exec 13 #define SYS_fcntl 14 +#define SYS_mprotect 15 #ifndef __want_syscalls #ifdef __cplusplus diff --git a/libs/libc/src/sys/mman.cpp b/libs/libc/src/sys/mman.cpp index c0f68ff0..7868da6d 100644 --- a/libs/libc/src/sys/mman.cpp +++ b/libs/libc/src/sys/mman.cpp @@ -14,4 +14,9 @@ extern "C" { return (int)syscall(SYS_munmap, addr, len); } + + int mprotect(void* addr, size_t size, int prot) + { + return (int)syscall(SYS_mprotect, addr, size, prot); + } } \ No newline at end of file diff --git a/libs/libc/src/unistd.cpp b/libs/libc/src/unistd.cpp index eb21d7b7..e9b0daa1 100644 --- a/libs/libc/src/unistd.cpp +++ b/libs/libc/src/unistd.cpp @@ -50,6 +50,7 @@ extern "C" case SYS_seek: case SYS_write: case SYS_read: + case SYS_mprotect: case SYS_mmap: { arg arg0 = va_arg(ap, arg); arg arg1 = va_arg(ap, arg);