summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-20 00:49:37 (GMT)
committerGitHub <noreply@github.com>2018-10-20 00:49:37 (GMT)
commit2bad7acdfebb87a6eef238a7acca636cfb648a02 (patch)
tree44a607dc41fb7f178fac659748f148652438eca6 /Doc
parentb0f7fa1dda61ae7519deed816993ac5d55870958 (diff)
downloadcpython-2bad7acdfebb87a6eef238a7acca636cfb648a02.zip
cpython-2bad7acdfebb87a6eef238a7acca636cfb648a02.tar.gz
cpython-2bad7acdfebb87a6eef238a7acca636cfb648a02.tar.bz2
bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621)
Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a3d5ebad575aafe5fcc572e3b05f7f24e5) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/mmap.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index a86eb13..c9fc733 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -68,7 +68,7 @@ memory but does not update the underlying file.
*offset* may be specified as a non-negative integer offset. mmap references
will be relative to the offset from the beginning of the file. *offset*
- defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY.
+ defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`.
.. class:: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
@@ -97,8 +97,8 @@ memory but does not update the underlying file.
*offset* may be specified as a non-negative integer offset. mmap references
will be relative to the offset from the beginning of the file. *offset*
- defaults to 0. *offset* must be a multiple of the PAGESIZE or
- ALLOCATIONGRANULARITY.
+ defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY`
+ which is equal to :const:`PAGESIZE` on Unix systems.
To ensure validity of the created memory mapping the file specified
by the descriptor *fileno* is internally automatically synchronized
@@ -171,7 +171,8 @@ memory but does not update the underlying file.
use of this call there is no guarantee that changes are written back before
the object is destroyed. If *offset* and *size* are specified, only
changes to the given range of bytes will be flushed to disk; otherwise, the
- whole extent of the mapping is flushed.
+ whole extent of the mapping is flushed. *offset* must be a multiple of the
+ :const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`.
**(Windows version)** A nonzero value returned indicates success; zero
indicates failure.