delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/25/14:47:08

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: Library problems
To: eliz AT is DOT elta DOT co DOT il
Date: Wed, 25 May 94 11:19:37 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 70.85]

You wrote:
> The following is a list of problems with the library as of 1.11maint5, which
> I discovered and which were identified as ``bugs'' by DJ:

...

> 4) stat() and fstat() return inconsistent results for the same file.
>     The st_blksize field is reported as 4096 (correct) by fstat(),
>     but stat() returns 512 (incorrect) in it.  stat() returns a
>     unique value for each file in the st_ino field, whereas fstat()
>     always returns 0 there.  (Beware programs that use this field to
>     infer that files with the same st_ino are actually the same
>     file.)

One way to make fstat() and stat() consistant would be to have fstat()
call stat().  There must be some way to ask DOS for the pathname
associated with the file pointer that fstat() gets, but I'm not a DOS
expert so I don't know how to do that.

About st_blksize:

Isn't 512 the true disk blocksize?  If not, is 4096 always the correct
value, or does it vary depending on how the disk is layed out?  Is
there a way to ask DOS and fill this field in correctly?
--
				Eric Backus
				ericb AT lsid DOT hp DOT com
				(206) 335-2495

- Raw text -


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