A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078901.html below:

[Python-Dev] mmap documentation error (2.5.1)

[Python-Dev] mmap documentation error (2.5.1)Neal Becker ndbecker2 at gmail.com
Fri Apr 25 15:41:12 CEST 2008
Sorry, my mistake.  Acutally, I was trying to debug this:
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 this c++ code works:

#include <sys/mman.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <iostream>

int main() {
  int fd = open ("/dev/eos", O_RDWR);
  void* m = mmap (NULL, 1000000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
  std::cout << m << '\n';
}

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4