Mail Archives: djgpp-workers/2011/09/04/17:29:07
OFYI, I applied the following patch to fix the described in thread:
http://www.delorie.com/archives/browse.cgi?p=djgpp/2011/08/30/18:59:04
Regards,
Juan M. Guerrero
2011-09-04 Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
* src/libc/posix/sys/stat/filelen.c: Check that 0x71A6 call is supported
by checking that ax does not contain 0x7100.
* src/libc/posix/sys/stat/lfilelen.c: Check that 0x71A6 call is supported
by checking that ax does not contain 0x7100.
Index: djgpp/src/libc/posix/sys/stat/filelen.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/sys/stat/filelen.c,v
retrieving revision 1.6
diff -U 5 -r1.6 filelen.c
--- djgpp/src/libc/posix/sys/stat/filelen.c 25 Sep 2001 01:00:52 -0000 1.6
+++ djgpp/src/libc/posix/sys/stat/filelen.c 4 Sep 2011 21:22:25 -0000
@@ -1,5 +1,6 @@
+/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* This is file FILELEN.C */
/*
* Copyright (c) 1994 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
@@ -39,12 +40,22 @@
regs.x.bx = fhandle;
regs.x.ds = __tb >> 4;
regs.x.dx = 0;
regs.x.flags |= 1;
__dpmi_int(0x21, ®s);
-
- if ((regs.x.flags & 1) == 0)
+
+ /* It is always necessary to test if LFN function
+ has been implemented because the assumption has
+ been proven false that a driver will set the CF
+ if the LFN function has not been implemented.
+ E.g.: all DOSLFN drivers do not implement
+ 0x71A6 and DOSLFN 0.40e does not set CF
+ making MSDOS 6.22 fail. If FreeDOS 1.0 is
+ used, the same LFN driver sets the CF.
+ If the ax register contains 0x7100 then the
+ corresponding LFN function is not implemented. */
+ if ((regs.x.flags & 1) == 0 && regs.x.ax != 0x7100)
{
/* Offset 0x24 contains the low 32-bits of the file size.
Offset 0x20 contains the high 32-bits. */
retval = _farpeekl(_dos_ds, __tb + 0x24);
Index: djgpp/src/libc/posix/sys/stat/lfilelen.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/sys/stat/lfilelen.c,v
retrieving revision 1.3
diff -U 5 -r1.3 lfilelen.c
--- djgpp/src/libc/posix/sys/stat/lfilelen.c 4 Feb 2001 19:13:01 -0000 1.3
+++ djgpp/src/libc/posix/sys/stat/lfilelen.c 4 Sep 2011 21:22:25 -0000
@@ -1,5 +1,6 @@
+/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* This is file LFILELEN.C */
/*
* Copyright (c) 1994 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
*
@@ -33,12 +34,22 @@
regs.x.bx = fhandle;
regs.x.ds = __tb >> 4;
regs.x.dx = 0;
regs.x.flags |= 1;
__dpmi_int (0x21, ®s);
-
- if ((regs.x.flags & 1) == 0)
+
+ /* It is always necessary to test if LFN function
+ has been implemented because the assumption has
+ been proven false that a driver will set the CF
+ if the LFN function has not been implemented.
+ E.g.: all DOSLFN drivers do not implement
+ 0x71A6 and DOSLFN 0.40e does not set CF
+ making MSDOS 6.22 fail. If FreeDOS 1.0 is
+ used, the same LFN driver sets the CF.
+ If the ax register contains 0x7100 then the
+ corresponding LFN function is not implemented. */
+ if ((regs.x.flags & 1) == 0 && regs.x.ax != 0x7100)
{
/* Offset 0x24 contains the low 32-bits of the file size.
Offset 0x20 contains the high 32-bits. */
long retval_l = _farpeekl (_dos_ds, __tb + 0x24);
long retval_h = _farpeekl (_dos_ds, __tb + 0x20);
- Raw text -