From 59d87ccc99f431da06a0ffab0d3e702d9ef82f48 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 19 Nov 2021 05:44:21 -0800 Subject: chore: make dependence on static syscalls explicit --- sys/linux/src/mprotect.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sys/linux/src/mprotect.c (limited to 'sys/linux/src/mprotect.c') diff --git a/sys/linux/src/mprotect.c b/sys/linux/src/mprotect.c new file mode 100644 index 0000000..6d20dc1 --- /dev/null +++ b/sys/linux/src/mprotect.c @@ -0,0 +1,14 @@ +#include "internal.h" + +int +sys·mprotect(void *addr, uintptr len, int prot) +{ + long ret; + uintptr beg, end; + + beg = (uintptr)addr & -PAGESIZE; + end = (uintptr)(addr + len + PAGESIZE-1) & -PAGESIZE; + + ret = syscall(·MProtect, beg, end-beg, prot); + return error(ret); +} -- cgit v1.2.1