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]

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


While attempting to get PostgreSQL's PL/Tcl to work under Cygwin, I
stumbled onto another mmap() issue.  The two attachments, server.c and
open2.c, are a minimal test case that demonstrates the problem:

    $ date > /tmp/cygipc_0
    $ server /tmp/cygipc_0&
    [1] 2456
    $ strace open2 /tmp/cygipc_0 | fgrep 'unknown windows error'
      197   51623 [main] open2 2948 geterrno_from_win_error: unknown windows error 1224, setting errno to 13

    $ 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.

Is there any way to work around this problem?  Or, is this just an
inherent Windows limitation?  I'm afraid the latter will be the case.

So far Cygwin PostgreSQL users have been fortunate, since only PL/Tcl
seems to trigger the sequence of IPC (i.e., cygipc) operations that
causes this failure.


PGP/GPG Key: or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Attachment: server.c
Description: Text document

Attachment: open2.c
Description: Text document

Unsubscribe info:
Bug reporting:

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