delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/25/15:44:17

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: Library problems
To: dj AT ctron DOT com
Date: Wed, 25 May 94 12:15:34 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 70.85]

> > 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?
> 
> 512 is the disk block size, but 4096 is the size of the transfer
> buffer.  FILE* accesses are based on st_blksize, so it's set to 4096
> to improve performance.  BUFSIZ is also set to 4096.

When writing a file to disk, are all 4096 bytes of a "transfer block"
always in 8 contiguous "disk blocks"?  If so, then I have no problem
with st_blksize getting set to 4096.

I don't recall, and I'm at work now.  Is there an st_blocks field in
the stat structure?  If so, I think it should be equal to the number
of st_blksize blocks in the file.
--
				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