Mail Archives: djgpp/2001/03/24/09:24:50
> From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
> Newsgroups: comp.os.msdos.djgpp
> Date: 23 Mar 2001 12:31:47 GMT
>
> : I'm not sure there's a bug; Emacs doesn't do anything that any other
> : DJGPP program would do. Please step with a debugger into _use_lfn and
> : see what happens there.
>
> : What you describe can and should happen if 71A0h doesn't return 71h
> : in the AH register. In that case, the library function
> : `_get_volume_info' does this:
>
> : if (r.h.ah == 0x71)
> : {
>
> This is executed.
>
> : errno = ENOSYS;
> : retval = 0; /* meaning none of the features supported */
> : }
> : else
> : {
> : /* If the call failed, but not because the OS doesn't support
> : the function (e.g., invalid drive), don't disable LFN. */
> : errno = __doserr_to_errno(r.x.ax);
> : retval = _FILESYS_UNKNOWN;
> : }
>
>
> : If FreeDOS doesn't return 71h in the AH register, this will return
> : _FILESYS_UNKNOWN. The function `_use_lfn' then does this:
>
> Sure but it's not relevant as the branch indicated above is taken.
There's still the case where _use_lfn is passed a valid file name with
a drive letter (as opposed to a NULL pointer, which is what the
_USE_LFN macro does). In that case, _use_lfn always calls 71A0h,
because it never caches the drive letter from the previous call.
One notable case where _use_lfn is passed a drive letter is when it is
called by _fixpath. Since stat calls _fixpath, and Emacs calls stat a
lot, I'd bet if you put a breakpoint in _get_volume_info and print a
backtrace, you will see _fixpath and stat most, if not all, of the
time.
Note that glob also calls _use_lfn with a file name, so any program
which gets argc > 1 will call _get_volume_info more than once in the
startup code.
- Raw text -