473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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
Aug 31 '10 #1
0 980

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Christopher Li | last post by:
I am surprised to find out the mmap module in python always mmap from offset 0. So I just hack up some patch to allow it accept offset arguments. So here it is. Chris Add optional offset...
1
by: Marco Cassiani | last post by:
Hi, if I insert an item in a mmap m: mmap<Tkey, TObj> m; mmap<Tkey, TObj>::iterator p1 = m.insert(make_pair(key, obj)); how long will be valid the p1 iterator if I made other insert...
2
by: sr | last post by:
I have this kind of a code. It is from a book Linux programming, unleashed. I am not able to make to work so that, when it is run in two different xterm windows, the two different processes would...
2
by: bite me if you can... | last post by:
The prototype of mmap() is: void * mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset); The second argument len is used to tell mmap() how many bytes I want to map. My...
3
by: Lawrence Oluyede | last post by:
While wrapping mmap indexing/sequence emulation I noticed something "strange". The source code of this oddity is: static PyObject * mmap_item(mmap_object *self, Py_ssize_t i) {...
26
by: myeates | last post by:
Hi Anyone ever done this? It looks like Python2.4 won't take a length arg Mathew
2
by: comp.unix.shell | last post by:
I'm trying to get mmap to working, potentially large files. Here's my data $ ls -l DATA/LaffAdd.1 -rwx------+ 1 a0312850 ???????? 255 Jul 24 2006 DATA/LaffAdd.1 Here's a snippett of my...
5
by: Dan Fulbright | last post by:
I'm trying to install PHP 5.2.2 on Windows, but I keep getting errors when running go-pear.bat: mmap cache can't open phar://go-pear.phar/index.php mmap cache can't open...
8
by: Unknown Soldier | last post by:
Hello, I have a couple queries about mmap() that ppl here might be able to help with. 1. What's the best way to resize an mmap()d area when you've enlarged the file? Can you call mmap() again...
2
by: Neal Becker | last post by:
On linux, I don't understand why: f = open ('/dev/eos', 'rw') m = mmap.mmap(f.fileno(), 1000000, prot=mmap.PROT_READ|mmap.PROT_WRITE, flags=mmap.MAP_SHARED) gives 'permission denied', but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.