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. Advertisements

  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. Advertisements

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. Mitchua
    Replies:
    5
    Views:
    3,118
    Eric J. Roode
    Jul 17, 2003
  2. www.MSmobiles.com
    Replies:
    1
    Views:
    1,645
    www.MSmobiles.com
    Jul 18, 2004
  3. Replies:
    26
    Views:
    1,118
    Chetan
    Oct 28, 2006
  4. Patrick Kowalzick
    Replies:
    5
    Views:
    725
    Patrick Kowalzick
    Mar 14, 2006
  5. iwasjoeking
    Replies:
    9
    Views:
    773
    dorayme
    Jun 10, 2008
  6. Neal Becker

    mmap doesn't support weakref

    Neal Becker, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    298
    Neal Becker
    Jan 8, 2009
  7. Fishtank

    mmap and large files

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