diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-10-20 00:47:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-20 00:47:15 (GMT) |
commit | 75ee130c39e73730535d94923fd8322ef616cb83 (patch) | |
tree | 827ca3b0d73a2055e197e10a1795d9f8f1b64b09 /Doc/library | |
parent | efc09a9701543f7180fc7ea0b6c45cf198c29cb8 (diff) | |
download | cpython-75ee130c39e73730535d94923fd8322ef616cb83.zip cpython-75ee130c39e73730535d94923fd8322ef616cb83.tar.gz cpython-75ee130c39e73730535d94923fd8322ef616cb83.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/library')
-rw-r--r-- | Doc/library/mmap.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index d965fa3..6c0f9a0 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -61,7 +61,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *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=MAP_SHARED, prot=PROT_WRITE|PROT_READ, access=ACCESS_DEFAULT[, offset]) @@ -90,8 +90,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *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 @@ -185,7 +185,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length 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. |