libc: Add support for mprotect()
This commit is contained in:
parent
613f8170b6
commit
225284a6ca
@ -16,6 +16,7 @@
|
|||||||
#define SYS_seek 12
|
#define SYS_seek 12
|
||||||
#define SYS_exec 13
|
#define SYS_exec 13
|
||||||
#define SYS_fcntl 14
|
#define SYS_fcntl 14
|
||||||
|
#define SYS_mprotect 15
|
||||||
|
|
||||||
#ifndef __want_syscalls
|
#ifndef __want_syscalls
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -14,4 +14,9 @@ extern "C"
|
|||||||
{
|
{
|
||||||
return (int)syscall(SYS_munmap, addr, len);
|
return (int)syscall(SYS_munmap, addr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mprotect(void* addr, size_t size, int prot)
|
||||||
|
{
|
||||||
|
return (int)syscall(SYS_mprotect, addr, size, prot);
|
||||||
|
}
|
||||||
}
|
}
|
@ -50,6 +50,7 @@ extern "C"
|
|||||||
case SYS_seek:
|
case SYS_seek:
|
||||||
case SYS_write:
|
case SYS_write:
|
||||||
case SYS_read:
|
case SYS_read:
|
||||||
|
case SYS_mprotect:
|
||||||
case SYS_mmap: {
|
case SYS_mmap: {
|
||||||
arg arg0 = va_arg(ap, arg);
|
arg arg0 = va_arg(ap, arg);
|
||||||
arg arg1 = va_arg(ap, arg);
|
arg arg1 = va_arg(ap, arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user