fix undefined behavior in memset due to missing sequence points
[musl] / src / mman / mprotect.c
index 5ab2d8b..535787b 100644 (file)
@@ -1,11 +1,13 @@
 #include <sys/mman.h>
-#include <limits.h>
+#include "libc.h"
 #include "syscall.h"
 
-int mprotect(void *addr, size_t len, int prot)
+int __mprotect(void *addr, size_t len, int prot)
 {
        size_t start, end;
        start = (size_t)addr & -PAGE_SIZE;
        end = (size_t)((char *)addr + len + PAGE_SIZE-1) & -PAGE_SIZE;
        return syscall(SYS_mprotect, start, end-start, prot);
 }
+
+weak_alias(__mprotect, mprotect);