ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/09/03/11:30:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc difficulties on MSDOS 6.22 with LFN driver installed
Date: Sat, 3 Sep 2011 08:16:46 -0700 (PDT)
Organization: http://groups.google.com
Lines: 84
Message-ID: <432dad51-33a8-4d91-bd57-781bf77ba7f8@u26g2000yqu.googlegroups.com>
References: <201108310027 DOT 22056 DOT juan DOT guerrero AT gmx DOT de> <E1Qye2f-0005Iu-TI AT fencepost DOT gnu DOT org>
<201108312117 DOT 54522 DOT juan DOT guerrero AT gmx DOT de> <j3op85$567$1 AT speranza DOT aioe DOT org>
<038ae4ff-44f2-4ad2-b806-a6ed9b6085a2 AT o9g2000vbo DOT googlegroups DOT com>
<83zkincty6 DOT fsf AT gnu DOT org> <e5b1540d-525e-48b9-9b15-59e9ba823a23 AT s2g2000vby DOT googlegroups DOT com>
<CAA2C=vA1fwBnmJh-L0g4Rw+BdoSD4VBXGd2WP-W5dws7KGFA-Q AT mail DOT gmail DOT com> <83pqjiuccr DOT fsf AT gnu DOT org>
NNTP-Posting-Host: 95.208.11.28
Mime-Version: 1.0
X-Trace: posting.google.com 1315063006 24226 127.0.0.1 (3 Sep 2011 15:16:46 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sat, 3 Sep 2011 15:16:46 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: u26g2000yqu.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: 3301
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p83FU2fj012199
Reply-To: djgpp AT delorie DOT com

On 2 Sep., 18:40, Eli Zaretskii <e DOT  DOT  DOT  AT gnu DOT org> wrote:
> > Date: Fri, 2 Sep 2011 17:25:48 +0300
> > From: Ozkan Sezer <seze DOT  DOT  DOT  AT gmail DOT com>
>
> > 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?

All functions that call filelength/lfilelength
will be affected by this bug.  The same applies
to all ports that have been compiled with djdev204.
GDB is an example.  To debug this with DOSLFN installed
I had to use the 2.03 version of latest GDB port.

fcmod is no concerned but fstat is.  fstat calls
filelength() so it fails.  The values of both
offsets are printed by filelength().
The test program below generates this output:

offset 0x24 = 0x9713c0  offset 0x20 = 0x8f4000

fstat:  errno=40  status=-1  size=0

fchmod:  errno=0  status=0


Regards,
Juan M. Guerrero


#include <sys/stat.h>

#include <errno.h>

#include <stdio.h>



int main(void)

{

  FILE *f = fopen("./foobar.txt", "w");

  struct stat sbuf;

  int status;



  fprintf(f, "%s\n", "The file name is foobar.txt");

  fflush(f);



  errno = 0;

  status = fstat(fileno(f), &sbuf);

  printf("fstat:  errno=%d  status=%d  size=%d\n", errno, status,
sbuf.st_size);



  errno = 0;

  status = fchmod(fileno(f), S_IWUSR|S_IRUSR);

  printf("fchmod:  errno=%d  status=%d\n", errno, status);



  return 0;

}


- Raw text -


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