This is the mail archive of the
mailing list for the Cygwin project.
Possible bug with mmap on XP?
- From: Dave Bodenstab <dave at bodenstab dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 2 Feb 2006 18:16:34 -0600 (CST)
- Subject: Possible bug with mmap on XP?
I searched the mailing list archives and googled, but failed to find
anything specific to XP regarding this...
I am using the latest version (1.5.19-4) of Cygwin.
I had previously ported a unix prog that used mmap to Cygwin. On win2k
it works fine. When I copied the prog to a newly-installed win XP
professional system, I get:
mmap failed (Permission denied)
when attempting to do a
I've found that changing the permissions (chmod +x) on the file being
mmap'ed makes the problem go away.
Is this the way things are supposed to work on XP?
PS. I have a test program that demonstrates this problem, but I wanted
to ask if this is a known problem before I start posting test programs.
PPS. If this is a limitation for XP, is there a way for a Cygwin program
to tell if it's running on XP?
My program generates x86 machine code and writes it to a file.
The program then mmap's the file and executes the code.
The problem is that I want the file prepended with '#!/bin/myprog\n"
to be "executable", but I don't want a file with just the raw
x86 code to be "executable" -- because it isn't without being
run under control of my program that generated it. This works
entirely correctly on Linux, FreeBSD and Solaris.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html