delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/03/01:36:56

X-Spam-Check-By: sourceware.org
Date: Fri, 3 Feb 2006 00:36:42 -0600 (CST)
From: Dave Bodenstab <dave AT bodenstab DOT org>
Message-Id: <200602030636.k136aggg013338@base686.home.org>
To: ebb9 AT byu DOT net
Subject: Re: Possible bug with mmap on XP?
Cc: cygwin AT cygwin DOT com
In-Reply-To: <43E2E07B.5000702@byu.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Thanks for the reply.

On Thu, 02 Feb 2006 21:47:55 -0700 Eric Blake <ebb9 AT byu DOT net> wrote:

> According to Dave Bodenstab on 2/2/2006 5:16 PM:
> >   mmap(0,1500,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_PRIVATE,<the fd>,0)
> > 
> > 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?
>
> Cygwin's behavior sounds reasonable to me - POSIX permits an
> implementation to fail with EACCESS if the prot parameter requests writes
> but filedes was not opened for writing, and permits failure with ENOTSUP
> if a combination of prot flags is not supported.  But I see nothing in
> POSIX that requires PROT_EXEC to either fail or succeed based on whether
> filedes is tied to a file that has execute privileges, so you are treading
> in unspecified waters.
>
> > 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.
>
> A test program would be very helpful.

It can be found at http://www.bodenstab.org/files/mmaptest.c

> > PPS.  If this is a limitation for XP, is there a way for a Cygwin program
> > to tell if it's running on XP?
>
> Yes, uname(2) can be used to give you an idea of what version of Windows
> you are running on.

Is there a reference for what is returned for each windows release?  On my
only windows (I only have these for a couple of games and the digital cameras)
systems I get:

 Win98SE   sysname="CYGWIN_98-4.10"
 WinXP     sysname="CYGWIN_NT-5.1"

I would have expected "XP" rather than "NT"... I thought I read somewhere
that NT is obsolete or at least unsupported now?  Does the 4.10 or 5.1
mean anything important?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019