This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mmap() issue affects cygipc (and PostgreSQL's PL/Tcl)

On Tue, Feb 04, 2003 at 11:59:30AM -0500, Jason Tishler wrote:
>     $ fgrep 1224 /usr/include/w32api/winerror.h 
>     #define ERROR_USER_MAPPED_FILE 1224L
> The root cause of the problem is opening the file with the "O_TRUNC"
> flag -- without it, the open (in open2) succeeds.  Unfortunately, cygipc
> seems to need open with truncation semantics for proper operation.

I'm surprised that this is meant to work at all.  However, did you
check to omit the O_CREAT?  The combination of O_CREATE and O_TRUNC
will result in a CreateFile() call using the CREATE_ALWAYS flag while
the O_TRUNC alone just uses the TRUNCATE_EXISTING flag.  I could
easiliy imagine that Win32 doesn't like to remove and recreate a
file which is mmapped currently...

In theory a change to Cygwin should be possible then to avoid calling
CreateFile(CREATE_ALWAYS) if the file exists.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]