Architectural Support: x86_64 (#37)
[lunaix-os.git] / lunaix-os / usr / libc / src / posix / mann.c
diff --git a/lunaix-os/usr/libc/src/posix/mann.c b/lunaix-os/usr/libc/src/posix/mann.c
new file mode 100644 (file)
index 0000000..f2fe186
--- /dev/null
@@ -0,0 +1,24 @@
+#include <lunaix/syscall.h>
+#include <lunaix/mann.h>
+#include <lunaix/types.h>
+
+void*
+mmap(void* addr, size_t length, int proct, int flags, int fd, off_t offset)
+{
+    struct usr_mmap_param mparam = {
+        .addr = addr,
+        .length = length,
+        .proct = proct,
+        .flags = flags,
+        .fd = fd,
+        .offset = offset
+    };
+
+    return (void*)do_lunaix_syscall(__SYSCALL_sys_mmap, &mparam);
+}
+
+int
+munmap(void* addr, size_t length)
+{
+    return do_lunaix_syscall(__SYSCALL_munmap, addr, length);
+}