mmap on a 0-sized file in /proc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dimitri Bee
    New Member
    • Aug 2010
    • 1

    mmap on a 0-sized file in /proc

    Hello Everybody,

    I have a problem with mmap'ing of a 0-sized file in the /proc filesystem in Linux.

    I have a file of length 0. The file supports read() and write() operations and is used for communication with a device driver. Besides, the file implements the mmap() file operation, which allows to open a shared memory window between the driver in the kernel and an application in the userspace. The size of the shared memory window is about 1 GB. The size of a file itself is 0.
    It looks like I cannot use Python's mmap() on this file. The mmap() wants to have a non-zero-sized file. But I cannot make a file as big as the memory region it maps.

    Has anybody had a similar problem?
    Does my description sound clear?

    Thanks,
    Dimitri
Working...