This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mmap missing offset parameter
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder: add offset to mmap
View: 708374
Assigned To: akuchling Nosy List: akuchling, foom, huangpeng, josiahcarlson, nnorwitz, phuang, quiver, teoliphant
Priority: normal Keywords:

Created on 2004-12-22 19:22 by foom, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (9)
msg23804 - (view) Author: James Y Knight (foom) Date: 2004-12-22 19:22
For some reason, the author of the MMap module didn't see fit to 
expose the "offset" parameter of the mmap syscall to python. It 
would be really nice if it had that. Currently, it's always set to 0.

    m_obj->data = mmap(NULL, map_size,
               prot, flags,
               fd, 0);
msg23805 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2004-12-23 16:57
Logged In: YES 
user_id=341410

I agree.  Having access to the offset parameter would be
quite convenient, at least to some who use mmap in a
nontrivial fashion.
msg23806 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-12-28 20:34
Logged In: YES 
user_id=11375

Would either of you care to provide a patch adding the
parameter?  I'll review it...
msg23807 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2004-12-28 23:51
Logged In: YES 
user_id=341410

I would, but I don't know the slightest about the C-level
mmap internals on any platform, and spending the last hour
looking through Python's mmap.c hasn't made me any more
informed.

James (or anyone else who reads this), are you able?
msg23808 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2004-12-29 05:54
Logged In: YES 
user_id=671362

There's already a patch for this request:

  http://www.python.org/sf/708374
  add offset to mmap

The rationale is same.
It's almost ready to be committed but has been left out for a 
year now. So give it a second chance.
msg23809 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-02-05 06:05
Logged In: YES 
user_id=33168

The patch just needs some attention (testing and possible
fixes) on Windows.
msg23810 - (view) Author: Huang Peng (huangpeng) Date: 2007-08-22 06:36
I need map a file large than 4G in my program, But it is impossible in an 32bit system. So I need use offset parameter to map specified part of the file. I want to know when python will expose the offset parameter to us.
msg23811 - (view) Author: Huang Peng (huangpeng) Date: 2007-08-22 06:38
I need map a file large than 4G in my program, But it is impossible in an 32bit system. So I need use offset parameter to map specified part of the file. I want to know when python will expose the offset parameter to us.
msg56665 - (view) Author: Travis Oliphant (teoliphant) * (Python committer) Date: 2007-10-23 02:45
This issue can be closed.  The issue is resolved in SVN.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41360
2007-10-23 06:59:52georg.brandlsetstatus: open -> closed
resolution: fixed
superseder: add offset to mmap
2007-10-23 02:45:09teoliphantsetnosy: + teoliphant
messages: + msg56665
2007-08-28 10:10:12phuangsetnosy: + phuang
2004-12-22 19:22:30foomcreate