Skip to content

Commit

Permalink
Documenting deprecation of getpagesize().
Browse files Browse the repository at this point in the history
  • Loading branch information
rptb1 committed Mar 4, 2023
1 parent 4de0839 commit 2191f3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion code/vmix.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ Size PageSize(void)
{
long pageSize;

/* Find out the operating system page size */
/* Find out the operating system page size
(see design.mps.vm.impl.ix.page.size) */
pageSize = sysconf(_SC_PAGESIZE);

/* Check the page size will fit in a Size. */
Expand Down
8 changes: 7 additions & 1 deletion design/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ Unix implementation

_`.impl.ix`: In ``vmix.c``.

_`.impl.ix.page.size`: The page size is given by ``sysconf(_SC_PAGESIZE)``.
_`.impl.ix.page.size`: The page size is given by
``sysconf(_SC_PAGESIZE)``. We avoid ``getpagesize()``, which is a
legacy function in Posix:

Applications should use the sysconf() function instead.

— `The Single UNIX ® Specification, Version 2 <https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpagesize.html>`__

_`.impl.ix.param`: Decodes no keyword arguments.

Expand Down

0 comments on commit 2191f3c

Please sign in to comment.