summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorTravis E. Oliphant <oliphant@enthought.com>2007-10-23 02:40:56 (GMT)
committerTravis E. Oliphant <oliphant@enthought.com>2007-10-23 02:40:56 (GMT)
commit8feafab3462500d33c0bc98787649db4502894f8 (patch)
tree23a06e5c80e6ec0879b8f795412d0d60481fa95b /Doc/library
parent5e81270b22ee6cfe6d7ead43ccbc258964cf14a7 (diff)
downloadcpython-8feafab3462500d33c0bc98787649db4502894f8.zip
cpython-8feafab3462500d33c0bc98787649db4502894f8.tar.gz
cpython-8feafab3462500d33c0bc98787649db4502894f8.tar.bz2
Add phuang patch from Issue 708374 which adds offset parameter to mmap module.
Diffstat (limited to 'Doc/library')
-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 abe5b7b..0e982c1 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -40,7 +40,7 @@ not update the underlying file.
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
@@ -56,8 +56,12 @@ not update the underlying file.
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
@@ -79,6 +83,10 @@ not update the underlying file.
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:
@@ -171,3 +179,4 @@ Memory-mapped file objects support the following methods:
created with :const:`ACCESS_READ`, then writing to it will throw a
:exc:`TypeError` exception.
+