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.
I was able to confirm this via the 2003 Platform SDK:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
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.
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.
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.
The patch was submitted as [patches:#430] and was eventually accepted.
Related
Patches:
#430