X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Juan Manuel Guerrero Newsgroups: comp.os.msdos.djgpp Subject: Re: gcc difficulties on MSDOS 6.22 with LFN driver installed Date: Sun, 4 Sep 2011 08:08:45 -0700 (PDT) Organization: http://groups.google.com Lines: 96 Message-ID: <340dcc25-1777-4a76-b2fd-bbc636df9afc@t9g2000yqi.googlegroups.com> References: <201108310027 DOT 22056 DOT juan DOT guerrero AT gmx DOT de> <201108312117 DOT 54522 DOT juan DOT guerrero AT gmx DOT de> <038ae4ff-44f2-4ad2-b806-a6ed9b6085a2 AT o9g2000vbo DOT googlegroups DOT com> <83zkincty6 DOT fsf AT gnu DOT org> <83pqjiuccr DOT fsf AT gnu DOT org> <306fc401-ad43-4c8c-9e86-382f90e32110 AT p10g2000yqi DOT googlegroups DOT com> NNTP-Posting-Host: 95.208.11.28 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1315149387 10006 127.0.0.1 (4 Sep 2011 15:16:27 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Sun, 4 Sep 2011 15:16:27 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: t9g2000yqi.googlegroups.com; posting-host=95.208.11.28; posting-account=OsAajgoAAADdKJnkJkmhzqP0jo6I_P_0 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0,gzip(gfe) Bytes: 4553 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p84FU2Kf004603 Reply-To: djgpp AT delorie DOT com On 4 Sep., 12:43, "Rod Pemberton" wrote: > "Juan Manuel Guerrero" wrote in messagenews:306fc401-ad43-4c8c-9e86-382f90e32110 AT p10g2000yqi DOT googlegroups DOT com... > > On 2 Sep., 18:40, Eli Zaretskii wrote: > > > > Date: Fri, 2 Sep 2011 17:25:48 +0300 > > > > From: Ozkan Sezer > > > > > Something like the following then? (Very quick+dirty patch, I know.) > > > > Yes, thanks. Although it would be better to know whether DOSLFN > > > returns -1 in offset 0x24 or non-zero in offset 0x20, and have a more > > > fine-grain recovery here. > > > > > I also wonder whether fchmod() and/or fstat() are affected by this > > > > lfn issue... > > > > Juan, can you test that? > > > I have found my old FreeDOS CD and installed DOSLFN 0.40c. > > With this driver everthing works on MSDOS.  Stepping into > > the filelength() code shows that the 0.40e version does > > not set the CF when it returns from 0x71A6 call while 0.40c > > does so that it jumps directly into the 0x4201 code instead > > of returning an EOVERFLOW. > > If 0.40e does not set the CF, shouldn't I be seeing the error with > MS-DOS 7.10 too?  I don't get why this is just 6.22 or FreeDOS ... > > Rod Pemberton I do not know why the behaviour is as it is. But I can confirm that that for some reason MSDOS and FreeDOS have different behaviour. Both partitions use FAT16. If MSDOS is used and DOSLFN-0.40c is used the CF is reset after calling 0x71A6 and ax contents 0x7100. If I replace the driver with DOSLFN-0.40e the the CF is not reseted but ax contents 0x7100 too. This has the consequence that the code below from filelength() generates an EOVERFLOW if MSDOS is used. if (_USE_LFN && (fhandle != 0 || _os_trueversion != 0x532)) { regs.x.ax = 0x71A6; 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) { /* Offset 0x24 contains the low 32-bits of the file size. Offset 0x20 contains the high 32-bits. */ retval = _farpeekl(_dos_ds, __tb + 0x24); if ((_farpeekl(_dos_ds, __tb + 0x20) != 0) || (retval == -1)) { errno = EOVERFLOW; return -1L; } return retval; } } If FreeDOS is used, the CF is always reset no matter what driver version is used. ax always contents 0x7100. This has been verified with debugger sessions. IMHO there are only 2 conclusions to this. Or DJGPP has a bug somewhere in __dpmi_int() or the OS and driver have a bug. Neitherless it is a fact that filelength should have checked that 0x71A6 is supported at all. Regards, Juan M.Guerrero