diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h
index 2373eff31..7e9bdb5cd 100644
--- a/sys/amd64/linux/linux_proto.h
+++ b/sys/amd64/linux/linux_proto.h
@@ -78,6 +78,10 @@ struct linux_mprotect_args {
 	char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
 	char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)];
 };
+struct linux_munmap_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+};
 struct linux_brk_args {
 	char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)];
 };
@@ -1450,6 +1454,7 @@ int	linux_poll(struct thread *, struct linux_poll_args *);
 int	linux_lseek(struct thread *, struct linux_lseek_args *);
 int	linux_mmap2(struct thread *, struct linux_mmap2_args *);
 int	linux_mprotect(struct thread *, struct linux_mprotect_args *);
+int	linux_munmap(struct thread *, struct linux_munmap_args *);
 int	linux_brk(struct thread *, struct linux_brk_args *);
 int	linux_rt_sigaction(struct thread *, struct linux_rt_sigaction_args *);
 int	linux_rt_sigprocmask(struct thread *, struct linux_rt_sigprocmask_args *);
@@ -1760,6 +1765,7 @@ int	linux_map_shadow_stack(struct thread *, struct linux_map_shadow_stack_args *
 #define	LINUX_SYS_AUE_linux_lseek	AUE_LSEEK
 #define	LINUX_SYS_AUE_linux_mmap2	AUE_MMAP
 #define	LINUX_SYS_AUE_linux_mprotect	AUE_MPROTECT
+#define	LINUX_SYS_AUE_linux_munmap	AUE_MUNMAP
 #define	LINUX_SYS_AUE_linux_brk	AUE_NULL
 #define	LINUX_SYS_AUE_linux_rt_sigaction	AUE_NULL
 #define	LINUX_SYS_AUE_linux_rt_sigprocmask	AUE_NULL
diff --git a/sys/amd64/linux/linux_syscall.h b/sys/amd64/linux/linux_syscall.h
index 3f1198399..d00dd7874 100644
--- a/sys/amd64/linux/linux_syscall.h
+++ b/sys/amd64/linux/linux_syscall.h
@@ -15,7 +15,7 @@
 #define	LINUX_SYS_linux_lseek	8
 #define	LINUX_SYS_linux_mmap2	9
 #define	LINUX_SYS_linux_mprotect	10
-#define	LINUX_SYS_munmap	11
+#define	LINUX_SYS_linux_munmap	11
 #define	LINUX_SYS_linux_brk	12
 #define	LINUX_SYS_linux_rt_sigaction	13
 #define	LINUX_SYS_linux_rt_sigprocmask	14
diff --git a/sys/amd64/linux/linux_syscalls.c b/sys/amd64/linux/linux_syscalls.c
index eeec76f3f..e6419b6cc 100644
--- a/sys/amd64/linux/linux_syscalls.c
+++ b/sys/amd64/linux/linux_syscalls.c
@@ -16,7 +16,7 @@ const char *linux_syscallnames[] = {
 	"linux_lseek",			/* 8 = linux_lseek */
 	"linux_mmap2",			/* 9 = linux_mmap2 */
 	"linux_mprotect",			/* 10 = linux_mprotect */
-	"munmap",			/* 11 = munmap */
+	"linux_munmap",			/* 11 = linux_munmap */
 	"linux_brk",			/* 12 = linux_brk */
 	"linux_rt_sigaction",			/* 13 = linux_rt_sigaction */
 	"linux_rt_sigprocmask",			/* 14 = linux_rt_sigprocmask */
diff --git a/sys/amd64/linux/linux_sysent.c b/sys/amd64/linux/linux_sysent.c
index 62b50cf68..9ee9f3773 100644
--- a/sys/amd64/linux/linux_sysent.c
+++ b/sys/amd64/linux/linux_sysent.c
@@ -25,7 +25,7 @@ struct sysent linux_sysent[] = {
 	{ .sy_narg = AS(linux_lseek_args), .sy_call = (sy_call_t *)linux_lseek, .sy_auevent = AUE_LSEEK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 8 = linux_lseek */
 	{ .sy_narg = AS(linux_mmap2_args), .sy_call = (sy_call_t *)linux_mmap2, .sy_auevent = AUE_MMAP, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 9 = linux_mmap2 */
 	{ .sy_narg = AS(linux_mprotect_args), .sy_call = (sy_call_t *)linux_mprotect, .sy_auevent = AUE_MPROTECT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 10 = linux_mprotect */
-	{ .sy_narg = AS(munmap_args), .sy_call = (sy_call_t *)sys_munmap, .sy_auevent = AUE_MUNMAP, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 11 = munmap */
+	{ .sy_narg = AS(linux_munmap_args), .sy_call = (sy_call_t *)linux_munmap, .sy_auevent = AUE_MUNMAP, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 11 = linux_munmap */
 	{ .sy_narg = AS(linux_brk_args), .sy_call = (sy_call_t *)linux_brk, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 12 = linux_brk */
 	{ .sy_narg = AS(linux_rt_sigaction_args), .sy_call = (sy_call_t *)linux_rt_sigaction, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 13 = linux_rt_sigaction */
 	{ .sy_narg = AS(linux_rt_sigprocmask_args), .sy_call = (sy_call_t *)linux_rt_sigprocmask, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC },	/* 14 = linux_rt_sigprocmask */
diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c
index 902a0c161..ae50e85a3 100644
--- a/sys/amd64/linux/linux_systrace_args.c
+++ b/sys/amd64/linux/linux_systrace_args.c
@@ -109,9 +109,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
 		*n_args = 3;
 		break;
 	}
-	/* munmap */
+	/* linux_munmap */
 	case 11: {
-		struct munmap_args *p = params;
+		struct linux_munmap_args *p = params;
 		uarg[a++] = (intptr_t)p->addr; /* void * */
 		iarg[a++] = p->len; /* l_size_t */
 		*n_args = 2;
@@ -2994,7 +2994,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 			break;
 		};
 		break;
-	/* munmap */
+	/* linux_munmap */
 	case 11:
 		switch (ndx) {
 		case 0:
@@ -7368,7 +7368,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
 		if (ndx == 0 || ndx == 1)
 			p = "int";
 		break;
-	/* munmap */
+	/* linux_munmap */
 	case 11:
 		if (ndx == 0 || ndx == 1)
 			p = "int";
diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master
index b3bbd917c..79e5ee8cd 100644
--- a/sys/amd64/linux/syscalls.master
+++ b/sys/amd64/linux/syscalls.master
@@ -109,8 +109,8 @@
 		    l_ulong prot
 		);
 	}
-11	AUE_MUNMAP	NOPROTO {
-		int munmap(
+11	AUE_MUNMAP	STD {
+		int linux_munmap(
 		    void *addr,
 		    l_size_t len
 		);
diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c
index a8e790a29..9939bf838 100644
--- a/sys/compat/linux/linux_mmap.c
+++ b/sys/compat/linux/linux_mmap.c
@@ -51,6 +51,18 @@
 #include <compat/linux/linux_mmap.h>
 #include <compat/linux/linux_persona.h>
 #include <compat/linux/linux_util.h>
+// #include <compat/linux/linux_proto.h>
+/* This pulls in the correct generated header based on the build target */
+#if defined(__amd64__)
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+#elif defined(__i386__)
+#include <i386/linux/linux.h>
+#include <i386/linux/linux_proto.h>
+#elif defined(__aarch64__)
+#include <arm64/linux/linux.h>
+#include <arm64/linux/linux_proto.h>
+#endif
 
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
@@ -423,3 +435,26 @@ linux_fixup_prot(struct thread *td, int *prot)
 
 }
 #endif
+
+int
+linux_munmap(struct thread *td, struct linux_munmap_args *args)
+{
+    size_t length;
+
+    /* Linux requires addresses to be page aligned */
+    if ((uintptr_t)args->addr & PAGE_MASK)
+        return -(EINVAL);
+
+    /* Check to see if len is 0, this is the EXACT
+     * same operation linux does to check to see
+     * if len is 0.
+     * Citing linux/mm/vma.c
+     */
+    if(args->len == 0)
+        return -(EINVAL);
+
+    /* round up to next page boundary */
+    length = roundup2(args->len, PAGE_SIZE);
+
+    return (kern_munmap(td, (uintptr_t) args->addr, length));
+}
