Mail Archives: djgpp/2001/06/07/14:51:46
> From: "Alex Oleynikov" <alex AT compuweigh DOT com>
> 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.
- Raw text -