summaryrefslogtreecommitdiffstats
path: root/Doc/library/mmap.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r--Doc/library/mmap.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 533034f..26748c4 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -38,7 +38,7 @@ not update the underlying file.
To map anonymous memory, -1 should be passed as the fileno along with the length.
-.. function:: mmap(fileno, length[, tagname[, access]])
+.. function:: mmap(fileno, length[, tagname[, access[, offset]]])
**(Windows version)** Maps *length* bytes from the file specified by the file
handle *fileno*, and returns a mmap object. If *length* is larger than the
@@ -54,8 +54,12 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
the mapping is created without a name. Avoiding the use of the tag parameter
will assist in keeping your code portable between Unix and Windows.
+ *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.
-.. function:: mmap(fileno, length[, flags[, prot[, access]]])
+
+.. function:: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
:noindex:
**(Unix version)** Maps *length* bytes from the file specified by the file
@@ -77,6 +81,10 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
parameter. It is an error to specify both *flags*, *prot* and *access*. See
the description of *access* above for information on how to use this parameter.
+ *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.
+
Memory-mapped file objects support the following methods:
@@ -169,3 +177,4 @@ Memory-mapped file objects support the following methods:
created with :const:`ACCESS_READ`, then writing to it will throw a
:exc:`TypeError` exception.
+