mprotect.c\mman\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/mman/mprotect.c
blob: 535787b9ec527bb12acbb80a53aadc4ab760c7b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <sys/mman.h>
#include "libc.h"
#include "syscall.h"
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);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月13日 16:45:20 +0000

AltStyle によって変換されたページ (->オリジナル) /