There's some important use cases for mprotect(), like toggling W^X on JIT pages, which that wouldn't work for.
uint8_t* mem = malloc_pages(1024);
mprotect_paged(mem, 1024);I think it's even part of POSIX: “The system performs mapping operations over whole pages. Thus, while the parameter len need not meet a size or alignment constraint, the system shall include, in any mapping operation, any partial page specified by the address range starting at pa and continuing for len bytes.”
"possibly copying a load of data into it for you incase you asked for a readonly range."