delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/09/04/07:51:08

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX19k4Tg4nhJkcY9B7zw0V3HCh3PMDyZ6DxnQjbSawM
N7Cmu1EXNEgeTh
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp AT delorie DOT com
Subject: Re: gcc difficulties on MSDOS 6.22 with LFN driver installed
Date: Sun, 4 Sep 2011 13:46:14 +0200
User-Agent: KMail/1.9.10
MIME-Version: 1.0
Message-Id: <201109041346.14413.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0

I still do not understand why DOSLFN 0.40e makes djgpp fail and why 0.40c does
not.  There is certainly an pending issue in DOSLFN.  Neitherless according to
DOSLFN documentation it does not support 0x71A6 at all.  filelength() should
check if the 0x71XX functions are supported by checking the value of ax.
This is done in other functions like _get_volume_info but has been forgotten
here.

If no one objects I will commit the patch below.


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.






diff -aprNU5 djgpp.orig/src/libc/posix/sys/stat/filelen.c djgpp/src/libc/posix/sys/stat/filelen.c
--- djgpp.orig/src/libc/posix/sys/stat/filelen.c	2001-09-25 01:00:52 +0000
+++ djgpp/src/libc/posix/sys/stat/filelen.c	2011-09-04 12:25:38 +0000
@@ -39,12 +39,13 @@ filelength(int fhandle)
     regs.x.bx = fhandle;
     regs.x.ds = __tb >> 4;
     regs.x.dx = 0;
     regs.x.flags |= 1;
     __dpmi_int(0x21, &regs);
-    
-    if ((regs.x.flags & 1) == 0)
+
+    /*  If function 0x71A6 is not supported then ax contains 0x7100.  */
+    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);
 
diff -aprNU5 djgpp.orig/src/libc/posix/sys/stat/lfilelen.c djgpp/src/libc/posix/sys/stat/lfilelen.c
--- djgpp.orig/src/libc/posix/sys/stat/lfilelen.c	2001-02-04 19:13:00 +0000
+++ djgpp/src/libc/posix/sys/stat/lfilelen.c	2011-09-04 12:25:38 +0000
@@ -33,12 +33,13 @@ lfilelength(int fhandle)
     regs.x.bx = fhandle;
     regs.x.ds = __tb >> 4;
     regs.x.dx = 0;
     regs.x.flags |= 1;
     __dpmi_int (0x21, &regs);
-    
-    if ((regs.x.flags & 1) == 0)
+
+    /*  If function 0x71A6 is not supported then ax contains 0x7100.  */
+    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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019