lkml.org 
[lkml]   [1998]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectst_blocks - was: Re: crazy swapping
Linus reportedly wrote:

if (st.st_blocks * 512 < st.st_size) {
fprintf(stderr, "File %s appears to have holes in it");

This is interesting.
So far, the unit used in st_blocks has been undocumented.
stat(2) only warns that it may well differ from what
is given in st_blksize.
So, one gets the impression that it might depend on the
filesystem type.

Must I document the st_blocks field in a struct stat
as returned by the stat system call on an ordinary file
to be an approximation of the size measured in 512-byte blocks?

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.055 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site