libc: Add support for mprotect()

This commit is contained in:
apio 2022-10-15 12:59:13 +02:00
parent 613f8170b6
commit 225284a6ca
3 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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);
}
}

View File

@ -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);