Page MenuHomeFreeBSD

mprotect.2: Remove legacy BSD text

Authored by brooks on Sep 1 2021, 9:28 PM.
Referenced Files
Unknown Object (File)
Tue, May 9, 7:35 PM
Unknown Object (File)
Feb 26 2023, 7:03 PM
Unknown Object (File)
Jan 4 2023, 4:21 AM
Unknown Object (File)
Dec 10 2022, 11:29 AM



This text dates to the BSD 4.4 import and is misleading. The mprotect
syscall acts on page granularity and breaks up mappings as required to
do so.

Note that with the addition of non-transparent superpages (aka
largepages) the size of a page at a given address may vary. This
commit does not attempt to address the lack of documentation of this

Sponsored by: DARPA

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Sep 1 2021, 9:28 PM
This revision is now accepted and ready to land.Sep 1 2021, 9:31 PM

Per the discussion in D30442 this removes the incorrect description of mprotect granularity. Documentation of large pages is left for later.

Ultimately, I think that the text will have to grow a new paragraph: (1) mentioning the possible existence of large page sizes on some architectures (See getpagesizes()); (2) that if the specified range does not cover an entire large page, the system will either demote the page mapping to a sufficiently small size or return an error, depending on whether the large page was created automatically or explicitly via shm_open(). In particular, I see no way of describing this without introducing the notion of demotion.

This revision was automatically updated to reflect the committed changes.