Date: Thu, 07 Jun 2001 21:45:03 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Alex Oleynikov" Message-Id: <9003-Thu07Jun2001214503+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <002e01c0ef70$d92dffe0$1400a8c0@alex2000> Subject: Re: DJGPP on PTS-DOS run problem References: <002e01c0ef70$d92dffe0$1400a8c0 AT alex2000> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Alex Oleynikov" > Date: Thu, 7 Jun 2001 12:42:32 -0400 > > > Eventually you will come to a low-level function which calls __dpmi_int, > > to use some DOS service, and fails. You don't need to go any further: > > just post here where did that happen, and what error code did that DOS > > function return in the __dpmi_regs structure accepted by __dpmi_int. > > Inside access( ) there is a call to findfirst( ), which fails with errno=22 > (ENOENT) Thanks for looking into this. However, if findfirst is called, it means that the preceding call to _chmod failed, and that is already a sign of trouble. Here's the beginning of `access': int access(const char *fn, int flags) { int attr = _chmod(fn, 0); if (attr == -1) { struct ffblk ff; char fixed_path[FILENAME_MAX]; /* Root directories on some non-local drives (e.g. CD-ROM) might fail `_chmod'. `findfirst' to the rescue. */ _fixpath(fn, fixed_path); if (fixed_path[1] == ':' && fixed_path[2] == '/' && fixed_path[3] == 0) { char *fp = fixed_path + 3; *fp++ = '*'; *fp++ = '.'; *fp++ = '*'; *fp++ = '\0'; /* Use _lfn_close_handle so we don't lose a handle. */ if (findfirst(fixed_path, &ff, FA_DIREC) == 0) As you see, findfirst is called only if _chmod returns -1, meaning that it failed. Could you please look inside _chmod and see what happens there, and what is the DOS error code returned in the AX register by __dpmi_int called from _chmod? As for findfirst, in addition to the carry flag being set, __dpmi_int also returns an error code in regs.x.ax. Please see what is the value of this. Finally, it might be important to know what does _fixpath return in the fixed_path[] string, because that's the file name we pass to findfirst. Thanks again for working on this.