#1347 Msys 1.0.11 broken on Windows9x


OS Windows 98se
MSYS version 1.0.11

Having corrected msys.bat as per my comment on bug 2845328 I have a shell running and
Bash builtins working correctly, but external commands are met with the message
- Cannot open

Searching the source for "- Cannot open" took me to the function
IsMsys(const char *File) in file ...\winsup\cygwin\ismsys.cc

The problem seems to be with the FILE_SHARE_DELETE flag at line 95 which I
believe is not supported on Windows9x.Unfortunately msdn documentation is not
now very helpful on older versions of Windows, but a simple test program suggests that
CreateFile() will always fail if this flag is used.


  • iysil

    iysil - 2009-09-08

    I was able to confirm this via the 2003 Platform SDK:
    This release of the SDK seems to be the best compromise between Windows 95 and newer releases (as far as microsoft SDK's go, it'll tell you what functions work with win9x, while still providing info on newer API additions).

    FILE_SHARE_DELETE flag is definitely *not* supported on Windows Me/98/95.

    There is also the following remark on the CreateFile() (2003 Platform SDK) page:

    "Windows Server 2003, Windows XP, Windows 2000: A sharing violation will occur if an attempt is made to open a file or directory for deletion on a remote computer when the value of the dwDesiredAccess parameter is the DELETE access flag OR'ed with any other access flag, and the remote file or directory has not been opened with FILE_SHARE_DELETE. To avoid the sharing violation in this scenario, open the remote file or directory with the DELETE access right only or call DeleteFile without first opening the file or directory for deletion."

    So maybe follow the rule above, and ' | ' (or) the read and write flags together.

    Peter: If you want to hack on the source, I have access to an XP machine, that I can verify whether or not it still functions properly.

  • Earnie Boyd

    Earnie Boyd - 2009-09-08
    • labels: --> OS Version Issue
    • milestone: --> 950166
    • status: open --> closed-wont-fix
  • Cesar Strauss

    Cesar Strauss - 2009-09-09

    It seems there is a "host_dependent.shared" variable, declared in host_dependent.h, that could solve this issue.
    See dcrt0.cc around line 256.
    An example of use is in fhandler.cc lines 386 and 411.
    If it works, I do not mind including a fix using it.

  • Cesar Strauss

    Cesar Strauss - 2009-09-09
    • assigned_to: nobody --> cstrauss
    • milestone: 950166 -->
    • status: closed-wont-fix --> open
  • Peter Hayward

    Peter Hayward - 2009-10-08

    This seems to work fine. Simply including the header
    and replacing the flags with
    "host_dependent.shared" fixed that problem.
    There is one further minor bug, though I have what
    appears to be a reasonable fix, after which all seems ok.
    I shall prepare a patch when I have the time.

  • Earnie Boyd

    Earnie Boyd - 2013-02-06
    • status: open --> closed
    • milestone: --> MSYS
    • type: --> Bug
    • resolution: --> out-of-date
    • category: --> Known_bugs
    • patch_attached: --> False
  • Cesar Strauss

    Cesar Strauss - 2014-03-04

    The patch was submitted as [patches:#430] and was eventually accepted.



    Patches: #430

  • Cesar Strauss

    Cesar Strauss - 2014-03-04
    • Resolution: out-of-date --> fixed
    • Category: Known_bugs --> Unknown

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks