aboutsummaryrefslogtreecommitdiff
path: root/sys/linux/src/mremap.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-11-19 05:44:21 -0800
committerNicholas Noll <nbnoll@eml.cc>2021-11-19 05:44:21 -0800
commit59d87ccc99f431da06a0ffab0d3e702d9ef82f48 (patch)
treee13de4f7e86cc731add3b3d3bcf3b32ce22adefc /sys/linux/src/mremap.c
parent835dea0eb6333a9ef452881ea073bfe59d14096a (diff)
chore: make dependence on static syscalls explicit
Diffstat (limited to 'sys/linux/src/mremap.c')
-rw-r--r--sys/linux/src/mremap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/linux/src/mremap.c b/sys/linux/src/mremap.c
new file mode 100644
index 0000000..dda05ce
--- /dev/null
+++ b/sys/linux/src/mremap.c
@@ -0,0 +1,20 @@
+#include "internal.h"
+
+int
+sys·mremap(void *addr, uintptr from, uintptr to, int flags, void **ret)
+{
+ long r;
+ void *new;
+
+ if(to >= PTRDIFF_MAX)
+ return sys·ErrorNoMemory;
+
+ new = (flags & sys·RemapFixed) ? *ret : nil;
+ r = syscall(·MRemap, addr, from, to, flags, new);
+ if(r > 0){
+ *ret = (void*)r;
+ return 0;
+ }
+
+ return error(r);
+}