X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com X-Authenticated: #27081556 X-Provags-ID: V01U2FsdGVkX1/lO9gSOI7l9/ZB8Qit5e53rF5UG2bWAhY6q1/r/p WVvjs+T4JO1II4 From: Juan Manuel Guerrero To: djgpp-workers AT delorie DOT com Subject: gcc difficulties on MSDOS 6.22 with LFN driver installed (patch) Date: Sun, 4 Sep 2011 23:24:07 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201109042324.08669.juan.guerrero@gmx.de> X-Y-GMX-Trusted: 0 Reply-To: djgpp-workers AT delorie DOT com 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 * 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 @@ -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 * @@ -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);