Patches item #1407135, was opened at 2006-01-16 09:44 Message generated for change (Comment added) made by titty You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1407135&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Ralf Schmitt (titty) Assigned to: Nobody/Anonymous (nobody) Summary: anonymous mmap Initial Comment: make mmap.mmap(-1, size) map anonymous memory on both windows and unix-like systems. If this goes in, I'll also write some documentation. here's some more reasoning: https://sourceforge.net/tracker/? func=detail&atid=105470&aid=1402308&group_id=5470 ---------------------------------------------------------------------- >Comment By: Ralf Schmitt (titty) Date: 2006-01-17 09:59 Message: Logged In: YES user_id=17929 Well, seems like one would also need some special handling for systems only defining one of MAP_ANON/MAP_ANONYOUS: http://www.winehq.org/hypermail/wine-devel/2004/12/0064.html ---------------------------------------------------------------------- Comment By: Ralf Schmitt (titty) Date: 2006-01-17 09:48 Message: Logged In: YES user_id=17929 quoting ubuntu's mmap man page: MAP_ANONYMOUS The mapping is not backed by any file; the fd and offset arguments are ignored. This flag in conjunction with MAP_SHARED is implemented since Linux 2.4. MAP_ANON Alias for MAP_ANONYMOUS. Deprecated. --- On a glibc 2.1 system (once installed with a 2.2 kernel, now running a 2.4 one) the manpage doesn't even mention MAP_ANON(YMOUS). The patch in it's current form will just fail on system's not defining MAP_ANON (i.e. mmap will fail and an exception will be raised). However, according to Stevens 'Advanced Programming in the Unix Environment', chapter 14.9, there are two ways to mmap anonymous memory. The first one works by using MAP_ANON (4.3+BSD), and the second one works by opening /dev/zero and passing that as a filedescriptor to mmap (SVR4). So, I guess all BSD's and newer Linux Systems would work with this version. Anyway I can send another patch handling that case if you like? ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-01-17 06:22 Message: Logged In: YES user_id=33168 In addition to docs, tests will also be necessary before committing. What if fd == -1 and MAP_ANON is not defined? It seems the state could be inconsistent. Shouldn't an exception be raised in this case? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1407135&group_id=5470 _______________________________________________ Patches mailing list [email protected] http://mail.python.org/mailman/listinfo/patches
