diff options
author | Justus Schwabedal <jusjusjus@users.noreply.github.com> | 2017-11-07 20:51:43 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-11-07 20:51:43 (GMT) |
commit | 5a8a84b34fbc385bf112819fe3b65503e33a33fa (patch) | |
tree | 947e4d2439eeb6e91d7fde953ef7d9a0b01e6950 /Doc/library/mmap.rst | |
parent | c62f0cb3b1f6f9ca4ce463b1c99b0543bdfa38d6 (diff) | |
download | cpython-5a8a84b34fbc385bf112819fe3b65503e33a33fa.zip cpython-5a8a84b34fbc385bf112819fe3b65503e33a33fa.tar.gz cpython-5a8a84b34fbc385bf112819fe3b65503e33a33fa.tar.bz2 |
Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093)
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r-- | Doc/library/mmap.rst | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index f46bf66..184119d 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -29,16 +29,20 @@ still needs to be closed when done). mapping. For both the Unix and Windows versions of the constructor, *access* may be -specified as an optional keyword parameter. *access* accepts one of three -values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY` -to specify read-only, write-through or copy-on-write memory respectively. -*access* can be used on both Unix and Windows. If *access* is not specified, -Windows mmap returns a write-through mapping. The initial memory values for -all three access types are taken from the specified file. Assignment to an -:const:`ACCESS_READ` memory map raises a :exc:`TypeError` exception. -Assignment to an :const:`ACCESS_WRITE` memory map affects both memory and the -underlying file. Assignment to an :const:`ACCESS_COPY` memory map affects -memory but does not update the underlying file. +specified as an optional keyword parameter. *access* accepts one of four +values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY` to +specify read-only, write-through or copy-on-write memory respectively, or +:const:`ACCESS_DEFAULT` to defer to *prot*. *access* can be used on both Unix +and Windows. If *access* is not specified, Windows mmap returns a +write-through mapping. The initial memory values for all three access types +are taken from the specified file. Assignment to an :const:`ACCESS_READ` +memory map raises a :exc:`TypeError` exception. Assignment to an +:const:`ACCESS_WRITE` memory map affects both memory and the underlying file. +Assignment to an :const:`ACCESS_COPY` memory map affects memory but does not +update the underlying file. + +.. versionchanged:: 3.7 + Added :const:`ACCESS_DEFAULT` constant. To map anonymous memory, -1 should be passed as the fileno along with the length. |