bug? mmap doesn't like 0-length files

Discussion in 'Python' started by Neal Becker, Nov 23, 2010.

  1. Neal Becker

    Neal Becker Guest

    mmap.mmap (f.fileno(), 0, prot=mmap.PROT_READ)
    error: [Errno 22] Invalid argument

    According to http://docs.python.org/library/mmap.html, mmap on _windows_
    doesn't accept 0-length file. But this was tested on linux. Is this a bug?

    I don't see anything in linux man-page about the underlying C mmap function
    not accepting 0-length files.
    Neal Becker, Nov 23, 2010
    #1
    1. Advertising

  2. Neal Becker

    Nobody Guest

    On Mon, 22 Nov 2010 20:33:08 -0500, Neal Becker wrote:

    > I don't see anything in linux man-page about the underlying C mmap function
    > not accepting 0-length files.


    My mmap(2) manpage says:

    ERRORS
    ...
    EINVAL (since Linux 2.6.12) length was 0.
    Nobody, Nov 23, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    26
    Views:
    911
    Chetan
    Oct 28, 2006
  2. Patrick Kowalzick
    Replies:
    5
    Views:
    456
    Patrick Kowalzick
    Mar 14, 2006
  3. Neal Becker

    mmap doesn't support weakref

    Neal Becker, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    237
    Neal Becker
    Jan 8, 2009
  4. Fishtank

    mmap and large files

    Fishtank, Nov 14, 2009, in forum: C Programming
    Replies:
    7
    Views:
    2,267
    Nobody
    Nov 15, 2009
  5. Han Holl
    Replies:
    2
    Views:
    100
    Yukihiro Matsumoto
    Sep 1, 2003
Loading...

Share This Page